source: ThirdParty/Glpk/trunk/configure.ac @ 1213

Last change on this file since 1213 was 1213, checked in by stefan, 11 years ago

fix error message

  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1# Copyright (C) 2007-2008 Stefan Vigerske and others.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac 1213 2008-10-27 10:46:23Z stefan $
6
7#############################################################################
8#                       Names and other basic things                        #
9#############################################################################
10
11AC_PREREQ(2.59)
12
13AC_INIT([ThirdPartyGlpk],[0.0],[http://projects.coin-or.org/BuildTools/newticket])
14
15AC_COPYRIGHT([
16Copyright 2007-2008 Stefan Vigerske and others.
17All Rights Reserved.
18This file is part of the open source package Coin which is distributed
19under the Common Public License.])
20
21# List one file in the package so that the configure script can test
22# whether the package is actually there
23AC_CONFIG_SRCDIR(Makefile.am)
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
31AC_COIN_PROJECTDIR_INIT
32
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_CANONICAL_BUILD
39
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
44# Check if user wants to produce debugging code
45AC_COIN_DEBUG_COMPILE(Glpk)
46
47# Get the name of the C compiler
48AC_COIN_PROG_CC
49
50# Initialize automake
51AC_COIN_INIT_AUTO_TOOLS
52
53###########################################################################
54#                            COIN_HAS_GLPK                                #
55###########################################################################
56
57# This macro checks for a library containing the GLPK library.  It
58# checks if the user has provided an argument for the GLPK library,
59# and if not, it checks whether the GLPK ThirdParty/GLPK directory has
60# been configured.  It adds to ADDLIBS any flags required to link with
61# an externally provided GLPK.  It defines the makefile conditional
62# and preprocessor macro COIN_HAS_GLPK, if GLPK is available, and it
63# defines the makefile conditional COIN_BUILD_GLPK, if GLPK is
64# compiled within COIN.
65
66## Check if GLPK is already provided by user
67AC_COIN_HAS_GLPK(Glpk)
68
69rm -f $MAKEOKFILE
70if test x"$use_thirdpartyglpk" = xbuild ; then
71  touch $MAKEOKFILE
72  # CoinUtils and SYMPHONY include glpmpl.h and have HAVE_CONFIG_H defined
73  # so we put a dummy config.h file into the glpk include directory. At least
74  # a newline is needed to avoid a bug in Sun Solaris Studio, 64-bit optimised
75  # build.
76  echo "" > ${GLPKINCDIR}/config.h
77  AC_MSG_CHECKING([GLPK version])
78  majorver=`awk '/define GLP_MAJOR_VERSION/ {print $3}' ${GLPKINCDIR}/glpk.h`
79  minorver=`awk '/define GLP_MINOR_VERSION/ {print $3}' ${GLPKINCDIR}/glpk.h`
80  AC_MSG_RESULT([${majorver}.${minorver}])
81  if test $majorver != 4 || test $minorver != 32 ; then
82    AC_MSG_ERROR(["Incorrect GLPK version. This build system is made for GLPK 4.32. Please update by rerunning get.GLPK"])
83  fi
84else
85  if test x$coin_has_glpk = xtrue ; then
86    AC_MSG_NOTICE([The Glpk sources don't need to be compiled])
87  else
88    AC_MSG_WARN([Glpk source is available but will not be built. No valid external library is detected. Are you sure this is what you want?])
89  fi
90  MAKEOKFILE=
91fi
92AC_SUBST(MAKEOKFILE)
93
94GLPKDIR=glpk
95AC_SUBST(GLPKDIR)
96
97AC_CONFIG_FILES([Makefile])
98
99AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.