[9] | 1 | dnl Process this file with autoconf to produce a configure script |
---|
| 2 | |
---|
| 3 | AC_INIT([GLPK], [4.47], [bug-glpk@gnu.org]) |
---|
| 4 | |
---|
| 5 | AC_CONFIG_SRCDIR([src/glpk.h]) |
---|
| 6 | |
---|
| 7 | AC_CONFIG_MACRO_DIR([m4]) |
---|
| 8 | |
---|
| 9 | AM_INIT_AUTOMAKE |
---|
| 10 | |
---|
| 11 | AC_CONFIG_HEADERS([config.h]) |
---|
| 12 | |
---|
| 13 | AC_ARG_WITH(gmp, |
---|
| 14 | AC_HELP_STRING([--with-gmp], |
---|
| 15 | [use GNU MP bignum library [[default=no]]]), |
---|
| 16 | [case $withval in |
---|
| 17 | yes | no) ;; |
---|
| 18 | *) AC_MSG_ERROR([invalid value `$withval' for --with-gmp]);; |
---|
| 19 | esac], |
---|
| 20 | [with_gmp=no]) |
---|
| 21 | |
---|
| 22 | AC_ARG_ENABLE(dl, |
---|
| 23 | AC_HELP_STRING([--enable-dl], |
---|
| 24 | [enable shared library support [[default=no]]]), |
---|
| 25 | [case $enableval in |
---|
| 26 | yes | ltdl | dlfcn | no) ;; |
---|
| 27 | *) AC_MSG_ERROR([invalid value `$enableval' for --enable-dl]);; |
---|
| 28 | esac], |
---|
| 29 | [enable_dl=no]) |
---|
| 30 | |
---|
| 31 | AC_ARG_ENABLE(odbc, |
---|
| 32 | AC_HELP_STRING([--enable-odbc], |
---|
| 33 | [enable MathProg ODBC support [[default=no]]]), |
---|
| 34 | [case $enableval in |
---|
| 35 | yes | unix | no) ;; |
---|
| 36 | *) AC_MSG_ERROR([invalid value `$enableval' for --enable-odbc]);; |
---|
| 37 | esac], |
---|
| 38 | [enable_odbc=no]) |
---|
| 39 | |
---|
| 40 | AC_ARG_ENABLE(mysql, |
---|
| 41 | AC_HELP_STRING([--enable-mysql], |
---|
| 42 | [enable MathProg MySQL support [[default=no]]]), |
---|
| 43 | [case $enableval in |
---|
| 44 | yes | no) ;; |
---|
| 45 | *) AC_MSG_ERROR([invalid value `$enableval' for --enable-mysql]);; |
---|
| 46 | esac], |
---|
| 47 | [enable_mysql=no]) |
---|
| 48 | |
---|
| 49 | dnl Disable unnecessary libtool tests |
---|
| 50 | define([AC_LIBTOOL_LANG_CXX_CONFIG], [:]) |
---|
| 51 | define([AC_LIBTOOL_LANG_F77_CONFIG], [:]) |
---|
| 52 | define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:]) |
---|
| 53 | |
---|
| 54 | dnl Check for programs |
---|
| 55 | AC_PROG_CC |
---|
| 56 | AC_PROG_INSTALL |
---|
| 57 | AC_PROG_LIBTOOL |
---|
| 58 | |
---|
| 59 | dnl Check for math library |
---|
| 60 | AC_CHECK_LIB([m], [exp]) |
---|
| 61 | |
---|
| 62 | dnl Check for <sys/time.h> header |
---|
| 63 | AC_CHECK_HEADER([sys/time.h], |
---|
| 64 | AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A])) |
---|
| 65 | |
---|
| 66 | dnl Check for gettimeofday function |
---|
| 67 | AC_CHECK_FUNC([gettimeofday], |
---|
| 68 | AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [N/A])) |
---|
| 69 | |
---|
| 70 | AC_MSG_CHECKING([whether to use GNU MP bignum library]) |
---|
| 71 | if test "$with_gmp" = "yes"; then |
---|
| 72 | AC_MSG_RESULT([yes]) |
---|
| 73 | AC_DEFINE([HAVE_GMP], [1], [N/A]) |
---|
| 74 | LIBS="-lgmp $LIBS" |
---|
| 75 | else |
---|
| 76 | AC_MSG_RESULT([no]) |
---|
| 77 | fi |
---|
| 78 | |
---|
| 79 | AC_MSG_CHECKING([whether to enable shared library support]) |
---|
| 80 | if test "$enable_dl" = "yes"; then |
---|
| 81 | AC_MSG_RESULT([ltdl]) |
---|
| 82 | AC_DEFINE([HAVE_LTDL], [1], [N/A]) |
---|
| 83 | LIBS="-lltdl $LIBS" |
---|
| 84 | elif test "$enable_dl" = "ltdl"; then |
---|
| 85 | AC_MSG_RESULT([ltdl]) |
---|
| 86 | AC_DEFINE([HAVE_LTDL], [1], [N/A]) |
---|
| 87 | LIBS="-lltdl $LIBS" |
---|
| 88 | elif test "$enable_dl" = "dlfcn"; then |
---|
| 89 | AC_MSG_RESULT([dlfcn]) |
---|
| 90 | AC_DEFINE([HAVE_DLFCN], [1], [N/A]) |
---|
| 91 | else |
---|
| 92 | AC_MSG_RESULT([no]) |
---|
| 93 | fi |
---|
| 94 | |
---|
| 95 | case $host_os in |
---|
| 96 | darwin* | macosx*) |
---|
| 97 | LIBIODBC="libiodbc.dylib" |
---|
| 98 | LIBODBC="libodbc.dylib" |
---|
| 99 | LIBMYSQL="libmysqlclient.dylib" |
---|
| 100 | ;; |
---|
| 101 | *) |
---|
| 102 | LIBIODBC="libiodbc.so" |
---|
| 103 | LIBODBC="libodbc.so" |
---|
| 104 | LIBMYSQL="libmysqlclient.so" |
---|
| 105 | ;; |
---|
| 106 | esac |
---|
| 107 | |
---|
| 108 | AC_MSG_CHECKING([whether to enable MathProg ODBC support]) |
---|
| 109 | if test "$enable_odbc" = "yes"; then |
---|
| 110 | if test "$enable_dl" = "no"; then |
---|
| 111 | AC_MSG_ERROR([--enable-odbc requires --enable-dl]) |
---|
| 112 | fi |
---|
| 113 | AC_MSG_RESULT([yes]) |
---|
| 114 | AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A]) |
---|
| 115 | elif test "$enable_odbc" = "unix"; then |
---|
| 116 | if test "$enable_dl" = "no"; then |
---|
| 117 | AC_MSG_ERROR([--enable-odbc requires --enable-dl]) |
---|
| 118 | fi |
---|
| 119 | AC_MSG_RESULT([unix]) |
---|
| 120 | AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBODBC"], [N/A]) |
---|
| 121 | else |
---|
| 122 | AC_MSG_RESULT([no]) |
---|
| 123 | fi |
---|
| 124 | |
---|
| 125 | AC_MSG_CHECKING([whether to enable MathProg MySQL support]) |
---|
| 126 | if test "$enable_mysql" = "yes"; then |
---|
| 127 | if test "$enable_dl" = "no"; then |
---|
| 128 | AC_MSG_ERROR([--enable-mysql requires --enable-dl]) |
---|
| 129 | fi |
---|
| 130 | AC_MSG_RESULT([yes]) |
---|
| 131 | CPPFLAGS="-I/usr/include/mysql $CPPFLAGS" |
---|
| 132 | AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A]) |
---|
| 133 | else |
---|
| 134 | AC_MSG_RESULT([no]) |
---|
| 135 | fi |
---|
| 136 | |
---|
| 137 | AC_CONFIG_FILES( |
---|
| 138 | [src/Makefile examples/Makefile Makefile]) |
---|
| 139 | AC_OUTPUT |
---|
| 140 | |
---|
| 141 | dnl eof |
---|