alpar@1: dnl Process this file with autoconf to produce a configure script alpar@1: alpar@1: AC_INIT([GLPK], [4.45], [bug-glpk@gnu.org]) alpar@1: alpar@1: AC_CONFIG_SRCDIR([include/glpk.h]) alpar@1: alpar@1: AC_CONFIG_MACRO_DIR([m4]) alpar@1: alpar@1: AM_INIT_AUTOMAKE alpar@1: alpar@1: AC_CONFIG_HEADERS([config.h]) alpar@1: alpar@1: AC_ARG_WITH(gmp, alpar@1: AC_HELP_STRING([--with-gmp], alpar@1: [use GNU MP bignum library [[default=no]]]), alpar@1: [case $withval in alpar@1: yes | no) ;; alpar@1: *) AC_MSG_ERROR([invalid value `$withval' for --with-gmp]);; alpar@1: esac], alpar@1: [with_gmp=no]) alpar@1: alpar@1: AC_ARG_WITH(zlib, alpar@1: AC_HELP_STRING([--with-zlib], alpar@1: [use zlib data compression library [[default=no]]]), alpar@1: [case $withval in alpar@1: yes | no) ;; alpar@1: *) AC_MSG_ERROR([invalid value `$withval' for --with-zlib]);; alpar@1: esac], alpar@1: [with_zlib=no]) alpar@1: alpar@1: AC_ARG_ENABLE(dl, alpar@1: AC_HELP_STRING([--enable-dl], alpar@1: [enable shared library support [[default=no]]]), alpar@1: [case $enableval in alpar@1: yes | ltdl | dlfcn | no) ;; alpar@1: *) AC_MSG_ERROR([invalid value `$enableval' for --enable-dl]);; alpar@1: esac], alpar@1: [enable_dl=no]) alpar@1: alpar@1: AC_ARG_ENABLE(odbc, alpar@1: AC_HELP_STRING([--enable-odbc], alpar@1: [enable MathProg ODBC support [[default=no]]]), alpar@1: [case $enableval in alpar@1: yes | unix | no) ;; alpar@1: *) AC_MSG_ERROR([invalid value `$enableval' for --enable-odbc]);; alpar@1: esac], alpar@1: [enable_odbc=no]) alpar@1: alpar@1: AC_ARG_ENABLE(mysql, alpar@1: AC_HELP_STRING([--enable-mysql], alpar@1: [enable MathProg MySQL support [[default=no]]]), alpar@1: [case $enableval in alpar@1: yes | no) ;; alpar@1: *) AC_MSG_ERROR([invalid value `$enableval' for --enable-mysql]);; alpar@1: esac], alpar@1: [enable_mysql=no]) alpar@1: alpar@1: dnl Disable unnecessary libtool tests alpar@1: define([AC_LIBTOOL_LANG_CXX_CONFIG], [:]) alpar@1: define([AC_LIBTOOL_LANG_F77_CONFIG], [:]) alpar@1: define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:]) alpar@1: alpar@1: dnl Check for programs alpar@1: AC_PROG_CC alpar@1: AC_PROG_INSTALL alpar@1: AC_PROG_LIBTOOL alpar@1: alpar@1: dnl Check for math library alpar@1: AC_CHECK_LIB([m], [exp]) alpar@1: alpar@1: dnl Check for header alpar@1: AC_CHECK_HEADER([sys/time.h], alpar@1: AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A])) alpar@1: alpar@1: dnl Check for gettimeofday function alpar@1: AC_CHECK_FUNC([gettimeofday], alpar@1: AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [N/A])) alpar@1: alpar@1: AC_MSG_CHECKING([whether to use GNU MP bignum library]) alpar@1: if test "$with_gmp" = "yes"; then alpar@1: AC_MSG_RESULT([yes]) alpar@1: AC_DEFINE([HAVE_GMP], [1], [N/A]) alpar@1: LIBS="-lgmp $LIBS" alpar@1: else alpar@1: AC_MSG_RESULT([no]) alpar@1: fi alpar@1: alpar@1: AC_MSG_CHECKING([whether to use zlib data compression library]) alpar@1: if test "$with_zlib" = "yes"; then alpar@1: AC_MSG_RESULT([yes]) alpar@1: AC_DEFINE([HAVE_ZLIB], [1], [N/A]) alpar@1: LIBS="-lz $LIBS" alpar@1: else alpar@1: AC_MSG_RESULT([no]) alpar@1: fi alpar@1: alpar@1: AC_MSG_CHECKING([whether to enable shared library support]) alpar@1: if test "$enable_dl" = "yes"; then alpar@1: AC_MSG_RESULT([ltdl]) alpar@1: AC_DEFINE([HAVE_LTDL], [1], [N/A]) alpar@1: LIBS="-lltdl $LIBS" alpar@1: elif test "$enable_dl" = "ltdl"; then alpar@1: AC_MSG_RESULT([ltdl]) alpar@1: AC_DEFINE([HAVE_LTDL], [1], [N/A]) alpar@1: LIBS="-lltdl $LIBS" alpar@1: elif test "$enable_dl" = "dlfcn"; then alpar@1: AC_MSG_RESULT([dlfcn]) alpar@1: AC_DEFINE([HAVE_DLFCN], [1], [N/A]) alpar@1: else alpar@1: AC_MSG_RESULT([no]) alpar@1: fi alpar@1: alpar@1: case $host_os in alpar@1: darwin* | macosx*) alpar@1: LIBIODBC="libiodbc.dylib" alpar@1: LIBODBC="libodbc.dylib" alpar@1: LIBMYSQL="libmysqlclient.dylib" alpar@1: ;; alpar@1: *) alpar@1: LIBIODBC="libiodbc.so" alpar@1: LIBODBC="libodbc.so" alpar@1: LIBMYSQL="libmysqlclient.so" alpar@1: ;; alpar@1: esac alpar@1: alpar@1: AC_MSG_CHECKING([whether to enable MathProg ODBC support]) alpar@1: if test "$enable_odbc" = "yes"; then alpar@1: if test "$enable_dl" = "no"; then alpar@1: AC_MSG_ERROR([--enable-odbc requires --enable-dl]) alpar@1: fi alpar@1: AC_MSG_RESULT([yes]) alpar@1: AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A]) alpar@1: elif test "$enable_odbc" = "unix"; then alpar@1: if test "$enable_dl" = "no"; then alpar@1: AC_MSG_ERROR([--enable-odbc requires --enable-dl]) alpar@1: fi alpar@1: AC_MSG_RESULT([unix]) alpar@1: AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBODBC"], [N/A]) alpar@1: else alpar@1: AC_MSG_RESULT([no]) alpar@1: fi alpar@1: alpar@1: AC_MSG_CHECKING([whether to enable MathProg MySQL support]) alpar@1: if test "$enable_mysql" = "yes"; then alpar@1: if test "$enable_dl" = "no"; then alpar@1: AC_MSG_ERROR([--enable-mysql requires --enable-dl]) alpar@1: fi alpar@1: AC_MSG_RESULT([yes]) alpar@1: CPPFLAGS="-I/usr/include/mysql $CPPFLAGS" alpar@1: AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A]) alpar@1: else alpar@1: AC_MSG_RESULT([no]) alpar@1: fi alpar@1: alpar@1: AC_CONFIG_FILES( alpar@1: [include/Makefile src/Makefile examples/Makefile Makefile]) alpar@1: AC_OUTPUT alpar@1: alpar@1: dnl eof