1
1
openmpi/config/ompi_get_version.m4

82 строки
2.6 KiB
Plaintext
Исходник Обычный вид История

dnl -*- shell-script -*-
dnl
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.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
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
AC_DEFUN([OMPI_GET_VERSION],[
gv_ver_file="$1"
gv_prefix="$2"
dnl quote eval to suppress macro expansion with non-GNU m4
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"`
else
ver=svn`date '+%m%d%Y'`
fi
gv_svn_r="$ver"
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
])