improve autoconf

This commit is contained in:
Vítor Santos Costa
2014-10-25 16:46:13 +01:00
parent f7fe32a03c
commit b5a43ae9ff
11 changed files with 23443 additions and 176 deletions

View File

@@ -1,21 +1,24 @@
dnl Gecode support
AC_ARG_ENABLE(gecode,
[ --enable-gecode install gecode library],
[use_gecode="$enableval"], use_gecode=no)
dnl gecode is usually in /usr/local
if test -d /usr/local/include/gecode -a x$SYSROOT = x; then
CFLAGS="$CFLAGS -I/usr/local/include"
SHLIB_CXXFLAGS="$SHLIB_CXXFLAGS -I/usr/local/include"
GECODE_EXTRALIBS="-L/usr/local/lib"
fi
AC_ARG_WITH(gecode,
[ --with-gecode install gecode library],
[use_gecode="$withval"], use_gecode=no)
if test "$use_gecode" = no; then
PKG_GECODE=""
else
PKG_GECODE="packages/gecode"
if test -d "$use_gecode"; then
CPPFLAGS="$CPPFLAGS -I $use_gecode/include"
GECODE_EXTRALIBS="-L $use_gecode/lib"
GECODE_PATH="$use_gecode/bin"
dnl gecode is usually in /usr/local
elif test -d /usr/local/include/gecode -a x$SYSROOT = x; then
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
GECODE_EXTRALIBS="-L/usr/local/lib"
fi
fi
AC_SUBST(PKG_GECODE)
AC_MSG_CHECKING([if dynamic arrays are supported])
@@ -32,7 +35,7 @@ AC_COMPILE_IFELSE([
GECODE_VERSION=unknown-gecode-version
if test "$use_gecode" = yes; then
if test "$use_gecode" != no; then
if test $i_am_cross_compiling = yes
then
GECODE_VERSION=4.2.1
@@ -42,9 +45,12 @@ if test "$use_gecode" = yes; then
else
GECODE_ARCH=i386
fi
GECODE_PATH=`which fzn-gecode`
GECODE_PATH=`dirname "$GECODE_PATH"`
if test "$use_gecode" = yes; then
GECODE_PATH=`which fzn-gecode`
GECODE_PATH=`dirname "$GECODE_PATH"`
else
GECODE_PATH="$use_gecode"
fi
GECODE_INCLUDES="$GECODE_PATH"/include
GECODE_LIBDIR="\"$GECODE_PATH\""/lib
GECODE_BINDIR="\"$GECODE_PATH\""/bin
@@ -76,6 +82,7 @@ if test "$use_gecode" = yes; then
[AC_MSG_ERROR([cannot determine gecode version])])
case "$target_os" in
*darwin*)
if test "$use_gecode" = yes; then
AC_MSG_CHECKING([if -framework gecode is required])
AC_LANG_PUSH([C++])
saved_CXXFLAGS="$CXXFLAGS"
@@ -90,6 +97,7 @@ return 0;
[AC_MSG_RESULT([no])])
AC_LANG_POP()
CXXFLAGS="$saved_CXXFLAGS"
fi
;;
esac

File diff suppressed because it is too large Load Diff