source: ThirdParty/ASL/branches/autotools-update/configure.ac

Last change on this file was 3981, checked in by stefan, 20 months ago

do not use -M[TD]d

  • raises an assert within MSVC runtime library when running ASL code
  • use -M[TD] instead
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1# Copyright (C) 2007, 2009 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4
5# Author:  Andreas Waechter            IBM    2006-04-13
6# Revised: Lou Hafer                   SFU    2007-09-15
7
8AC_PREREQ(2.59)
9
10AC_INIT([ThirdPartyASL],[trunk],[https://github.com/coin-or-tools/ThirdParty-ASL/issues/new],,[https://github.com/coin-or-tools/ThirdParty-ASL])
11
12AC_COPYRIGHT([
13Copyright 2006, 2007, 2009 International Business Machines and others.
14All Rights Reserved.
15This file is part of the open source package ThirdParty-ASL which is distributed
16under the Eclipse Public License.])
17
18# List one file in the package so that the configure script can test
19# whether the package is actually there
20AC_CONFIG_SRCDIR(solvers/asl.h)
21
22AC_COIN_INITIALIZE(ASL)
23
24# Get the name of the C compiler and compiler flags
25AC_COIN_PROG_CC
26
27# Initialize libtool
28AC_COIN_PROG_LIBTOOL(no-win32-dll)
29
30# Determine additional pre-compiler flags using various feature checks
31AC_LANG_PUSH(C)
32
33CPPFLAGS="$CPPFLAGS -DNo_dtoa"
34
35case $build in
36  *-linux*)
37    case $CC in
38      pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
39        CPPFLAGS="$CPPFLAGS -DNO_fpu_control";;
40    esac
41    ;;
42esac
43
44# The critical function for NO_RUSAGE is getrusage(). Use a standard test.
45
46AC_MSG_CHECKING([for getrusage])
47AC_LINK_IFELSE(
48  [AC_LANG_PROGRAM([[]],[[getrusage()]])],
49  [AC_MSG_RESULT([yes])],
50  [CPPFLAGS="$CPPFLAGS -DNO_RUSAGE"
51   AC_MSG_RESULT([no])])
52
53# Check for long long; we need to define NO_LONG_LONG if it's not present.
54# It's hardly likely that long long is missing on any modern system, but it's easy to check.
55# Also, if it's present, then ASL uses strtoull, which is not supported on Windows systems.
56# Instead, there should be a _strtoui64.
57
58AC_CHECK_TYPE([long long],
59  [case "$CC" in *cl ) CPPFLAGS="$CPPFLAGS -Dstrtoull=_strtoui64" ;; esac],
60  [CPPFLAGS="$CPPFLAGS -DNO_LONG_LONG"])
61
62# Check for ssize_t; we need to define NO_SSIZE_T if it's not present.
63AC_CHECK_TYPE([ssize_t],[],[CPPFLAGS="$CPPFLAGS -DNO_SSIZE_T"])
64
65# Check for dlopen, ASL uses it to load userdefined function libraries
66AC_CHECK_LIB(dl,[dlopen],[ASL_LFLAGS="-ldl $ASL_LFLAGS"])
67
68AC_COIN_CHK_LIBM(ASL)
69
70# Back to whatever language we were in.
71AC_LANG_POP(C)
72
73case "$CC" in
74  *cl )
75    cc_is_cl=true
76    case "$CFLAGS" in *-MDd* | *-MTd* )
77      CFLAGS=`echo $CFLAGS | sed -e 's/-MDd/-MD/g' -e 's/-MTd/-MT/g'`
78      AC_MSG_NOTICE([ASL libraries linked with debug MSVC runtime libs do not work. Replaced -MDd and -MTd by -MD and -MT in CFLAGS, resp.])
79      ;;
80    esac
81    ;;
82  * )
83    cc_is_cl=false
84    ;;
85esac
86AM_CONDITIONAL([CC_IS_CL], [$cc_is_cl])
87
88# generate the output files.
89
90AC_CONFIG_LINKS(stdio1.h:solvers/stdio1.h0)
91
92# we need a second fpinit.c because we need it for a libtool lib and a non-libtool program
93# and doing this for the same file isn't supported
94AC_CONFIG_LINKS(fpinit.c:solvers/fpinit.c)
95
96AC_CONFIG_FILES([Makefile coinasl.pc])
97
98AC_COIN_FINALIZE_FLAGS([ASL])
99AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.