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

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

corrected last correcion

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