1 | # Copyright (C) 2007 Stefan Vigerske |
---|
2 | # All Rights Reserved. |
---|
3 | # This file is distributed under the Common Public License. |
---|
4 | |
---|
5 | ## $Id: configure.ac 130 2007-07-17 23:07:33Z andreasw $ |
---|
6 | |
---|
7 | ############################################################################# |
---|
8 | # Names and other basic things # |
---|
9 | ############################################################################# |
---|
10 | |
---|
11 | AC_PREREQ(2.59) |
---|
12 | |
---|
13 | AC_INIT([ThirdPartyGlpk],[1.2.1],[http://projects.coin-or.org/BuildTools/newticket]) |
---|
14 | |
---|
15 | AC_COPYRIGHT([ |
---|
16 | Copyright 2007 Stefan Vigerske and others. |
---|
17 | All Rights Reserved. |
---|
18 | This file is part of the open source package Coin which is distributed |
---|
19 | under 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 |
---|
23 | AC_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. |
---|
29 | AC_PREFIX_DEFAULT([`pwd`]) |
---|
30 | |
---|
31 | AC_COIN_PROJECTDIR_INIT |
---|
32 | |
---|
33 | |
---|
34 | ############################################################################# |
---|
35 | # Standard build tool stuff # |
---|
36 | ############################################################################# |
---|
37 | |
---|
38 | # Get the system type |
---|
39 | AC_CANONICAL_BUILD |
---|
40 | |
---|
41 | #turn off warnings and pedantic mode since it seem to make trouble on solaris platform |
---|
42 | #and we couldn't fix it anyway |
---|
43 | coin_skip_warn_cflags=yes |
---|
44 | |
---|
45 | # Check if user wants to produce debugging code |
---|
46 | AC_COIN_DEBUG_COMPILE(GLPK) |
---|
47 | |
---|
48 | # Get the name of the C compiler |
---|
49 | AC_COIN_PROG_CC |
---|
50 | |
---|
51 | # Initialize automake |
---|
52 | AC_COIN_INIT_AUTO_TOOLS |
---|
53 | |
---|
54 | AC_CHECK_FUNCS([vsnprintf]) |
---|
55 | |
---|
56 | ########################################################################### |
---|
57 | # COIN_HAS_GLPK # |
---|
58 | ########################################################################### |
---|
59 | |
---|
60 | # This macro checks for a library containing the GLPK library. It |
---|
61 | # checks if the user has provided an argument for the GLPK library, |
---|
62 | # and if not, it checks whether the GLPK ThirdParty/GLPK directory has |
---|
63 | # been configured. It adds to ADDLIBS any flags required to link with |
---|
64 | # an externally provided GLPK. It defines the makefile conditional |
---|
65 | # and preprocessor macro COIN_HAS_GLPK, if GLPK is available, and it |
---|
66 | # defines the makefile conditional COIN_BUILD_GLPK, if GLPK is |
---|
67 | # compiled within COIN. |
---|
68 | |
---|
69 | ## Check if GLPK is already provided by user |
---|
70 | AC_COIN_HAS_GLPK(Glpk) |
---|
71 | |
---|
72 | rm -f $MAKEOKFILE |
---|
73 | if test x"$use_thirdpartyglpk" = xbuild ; then |
---|
74 | touch $MAKEOKFILE |
---|
75 | else |
---|
76 | if test x$coin_has_glpk = xtrue ; then |
---|
77 | AC_MSG_NOTICE([The Glpk sources don't need to be compiled]) |
---|
78 | else |
---|
79 | 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?]) |
---|
80 | fi |
---|
81 | MAKEOKFILE= |
---|
82 | fi |
---|
83 | AC_SUBST(MAKEOKFILE) |
---|
84 | |
---|
85 | GLPKDIR=glpk |
---|
86 | AC_SUBST(GLPKDIR) |
---|
87 | |
---|
88 | AC_CONFIG_FILES([Makefile]) |
---|
89 | |
---|
90 | AC_CONFIG_HEADER([glpk/config.h]) |
---|
91 | |
---|
92 | AC_COIN_FINALIZE |
---|