there was an #include directive missing
[openmpi-llc.git] / config / ompi_get_version.m4sh
blobf3c6df2b9906d05b6913b75a618789b4cab96847
1 m4_define([_m4_divert(SCRIPT)], 100)
2 m4_divert_push([SCRIPT])dnl
3 #!/bin/sh
5 # ompi_get_version is created from ompi_get_version.m4 and ompi_get_version.m4sh.
7 # Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
8 #                         University Research and Technology
9 #                         Corporation.  All rights reserved.
10 # Copyright (c) 2004-2005 The University of Tennessee and The University
11 #                         of Tennessee Research Foundation.  All rights
12 #                         reserved.
13 # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
14 #                         University of Stuttgart.  All rights reserved.
15 # Copyright (c) 2004-2005 The Regents of the University of California.
16 #                         All rights reserved.
17 # $COPYRIGHT$
18
19 # Additional copyrights may follow
20
21 # $HEADER$
24 m4_include([ompi_get_version.m4])
26 srcfile="$1"
27 option="$2"
29 case "$option" in
30     # svnversion can take a while to run.  If we don't need it, don't run it.
31     --major|--minor|--release|--greek|--base|--help)
32         ompi_ver_need_svn=0
33         ;;
34     *)
35         ompi_ver_need_svn=1
36 esac
39 if test -z "$srcfile"; then
40     option="--help"
41 else
42     OMPI_GET_VERSION([$srcfile],[OMPI])
44     if test "$option" = ""; then
45         option="--full"
46     fi
49 case "$option" in
50     --full|-v|--version)
51         echo $OMPI_VERSION
52         ;;
53     --major)
54         echo $OMPI_MAJOR_VERSION
55         ;;
56     --minor)
57         echo $OMPI_MINOR_VERSION
58         ;;
59     --release)
60         echo $OMPI_RELEASE_VERSION
61         ;;
62     --greek)
63         echo $OMPI_GREEK_VERSION
64         ;;
65     --svn)
66         echo $OMPI_SVN_R
67         ;;
68     --base)
69         echo $OMPI_BASE_VERSION
70         ;;
71     --all)
72         echo ${OMPI_VERSION} ${OMPI_MAJOR_VERSION} ${OMPI_MINOR_VERSION} ${OMPI_RELEASE_VERSION} ${OMPI_GREEK_VERSION} ${OMPI_SVN_R}
73         ;;
74     -h|--help)
75         cat <<EOF
76 $0 <srcfile> [<option>]
78 <srcfile> - Text version file
79 <option>  - One of:
80     --full    - Full version number
81     --major   - Major version number
82     --minor   - Minor version number
83     --release - Release version number
84     --greek   - Greek (alpha, beta, etc) version number
85     --svn     - Subversion repository number
86     --all     - Show all version numbers, separated by :
87     --base    - Show base version number (no svn number)
88     --help    - This message
89 EOF
90         ;;
91     *)
92         echo "Unrecognized option $option.  Run $0 --help for options"
93         ;;
94 esac
96 # All done
98 exit 0