COIN-OR::LEMON - Graph Library

source: glpk-cmake/configure.ac @ 2:4c8956a7bdf4

Last change on this file since 2:4c8956a7bdf4 was 1:c445c931472f, checked in by Alpar Juttner <alpar@…>, 10 years ago

Import glpk-4.45

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