Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (48 sloc) 2.396 kb
afb8bd9 Added retrieval of ISIS version in Autotools
Moratto authored
1 dnl __BEGIN_LICENSE__
d41caa3 Zack Moratto all: Relicense for 2013
zmoratto authored
2 dnl Copyright (c) 2009-2013, United States Government as represented by the
815e548 Zack Moratto all: Relicense ASP as Apache 2
zmoratto authored
3 dnl Administrator of the National Aeronautics and Space Administration. All
4 dnl rights reserved.
5 dnl
6 dnl The NGT platform is licensed under the Apache License, Version 2.0 (the
7 dnl "License"); you may not use this file except in compliance with the
8 dnl License. You may obtain a copy of the License at
9 dnl http://www.apache.org/licenses/LICENSE-2.0
10 dnl
11 dnl Unless required by applicable law or agreed to in writing, software
12 dnl distributed under the License is distributed on an "AS IS" BASIS,
13 dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 dnl See the License for the specific language governing permissions and
15 dnl limitations under the License.
afb8bd9 Added retrieval of ISIS version in Autotools
Moratto authored
16 dnl __END_LICENSE__
17
815e548 Zack Moratto all: Relicense ASP as Apache 2
zmoratto authored
18
afb8bd9 Added retrieval of ISIS version in Autotools
Moratto authored
19 # Usage AX_PKG_ISIS_CHECK_VERSION()
20 # This checks for ISIS3.3.0+ style versioning
21 AC_DEFUN([AX_PKG_ISIS_CHECK_VERSION],
22 [
23 if test x"$HAVE_PKG_ISIS" != "xyes"; then
24 AC_MSG_ERROR([ISIS not found before hand, unable to find version now])
25 fi
26
27 echo "ISISROOT = $ISISROOT" >&AS_MESSAGE_LOG_FD
28 echo "PKG_PATHS_ISIS = $PKG_PATHS_ISIS" >&AS_MESSAGE_LOG_FD
29
30 if test -s "$ISISROOT"/version; then
31 # Found ISIS 3.3.0+ style versioning
32 ISIS_VERSION_PRE=`tr '\n' ' ' < $ISISROOT/version`
33 elif test -s "$PKG_PATHS_ISIS"/version; then
34 # Found ISIS 3.3.0+ style versioning
35 ISIS_VERSION_PRE=`tr '\n' ' ' < $PKG_PATHS_ISIS/version`
36 elif grep "std::string version" < "$ISISROOT"/inc/Constants.h > /dev/null; then
37 # Found ISIS < 3.3.0 style versioning
38 ISIS_VERSION_PRE=`grep "std::string version" < $ISISROOT/inc/Constants.h | sed 's/.*"\(.*\)".*/\1/'`
39 elif grep "std::string version" < "$PKG_PATHS_ISIS"/inc/Constants.h > /dev/null; then
40 # Found ISIS < 3.3.0 style versioning
41 ISIS_VERSION_PRE=`grep "std::string version" < $PKG_PATHS_ISIS/inc/Constants.h | sed 's/.*"\(.*\)".*/\1/'`
42 else
43 AC_MSG_ERROR([Unable to detect ISIS version])
44 fi
45
46 # Trim whitespaces leading an trailing
47 ISIS_VERSION=`echo $ISIS_VERSION_PRE | sed 's/^[ \t]*//;s/[ \t]*$//'`
48
49 echo "ISIS_VERSION_PRE = \"$ISIS_VERSION_PRE\"" >&AS_MESSAGE_LOG_FD
50 echo "ISIS_VERSION = \"$ISIS_VERSION\"" >&AS_MESSAGE_LOG_FD
51
52 AC_DEFINE_UNQUOTED([ISIS_VERSION],
53 ["$ISIS_VERSION"],
54 [The version of ISIS that this software was built against.])
55 ])
Something went wrong with that request. Please try again.