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

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

temporarily committing stable candidate

  • 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 Common Public License.
4
5## $Id: configure.ac 1716 2010-11-03 04:59:05Z 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],[1.1],[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 Common 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)
72case "$CC" in
73  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
74    AMPLSOLVER_A=amplsolv.lib
75    msvc_compile=yes
76    ;;
77  *)
78    AMPLSOLVER_A=amplsolver.a
79    msvc_compile=no
80    ;;
81esac
82AC_MSG_NOTICE([Configuring ASL to build $AMPLSOLVER_A.])
83
84# Set substitutable variables with the absolute path to the library name
85# translate to windows style if necessary, but use slashes instead of backslashes
86ABSPATH_AMPLSOLVER_INSTALLED=`${CYGPATH_W} ${prefix}/lib/coin/ThirdParty/${AMPLSOLVER_A} | sed -e 's/\\\\/\\//g'`
87curdir=`pwd`
88ABSPATH_AMPLSOLVER_UNINSTALLED=`${CYGPATH_W} ${curdir}/${AMPLSOLVER_A} | sed -e 's/\\\\/\\//g'`
89AC_SUBST(ABSPATH_AMPLSOLVER_INSTALLED)
90AC_SUBST(ABSPATH_AMPLSOLVER_UNINSTALLED)
91
92# Determine flags to be passed on the command line to (n)make. The main
93# activity is to groom CFLAGS and set up ASLMAKEFLAGS to pass CFLAGS on the
94# (n)make command line.
95# NON_STDIO no longer appears in any source file; removed all mention.
96# No_Control87 seems to be specific to DEC Alpha. Try leaving it undefined.
97
98if test -z "$ASLMAKEFLAGS" ; then
99  asladdcflags=
100  case $build in
101    *-linux*)
102      case $CC in
103        pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
104          asladdcflags="$asladdcflags -DNO_fpu_control";;
105      esac
106      ;;
107  esac
108
109# Various feature checks. Force the language to be C while we do this to avoid
110# issues with C++ (re)declarations.
111  AC_LANG_PUSH(C)
112
113# The critical function for NO_RUSAGE is getrusage(). Use a standard test.
114
115  AC_MSG_CHECKING([for getrusage])
116  AC_LINK_IFELSE(
117    [AC_LANG_PROGRAM([[]],[[getrusage()]])],
118    [AC_MSG_RESULT([yes])],
119    [asladdcflags="$asladdcflags -DNO_RUSAGE"
120     AC_MSG_RESULT([no])])
121
122# Check for long long; we need to define NO_LONG_LONG if it's not present.  ASL
123# makefile.u and makefile.vc both deal with this, in their own way.
124# Unfortunately, when trying to build with cl under cygwin, the makefile.vc
125# solution, comptry.bat, fails. To safely discard comptry.bat, we need to do
126# this check. It's hardly likely that long long is missing on any modern
127# system, but it's easy to check.
128
129  AC_CHECK_TYPE([long long],[],
130    [asladdcflags="$asladdcflags -DNO_LONG_LONG"],[])
131
132# Back to whatever language we were in.
133  AC_LANG_POP(C)
134
135# On BlueGene disable dynamic library loading
136  if test x"$enable_bg" = xyes; then
137    asladdcflags="$asladdcflags -DNO_FUNCADD"
138  fi
139
140# Groom CFLAGS before we merge it with asladdcflags.
141# Remove -Werror if present, to make sure we are not interrupting compilation
142# of ASL because of warning messages. The cl equivalent is -WX.
143  bla=
144  if test x$msvc_compile = xyes ; then
145    warnToErr="-WX"
146  else
147    warnToErr="-Werror"
148  fi
149  for i in $CFLAGS; do
150    if test "$i" != "$warnToErr"; then
151      bla="$bla $i"
152    fi
153  done
154  ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
155
156# Somehow, the flags specified here cause ASL to segfault on the AIX
157# compiler, so take them out.
158  case $CC in
159    xlc* | */xlc* | mpxlc* | */mpxlc*)
160      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-qtune=auto//g' -e 's/-qarch=auto//g' -e 's/-qcache=auto//g' -e 's/-qhot//g' -e sed 's/-O3/-O/g'`
161      ;;
162    pgcc* | */pgcc*)
163      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-fast/-O1/g'`
164      ;;
165  esac
166
167# Limit GNU make to one thread. But remember that if we're building with
168# cl, ultimately we're going to use nmake, which knows nothing of this.
169  if test x$msvc_compile = xno ; then
170    rm -rf conftest.mak
171    ($am_make -v > conftest.grp) 2>&5
172    if $EGREP GNU conftest.grp >&5 ; then
173      ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
174    fi
175    rm -f conftest.grp
176  fi
177fi
178# End if-then to construct ASLMAKEFLAGS. Announce the result.
179
180AC_MSG_NOTICE([Command line flags for (n)make \"$ASLMAKEFLAGS\".])
181AC_ARG_VAR(ASLMAKEFLAGS, [Compilation flags necessary for compiling the AMPL solver library])
182
183# Set automake conditional and generate the output files.
184
185AM_CONDITIONAL(MSVC_COMPILE, test x$msvc_compile = xyes)
186
187AC_CONFIG_FILES([Makefile])
188AC_CONFIG_FILES([compile_MS_ASL],[chmod a+x compile_MS_ASL])
189AC_CONFIG_FILES([compile_Unix_ASL],[chmod a+x compile_Unix_ASL])
190AC_CONFIG_FILES([coinasl.pc coinasl-uninstalled.pc])
191
192AC_COIN_CHECK_LIBM(ASL)
193AC_SUBST(ASL_PCLIBS)
194
195AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.