source: ThirdParty/ASL/stable/1.0/configure.ac @ 147

Last change on this file since 147 was 147, checked in by andreasw, 13 years ago

included latest changes from coin.m4

  • 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 147 2006-11-29 18:28:22Z 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
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
50coin_skip_warn_cflags=yes
51AC_COIN_PROG_CC
52
53# We filter out the -pedantic-errors flag for C compiler because
54# ASL otherwise doesn't compile
55CFLAGS=`echo $CFLAGS | sed -e s/-pedantic-errors//g`
56
57
58# Initialize automake
59AC_COIN_INIT_AUTOMAKE
60
61#############################################################################
62#                          AMPL SOLVER LIBRARY                              #
63#############################################################################
64
65# Determine the name of the ASL library
66AC_SUBST(AMPLSOLVER_A)
67case "$CXX" in
68  cl* | */cl*)
69    AMPLSOLVER_A=amplsolv.lib
70    msvc_compile=yes ;;
71  *)
72    AMPLSOLVER_A=amplsolver.a
73    msvc_compile=no ;;
74esac
75AM_CONDITIONAL(MSVC_COMPILE, test $msvc_compile = yes)
76
77if test -z "$ASLMAKEFLAGS" ; then
78  asladdcflags=
79  case $build in
80    *-linux*)
81      asladdcflags="-DNON_STDIO"
82      case $CC in
83        pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
84          asladdcflags="$asladdcflags -DNO_fpu_control";;
85      esac
86      ;;
87    *-cygwin*) # ToDo: If on Cygwin but not using -mno-cygwin, we should not define -DNo_Control87 -DNO_RUSAGE
88      asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
89      ;;
90    *-mingw32)
91      asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
92      ;;
93  esac
94
95# On BlueGene disable dynamic library loading
96  if test x"$enable_bg" = xyes; then
97    asladdcflags="$asladdcflags -DNO_FUNCADD"
98  fi
99
100# Do the following for now to make sure we are not interupting compilation
101# of ASL because of warning message:
102  bla=
103  for i in $CFLAGS; do
104    if test "$i" != "-Werror"; then
105      bla="$bla $i"
106    fi
107  done
108  ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
109
110#   Somehow, -qtune=auto makes ASL segfault on AIX compiler, so take them out
111  case $CC in
112    xlc* | */xlc* | mpxlc* | */mpxlc*)
113      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'`
114      ;;
115    pgcc* | */pgcc*)
116      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed 's/-fast/-O1/g'`
117      ;;
118  esac
119
120  AC_MSG_CHECKING([whether $am_make is the GNU make])
121  rm -rf conftest.mak
122  ($am_make -v -f conftest.mak > conftest.grp) 2>&5
123  if $EGREP GNU conftest.grp >&5 ; then
124    AC_MSG_RESULT([yes])
125    ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
126  else
127    AC_MSG_RESULT([no])
128  fi
129  rm -f conftest.mak conftest.grp
130fi
131
132if test x"$AR" = x; then
133  AR=ar
134fi
135
136ASLMAKEFILECMDS="sed -e 's%ar \$\$(ARFLAGS)%$AR \$\$(ARFLAGS)%' makefile.u | sed -e 's%ar ruv%$AR ruv%' "
137if test "$EXEEXT" = ".exe"; then
138  ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's/a.out/a.exe/'"
139fi
140case $build in
141  *-cygwin*)
142    ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's%s/System_details/\`uname -sr\`/%s|System_details|\`uname -sr\`|%'" ;;
143esac
144ASLMAKEFILECMDS="$ASLMAKEFILECMDS > makefile"
145
146AC_ARG_VAR(ASLMAKEFLAGS,[Compilation flags necessary for compiling the AMPL solver library])
147AC_SUBST(ASLMAKEFILECMDS)
148
149AC_CONFIG_FILES([Makefile compile_MS_ASL])
150
151AC_COIN_FINALIZE
152
153# Finally, we need to make sure that compile_MS_ASL is executable
154chmod a+x compile_MS_ASL
Note: See TracBrowser for help on using the repository browser.