source: ThirdParty/SoPlex/trunk/configure.ac @ 2641

Last change on this file since 2641 was 2641, checked in by stefan, 9 years ago

proper check for gmpxx

File size: 3.1 KB
Line 
1# Copyright (C) 2010,2011 Stefan Vigerske
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac 928 2010-09-14 12:18:54Z stefan $
6
7#############################################################################
8#                       Names and other basic things                        #
9#############################################################################
10
11AC_PREREQ(2.59)
12
13AC_INIT([ThirdPartySoplex],[trunk],[http://projects.coin-or.org/BuildTools/newticket])
14
15AC_COPYRIGHT([
16Copyright 2010,2011 Stefan Vigerske and others.
17All Rights Reserved.
18This file is part of the open source package COIN-OR which is distributed
19under the Eclipse 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(soplex/src/soplex.h)
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(SoPlex)
32
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_CANONICAL_BUILD
39
40# Check if user wants to produce debugging code
41AC_COIN_DEBUG_COMPILE(SoPlex)
42
43# Get the name of the C compiler and appropriate compiler options
44AC_COIN_PROG_CC
45
46# Get the name of the C++ compiler and appropriate compiler options
47AC_COIN_PROG_CXX
48
49# Check if pkg-config is available (to setup addlibs file)
50AC_COIN_HAS_PKGCONFIG
51
52# Initialize automake
53AC_COIN_INIT_AUTO_TOOLS
54
55###########################################################################
56#                         ZLIB and compiler flags                         #
57###########################################################################
58
59AC_COIN_CHECK_GNU_ZLIB(SOPLEX)
60if test $coin_has_zlib = "yes"; then
61  CXXFLAGS="$CXXFLAGS -DWITH_ZLIB"
62fi
63
64AC_COIN_CHECK_GMP
65if test $coin_has_gmp = yes; then
66  AC_MSG_CHECKING([for gmpxx])
67  AC_LANG_PUSH(C++)
68  SAVED_LDFLAGS="$LDFLAGS"
69  LDFLAGS="-lgmpxx -lgmp $LDFLAGS"
70  AC_LINK_IFELSE(
71    [AC_LANG_PROGRAM([#include <gmpxx.h>],[mpq_class pq])],
72    [AC_MSG_RESULT(yes)
73     CXXFLAGS="$CXXFLAGS -DSOPLEX_WITH_GMP"
74     SOPLEX_LIBS="-lgmpxx -lgmp $SOPLEX_LIBS"
75     SOPLEX_PCLIBS="-lgmpxx -lgmp $SOPLEX_PCLIBS"
76     SOPLEX_LIBS_INSTALLED="-lgmpxx -lgmp $SOPLEX_LIBS_INSTALLED"
77    ],
78    [AC_MSG_RESULT(no)
79     coin_has_gmp=no])
80  LDFLAGS="$SAVED_LDFLAGS"
81  AC_LANG_POP(C++)
82fi
83
84###########################################################################
85#                               finish up                                 #
86###########################################################################
87
88AC_CONFIG_FILES([Makefile coinsoplex.pc coinsoplex-uninstalled.pc])
89
90# dummy header file to avoid many extra compiler flags
91AC_CONFIG_HEADER([config_soplex.h])
92
93AC_SUBST(SOPLEX_PCLIBS)
94 
95AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.