2006-01-22 01:53:16 +03:00
|
|
|
m4_define([_m4_divert(SCRIPT)], 100)
|
|
|
|
m4_divert_push([SCRIPT])dnl
|
2003-12-22 19:29:21 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2006-01-22 01:53:16 +03:00
|
|
|
# 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
|
2005-11-05 22:57:48 +03:00
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
# University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
2004-01-07 10:47:13 +03:00
|
|
|
# $HEADER$
|
2003-12-22 19:29:21 +03:00
|
|
|
#
|
2004-07-07 16:45:36 +04:00
|
|
|
|
2006-01-22 01:53:16 +03:00
|
|
|
m4_include([ompi_get_version.m4])
|
2003-12-22 19:29:21 +03:00
|
|
|
|
|
|
|
srcfile="$1"
|
|
|
|
option="$2"
|
|
|
|
|
2005-09-07 23:59:28 +04:00
|
|
|
case "$option" in
|
|
|
|
# svnversion can take a while to run. If we don't need it, don't run it.
|
2005-09-27 06:06:05 +04:00
|
|
|
--major|--minor|--release|--greek|--base|--help)
|
2006-01-22 01:53:16 +03:00
|
|
|
ompi_ver_need_svn=0
|
2005-09-07 23:59:28 +04:00
|
|
|
;;
|
|
|
|
*)
|
2006-01-22 01:53:16 +03:00
|
|
|
ompi_ver_need_svn=1
|
2005-09-07 23:59:28 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
|
2006-01-22 01:53:16 +03:00
|
|
|
if test -z "$srcfile"; then
|
2003-12-22 19:29:21 +03:00
|
|
|
option="--help"
|
|
|
|
else
|
2006-01-22 01:53:16 +03:00
|
|
|
OMPI_GET_VERSION([$srcfile],[OMPI])
|
2003-12-22 19:29:21 +03:00
|
|
|
|
|
|
|
if test "$option" = ""; then
|
|
|
|
option="--full"
|
2004-07-07 16:45:36 +04:00
|
|
|
fi
|
2003-12-22 19:29:21 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
case "$option" in
|
|
|
|
--full|-v|--version)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--major)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_MAJOR_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--minor)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_MINOR_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--release)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_RELEASE_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
2005-09-27 06:06:05 +04:00
|
|
|
--greek)
|
|
|
|
echo $OMPI_GREEK_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
2004-03-19 09:05:27 +03:00
|
|
|
--svn)
|
2005-03-25 06:19:46 +03:00
|
|
|
echo $OMPI_SVN_R
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
2005-09-07 09:54:53 +04:00
|
|
|
--base)
|
|
|
|
echo $OMPI_BASE_VERSION
|
|
|
|
;;
|
2004-02-13 06:58:56 +03:00
|
|
|
--all)
|
2005-09-27 06:06:05 +04:00
|
|
|
echo ${OMPI_VERSION} ${OMPI_MAJOR_VERSION} ${OMPI_MINOR_VERSION} ${OMPI_RELEASE_VERSION} ${OMPI_GREEK_VERSION} ${OMPI_SVN_R}
|
2004-02-13 06:58:56 +03:00
|
|
|
;;
|
2003-12-22 19:29:21 +03:00
|
|
|
-h|--help)
|
|
|
|
cat <<EOF
|
|
|
|
$0 <srcfile> [<option>]
|
|
|
|
|
|
|
|
<srcfile> - Text version file
|
|
|
|
<option> - One of:
|
|
|
|
--full - Full version number
|
|
|
|
--major - Major version number
|
|
|
|
--minor - Minor version number
|
|
|
|
--release - Release version number
|
2005-09-27 06:06:05 +04:00
|
|
|
--greek - Greek (alpha, beta, etc) version number
|
2004-03-19 09:05:27 +03:00
|
|
|
--svn - Subversion repository number
|
2004-02-13 06:58:56 +03:00
|
|
|
--all - Show all version numbers, separated by :
|
2005-09-07 09:54:53 +04:00
|
|
|
--base - Show base version number (no svn number)
|
2003-12-22 19:29:21 +03:00
|
|
|
--help - This message
|
|
|
|
EOF
|
2005-09-07 23:59:28 +04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unrecognized option $option. Run $0 --help for options"
|
|
|
|
;;
|
2003-12-22 19:29:21 +03:00
|
|
|
esac
|
|
|
|
|
|
|
|
# All done
|
|
|
|
|
|
|
|
exit 0
|