| 1 |
dnl ------------------------------------------------------------------------ |
|---|
| 2 |
dnl Find a file (or one of more files in a list of dirs) |
|---|
| 3 |
dnl ------------------------------------------------------------------------ |
|---|
| 4 |
dnl |
|---|
| 5 |
AC_DEFUN([AC_FIND_FILE], |
|---|
| 6 |
[ |
|---|
| 7 |
$3=NO |
|---|
| 8 |
for i in $2; |
|---|
| 9 |
do |
|---|
| 10 |
for j in $1; |
|---|
| 11 |
do |
|---|
| 12 |
echo "configure: __oline__: $i/$j" >&AC_FD_CC |
|---|
| 13 |
if test -r "$i/$j"; then |
|---|
| 14 |
echo "taking that" >&AC_FD_CC |
|---|
| 15 |
$3=$i |
|---|
| 16 |
break 2 |
|---|
| 17 |
fi |
|---|
| 18 |
done |
|---|
| 19 |
done |
|---|
| 20 |
]) |
|---|
| 21 |
|
|---|
| 22 |
AC_DEFUN([CHECK_SFCC], |
|---|
| 23 |
[ |
|---|
| 24 |
|
|---|
| 25 |
ac_SFCC_includes=NO |
|---|
| 26 |
ac_SFCC_libraries=NO |
|---|
| 27 |
SFCC_libraries="" |
|---|
| 28 |
SFCC_includes="" |
|---|
| 29 |
sfcc_error="" |
|---|
| 30 |
AC_ARG_WITH(sfcc-dir, |
|---|
| 31 |
[ --with-sfcc-dir=DIR where the root of sfcc is installed], |
|---|
| 32 |
[ ac_SFCC_includes="$withval"/include |
|---|
| 33 |
ac_SFCC_libraries="$withval"/lib${libsuff} |
|---|
| 34 |
]) |
|---|
| 35 |
|
|---|
| 36 |
want_SFCC=yes |
|---|
| 37 |
if test $want_SFCC = yes; then |
|---|
| 38 |
AC_MSG_CHECKING(for Sfcc) |
|---|
| 39 |
|
|---|
| 40 |
AC_CACHE_VAL(ac_cv_have_SFCC, |
|---|
| 41 |
[#try to guess Sfcc locations |
|---|
| 42 |
|
|---|
| 43 |
SFCC_incdirs="/usr/include /usr/local/include /usr/sfcc/include /usr/local/sfcc/include $prefix/include" |
|---|
| 44 |
SFCC_incdirs="$ac_SFCC_includes $SFCC_incdirs" |
|---|
| 45 |
AC_FIND_FILE([CimClientLib/cimcClient.h], $SFCC_incdirs, SFCC_incdir) |
|---|
| 46 |
ac_SFCC_includes="$SFCC_incdir" |
|---|
| 47 |
|
|---|
| 48 |
SFCC_libdirs="/usr/lib${libsuff} /usr/local/lib${libsuff} /usr/sfcc/lib /usr/local/sfcc/lib $prefix/lib${libsuff} $exec_prefix/lib${libsuff}" |
|---|
| 49 |
if test ! "$ac_SFCC_libraries" = "NO"; then |
|---|
| 50 |
SFCC_libdirs="$ac_SFCC_libraries $SFCC_libdirs" |
|---|
| 51 |
fi |
|---|
| 52 |
test=NO |
|---|
| 53 |
SFCC_libdir=NO |
|---|
| 54 |
for dir in $SFCC_libdirs; do |
|---|
| 55 |
try="ls -1 $dir/libcimc*" |
|---|
| 56 |
if test=`eval $try 2> /dev/null`; then SFCC_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi |
|---|
| 57 |
done |
|---|
| 58 |
|
|---|
| 59 |
ac_SFCC_libraries="$SFCC_libdir" |
|---|
| 60 |
|
|---|
| 61 |
if test "$ac_SFCC_includes" = NO || test "$ac_SFCC_libraries" = NO; then |
|---|
| 62 |
have_SFCC=no |
|---|
| 63 |
sfcc_error="Sfcc not found" |
|---|
| 64 |
else |
|---|
| 65 |
have_SFCC=yes; |
|---|
| 66 |
fi |
|---|
| 67 |
|
|---|
| 68 |
]) |
|---|
| 69 |
|
|---|
| 70 |
eval "$ac_cv_have_SFCC" |
|---|
| 71 |
|
|---|
| 72 |
AC_MSG_RESULT([libraries $ac_SFCC_libraries, headers $ac_SFCC_includes]) |
|---|
| 73 |
|
|---|
| 74 |
else |
|---|
| 75 |
have_SFCC=no |
|---|
| 76 |
sfcc_error="Sfcc not found" |
|---|
| 77 |
fi |
|---|
| 78 |
|
|---|
| 79 |
if test "$ac_SFCC_includes" = "/usr/include" || test "$ac_SFCC_includes" = "/usr/local/include" || test -z "$ac_SFCC_includes"; then |
|---|
| 80 |
SFCC_INCLUDES=""; |
|---|
| 81 |
else |
|---|
| 82 |
SFCC_INCLUDES="-I$ac_SFCC_includes" |
|---|
| 83 |
fi |
|---|
| 84 |
|
|---|
| 85 |
if test "$ac_SFCC_libraries" = "/usr/lib" || test "$ac_SFCC_libraries" = "/usr/local/lib" || test -z "$ac_SFCC_libraries"; then |
|---|
| 86 |
SFCC_LDFLAGS="" |
|---|
| 87 |
else |
|---|
| 88 |
SFCC_LDFLAGS="-L$ac_SFCC_libraries -R$ac_SFCC_libraries" |
|---|
| 89 |
fi |
|---|
| 90 |
|
|---|
| 91 |
AC_SUBST(SFCC_INCLUDES) |
|---|
| 92 |
AC_SUBST(SFCC_LDFLAGS) |
|---|
| 93 |
]) |
|---|
| 94 |
##### http://autoconf-archive.cryp.to/ac_pkg_swig.html |
|---|
| 95 |
# |
|---|
| 96 |
# SYNOPSIS |
|---|
| 97 |
# |
|---|
| 98 |
# AC_PROG_SWIG([major.minor.micro]) |
|---|
| 99 |
# |
|---|
| 100 |
# DESCRIPTION |
|---|
| 101 |
# |
|---|
| 102 |
# This macro searches for a SWIG installation on your system. If |
|---|
| 103 |
# found you should call SWIG via $(SWIG). You can use the optional |
|---|
| 104 |
# first argument to check if the version of the available SWIG is |
|---|
| 105 |
# greater than or equal to the value of the argument. It should have |
|---|
| 106 |
# the format: N[.N[.N]] (N is a number between 0 and 999. Only the |
|---|
| 107 |
# first N is mandatory.) |
|---|
| 108 |
# |
|---|
| 109 |
# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks |
|---|
| 110 |
# that the swig package is this version number or higher. |
|---|
| 111 |
# |
|---|
| 112 |
# In configure.in, use as: |
|---|
| 113 |
# |
|---|
| 114 |
# AC_PROG_SWIG(1.3.17) |
|---|
| 115 |
# SWIG_ENABLE_CXX |
|---|
| 116 |
# SWIG_MULTI_MODULE_SUPPORT |
|---|
| 117 |
# SWIG_PYTHON |
|---|
| 118 |
# |
|---|
| 119 |
# LAST MODIFICATION |
|---|
| 120 |
# |
|---|
| 121 |
# 2006-10-22 |
|---|
| 122 |
# |
|---|
| 123 |
# COPYLEFT |
|---|
| 124 |
# |
|---|
| 125 |
# Copyright (c) 2006 Sebastian Huber <sebastian-huber@web.de> |
|---|
| 126 |
# Copyright (c) 2006 Alan W. Irwin <irwin@beluga.phys.uvic.ca> |
|---|
| 127 |
# Copyright (c) 2006 Rafael Laboissiere <rafael@laboissiere.net> |
|---|
| 128 |
# Copyright (c) 2006 Andrew Collier <colliera@ukzn.ac.za> |
|---|
| 129 |
# |
|---|
| 130 |
# This program is free software; you can redistribute it and/or |
|---|
| 131 |
# modify it under the terms of the GNU General Public License as |
|---|
| 132 |
# published by the Free Software Foundation; either version 2 of the |
|---|
| 133 |
# License, or (at your option) any later version. |
|---|
| 134 |
# |
|---|
| 135 |
# This program is distributed in the hope that it will be useful, but |
|---|
| 136 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 137 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 138 |
# General Public License for more details. |
|---|
| 139 |
# |
|---|
| 140 |
# You should have received a copy of the GNU General Public License |
|---|
| 141 |
# along with this program; if not, write to the Free Software |
|---|
| 142 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
|---|
| 143 |
# 02111-1307, USA. |
|---|
| 144 |
# |
|---|
| 145 |
# As a special exception, the respective Autoconf Macro's copyright |
|---|
| 146 |
# owner gives unlimited permission to copy, distribute and modify the |
|---|
| 147 |
# configure scripts that are the output of Autoconf when processing |
|---|
| 148 |
# the Macro. You need not follow the terms of the GNU General Public |
|---|
| 149 |
# License when using or distributing such scripts, even though |
|---|
| 150 |
# portions of the text of the Macro appear in them. The GNU General |
|---|
| 151 |
# Public License (GPL) does govern all other use of the material that |
|---|
| 152 |
# constitutes the Autoconf Macro. |
|---|
| 153 |
# |
|---|
| 154 |
# This special exception to the GPL applies to versions of the |
|---|
| 155 |
# Autoconf Macro released by the Autoconf Macro Archive. When you |
|---|
| 156 |
# make and distribute a modified version of the Autoconf Macro, you |
|---|
| 157 |
# may extend this special exception to the GPL to apply to your |
|---|
| 158 |
# modified version as well. |
|---|
| 159 |
|
|---|
| 160 |
AC_DEFUN([AC_PROG_SWIG],[ |
|---|
| 161 |
AC_PATH_PROG([SWIG],[swig]) |
|---|
| 162 |
if test -z "$SWIG" ; then |
|---|
| 163 |
AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) |
|---|
| 164 |
SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' |
|---|
| 165 |
elif test -n "$1" ; then |
|---|
| 166 |
AC_MSG_CHECKING([for SWIG version]) |
|---|
| 167 |
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] |
|---|
| 168 |
AC_MSG_RESULT([$swig_version]) |
|---|
| 169 |
if test -n "$swig_version" ; then |
|---|
| 170 |
# Calculate the required version number components |
|---|
| 171 |
[required=$1] |
|---|
| 172 |
[required_major=`echo $required | sed 's/[^0-9].*//'`] |
|---|
| 173 |
if test -z "$required_major" ; then |
|---|
| 174 |
[required_major=0] |
|---|
| 175 |
fi |
|---|
| 176 |
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`] |
|---|
| 177 |
[required_minor=`echo $required | sed 's/[^0-9].*//'`] |
|---|
| 178 |
if test -z "$required_minor" ; then |
|---|
| 179 |
[required_minor=0] |
|---|
| 180 |
fi |
|---|
| 181 |
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`] |
|---|
| 182 |
[required_patch=`echo $required | sed 's/[^0-9].*//'`] |
|---|
| 183 |
if test -z "$required_patch" ; then |
|---|
| 184 |
[required_patch=0] |
|---|
| 185 |
fi |
|---|
| 186 |
# Calculate the available version number components |
|---|
| 187 |
[available=$swig_version] |
|---|
| 188 |
[available_major=`echo $available | sed 's/[^0-9].*//'`] |
|---|
| 189 |
if test -z "$available_major" ; then |
|---|
| 190 |
[available_major=0] |
|---|
| 191 |
fi |
|---|
| 192 |
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`] |
|---|
| 193 |
[available_minor=`echo $available | sed 's/[^0-9].*//'`] |
|---|
| 194 |
if test -z "$available_minor" ; then |
|---|
| 195 |
[available_minor=0] |
|---|
| 196 |
fi |
|---|
| 197 |
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`] |
|---|
| 198 |
[available_patch=`echo $available | sed 's/[^0-9].*//'`] |
|---|
| 199 |
if test -z "$available_patch" ; then |
|---|
| 200 |
[available_patch=0] |
|---|
| 201 |
fi |
|---|
| 202 |
if test $available_major -ne $required_major \ |
|---|
| 203 |
-o $available_minor -ne $required_minor \ |
|---|
| 204 |
-o $available_patch -lt $required_patch ; then |
|---|
| 205 |
AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) |
|---|
| 206 |
SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' |
|---|
| 207 |
else |
|---|
| 208 |
AC_MSG_NOTICE([SWIG executable is '$SWIG']) |
|---|
| 209 |
SWIG_LIB=`$SWIG -swiglib` |
|---|
| 210 |
AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) |
|---|
| 211 |
SWIG_VERSION=`echo $(( $available_major * 100 * 100 + $available_minor * 100 + $available_patch ))` |
|---|
| 212 |
AC_MSG_NOTICE([SWIG version is '$SWIG_VERSION']) |
|---|
| 213 |
# AM_CONDITIONAL(SWIG_NEW_OPTIONS, test "$SWIG_VERSION" \> 10331) |
|---|
| 214 |
fi |
|---|
| 215 |
else |
|---|
| 216 |
AC_MSG_WARN([cannot determine SWIG version]) |
|---|
| 217 |
SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' |
|---|
| 218 |
fi |
|---|
| 219 |
fi |
|---|
| 220 |
AC_SUBST([SWIG_LIB]) |
|---|
| 221 |
]) |
|---|