* Generate ompi_get_version.sh from ompi_get_version.m4, removing a bunch of
duplicated logic that wasn't being duplicated all that well. Thanks goes to Ralf Wildenhues for the bulk of the patch. This commit was SVN r8779.
Этот коммит содержится в:
родитель
a437fd3aaf
Коммит
dc088d0023
14
autogen.sh
14
autogen.sh
@ -1,6 +1,6 @@
|
||||
#! /bin/bash
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -40,6 +40,10 @@ ompi_autoconf_search="autoconf"
|
||||
if test ! -z "$AUTOCONF"; then
|
||||
ompi_autoconf_search="$AUTOCONF"
|
||||
fi
|
||||
ompi_autom4te_search="autom4te"
|
||||
if test ! -z "$AUTOM4TE"; then
|
||||
ompi_autom4te_search="$AUTOM4TE"
|
||||
fi
|
||||
ompi_libtoolize_search="libtoolize;glibtoolize"
|
||||
if test ! -z "$LIBTOOLIZE"; then
|
||||
ompi_libtoolize_search="$LIBTOOLIZE"
|
||||
@ -63,6 +67,7 @@ ompi_libtool_version="1.5.16"
|
||||
ompi_aclocal_version="$ompi_automake_version"
|
||||
ompi_autoheader_version="$ompi_autoconf_version"
|
||||
ompi_libtoolize_version="$ompi_libtool_version"
|
||||
ompi_autom4te_version="$ompi_autoconf_version"
|
||||
|
||||
# program names to execute
|
||||
ompi_aclocal=""
|
||||
@ -375,6 +380,12 @@ EOF
|
||||
|
||||
echo "*** Running GNU tools"
|
||||
|
||||
if test -f include/mpi.h.in; then
|
||||
cd config
|
||||
run_and_check $ompi_autom4te --language=m4sh ompi_get_version.m4sh -o ompi_get_version.sh
|
||||
cd ..
|
||||
fi
|
||||
|
||||
run_and_check $ompi_aclocal
|
||||
if test "`grep AC_CONFIG_HEADER $file`" != "" -o \
|
||||
"`grep AM_CONFIG_HEADER $file`" != ""; then
|
||||
@ -1088,6 +1099,7 @@ EOF
|
||||
fi
|
||||
|
||||
# find all the apps we are going to run
|
||||
find_app "autom4te"
|
||||
find_app "aclocal"
|
||||
find_app "autoheader"
|
||||
find_app "autoconf"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -49,6 +49,7 @@ EXTRA_DIST = \
|
||||
ompi_configure_options.m4 \
|
||||
ompi_functions.m4 \
|
||||
ompi_get_version.m4 \
|
||||
ompi_get_version.m4sh \
|
||||
ompi_get_version.sh \
|
||||
ompi_make_stripped_flags.m4 \
|
||||
ompi_mca.m4 \
|
||||
|
@ -1,6 +1,6 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
dnl University Research and Technology
|
||||
dnl Corporation. All rights reserved.
|
||||
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -18,70 +18,68 @@ dnl $HEADER$
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl This file is almost identical in functionality to
|
||||
dnl ompi_get_version.sh. It is unfortunate that we have to duplicate code,
|
||||
dnl but it is really the only what that I can think to do it. :-( Hence,
|
||||
dnl if you change the logic here for determining version numbers, YOU MUST
|
||||
dnl ALSO CHANGE IT IN ompi_get_version.sh!!
|
||||
dnl
|
||||
dnl This file is also used as input to ompi_get_version.sh.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([OMPI_GET_VERSION],[
|
||||
gv_ver_file="$1"
|
||||
gv_prefix="$2"
|
||||
# OMPI_GET_VERSION(version_file, variable_prefix)
|
||||
# -----------------------------------------------
|
||||
# parse version_file for version information, setting
|
||||
# the following shell variables:
|
||||
#
|
||||
# prefix_VERSION
|
||||
# prefix_BASE_VERSION
|
||||
# prefix_MAJOR_VERSION
|
||||
# prefix_MINOR_VERSION
|
||||
# prefix_RELEASE_VERSION
|
||||
# prefix_GREEK_VERSION
|
||||
# prefix_WANT_SVN
|
||||
# prefix_SVN_R
|
||||
m4_define([OMPI_GET_VERSION],[
|
||||
: ${ompi_ver_need_svn=1}
|
||||
: ${srcdir=.}
|
||||
|
||||
dnl quote eval to suppress macro expansion with non-GNU m4
|
||||
dnl quote eval to suppress macro expansion with non-GNU m4
|
||||
if test -f "$1"; then
|
||||
[eval] "`sed -n \"\
|
||||
t clear
|
||||
: clear
|
||||
s/^major/$2_MAJOR_VERSION/
|
||||
s/^minor/$2_MINOR_VERSION/
|
||||
s/^release/$2_RELEASE_VERSION/
|
||||
s/^greek/$2_GREEK_VERSION/
|
||||
s/^want_svn/$2_WANT_SVN/
|
||||
s/^svn_r/$2_SVN_R/
|
||||
t print
|
||||
b
|
||||
: print
|
||||
p\" < \"\$1\"`"
|
||||
|
||||
gv_run() {
|
||||
str="${gv_prefix}_${2}=\$gv_${1}"
|
||||
[eval] $str
|
||||
}
|
||||
|
||||
if test -n "$gv_ver_file" -a -f "$gv_ver_file"; then
|
||||
gv_major_version="`egrep '^major=' $gv_ver_file | cut -d= -f2`"
|
||||
gv_minor_version="`egrep '^minor=' $gv_ver_file | cut -d= -f2`"
|
||||
gv_release_version="`egrep '^release=' $gv_ver_file | cut -d= -f2`"
|
||||
gv_greek_version="`egrep '^greek=' $gv_ver_file | cut -d= -f2`"
|
||||
gv_want_svn="`egrep '^want_svn=' $gv_ver_file | cut -d= -f2`"
|
||||
gv_svn_r="`egrep '^svn_r=' $gv_ver_file | cut -d= -f2`"
|
||||
|
||||
if test -n "$gv_release_version" -a "$gv_release_version" != "0"; then
|
||||
gv_full_version="$gv_major_version.$gv_minor_version.$gv_release_version"
|
||||
else
|
||||
gv_full_version="$gv_major_version.$gv_minor_version"
|
||||
fi
|
||||
|
||||
gv_full_version="${gv_full_version}${gv_greek_version}"
|
||||
|
||||
if test "$gv_want_svn" = "1"; then
|
||||
if test "$gv_svn_r" = "-1"; then
|
||||
if test -d "$srcdir/.svn"; then
|
||||
ver=r`svnversion "$srcdir"`
|
||||
# make sure svnversion worked
|
||||
if test "$?" != "0" ; then
|
||||
ver=svn`date '+%m%d%Y'`
|
||||
fi
|
||||
else
|
||||
ver=svn`date '+%m%d%Y'`
|
||||
fi
|
||||
gv_svn_r="$ver"
|
||||
# Only print release version if it isn't 0
|
||||
if test $$2_RELEASE_VERSION -ne 0 ; then
|
||||
$2_VERSION="$$2_MAJOR_VERSION.$$2_MINOR_VERSION.$$2_RELEASE_VERSION"
|
||||
else
|
||||
$2_VERSION="$$2_MAJOR_VERSION.$$2_MINOR_VERSION"
|
||||
fi
|
||||
$2_VERSION="${$2_VERSION}${$2_GREEK_VERSION}"
|
||||
$2_BASE_VERSION=$$2_VERSION
|
||||
|
||||
if test $$2_WANT_SVN -eq 1 && test $ompi_ver_need_svn -eq 1 ; then
|
||||
if test $$2_SVN_R -eq -1 ; then
|
||||
m4_ifdef([AC_MSG_CHECKING],
|
||||
[AC_MSG_CHECKING([for SVN version])])
|
||||
if test -d "$srcdir/.svn" ; then
|
||||
$2_SVN_R=r`svnversion "$srcdir"`
|
||||
# make sure svnversion worked
|
||||
if test $? -ne 0 ; then
|
||||
$2_SVN_R=svn`date '+%m%d%Y'`
|
||||
fi
|
||||
else
|
||||
$2_SVN_R=svn`date '+%m%d%Y'`
|
||||
fi
|
||||
m4_ifdef([AC_MSG_RESULT],
|
||||
[AC_MSG_RESULT([done])])
|
||||
fi
|
||||
$2_VERSION="${$2_VERSION}${$2_SVN_R}"
|
||||
fi
|
||||
gv_full_version="${gv_full_version}$gv_svn_r"
|
||||
fi
|
||||
|
||||
# Set the values
|
||||
|
||||
gv_run full_version VERSION
|
||||
gv_run major_version MAJOR_VERSION
|
||||
gv_run minor_version MINOR_VERSION
|
||||
gv_run release_version RELEASE_VERSION
|
||||
gv_run greek_version GREEK_VERSION
|
||||
gv_run want_svn WANT_SVN
|
||||
gv_run svn_r SVN_R
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
|
||||
unset gv_glv_dir gv_ver_file gv_prefix gv_prog gv_run \
|
||||
gv_major_version gv_minor_version gv_release_version \
|
||||
gv_greek_version gv_want_svn gv_svn_r
|
||||
])
|
||||
|
48
config/ompi_get_version.sh → config/ompi_get_version.m4sh
Исполняемый файл → Обычный файл
48
config/ompi_get_version.sh → config/ompi_get_version.m4sh
Исполняемый файл → Обычный файл
@ -1,6 +1,10 @@
|
||||
m4_define([_m4_divert(SCRIPT)], 100)
|
||||
m4_divert_push([SCRIPT])dnl
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# ompi_get_version is created from ompi_get_version.m4 and ompi_get_version.m4sh.
|
||||
#
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -17,13 +21,7 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
#
|
||||
# This file is almost identical in functionality to
|
||||
# ompi_get_version.m4. It is unfortunate that we have to duplicate
|
||||
# code, but it is really the only what that I can think to do it. :-(
|
||||
# Hence, if you change the logic here for determining version numbers,
|
||||
# YOU MUST ALSO CHANGE IT IN ompi_get_version.m4!!
|
||||
#
|
||||
m4_include([ompi_get_version.m4])
|
||||
|
||||
srcfile="$1"
|
||||
option="$2"
|
||||
@ -31,43 +29,17 @@ option="$2"
|
||||
case "$option" in
|
||||
# svnversion can take a while to run. If we don't need it, don't run it.
|
||||
--major|--minor|--release|--greek|--base|--help)
|
||||
OMPI_NEED_SVN=0
|
||||
ompi_ver_need_svn=0
|
||||
;;
|
||||
*)
|
||||
OMPI_NEED_SVN=1
|
||||
ompi_ver_need_svn=1
|
||||
esac
|
||||
|
||||
|
||||
if test "$srcfile" = ""; then
|
||||
if test -z "$srcfile"; then
|
||||
option="--help"
|
||||
else
|
||||
OMPI_MAJOR_VERSION="`cat $srcfile | egrep '^major=' | cut -d= -f2`"
|
||||
OMPI_MINOR_VERSION="`cat $srcfile | egrep '^minor=' | cut -d= -f2`"
|
||||
OMPI_RELEASE_VERSION="`cat $srcfile | egrep '^release=' | cut -d= -f2`"
|
||||
OMPI_GREEK_VERSION="`cat $srcfile | egrep '^greek=' | cut -d= -f2`"
|
||||
OMPI_WANT_SVN="`cat $srcfile | egrep '^want_svn=' | cut -d= -f2`"
|
||||
OMPI_SVN_R="`cat $srcfile | egrep '^svn_r=' | cut -d= -f2`"
|
||||
if test "$OMPI_RELEASE_VERSION" != "0" -a "$OMPI_RELEASE_VERSION" != ""; then
|
||||
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.$OMPI_RELEASE_VERSION"
|
||||
else
|
||||
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION"
|
||||
fi
|
||||
|
||||
OMPI_VERSION="${OMPI_VERSION}${OMPI_GREEK_VERSION}"
|
||||
|
||||
OMPI_BASE_VERSION="$OMPI_VERSION"
|
||||
|
||||
if test "$OMPI_WANT_SVN" = "1" -a "$OMPI_NEED_SVN" = "1" ; then
|
||||
if test "$OMPI_SVN_R" = "-1"; then
|
||||
if test -d .svn; then
|
||||
ver="r`svnversion .`"
|
||||
else
|
||||
ver="svn`date '+%m%d%Y'`"
|
||||
fi
|
||||
OMPI_SVN_R="$ver"
|
||||
fi
|
||||
OMPI_VERSION="${OMPI_VERSION}$OMPI_SVN_R"
|
||||
fi
|
||||
OMPI_GET_VERSION([$srcfile],[OMPI])
|
||||
|
||||
if test "$option" = ""; then
|
||||
option="--full"
|
21
configure.ac
21
configure.ac
@ -1,6 +1,6 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -48,9 +48,18 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define])
|
||||
# Make configure depend on the VERSION file, since it's used in AC_INIT
|
||||
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
|
||||
|
||||
#
|
||||
# Start it up
|
||||
#
|
||||
|
||||
OMPI_CONFIGURE_SETUP
|
||||
ompi_show_title "Configuring Open MPI"
|
||||
|
||||
ompi_show_subtitle "Checking versions"
|
||||
|
||||
# Get the version of OMPI that we are installing
|
||||
|
||||
OMPI_GET_VERSION($srcdir/VERSION, OMPI)
|
||||
OMPI_GET_VERSION([$srcdir/VERSION], OMPI)
|
||||
|
||||
# override/fixup the version numbers set by AC_INIT, since on
|
||||
# developer builds, there's no good way to know what the version is
|
||||
@ -140,14 +149,6 @@ AC_DEFINE_UNQUOTED(OPAL_GREEK_VERSION, "$OPAL_GREEK_VERSION",
|
||||
AC_DEFINE_UNQUOTED(OPAL_VERSION, "$OPAL_RELEASE_VERSION",
|
||||
[Complete release number of OPAL])
|
||||
|
||||
#
|
||||
# Start it up
|
||||
#
|
||||
|
||||
OMPI_CONFIGURE_SETUP
|
||||
ompi_show_title "Configuring Open MPI"
|
||||
|
||||
ompi_show_subtitle "Checking versions"
|
||||
AC_MSG_CHECKING([Open MPI version])
|
||||
AC_MSG_RESULT([$OMPI_VERSION])
|
||||
AC_MSG_CHECKING([Open MPI Subversion repository version])
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user