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

Last change on this file since 136 was 136, checked in by ladanyi, 14 years ago

do not do fpu control in AMPL on linux w/ xlc

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 4.6 KB
Line 
1# Copyright (C) 2006 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac 136 2006-11-21 04:07:17Z ladanyi $
6
7# Author:  Andreas Waechter            IBM    2006-04-13
8
9#############################################################################
10#                       Names and other basic things                        #
11#############################################################################
12
13AC_PREREQ(2.59)
14
15AC_INIT([ThirdPartyASL],[0.0],[http://projects.coin-or.org/BuildTools/newticket])
16
17AC_COPYRIGHT([
18Copyright 2006 International Business Machines and others.
19All Rights Reserved.
20This file is part of the open source package Coin which is distributed
21under the Common Public License.])
22
23# List one file in the package so that the configure script can test
24# whether the package is actually there
25AC_CONFIG_SRCDIR(solvers/asl.h)
26
27# Where should everything be installed by default?  Here, we want it
28# to be installed directly in 'bin', 'lib', 'include' subdirectories
29# of the directory where configure is run.  The default would be
30# /usr/local.
31AC_PREFIX_DEFAULT([`pwd`])
32
33AC_COIN_PROJECTDIR_INIT
34
35#############################################################################
36#                         Standard build tool stuff                         #
37#############################################################################
38
39# Get the system type
40AC_CANONICAL_BUILD
41
42# Check if user wants to produce debugging code
43AC_COIN_DEBUG_COMPILE(ASL)
44
45# We need egrep and ln -s somewhere
46AC_PROG_EGREP
47AC_PROG_LN_S
48
49# Get the name of the C compiler and appropriate compiler options
50AC_COIN_PROG_CC
51
52# We filter out the -pedantic-errors flag for C compiler because
53# ASL otherwise doesn't compile
54CFLAGS=`echo $CFLAGS | sed -e s/-pedantic-errors//g`
55
56
57# Initialize automake
58AC_COIN_INIT_AUTOMAKE
59
60#############################################################################
61#                          AMPL SOLVER LIBRARY                              #
62#############################################################################
63
64# Determine the name of the ASL library
65AC_SUBST(AMPLSOLVER_A)
66case "$CXX" in
67  cl* | */cl*)
68    AMPLSOLVER_A=amplsolv.lib
69    msvc_compile=yes ;;
70  *)
71    AMPLSOLVER_A=amplsolver.a
72    msvc_compile=no ;;
73esac
74AM_CONDITIONAL(MSVC_COMPILE, test $msvc_compile = yes)
75
76if test -z "$ASLMAKEFLAGS" ; then
77  asladdcflags=
78  case $build in
79    *-linux*)
80      asladdcflags="-DNON_STDIO"
81      case $CC in
82        pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
83          asladdcflags="$asladdcflags -DNO_fpu_control";;
84      esac
85      ;;
86    *-cygwin*) # ToDo: If on Cygwin but not using -mno-cygwin, we should not define -DNo_Control87 -DNO_RUSAGE
87      asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
88      ;;
89    *-mingw32)
90      asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
91      ;;
92  esac
93
94# On BlueGene disable dynamic library loading
95  if test x"$enable_bg" = xyes; then
96    asladdcflags="$asladdcflags -DNO_FUNCADD"
97  fi
98
99# Do the following for now to make sure we are not interupting compilation
100# of ASL because of warning message:
101  bla=
102  for i in $CFLAGS; do
103    if test "$i" != "-Werror"; then
104      bla="$bla $i"
105    fi
106  done
107  ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
108
109#   Somehow, -qtune=auto makes ASL segfault on AIX compiler, so take them out
110  case $CC in
111    xlc* | */xlc* | mpxlc* | */mpxlc*)
112      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'`
113      ;;
114    pgcc* | */pgcc*)
115      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed 's/-fast/-O1/g'`
116      ;;
117  esac
118
119  AC_MSG_CHECKING([whether $am_make is the GNU make])
120  rm -rf conftest.mak
121  ($am_make -v -f conftest.mak > conftest.grp) 2>&5
122  if $EGREP GNU conftest.grp >&5 ; then
123    AC_MSG_RESULT([yes])
124    ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
125  else
126    AC_MSG_RESULT([no])
127  fi
128  rm -f conftest.mak conftest.grp
129fi
130
131if test x"$AR" = x; then
132  AR=ar
133fi
134
135ASLMAKEFILECMDS="sed -e 's%ar \$\$(ARFLAGS)%$AR \$\$(ARFLAGS)%' makefile.u | sed -e 's%ar ruv%$AR ruv%' "
136if test "$EXEEXT" = ".exe"; then
137  ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's/a.out/a.exe/'"
138fi
139case $build in
140  *-cygwin*)
141    ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's%s/System_details/\`uname -sr\`/%s|System_details|\`uname -sr\`|%'" ;;
142esac
143ASLMAKEFILECMDS="$ASLMAKEFILECMDS > makefile"
144
145AC_ARG_VAR(ASLMAKEFLAGS,[Compilation flags necessary for compiling the AMPL solver library])
146AC_SUBST(ASLMAKEFILECMDS)
147
148AC_CONFIG_FILES([Makefile compile_MS_ASL])
149
150AC_COIN_FINALIZE
151
152# Finally, we need to make sure that compile_MS_ASL is executable
153chmod a+x compile_MS_ASL
Note: See TracBrowser for help on using the repository browser.