configure.ac
changeset 1 c445c931472f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/configure.ac	Mon Dec 06 13:09:21 2010 +0100
     1.3 @@ -0,0 +1,159 @@
     1.4 +dnl Process this file with autoconf to produce a configure script
     1.5 +
     1.6 +AC_INIT([GLPK], [4.45], [bug-glpk@gnu.org])
     1.7 +
     1.8 +AC_CONFIG_SRCDIR([include/glpk.h])
     1.9 +
    1.10 +AC_CONFIG_MACRO_DIR([m4])
    1.11 +
    1.12 +AM_INIT_AUTOMAKE
    1.13 +
    1.14 +AC_CONFIG_HEADERS([config.h])
    1.15 +
    1.16 +AC_ARG_WITH(gmp,
    1.17 +AC_HELP_STRING([--with-gmp],
    1.18 +   [use GNU MP bignum library [[default=no]]]),
    1.19 +   [case $withval in
    1.20 +      yes | no) ;;
    1.21 +      *) AC_MSG_ERROR([invalid value `$withval' for --with-gmp]);;
    1.22 +      esac],
    1.23 +   [with_gmp=no])
    1.24 +
    1.25 +AC_ARG_WITH(zlib,
    1.26 +AC_HELP_STRING([--with-zlib],
    1.27 +   [use zlib data compression library [[default=no]]]),
    1.28 +   [case $withval in
    1.29 +      yes | no) ;;
    1.30 +      *) AC_MSG_ERROR([invalid value `$withval' for --with-zlib]);;
    1.31 +      esac],
    1.32 +   [with_zlib=no])
    1.33 +
    1.34 +AC_ARG_ENABLE(dl,
    1.35 +AC_HELP_STRING([--enable-dl],
    1.36 +   [enable shared library support [[default=no]]]),
    1.37 +   [case $enableval in
    1.38 +      yes | ltdl | dlfcn | no) ;;
    1.39 +      *) AC_MSG_ERROR([invalid value `$enableval' for --enable-dl]);;
    1.40 +      esac],
    1.41 +   [enable_dl=no])
    1.42 +
    1.43 +AC_ARG_ENABLE(odbc,
    1.44 +AC_HELP_STRING([--enable-odbc],
    1.45 +   [enable MathProg ODBC support [[default=no]]]),
    1.46 +   [case $enableval in
    1.47 +      yes | unix | no) ;;
    1.48 +      *) AC_MSG_ERROR([invalid value `$enableval' for --enable-odbc]);;
    1.49 +      esac],
    1.50 +   [enable_odbc=no])
    1.51 +
    1.52 +AC_ARG_ENABLE(mysql,
    1.53 +AC_HELP_STRING([--enable-mysql],
    1.54 +   [enable MathProg MySQL support [[default=no]]]),
    1.55 +   [case $enableval in
    1.56 +      yes | no) ;;
    1.57 +      *) AC_MSG_ERROR([invalid value `$enableval' for --enable-mysql]);;
    1.58 +      esac],
    1.59 +   [enable_mysql=no])
    1.60 +
    1.61 +dnl Disable unnecessary libtool tests
    1.62 +define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
    1.63 +define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
    1.64 +define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])
    1.65 +
    1.66 +dnl Check for programs
    1.67 +AC_PROG_CC
    1.68 +AC_PROG_INSTALL
    1.69 +AC_PROG_LIBTOOL
    1.70 +
    1.71 +dnl Check for math library
    1.72 +AC_CHECK_LIB([m], [exp])
    1.73 +
    1.74 +dnl Check for <sys/time.h> header
    1.75 +AC_CHECK_HEADER([sys/time.h],
    1.76 +   AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A]))
    1.77 +
    1.78 +dnl Check for gettimeofday function
    1.79 +AC_CHECK_FUNC([gettimeofday],
    1.80 +   AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [N/A]))
    1.81 +
    1.82 +AC_MSG_CHECKING([whether to use GNU MP bignum library])
    1.83 +if test "$with_gmp" = "yes"; then
    1.84 +   AC_MSG_RESULT([yes])
    1.85 +   AC_DEFINE([HAVE_GMP], [1], [N/A])
    1.86 +   LIBS="-lgmp $LIBS"
    1.87 +else
    1.88 +   AC_MSG_RESULT([no])
    1.89 +fi
    1.90 +
    1.91 +AC_MSG_CHECKING([whether to use zlib data compression library])
    1.92 +if test "$with_zlib" = "yes"; then
    1.93 +   AC_MSG_RESULT([yes])
    1.94 +   AC_DEFINE([HAVE_ZLIB], [1], [N/A])
    1.95 +   LIBS="-lz $LIBS"
    1.96 +else
    1.97 +   AC_MSG_RESULT([no])
    1.98 +fi
    1.99 +
   1.100 +AC_MSG_CHECKING([whether to enable shared library support])
   1.101 +if test "$enable_dl" = "yes"; then
   1.102 +   AC_MSG_RESULT([ltdl])
   1.103 +   AC_DEFINE([HAVE_LTDL], [1], [N/A])
   1.104 +   LIBS="-lltdl $LIBS"
   1.105 +elif test "$enable_dl" = "ltdl"; then
   1.106 +   AC_MSG_RESULT([ltdl])
   1.107 +   AC_DEFINE([HAVE_LTDL], [1], [N/A])
   1.108 +   LIBS="-lltdl $LIBS"
   1.109 +elif test "$enable_dl" = "dlfcn"; then
   1.110 +   AC_MSG_RESULT([dlfcn])
   1.111 +   AC_DEFINE([HAVE_DLFCN], [1], [N/A])
   1.112 +else
   1.113 +   AC_MSG_RESULT([no])
   1.114 +fi
   1.115 +
   1.116 +case $host_os in
   1.117 +   darwin* | macosx*)
   1.118 +      LIBIODBC="libiodbc.dylib"
   1.119 +      LIBODBC="libodbc.dylib"
   1.120 +      LIBMYSQL="libmysqlclient.dylib"
   1.121 +      ;;
   1.122 +   *)
   1.123 +      LIBIODBC="libiodbc.so"
   1.124 +      LIBODBC="libodbc.so"
   1.125 +      LIBMYSQL="libmysqlclient.so"
   1.126 +      ;;
   1.127 +esac
   1.128 +
   1.129 +AC_MSG_CHECKING([whether to enable MathProg ODBC support])
   1.130 +if test "$enable_odbc" = "yes"; then
   1.131 +   if test "$enable_dl" = "no"; then
   1.132 +      AC_MSG_ERROR([--enable-odbc requires --enable-dl])
   1.133 +   fi
   1.134 +   AC_MSG_RESULT([yes])
   1.135 +   AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A])
   1.136 +elif test "$enable_odbc" = "unix"; then
   1.137 +   if test "$enable_dl" = "no"; then
   1.138 +      AC_MSG_ERROR([--enable-odbc requires --enable-dl])
   1.139 +   fi
   1.140 +   AC_MSG_RESULT([unix])
   1.141 +   AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBODBC"], [N/A])
   1.142 +else
   1.143 +   AC_MSG_RESULT([no])
   1.144 +fi
   1.145 +
   1.146 +AC_MSG_CHECKING([whether to enable MathProg MySQL support])
   1.147 +if test "$enable_mysql" = "yes"; then
   1.148 +   if test "$enable_dl" = "no"; then
   1.149 +      AC_MSG_ERROR([--enable-mysql requires --enable-dl])
   1.150 +   fi
   1.151 +   AC_MSG_RESULT([yes])
   1.152 +   CPPFLAGS="-I/usr/include/mysql $CPPFLAGS"
   1.153 +   AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A])
   1.154 +else
   1.155 +   AC_MSG_RESULT([no])
   1.156 +fi
   1.157 +
   1.158 +AC_CONFIG_FILES(
   1.159 +   [include/Makefile src/Makefile examples/Makefile Makefile])
   1.160 +AC_OUTPUT
   1.161 +
   1.162 +dnl eof