This repository has been archived by the owner on Jun 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacinclude.m4
184 lines (178 loc) · 6.39 KB
/
acinclude.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# SNS Common Libraries
# A part of the SNS Analysis Software Suite.
#
# Spallation Neutron Source
# Oak Ridge National Laboratory, Oak Ridge TN.
#
#
# NOTICE
#
# For this software and its associated documentation, permission is granted
# to reproduce, prepare derivative works, and distribute copies to the public
# for any purpose and without fee.
#
# This material was prepared as an account of work sponsored by an agency of
# the United States Government. Neither the United States Government nor the
# United States Department of Energy, nor any of their employees, makes any
# warranty, express or implied, or assumes any legal liability or
# responsibility for the accuracy, completeness, or usefulness of any
# information, apparatus, product, or process disclosed, or represents that
# its use would not infringe privately owned rights.
#
# $Id$
# AC_CHECK_ROOT
#
# $1 = name of arg
# $2 = root variable name to set
# $3 = list of root paths to try
# $4 = file in path to locate
#
# e.g. AC_CHECK_ROOT([tcl],[TCLROOT],[/usr /usr/local],[include/tcl.h])
#
AC_DEFUN(
[AC_CHECK_ROOT],
[ $2=""
AC_SUBST([$2])
AC_ARG_WITH([$1],
AC_HELP_STRING([--with-$1=/path/to/$1/directory],
[Specify location of $1 install directory]),
[if test x$withval != xno; then $2=$withval; fi],
[])
if test x$withval != xno -a x[$]$2 = x; then
AC_MSG_CHECKING(for $1 root installation directory)
for i in $3; do
if test x[$]$2 = x -a -r $i/$4; then $2=$i; fi
done
if test x[$]$2 = x; then
AC_MSG_RESULT(unknown)
else
AC_MSG_RESULT([$]$2)
fi
fi
])
# SCL_SWIG_CHECK
#
# Adds an Autotools check on the version of Swig for the SNS Common Libraries
#
# $1 = required version of swig
#
# e.g. SCL_SWIG_CHECK(1.3.28)
#
AC_DEFUN(
[SCL_SWIG_CHECK],
[AC_CHECK_PROGS([SWIG], [swig])
AC_SUBST(SWIG)
if test -z "$SWIG" ; then
AC_MSG_ERROR([Cannot find SWIG. This is vital to the library build, so please obtain SWIG. See http://www.swig.org])
elif test -n "$1" ; then
AC_MSG_CHECKING([for SWIG version])
[SWIG_VERSION=`$SWIG -version 2>&1 | grep 'SWIG Version' | cut -d" " -f3`]
AC_MSG_RESULT([$SWIG_VERSION])
AC_SUBST(SWIG_VERSION)
if test -n "$SWIG_VERSION" ; then
[required=$1]
[required_major=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_major" ; then
[required_major=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_minor" ; then
[required_minor=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_patch" ; then
[required_patch=0]
fi
# Calculate the available version number components
[available=`echo $SWIG_VERSION | sed 's/[^0-9]*//'`]
[available_major=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_major" ; then
[available_major=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_minor" ; then
[available_minor=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_patch=`echo $available | sed -e 's/.*Patch[^0-9]*//' -e 's/[^0-9]*//g' `]
if test -z "$available_patch" ; then
[available_patch=0]
fi
if test $available_major -le $required_major ; then
if test $available_minor -le $required_minor ; then
if test $available_patch -lt $required_patch ; then
AC_MSG_ERROR([You need SWIG version $1 and have SWIG version $SWIG_VERSION])
fi
fi
fi
fi
fi
])
# SCL_DOXYGEN_CHECK
#
# Adds an Autotools check on the version of Doxygen for the SNS Common
# Libraries
#
# $1 = required version of doxygen
#
# e.g. SCL_DOXYGEN_CHECK(1.4.6)
#
AC_DEFUN(
[SCL_DOXYGEN_CHECK],
[AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_SUBST(DOXYGEN)
if test -z "$DOXYGEN" ; then
AC_MSG_WARN([Cannot find doxygen. See http://www.doxygen.org])
elif test -n "$1" ; then
AC_MSG_CHECKING([for DOXYGEN version])
[doxygen_version=`$DOXYGEN --version 2>&1`]
AC_MSG_RESULT([$doxygen_version])
if test -n "$doxygen_version" ; then
[required=$1]
[required_major=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_major" ; then
[required_major=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_minor" ; then
[required_minor=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_patch" ; then
[required_patch=0]
fi
# Calculate the available version number components
[available=`echo $doxygen_version | sed 's/[^0-9]*//'`]
[available_major=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_major" ; then
[available_major=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_minor" ; then
[available_minor=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_patch=`echo $available | sed -e 's/.*Patch[^0-9]*//' -e 's/[^0-9]*//g' `]
if test -z "$available_patch" ; then
[available_patch=0]
fi
if test $available_major -le $required_major ; then
if test $available_minor -le $required_minor ; then
if test $available_patch -lt $required_patch ; then
AC_MSG_WARN([You need $DOXYGEN version $1 and have $DOXYGEN version $doxygen_version])
DOXYGEN_VERSION_REQ='$1'
DOXYGEN_VERSION_HAVE=$doxygen_version
AC_SUBST(DOXYGEN_VERSION_REQ)
AC_SUBST(DOXYGEN_VERSION_HAVE)
fi
fi
fi
fi
fi
])