2003-12-22 19:29:21 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
2004-11-22 04:38:40 +03:00
|
|
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
dnl All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
dnl All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
dnl University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
dnl All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
dnl $COPYRIGHT$
|
|
|
|
dnl
|
|
|
|
dnl Additional copyrights may follow
|
|
|
|
dnl
|
2004-01-07 10:47:13 +03:00
|
|
|
dnl $HEADER$
|
2003-12-22 19:29:21 +03:00
|
|
|
dnl
|
|
|
|
|
2004-07-07 16:45:36 +04:00
|
|
|
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
|
2003-12-22 19:29:21 +03:00
|
|
|
|
2004-07-07 16:45:36 +04:00
|
|
|
AC_DEFUN([OMPI_GET_VERSION],[
|
|
|
|
gv_ver_file="$1"
|
|
|
|
gv_prefix="$2"
|
2003-12-22 19:29:21 +03:00
|
|
|
|
|
|
|
dnl quote eval to suppress macro expansion with non-GNU m4
|
|
|
|
|
|
|
|
gv_run() {
|
2005-03-25 06:19:46 +03:00
|
|
|
str="${gv_prefix}_${2}=\$gv_${1}"
|
2004-07-07 16:45:36 +04:00
|
|
|
[eval] $str
|
2003-12-22 19:29:21 +03:00
|
|
|
}
|
|
|
|
|
2004-07-07 16:45:36 +04:00
|
|
|
if test -n "$gv_ver_file" -a -f "$gv_ver_file"; then
|
2005-03-27 15:24:27 +04:00
|
|
|
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`"
|
2005-09-27 06:06:05 +04:00
|
|
|
gv_greek_version="`egrep '^greek=' $gv_ver_file | cut -d= -f2`"
|
2005-03-27 15:24:27 +04:00
|
|
|
gv_want_svn="`egrep '^want_svn=' $gv_ver_file | cut -d= -f2`"
|
|
|
|
gv_svn_r="`egrep '^svn_r=' $gv_ver_file | cut -d= -f2`"
|
2004-07-07 16:45:36 +04:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2005-09-27 06:06:05 +04:00
|
|
|
gv_full_version="${gv_full_version}${gv_greek_version}"
|
2004-07-07 16:45:36 +04:00
|
|
|
|
2005-03-25 06:19:46 +03:00
|
|
|
if test "$gv_want_svn" = "1"; then
|
|
|
|
if test "$gv_svn_r" = "-1"; then
|
2005-04-08 01:39:03 +04:00
|
|
|
if test -d "$srcdir/.svn"; then
|
2005-08-31 07:01:06 +04:00
|
|
|
ver=r`svnversion "$srcdir"`
|
2005-03-25 06:19:46 +03:00
|
|
|
else
|
2005-08-30 14:44:55 +04:00
|
|
|
ver=svn`date '+%m%d%Y'`
|
2005-03-25 06:19:46 +03:00
|
|
|
fi
|
|
|
|
gv_svn_r="$ver"
|
2004-07-07 16:45:36 +04:00
|
|
|
fi
|
2005-03-25 06:19:46 +03:00
|
|
|
gv_full_version="${gv_full_version}$gv_svn_r"
|
2004-07-07 16:45:36 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Set the values
|
|
|
|
|
2005-03-25 06:19:46 +03:00
|
|
|
gv_run full_version VERSION
|
|
|
|
gv_run major_version MAJOR_VERSION
|
|
|
|
gv_run minor_version MINOR_VERSION
|
|
|
|
gv_run release_version RELEASE_VERSION
|
2005-09-27 06:06:05 +04:00
|
|
|
gv_run greek_version GREEK_VERSION
|
2005-03-25 06:19:46 +03:00
|
|
|
gv_run want_svn WANT_SVN
|
|
|
|
gv_run svn_r SVN_R
|
2004-07-07 16:45:36 +04:00
|
|
|
fi
|
2003-12-22 19:29:21 +03:00
|
|
|
|
|
|
|
# Clean up
|
|
|
|
|
2004-07-07 16:45:36 +04:00
|
|
|
unset gv_glv_dir gv_ver_file gv_prefix gv_prog gv_run \
|
|
|
|
gv_major_version gv_minor_version gv_release_version \
|
2005-09-27 06:06:05 +04:00
|
|
|
gv_greek_version gv_want_svn gv_svn_r
|
2003-12-22 19:29:21 +03:00
|
|
|
])
|