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

Last change on this file since 1388 was 1388, checked in by stefan, 11 years ago

install libraries and header files

  • 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 1388 2009-08-01 13:12:40Z 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.0trunk],[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
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# See what we're actually going to do for ASL. This will define ampllib.
62#AC_COIN_HAS_ASL
63
64# Determine the name of the ASL library
65case "$CC" in
66  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
67    ampllib=amplsolv.lib ;;
68  *)
69    ampllib=amplsolver.a ;;
70esac
71
72
73#MAKEOKFILE=.MakeOk
74#if test $coin_has_asl != no && test "$use_asldir" != BUILD; then
75#  skip_further_test=yes
76#  rm -f $MAKEOKFILE
77#  AC_MSG_NOTICE([The ASL sources don't need to be compiled])
78#  MAKEOKFILE=
79#else
80#  touch $MAKEOKFILE
81#fi
82#AC_SUBST(MAKEOKFILE)
83#AM_CONDITIONAL(SKIPMAKE, test -z "$MAKEOKFILE")
84
85#############################################################################
86#                          AMPL SOLVER LIBRARY                              #
87#############################################################################
88
89if test x$skip_further_test != xyes; then
90
91# Set a substitutable variable with the library name, and determine the
92# compilation style.
93
94  AC_SUBST(AMPLSOLVER_A)
95  AMPLSOLVER_A=$ampllib
96  case "$CC" in
97    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
98      msvc_compile=yes ;;
99    *)
100      msvc_compile=no ;;
101  esac
102  AC_MSG_NOTICE([Configuring ASL to build $AMPLSOLVER_A.])
103
104# Determine flags to be passed on the command line to (n)make. The main
105# activity is to groom CFLAGS and set up ASLMAKEFLAGS to pass CFLAGS on the
106# (n)make command line.
107# NON_STDIO no longer appears in any source file; removed all mention.
108# No_Control87 seems to be specific to DEC Alpha. Try leaving it undefined.
109
110  if test -z "$ASLMAKEFLAGS" ; then
111    asladdcflags=
112    case $build in
113      *-linux*)
114        case $CC in
115          pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
116            asladdcflags="$asladdcflags -DNO_fpu_control";;
117        esac
118        ;;
119    esac
120
121# Various feature checks. Force the language to be C while we do this to avoid
122# issues with C++ (re)declarations.
123
124    AC_LANG_PUSH(C)
125
126# The critical function for NO_RUSAGE is getrusage(). Use a standard test.
127
128    AC_MSG_CHECKING([for getrusage])
129    AC_LINK_IFELSE(
130      [AC_LANG_PROGRAM([[]],[[getrusage()]])],
131      [AC_MSG_RESULT([yes])],
132      [asladdcflags="$asladdcflags -DNO_RUSAGE"
133       AC_MSG_RESULT([no])])
134
135# Check for long long; we need to define NO_LONG_LONG if it's not present.  ASL
136# makefile.u and makefile.vc both deal with this, in their own way.
137# Unfortunately, when trying to build with cl under cygwin, the makefile.vc
138# solution, comptry.bat, fails. To safely discard comptry.bat, we need to do
139# this check. It's hardly likely that long long is missing on any modern
140# system, but it's easy to check.
141
142    AC_CHECK_TYPE([long long],[],
143      [asladdcflags="$asladdcflags -DNO_LONG_LONG"],[])
144
145# Back to whatever language we were in.
146
147    AC_LANG_POP(C)
148
149# On BlueGene disable dynamic library loading
150
151    if test x"$enable_bg" = xyes; then
152      asladdcflags="$asladdcflags -DNO_FUNCADD"
153    fi
154
155# Groom CFLAGS before we merge it with asladdcflags.
156# Remove -Werror if present, to make sure we are not interrupting compilation
157# of ASL because of warning messages. The cl equivalent is -WX.
158
159    bla=
160    if test x$msvc_compile = xyes ; then
161      warnToErr="-WX"
162    else
163      warnToErr="-Werror"
164    fi
165    for i in $CFLAGS; do
166      if test "$i" != "$warnToErr"; then
167        bla="$bla $i"
168      fi
169    done
170    ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
171
172# Somehow, the flags specified here cause ASL to segfault on the AIX
173# compiler, so take them out.
174
175    case $CC in
176      xlc* | */xlc* | mpxlc* | */mpxlc*)
177        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'`
178        ;;
179      pgcc* | */pgcc*)
180        ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-fast/-O1/g'`
181        ;;
182    esac
183
184# Limit GNU make to one thread. But remember that if we're building with
185# cl, ultimately we're going to use nmake, which knows nothing of this.
186
187    if test x$msvc_compile = xno ; then
188      rm -rf conftest.mak
189      ($am_make -v > conftest.grp) 2>&5
190      if $EGREP GNU conftest.grp >&5 ; then
191        ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
192      fi
193      rm -f conftest.grp
194    fi
195  fi
196
197# End if-then to construct ASLMAKEFLAGS. Announce the result.
198
199  AC_MSG_NOTICE([Command line flags for (n)make \"$ASLMAKEFLAGS\".])
200  AC_ARG_VAR(ASLMAKEFLAGS,
201        [Compilation flags necessary for compiling the AMPL solver library])
202
203fi
204
205# Set automake conditional and generate the output files.
206
207AM_CONDITIONAL(MSVC_COMPILE, test x$msvc_compile = xyes)
208
209AC_CONFIG_FILES([Makefile asl_addlibs.txt])
210AC_CONFIG_FILES([compile_MS_ASL],[chmod a+x compile_MS_ASL])
211AC_CONFIG_FILES([compile_Unix_ASL],[chmod a+x compile_Unix_ASL])
212
213AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.