From 388ac0dd4ecb78fc5140a88a0f66e714aba2b987 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 13 Sep 2004 20:29:21 +0000 Subject: [PATCH] Since everyone has to recompile almost everything because of changes to the docs in src/utl/output.h from the last commit, might as well do this one. No real rush to update to this, but you'll need to re-autogen.sh, etc. Fixes an old, small bug that caused the static-components.h files to always be regenerated, even if they didn't change. This caused several files to be unnecessarily recompiled if you ran the following: ./configure make ./configure make Granted, this is a small error, but a) we have it Right in other places, b) AC does the Right things for AC_CONFIG_HEADER, so we should do the Right things too. This commit was SVN r2638. --- config/ompi_mca.m4 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/config/ompi_mca.m4 b/config/ompi_mca.m4 index 22d6293cf1..117c0b1819 100644 --- a/config/ompi_mca.m4 +++ b/config/ompi_mca.m4 @@ -108,7 +108,8 @@ for type in $found_types; do # Remove any previous generated #include files. - outfile=$outdir/static-components.h + outfile_real=$outdir/static-components.h + outfile=$outfile_real.new rm -f $outfile $outfile.struct $outfile.extern \ $outfile.all $outfile.static $outfile.dyanmic touch $outfile.struct $outfile.extern \ @@ -226,6 +227,18 @@ const mca_base_component_t *mca_${type}_base_static_components[[]] = { NULL }; EOF + # Only replace the header file if a) it doesn't previously + # exist, or b) the contents are different. Do this to not + # trigger recompilation of certain .c files just because the + # timestamp changed on $outfile_real (similar to the way AC + # handles AC_CONFIG_HEADER files). + + diff $outfile $outfile_real 2>&1 > /dev/null + if test "$?" != "0"; then + mv $outfile $outfile_real + else + rm -f $outfile + fi fi rm -f $outfile.struct $outfile.extern