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