source: ThirdParty/ASL/trunk/configure.ac @ 2507

Last change on this file since 2507 was 2480, checked in by stefan, 10 years ago

try to workaround issue in recent ASL with unavailability of strtoull on 64bit windows

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 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## $Id: configure.ac 2480 2011-11-13 17:59:59Z stefan $
6
7# Author:  Andreas Waechter            IBM    2006-04-13
8# Revised: Lou Hafer                   SFU    2007-09-15
9
10#############################################################################
11#                       Names and other basic things                        #
12#############################################################################
13
14AC_PREREQ(2.59)
15
16AC_INIT([ThirdPartyASL],[trunk],[http://projects.coin-or.org/BuildTools/newticket])
17
18AC_COPYRIGHT([
19Copyright 2006, 2007, 2009 International Business Machines and others.
20All Rights Reserved.
21This file is part of the open source package Coin which is distributed
22under the Eclipse Public License.])
23
24# List one file in the package so that the configure script can test
25# whether the package is actually there
26AC_CONFIG_SRCDIR(solvers/asl.h)
27
28# Where should everything be installed by default?  Here, we want it
29# to be installed directly in 'bin', 'lib', 'include' subdirectories
30# of the directory where configure is run.  The default would be
31# /usr/local.
32AC_PREFIX_DEFAULT([`pwd`])
33
34#############################################################################
35#                         Standard build tool stuff                         #
36#############################################################################
37
38# Get the system type
39AC_CANONICAL_BUILD
40
41# A bit of initial setup.
42AC_COIN_PROJECTDIR_INIT(ASL)
43
44# Turn off warnings and pedantic mode since they could make trouble on some
45# platforms, and we can't fix issues in third-party code.
46coin_skip_warn_cflags=yes
47
48# Check if user wants to produce debugging code
49AC_COIN_DEBUG_COMPILE(ASL)
50
51# We need egrep and ln -s somewhere
52AC_PROG_EGREP
53AC_PROG_LN_S
54
55# Get the name of the C compiler and compiler flags
56AC_COIN_PROG_CC
57
58# Initialize automake and libtool
59AC_COIN_INIT_AUTO_TOOLS
60
61# Check if pkg-config is available (to setup addlibs file)
62AC_COIN_HAS_PKGCONFIG
63
64#############################################################################
65#                          AMPL SOLVER LIBRARY                              #
66#############################################################################
67
68# Determine the name of the ASL library
69
70# Set a substitutable variable with the library name, and determine the compilation style.
71AC_SUBST(AMPLSOLVER_A)
72if test "x$coin_cc_is_cl" = xtrue ; then
73  AMPLSOLVER_A=libamplsolver.lib
74else
75  AMPLSOLVER_A=libamplsolver.a
76fi
77
78# Determine flags to be passed on the command line to (n)make. The main
79# activity is to groom CFLAGS and set up ASLMAKEFLAGS to pass CFLAGS on the
80# (n)make command line.
81# NON_STDIO no longer appears in any source file; removed all mention.
82# No_Control87 seems to be specific to DEC Alpha. Try leaving it undefined.
83
84if test -z "$ASLMAKEFLAGS" ; then
85  asladdcflags=
86  case $build in
87    *-linux*)
88      case $CC in
89        pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
90          asladdcflags="$asladdcflags -DNO_fpu_control";;
91      esac
92      ;;
93  esac
94
95# Various feature checks. Force the language to be C while we do this to avoid
96# issues with C++ (re)declarations.
97  AC_LANG_PUSH(C)
98
99# The critical function for NO_RUSAGE is getrusage(). Use a standard test.
100
101  AC_MSG_CHECKING([for getrusage])
102  AC_LINK_IFELSE(
103    [AC_LANG_PROGRAM([[]],[[getrusage()]])],
104    [AC_MSG_RESULT([yes])],
105    [asladdcflags="$asladdcflags -DNO_RUSAGE"
106     AC_MSG_RESULT([no])])
107
108# Check for long long; we need to define NO_LONG_LONG if it's not present.  ASL
109# makefile.u and makefile.vc both deal with this, in their own way.
110# Unfortunately, when trying to build with cl under cygwin, the makefile.vc
111# solution, comptry.bat, fails. To safely discard comptry.bat, we need to do
112# this check. It's hardly likely that long long is missing on any modern
113# system, but it's easy to check.
114# Also, if it's present, then ASL uses strtoull, which is not supported on Windows systems.
115# Instead, there should be a _strtoui64.
116
117  AC_CHECK_TYPE([long long],[
118     if test "x$coin_cc_is_cl" = xtrue ; then
119       asladdcflags="$asladdcflags -Dstrtoull=_strtoui64"
120     fi],
121    [asladdcflags="$asladdcflags -DNO_LONG_LONG"],[])
122
123
124# Check for dlopen, ASL uses it to load userdefined function libraries
125  AC_CHECK_LIB(dl,[dlopen],[ASL_PCLIBS="-ldl $ASL_PCLIBS"])
126
127# Back to whatever language we were in.
128  AC_LANG_POP(C)
129
130# On BlueGene disable dynamic library loading
131  if test x"$enable_bg" = xyes; then
132    asladdcflags="$asladdcflags -DNO_FUNCADD"
133  fi
134
135# Groom CFLAGS before we merge it with asladdcflags.
136# Remove -Werror if present, to make sure we are not interrupting compilation
137# of ASL because of warning messages. The cl equivalent is -WX.
138# SV: Our buildsystem should never add these flags to the CFLAGS, so why bother checking for them?
139#     If the user added some, shouldn't we listen to it and not just remove them again?
140  bla=
141  if test "x$coin_cc_is_cl" = xtrue ; then
142    warnToErr="-WX"
143  else
144    warnToErr="-Werror"
145  fi
146  for i in $CFLAGS; do
147    if test "$i" != "$warnToErr"; then
148      bla="$bla $i"
149    fi
150  done
151 
152# Add -fPIC -DPIC if we actually build shared libraries
153  if test x$enable_shared != xno; then
154    asladdcflags="$asladdcflags -fPIC -DPIC"
155  fi
156 
157  ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
158
159# Somehow, the flags specified here cause ASL to segfault on the AIX
160# compiler, so take them out.
161  case $CC in
162    xlc* | */xlc* | mpxlc* | */mpxlc*)
163      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-qtune=auto//g' -e 's/-qarch=auto//g' -e 's/-qcache=auto//g' -e 's/-qhot//g' -e 's/-O3/-O/g'`
164      ;;
165    pgcc* | */pgcc*)
166      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-fast/-O1/g'`
167      ;;
168  esac
169
170# Limit GNU make to one thread. But remember that if we're building with
171# cl, ultimately we're going to use nmake, which knows nothing of this.
172  if test "x$coin_cc_is_cl" != xtrue ; then
173    rm -rf conftest.mak
174    ($am_make -v > conftest.grp) 2>&5
175    if $EGREP GNU conftest.grp >&5 ; then
176      ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
177    fi
178    rm -f conftest.grp
179  fi
180fi
181# End if-then to construct ASLMAKEFLAGS. Announce the result.
182
183AC_MSG_NOTICE([Command line flags for (n)make \"$ASLMAKEFLAGS\".])
184AC_ARG_VAR(ASLMAKEFLAGS, [Compilation flags necessary for compiling the AMPL solver library])
185
186# generate the output files.
187
188AC_CONFIG_FILES([Makefile])
189AC_CONFIG_FILES([compile_MS_ASL],[chmod a+x compile_MS_ASL])
190AC_CONFIG_FILES([compile_Unix_ASL],[chmod a+x compile_Unix_ASL])
191AC_CONFIG_FILES([coinasl.pc coinasl-uninstalled.pc])
192
193AC_COIN_CHECK_LIBM(ASL)
194AC_SUBST(ASL_PCLIBS)
195
196AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.