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
|
dnl GLPK for Java
dnl Initialization
AC_INIT([GLPK for Java], [1.12.0], [xypron.glpk@gmx.de],
[libglpk-java], [http://glpk-java.sourceforge.net])
AC_CONFIG_SRCDIR([swig/glpk.i])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
LT_INIT
dnl Compiler check
AC_PROG_CC
AC_CHECK_PROG([have_cc],[$CC],[yes],[no])
if test [$have_cc] != [yes]; then
AC_MSG_ERROR([$CC is missing])
fi
dnl Provide $(LN_S)
AC_PROG_LN_S
dnl Check for programs needed
AC_PATH_PROG([SWIG],[swig])
if test "x$SWIG" == "x"; then
AC_MSG_ERROR([Swig is missing])
fi
AC_PATH_PROG([JAVAC],[javac])
if test "x$JAVAC" == "x"; then
AC_MSG_ERROR([javac is missing])
fi
AC_PATH_PROG([JAVADOC],[javadoc])
if test "x$JAVADOC" == "x"; then
AC_MSG_ERROR([javadoc is missing])
fi
AC_PATH_PROG([JAR],[jar])
if test "x$JAR" == "x"; then
AC_MSG_ERROR([jar is missing])
fi
AC_ARG_ENABLE(maven,
AC_HELP_STRING([--enable-maven],
[build maven project [[default=yes]]]),
[case $enableval in
yes | no) ;;
*) AC_MSG_ERROR([invalid value $enableval for --enable-maven]);;
esac],
[enable_maven=yes;])
if test "x$enable_maven" == "xyes"; then
AC_PATH_PROG([MVN],[mvn])
fi
AM_CONDITIONAL([HAVEMVN], [test "x$MVN" != "x"])
if test "x$enable_maven" == "xyes"; then
AM_COND_IF([HAVEMVN],
[],
AC_MSG_WARN([Maven is missing])
)
fi
AC_ARG_ENABLE(libpath,
AC_HELP_STRING([--enable-libpath],
[load GLPK library from java.library.path [[default=no]]]),
[case $enableval in
yes | no) ;;
*) AC_MSG_ERROR([invalid value $enableval for --enable-libpath]);;
esac],
[enable_libpath=no])
AC_MSG_CHECKING([whether to load GLPK library from java.library.path])
AC_MSG_RESULT([$enable_libpath])
if test "x$enable_libpath" == "xyes"; then
SWIGFLAGS="-DGLPKPRELOAD $SWIGFLAGS"
fi
dnl Check JAVA_HOME is set
if test "x$JAVA_HOME" == "x"; then
AC_MSG_ERROR([JAVA_HOME is not set])
fi
dnl Include path
CPPFLAGS+=" -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
dnl SWIG
AC_ARG_VAR([SWIGFLAGS],[The list of flags that should be passed to SWIG.])
SWIGFLAGS="-I/usr/include -I/usr/local/include $SWIGFLAGS"
SWIGFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux $SWIGFLAGS"
dnl Thread local storage
AC_MSG_CHECKING(for thread local storage (TLS) class)
tls_keywords="_Thread_local __thread __declspec(thread)"
cv_tls="none"
for tls_keyword in $tls_keywords; do
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <stdlib.h>
static void foo(void) {
static ] $tls_keyword [ int bar;
exit(1);
}])],
[cv_tls=$tls_keyword ; break],
[]
)
done
AC_MSG_RESULT($cv_tls)
if test "x$cv_tls" == "xnone"; then
cv_tls="/**/"
fi
AC_DEFINE_UNQUOTED([TLS], $cv_tls, [Thread local storage])
dnl Check includes
AC_CHECK_HEADER([glpk.h],
[],
[AC_MSG_ERROR([glpk.h not found])]
)
AC_CHECK_HEADER([jni.h],
[],
[AC_MSG_ERROR([jni.h not found])]
)
dnl Makefiles
AC_CONFIG_FILES([
Makefile
doc/Makefile
swig/Makefile
])
CPPFLAGS+=" -I.."
AC_MSG_NOTICE([CFLAGS = $CFLAGS])
AC_MSG_NOTICE([CPPFLAGS = $CPPFLAGS])
AC_MSG_NOTICE([SWIGFLAGS = $SWIGFLAGS])
AC_MSG_NOTICE([LDFLAGS = $LDFLAGS])
dnl Generate files
AC_OUTPUT
|