lemon-project-template-glpk

annotate deps/glpk/configure.ac @ 11:4fc6ad2fb8a6

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