source: ThirdParty/Glpk/stable/1.9/configure.ac @ 2937

Last change on this file since 2937 was 2937, checked in by stefan, 6 years ago

temporarily committing release candidate

  • Property svn:keywords set to Author Date Id Revision
File size: 7.6 KB
RevLine 
[1548]1# Copyright (C) 2007-2010 Stefan Vigerske and others.
[430]2# All Rights Reserved.
[1983]3# This file is distributed under the Eclipse Public License.
[430]4
[941]5## $Id: configure.ac 2937 2013-09-12 12:59:47Z stefan $
[430]6
7#############################################################################
8#                       Names and other basic things                        #
9#############################################################################
10
11AC_PREREQ(2.59)
12
[2937]13AC_INIT([ThirdPartyGlpk],[1.9.2],[http://projects.coin-or.org/BuildTools/newticket])
[430]14
15AC_COPYRIGHT([
[1548]16Copyright 2007-2010 Stefan Vigerske and others.
[430]17All Rights Reserved.
18This file is part of the open source package Coin which is distributed
[1983]19under the Eclipse Public License.])
[430]20
21# List one file in the package so that the configure script can test
22# whether the package is actually there
[2639]23AC_CONFIG_SRCDIR(glpk/src/glpk.h)
[430]24
25# Where should everything be installed by default?  Here, we want it
26# to be installed directly in 'bin', 'lib', 'include' subdirectories
27# of the directory where configure is run.  The default would be
28# /usr/local.
29AC_PREFIX_DEFAULT([`pwd`])
30
[2937]31AC_COIN_PROJECTDIR_INIT(Glpk,10:2:9)
[430]32
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_CANONICAL_BUILD
39
[522]40#turn off warnings and pedantic mode since it seem to make trouble on solaris platform
41#and we couldn't fix it anyway
42coin_skip_warn_cflags=yes
43
[959]44# Check if user wants to produce debugging code
45AC_COIN_DEBUG_COMPILE(Glpk)
46
[430]47# Get the name of the C compiler
48AC_COIN_PROG_CC
49
[1548]50# Check if pkg-config is available (to setup addlibs file)
51AC_COIN_HAS_PKGCONFIG
52
[430]53# Initialize automake
54AC_COIN_INIT_AUTO_TOOLS
55
56###########################################################################
[1548]57#                            check GLPK version                           #
[430]58###########################################################################
59
[1548]60AC_MSG_CHECKING([GLPK version])
[2639]61glpkmajorver=`awk '/define GLP_MAJOR_VERSION/ {print $3}' $srcdir/glpk/src/glpk.h`
62glpkminorver=`awk '/define GLP_MINOR_VERSION/ {print $3}' $srcdir/glpk/src/glpk.h`
[1548]63AC_MSG_RESULT([${glpkmajorver}.${glpkminorver}])
[2712]64if test x$glpkmajorver != x4 || test x$glpkminorver != x48 ; then
65  AC_MSG_ERROR(["Incorrect GLPK version. This build system is made for GLPK 4.48. Please update by rerunning get.GLPK"])
[1411]66fi
[1548]67AC_SUBST(glpkmajorver)
68AC_SUBST(glpkminorver)
[430]69
[1321]70###########################################################################
[2425]71#                 Other packages and C functions                          #
[1321]72###########################################################################
73
74AC_LANG_PUSH(C)
75
[2425]76AC_COIN_CHECK_GMP(Glpk)
77if test $coin_has_gmp = yes; then
78  AC_DEFINE([HAVE_GMP],[1],[Define to 1 if GMP is available])
[1321]79fi
80
81AC_CHECK_FUNC([vsnprintf])
82
83AC_LANG_POP(C)
84
85###########################################################################
86#                     Database connectivity                               #
87###########################################################################
88
89#whether we have any means to load shared libraries
90enable_dl=no
91
92AC_LANG_PUSH(C)
93
94AC_COIN_CHECK_HEADER([dlfcn.h],[enable_dl=yes])
95if test "$enable_dl" = "yes"; then
96  #if dlfcn.h is there, check also if libdl is there; if so, set corresponding define for GLPK
97  AC_CHECK_LIB(dl,[dlopen],[AC_DEFINE([HAVE_DLFCN],[1],[Define to 1 if dlfcn support is available])],[enable_dl=no])
98  if test $enable_dl = yes; then
[1681]99    GLPK_LIBS="-ldl $GLPK_LIBS"
100    GLPK_PCLIBS="-ldl $GLPK_PCLIBS"
[1321]101  fi
102fi
103
104if test "$enable_dl" = "no"; then
[1548]105  AC_COIN_CHECK_HEADER([ltdl.h],[enable_dl=yes])
[1321]106  if test "$enable_dl" = "yes"; then
107    #if ltdl.h is there, check also if libltdl is there; if so, set corresponding define for GLPK
108    AC_CHECK_LIB(ldtl,[lt_dlopen],[AC_DEFINE([HAVE_LTDL],[1],[Define to 1 if ltdl support is available])],[enable_dl=no])
109    if test $enable_dl = yes; then
[1681]110      GLPK_LIBS="-lltdl $GLPK_LIBS"
111      GLPK_PCLIBS="-lltdl $GLPK_PCLIBS"
[1321]112    fi
113  fi
114fi
115
116if test "$enable_dl" = "no"; then
117  AC_COIN_CHECK_HEADER([windows.h],[enable_dl=yes])
118  if test "$enable_dl" = "yes"; then
119    AC_DEFINE([__WOE__],[1],[Define to 1 if windows dll support is available])
120  fi
121fi
122
123AC_ARG_ENABLE(odbc,
[1548]124  AC_HELP_STRING([--enable-odbc],[enable MathProg ODBC support [[default=auto]]]),
125  [case $enableval in
126     yes | unix)
[1321]127       AC_COIN_CHECK_HEADER([sql.h],,[AC_MSG_ERROR(["need sql.h to enable ODBC support"])])
128       enable_odbc="$enableval"
129     ;;
130     no)
131       enable_odbc="no"
132     ;;
[1548]133     *)
134       AC_MSG_ERROR([invalid value '$enableval' for --enable-odbc])
135     ;;
[1321]136   esac],
[1548]137  [AC_COIN_CHECK_HEADER([sql.h],[enable_odbc=yes],[enable_odbc=no])]
[1321]138)
139
140AC_ARG_ENABLE(mysql,
[1548]141  AC_HELP_STRING([--enable-mysql],[enable MathProg MySQL support [[default=auto]]]),
142  [case $enableval in
143     yes)
[1321]144       AC_COIN_CHECK_HEADER([mysql.h mysql/mysql.h],,[AC_MSG_ERROR(["need mysql.h to enable MySQL support"])])
145       enable_mysql="$enableval"
146     ;;
147     no)
148       enable_mysql="no"
149     ;;
[1548]150     *)
151       AC_MSG_ERROR([invalid value '$enableval' for --enable-mysql])
152     ;;
[1321]153   esac],
[1548]154  [AC_COIN_CHECK_HEADER([mysql.h mysql/mysql.h],[enable_mysql=yes],[enable_mysql=no])]
[1321]155)
156
157AC_LANG_POP(C)
[1548]158
[1321]159if test "$enable_dl" = "yes" && ( test "$enable_odbc" = "yes" || test "$enable_odbc" = "unix"); then
160  AC_MSG_CHECKING([checking name of ODBC library])
161  case $build in
162    *-cygwin* |  *-mingw32*)
163       case "$CC" in
164         *cl* )
165            odbclibname="odbc32.dll"
166         ;;
167         *) #FIXME: what are the correct library names for using ODBC with gnu compiler under Windows?
168            if test "$enable_odbc" = "yes"; then
169              odbclibname="libiodbc.dll"
170            else
171              odbclibname="libodbc.dll"
172            fi
173         ;;
174       esac
175    ;;
176    *-mingw64*)
177       case "$CC" in
178         *cl* )
179            odbclibname="odbc64.dll"
180         ;;
181         *) #FIXME: what are the correct library names for using ODBC with gnu compiler under Windows?
182            if test "$enable_odbc" = "yes"; then
183              odbclibname="libiodbc.dll"
184            else
185              odbclibname="libodbc.dll"
186            fi
187         ;;
188       esac
189    ;;
190    *-darwin*)
191       if test "$enable_odbc" = "yes"; then
192          odbclibname="libiodbc.dylib"
193       else
194          odbclibname="libodbc.dylib"
195       fi
196    ;;
197    *)
198       if test "$enable_odbc" = "yes"; then
199          odbclibname="libiodbc.so"
200       else
201          odbclibname="libodbc.so"
202       fi
203    ;;
204  esac
205
206  AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$odbclibname"], ["Set to the name of the ODBC dynamic library"])
207  AC_MSG_RESULT([$odbclibname])
208fi
209
210if test "$enable_dl" = "yes" && test "$enable_mysql" = "yes" ; then
211  AC_MSG_CHECKING([checking name of MySQL library])
212  case $build in
213    *-cygwin* |  *-mingw*)
214       case "$CC" in
215         *cl* )
216            mysqllibname="libmysql.dll"
217         ;;
218         *) #FIXME: what is the correct library name for using MySQL with gnu compiler under Windows?
219            mysqllibname="libmysqlclient.dll"
220            CFLAGS="-I/usr/include/mysql $CFLAGS"
221         ;;
222       esac
223    ;;
224    *-darwin*)
225       mysqllibname="libmysqlclient.dylib"
226       CFLAGS="-I/usr/include/mysql $CFLAGS"
227    ;;
228    *)
229       mysqllibname="libmysqlclient.so"
230       CFLAGS="-I/usr/include/mysql $CFLAGS"
231    ;;
232  esac
233
234  AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$mysqllibname"], ["Set to the name of the MySQL dynamic library"])
235  AC_MSG_RESULT([$mysqllibname])
236fi
237
[430]238GLPKDIR=glpk
239AC_SUBST(GLPKDIR)
240
[1548]241AC_CONFIG_FILES([Makefile coinglpk.pc coinglpk-uninstalled.pc])
[1321]242AC_CONFIG_HEADER([config_glpk.h])
[430]243
[1681]244AC_SUBST(GLPK_PCLIBS)
245
[430]246AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.