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