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

Last change on this file since 62 was 62, checked in by andreasw, 14 years ago

filter out -pedantic-errors flag

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 4.1 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 62 2006-06-16 16:04:54Z andreasw $
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
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_CANONICAL_BUILD
39
40# Check if user wants to produce debugging code
41AC_COIN_DEBUG_COMPILE
42
43# We need egrep and ln -s somewhere
44AC_PROG_EGREP
45AC_PROG_LN_S
46
47# Get the name of the C compiler and appropriate compiler options
48AC_COIN_PROG_CC
49
50# We filter out the -pedantic-errors flag for C compiler because
51# ASL otherwise doesn't compile
52if test "${with_mpi_lib+set}" = set; then
53  CFLAGS=`echo $CFLAGS | sed -e s/-pedantic-errors//g`
54fi
55
56
57# Initialize automake
58AC_COIN_INIT_AUTOMAKE
59
60#############################################################################
61#                          AMPL SOLVER LIBRARY                              #
62#############################################################################
63
64if test -z "$ASLMAKEFLAGS" ; then
65  asladdcflags=
66  case $build in
67    *-linux*)
68      asladdcflags="-DNON_STDIO"
69      case $CC in
70        pgcc* | */pgcc*)
71          asladdcflags="$asladdcflags -DNO_fpu_control";;
72      esac
73      ;;
74    *-cygwin*) # ToDo: If on Cygwin but not using -mno-cygwin, we should not define -DNo_Control87 -DNO_RUSAGE
75      asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
76      ;;
77    *-mingw32)
78      asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
79      ;;
80  esac
81# Do the following for now to make sure we are not interupting compilation
82# of ASL because of warning message:
83  bla=
84  for i in $CFLAGS; do
85    if test "$i" != "-Werror"; then
86      bla="$bla $i"
87    fi
88  done
89  ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
90
91#   Somehow, -qtune=auto makes ASL segfault on AIX compiler, so take them out
92  case $CC in
93    xlc* | */xlc* | mpxlc* | */mpxlc*)
94      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'`
95      ;;
96    pgcc* | */pgcc*)
97      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed 's/-fast/-O1/g'`
98      ;;
99  esac
100
101  AC_MSG_CHECKING([whether $am_make is the GNU make])
102  rm -rf conftest.mak
103  ($am_make -v -f conftest.mak > conftest.grp) 2>&5
104  if $EGREP GNU conftest.grp >&5 ; then
105    AC_MSG_RESULT([yes])
106    ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
107  else
108    AC_MSG_RESULT([no])
109  fi
110  rm -f conftest.mak conftest.grp
111fi
112
113if test x"$AR" = x; then
114  AR=ar
115fi
116
117ASLMAKEFILECMDS="sed -e 's%ar \$\$(ARFLAGS)%$AR \$\$(ARFLAGS)%' makefile.u | sed -e 's%ar ruv%$AR ruv%' "
118if test "$EXEEXT" = ".exe"; then
119  ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's/a.out/a.exe/'"
120fi
121case $build in
122  *-cygwin*)
123    ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's%s/System_details/\`uname -sr\`/%s|System_details|\`uname -sr\`|%'" ;;
124esac
125ASLMAKEFILECMDS="$ASLMAKEFILECMDS > makefile"
126
127AC_ARG_VAR(ASLMAKEFLAGS,[Compilation flags necessary for compiling the AMPL solver library])
128AC_SUBST(ASLMAKEFILECMDS)
129
130AC_CONFIG_FILES([Makefile])
131
132AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.