diff --git a/autogen.sh b/autogen.sh index 92d36374ee..64daa23448 100755 --- a/autogen.sh +++ b/autogen.sh @@ -467,12 +467,6 @@ EOF pd_component_name="`basename $pd_dir`" pd_component_type="`dirname $pd_dir`" pd_component_type="`basename $pd_component_type`" - pd_ver_file="`grep PARAM_VERSION_FILE configure.params`" - if test -z "$pd_ver_file"; then - pd_ver_file="VERSION" - else - pd_ver_file="`echo $pd_ver_file | cut -d= -f1`" - fi # Write out to two files (they're merged at the end) @@ -493,55 +487,154 @@ dnl No-configure component: dnl $pd_dir EOF + # Tell configure to add all the PARAM_CONFIG_FILES to + # the AC_CONFIG_FILES list. + for file in $PARAM_CONFIG_FILES; do echo "AC_CONFIG_FILES([$pd_dir/$file])" >> $pd_list_file done - # Get all the version numbers + # Add this component directory to the list of + # subdirectories to traverse when building. - pd_get_ver="../../../../config/ompi_get_version.sh" - pd_ver="`sh $pd_get_ver $pd_ver_file --all`" - pd_ver_full="`echo $pd_ver | awk '{ print $1 }'`" - pd_ver_major="`echo $pd_ver | awk '{ print $2 }'`" - pd_ver_minor="`echo $pd_ver | awk '{ print $3 }'`" - pd_ver_release="`echo $pd_ver | awk '{ print $4 }'`" - pd_ver_alpha="`echo $pd_ver | awk '{ print $5 }'`" - pd_ver_beta="`echo $pd_ver | awk '{ print $6 }'`" - pd_ver_svn="`echo $pd_ver | awk '{ print $7 }'`" cat >> $pd_list_file <--version.h.template.in. In there, + # have #define's with values that are @foo@ (i.e., + # the result of AC_SUBST) + + # 2. Add the template header file to the list of + # AC_CONFIG_FILES so that AC_SUBST'ed things will + # be substituted in. + + # 3. Setup commands to run after config.status has + # run. Compare the resulting template header + # version file with the existing version header + # file. If they're different (or if the version + # header file does not yet exist), replace it with + # the template version header file. Otherwise, + # leave it alone. This leaves the + # --version.h file unchanged (and + # therefore its timestamp unaltered) if nothing + # changed. + + rm -f "$pd_ver_header_base.template.in" + cat > "$pd_ver_header_base.template.in" <> $pd_list_file < /dev/null 2>&1 + if test "$?" != 0; then + cp "$pd_ver_header.template" "$pd_ver_header" + echo "config.status: regenerating $pd_ver_header" + else + echo "config.state: $pd_ver_header unchanged" + fi +else + cp "$pd_ver_header.template" "$pd_ver_header" + echo "config.status: creating $pd_ver_header" +fi]) EOF + fi + + # Setup the AM_CONDITIONAL to build this component + cat >> $pd_amc_file <