1
1

- Due to limitations in AC_DEFINE (namely that you can't direct a

specific AC_DEFINE to a specific header file), emulate the behavior
  of AC_HEADER_FILES when saving the values from the VERSION files;
  dump them into a temporary file and diff them against the
  already-existing .h file.  If they're the same, do nothing.  If
  they're different, replace the .h file.
- With this capabiliy, move the #define's of all version numbers out
  of ompi_config.h and into component-specific <type>-<name>-version.h
  header files.  This will prevent a lot of extra compilation when
  you updat your local svn working copy.
- Remove the requirement for having a VERSION file.  If you don't have
  it, then a .h file with your version numbers won't be generated.
- Remove the VERSION file from lots of components that don't use it.
  I've added it to my "consistency" list to go back and re-add them
  along with using the proper #define's in the component struct after
  we reach a period of stability.

This commit was SVN r1999.
Этот коммит содержится в:
Jeff Squyres 2004-08-10 04:10:08 +00:00
родитель 8e8ef21ae8
Коммит ff62e4db26
20 изменённых файлов: 139 добавлений и 138 удалений

Просмотреть файл

@ -467,12 +467,6 @@ EOF
pd_component_name="`basename $pd_dir`" pd_component_name="`basename $pd_dir`"
pd_component_type="`dirname $pd_dir`" pd_component_type="`dirname $pd_dir`"
pd_component_type="`basename $pd_component_type`" 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) # Write out to two files (they're merged at the end)
@ -493,14 +487,51 @@ dnl No-configure component:
dnl $pd_dir dnl $pd_dir
EOF EOF
# Tell configure to add all the PARAM_CONFIG_FILES to
# the AC_CONFIG_FILES list.
for file in $PARAM_CONFIG_FILES; do for file in $PARAM_CONFIG_FILES; do
echo "AC_CONFIG_FILES([$pd_dir/$file])" >> $pd_list_file echo "AC_CONFIG_FILES([$pd_dir/$file])" >> $pd_list_file
done done
# Add this component directory to the list of
# subdirectories to traverse when building.
cat >> $pd_list_file <<EOF
dnl Add this component directory to the list of directories to
dnl traverse for this component framework
MCA_${pd_component_type}_NO_CONFIGURE_SUBDIRS="$pd_dir \$MCA_${pd_component_type}_NO_CONFIGURE_SUBDIRS"
EOF
# See if we have a VERSION file
if test -z "$PARAM_VERSION_FILE"; then
if test -f "VERSION"; then
PARAM_VERSION_FILE="VERSION"
fi
else
if test ! -f "$PARAM_VERSION_FILE"; then
PARAM_VERSION_FILE=
fi
fi
# If we have the VERSION file, save the version
# numbers in a .h file. Ignore this for the
# mca/common tree -- they're not components, so they
# don't have version numbers.
if test -n "$PARAM_VERSION_FILE" -a \
"$pd_component_type" != "common"; then
pd_ver_header="$pd_dir/$pd_component_type-$pd_component_name-version.h"
pd_ver_header_base="`basename $pd_ver_header`"
# Get all the version numbers # Get all the version numbers
pd_get_ver="../../../../config/ompi_get_version.sh" pd_get_ver="../../../../config/ompi_get_version.sh"
pd_ver="`sh $pd_get_ver $pd_ver_file --all`" pd_ver="`sh $pd_get_ver $PARAM_VERSION_FILE --all`"
pd_ver_full="`echo $pd_ver | awk '{ print $1 }'`" pd_ver_full="`echo $pd_ver | awk '{ print $1 }'`"
pd_ver_major="`echo $pd_ver | awk '{ print $2 }'`" pd_ver_major="`echo $pd_ver | awk '{ print $2 }'`"
pd_ver_minor="`echo $pd_ver | awk '{ print $3 }'`" pd_ver_minor="`echo $pd_ver | awk '{ print $3 }'`"
@ -508,40 +539,102 @@ EOF
pd_ver_alpha="`echo $pd_ver | awk '{ print $5 }'`" pd_ver_alpha="`echo $pd_ver | awk '{ print $5 }'`"
pd_ver_beta="`echo $pd_ver | awk '{ print $6 }'`" pd_ver_beta="`echo $pd_ver | awk '{ print $6 }'`"
pd_ver_svn="`echo $pd_ver | awk '{ print $7 }'`" pd_ver_svn="`echo $pd_ver | awk '{ print $7 }'`"
# Because autoconf does not handle selectively
# sending some AC_DEFINE's to one file and not to
# all others, we have to do a bizarre multi-step
# thing to make this work. :-(
# 1. make a template header file
# <type>-<name>-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
# <type>-<name>-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" <<EOF
/*
* This file is automatically created by autogen.sh; it should not
* be edited by hand!!
*
* List of version number for this component
*/
#ifndef MCA_${pd_component_type}_${pd_component_name}_VERSION_H
#define MCA_${pd_component_type}_${pd_component_name}_VERSION_H
#define MCA_${pd_component_type}_${pd_component_name}_MAJOR_VERSION @MCA_${pd_component_type}_${pd_component_name}_MAJOR_VERSION@
#define MCA_${pd_component_type}_${pd_component_name}_MINOR_VERSION @MCA_${pd_component_type}_${pd_component_name}_MINOR_VERSION@
#define MCA_${pd_component_type}_${pd_component_name}_RELEASE_VERSION @MCA_${pd_component_type}_${pd_component_name}_RELEASE_VERSION@
#define MCA_${pd_component_type}_${pd_component_name}_ALPHA_VERSION @MCA_${pd_component_type}_${pd_component_name}_ALPHA_VERSION@
#define MCA_${pd_component_type}_${pd_component_name}_BETA_VERSION @MCA_${pd_component_type}_${pd_component_name}_BETA_VERSION@
#define MCA_${pd_component_type}_${pd_component_name}_SVN_VERSION "@MCA_${pd_component_type}_${pd_component_name}_SVN_VERSION@"
#define MCA_${pd_component_type}_${pd_component_name}_FULL_VERSION "@MCA_${pd_component_type}_${pd_component_name}_FULL_VERSION@"
#endif /* MCA_${pd_component_type}_${pd_component_name}_VERSION_H */
EOF
cat >> $pd_list_file <<EOF cat >> $pd_list_file <<EOF
dnl Generate the version header template
MCA_${pd_component_type}_NO_CONFIGURE_SUBDIRS="$pd_dir \$MCA_${pd_component_type}_NO_CONFIGURE_SUBDIRS" AC_CONFIG_FILES([$pd_ver_header.template])
dnl Since AM_CONDITIONAL does not accept a variable name as its first dnl Assign and AC_SUBST all the version number components
dnl argument, we generate it here, and the variable used in the test
dnl will be filled in later.
dnl Similarly, AC_DEFINE_UNQUOTED doesn't take a variable first MCA_${pd_component_type}_${pd_component_name}_MAJOR_VERSION=$pd_ver_major
dnl argument. So we have to figure it out here. AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_MAJOR_VERSION)
MCA_${pd_component_type}_${pd_component_name}_MINOR_VERSION=$pd_ver_minor
AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_MINOR_VERSION)
MCA_${pd_component_type}_${pd_component_name}_RELEASE_VERSION=$pd_ver_release
AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_RELEASE_VERSION)
MCA_${pd_component_type}_${pd_component_name}_ALPHA_VERSION=$pd_ver_alpha
AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_ALPHA_VERSION)
MCA_${pd_component_type}_${pd_component_name}_BETA_VERSION=$pd_ver_beta
AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_BETA_VERSION)
MCA_${pd_component_type}_${pd_component_name}_SVN_VERSION="$pd_ver_svn"
AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_SVN_VERSION)
MCA_${pd_component_type}_${pd_component_name}_FULL_VERSION="$pd_ver_full"
AC_SUBST(MCA_${pd_component_type}_${pd_component_name}_FULL_VERSION)
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_MAJOR_VERSION, dnl After config.status has run, compare the version header template to
$pd_ver_major, dnl the version header. If the version header does not exist, create it
[Major OMPI MCA $pd_component_type $pd_component_name version]) dnl from the template. If it does already exist, diff it and see if
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_MINOR_VERSION, dnl they're different. If they're different, copy the template over the
$pd_ver_minor, dnl old version. If they're the same, leave the original alone so that
[Minor OMPI MCA $pd_component_type $pd_component_name version]) dnl we don't distrub any dependencies.
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_RELEASE_VERSION,
$pd_ver_release, AC_CONFIG_COMMANDS([${pd_component_type}-${pd_component_name}],
[Release OMPI MCA $pd_component_type $pd_component_name version]) [if test -f "$pd_ver_header"; then
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_ALPHA_VERSION, diff "$pd_ver_header" "$pd_ver_header.template" > /dev/null 2>&1
$pd_ver_alpha, if test "$?" != 0; then
[Alpha OMPI MCA $pd_component_type $pd_component_name version]) cp "$pd_ver_header.template" "$pd_ver_header"
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_BETA_VERSION, echo "config.status: regenerating $pd_ver_header"
$pd_ver_beta, else
[Beta OMPI MCA $pd_component_type $pd_component_name version]) echo "config.state: $pd_ver_header unchanged"
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_SVN_VERSION, fi
"$pd_ver_svn", else
[SVN OMPI MCA $pd_component_type $pd_component_name version]) cp "$pd_ver_header.template" "$pd_ver_header"
AC_DEFINE_UNQUOTED(MCA_${pd_component_type}_${pd_component_name}_FULL_VERSION, echo "config.status: creating $pd_ver_header"
"$pd_ver_full", fi])
[Full OMPI MCA $pd_component_type $pd_component_name version])
EOF EOF
fi
# Setup the AM_CONDITIONAL to build this component
cat >> $pd_amc_file <<EOF cat >> $pd_amc_file <<EOF
AM_CONDITIONAL(OMPI_BUILD_${pd_component_type}_${pd_component_name}_DSO, AM_CONDITIONAL(OMPI_BUILD_${pd_component_type}_${pd_component_name}_DSO,
test "\$BUILD_${pd_component_type}_${pd_component_name}_DSO" = "1") test "\$BUILD_${pd_component_type}_${pd_component_name}_DSO" = "1")
@ -568,6 +661,7 @@ EOF
cd "$pd_cur_dir" cd "$pd_cur_dir"
fi fi
unset PARAM_CONFIG_FILES PARAM_VERSION_FILE
unset pd_dir pd_ompi_topdir pd_cur_dir pd_component_type unset pd_dir pd_ompi_topdir pd_cur_dir pd_component_type
} }

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -10,6 +10,7 @@
#include "ompi_config.h" #include "ompi_config.h"
#include "coll_basic.h" #include "coll_basic.h"
#include "mca/coll/basic/coll-basic-version.h"
#include "mpi.h" #include "mpi.h"
#include "mca/coll/coll.h" #include "mca/coll/coll.h"

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -4,6 +4,7 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "mca/llm/hostfile/llm-hostfile-version.h"
#include "llm_hostfile.h" #include "llm_hostfile.h"
#include "util/os_path.h" #include "util/os_path.h"
#include "mca/llm/llm.h" #include "mca/llm/llm.h"

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

@ -9,6 +9,7 @@
*/ */
#include "mca/topo/unity/src/topo_unity.h" #include "mca/topo/unity/src/topo_unity.h"
#include "mca/topo/unity/topo-unity-version.h"
/* /*
* Public string showing the topo unity module version number * Public string showing the topo unity module version number