Avoid spurious rebuilds of the dynamic lookups Makefile.
[exim.git] / src / scripts / Configure-Makefile
index 3e901e6a6a8bb6f0b9b20e904dadc39f163c2f47..58b2b577067538d48606f6a4c6a8d04c023d4ac0 100755 (executable)
@@ -77,8 +77,9 @@ mf=Makefile
 mft=$mf-t
 mftt=$mf-tt
 
-look_mf=lookups/Makefile.predynamic
-look_mft=${look_mf}-t
+look_mf=lookups/Makefile
+look_mf_pre=${look_mf}.predynamic
+look_mf_post=${look_mf}.postdynamic
 
 # Ensure the temporary does not exist and start the new one by setting
 # the OSTYPE and ARCHTYPE variables.
@@ -195,10 +196,10 @@ fi
 rm -f $mftt
 
 # make the lookups Makefile with the definitions
+# the auxiliary script generates $look_mf_post from $look_mf_pre
 
-## prepend stuff here; eg: grep LOOKUP_ $mft > $look_mft
-## cat ../src/lookups/Makefile >> $look_mft
-cp ../src/lookups/Makefile $look_mft
+cp ../src/lookups/Makefile $look_mf_pre
+../scripts/lookups-Makefile
 
 # See if there is a definition of EXIM_PERL in what we have built so far.
 # If so, run Perl to find the default values for PERL_CC, PERL_CCOPTS,
@@ -249,14 +250,14 @@ cat ../OS/Makefile-Base >> $mft || exit 1
 # If the new makefile is the same as the existing one, say so, and just
 # update the timestamp. Otherwise remove the old and install the new.
 
-if      [ -s $mf ] && cmp -s $mft $mf && [ -s $look_mf ] && cmp -s $look_mft $look_mf
+if      [ -s $mf ] && cmp -s $mft $mf && [ -s $look_mf ] && cmp -s $look_mf_post $look_mf
 then    echo ">>> rebuilt $mf unchanged"
         echo " "
         touch $mf || exit
-        rm -f $mft
-elif    rm -f $mf $look_mf
+        rm -f $mft $look_mf_pre $look_mf_post
+elif    rm -f $mf $look_mf $look_mf_pre
         mv $mft $mf
-       mv $look_mft $look_mf
+       mv $look_mf_post $look_mf
 then    echo ">>> New $mf & $look_mf installed"
         echo '>>> Use "make makefile" if you need to force rebuilding of the makefile'
         echo " "