1 dnl Process this file with autoconf to produce a configure script
3 AC_INIT([GLPK], [4.45], [bug-glpk@gnu.org])
5 AC_CONFIG_SRCDIR([include/glpk.h])
7 AC_CONFIG_MACRO_DIR([m4])
11 AC_CONFIG_HEADERS([config.h])
14 AC_HELP_STRING([--with-gmp],
15 [use GNU MP bignum library [[default=no]]]),
18 *) AC_MSG_ERROR([invalid value `$withval' for --with-gmp]);;
23 AC_HELP_STRING([--with-zlib],
24 [use zlib data compression library [[default=no]]]),
27 *) AC_MSG_ERROR([invalid value `$withval' for --with-zlib]);;
32 AC_HELP_STRING([--enable-dl],
33 [enable shared library support [[default=no]]]),
35 yes | ltdl | dlfcn | no) ;;
36 *) AC_MSG_ERROR([invalid value `$enableval' for --enable-dl]);;
41 AC_HELP_STRING([--enable-odbc],
42 [enable MathProg ODBC support [[default=no]]]),
45 *) AC_MSG_ERROR([invalid value `$enableval' for --enable-odbc]);;
50 AC_HELP_STRING([--enable-mysql],
51 [enable MathProg MySQL support [[default=no]]]),
54 *) AC_MSG_ERROR([invalid value `$enableval' for --enable-mysql]);;
58 dnl Disable unnecessary libtool tests
59 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
60 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
61 define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])
63 dnl Check for programs
68 dnl Check for math library
69 AC_CHECK_LIB([m], [exp])
71 dnl Check for <sys/time.h> header
72 AC_CHECK_HEADER([sys/time.h],
73 AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A]))
75 dnl Check for gettimeofday function
76 AC_CHECK_FUNC([gettimeofday],
77 AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [N/A]))
79 AC_MSG_CHECKING([whether to use GNU MP bignum library])
80 if test "$with_gmp" = "yes"; then
82 AC_DEFINE([HAVE_GMP], [1], [N/A])
88 AC_MSG_CHECKING([whether to use zlib data compression library])
89 if test "$with_zlib" = "yes"; then
91 AC_DEFINE([HAVE_ZLIB], [1], [N/A])
97 AC_MSG_CHECKING([whether to enable shared library support])
98 if test "$enable_dl" = "yes"; then
100 AC_DEFINE([HAVE_LTDL], [1], [N/A])
102 elif test "$enable_dl" = "ltdl"; then
103 AC_MSG_RESULT([ltdl])
104 AC_DEFINE([HAVE_LTDL], [1], [N/A])
106 elif test "$enable_dl" = "dlfcn"; then
107 AC_MSG_RESULT([dlfcn])
108 AC_DEFINE([HAVE_DLFCN], [1], [N/A])
115 LIBIODBC="libiodbc.dylib"
116 LIBODBC="libodbc.dylib"
117 LIBMYSQL="libmysqlclient.dylib"
120 LIBIODBC="libiodbc.so"
122 LIBMYSQL="libmysqlclient.so"
126 AC_MSG_CHECKING([whether to enable MathProg ODBC support])
127 if test "$enable_odbc" = "yes"; then
128 if test "$enable_dl" = "no"; then
129 AC_MSG_ERROR([--enable-odbc requires --enable-dl])
132 AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A])
133 elif test "$enable_odbc" = "unix"; then
134 if test "$enable_dl" = "no"; then
135 AC_MSG_ERROR([--enable-odbc requires --enable-dl])
137 AC_MSG_RESULT([unix])
138 AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBODBC"], [N/A])
143 AC_MSG_CHECKING([whether to enable MathProg MySQL support])
144 if test "$enable_mysql" = "yes"; then
145 if test "$enable_dl" = "no"; then
146 AC_MSG_ERROR([--enable-mysql requires --enable-dl])
149 CPPFLAGS="-I/usr/include/mysql $CPPFLAGS"
150 AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A])
156 [include/Makefile src/Makefile examples/Makefile Makefile])