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

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

restoring stable/1.0

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 5.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 560 2007-08-25 01:55:44Z 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],[1.0stable],[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#turn off warnings and pedantic mode since they could make trouble on some platforms,
43#and we couldn't fix them anyway
44coin_skip_warn_cflags=yes
45
46# Check if user wants to produce debugging code
47AC_COIN_DEBUG_COMPILE(ASL)
48
49# We need egrep and ln -s somewhere
50AC_PROG_EGREP
51AC_PROG_LN_S
52
53# Get the name of the C compiler and appropriate compiler options
54coin_skip_warn_cflags=yes
55AC_COIN_PROG_CC
56
57# Initialize automake
58AC_COIN_INIT_AUTOMAKE
59
60AC_COIN_HAS_ASL
61MAKEOKFILE=.MakeOk
62if test $coin_has_asl != no && test "$use_asldir" != BUILD; then
63  skip_further_test=yes
64  rm -f $MAKEOKFILE
65  AC_MSG_NOTICE([The ASL sources don't need to be compiled])
66  MAKEOKFILE=
67else
68  touch $MAKEOKFILE
69fi
70AC_SUBST(MAKEOKFILE)
71AM_CONDITIONAL(SKIPMAKE, test -z "$MAKEOKFILE")
72
73#############################################################################
74#                          AMPL SOLVER LIBRARY                              #
75#############################################################################
76
77if test x$skip_further_test != xyes; then
78
79  # Determine the name of the ASL library
80  AC_SUBST(AMPLSOLVER_A)
81  case "$CC" in
82    cl* | */cl* | CL* | */CL*)
83      AMPLSOLVER_A=amplsolv.lib
84      msvc_compile=yes ;;
85    *)
86      AMPLSOLVER_A=amplsolver.a
87      msvc_compile=no ;;
88  esac
89
90  if test -z "$ASLMAKEFLAGS" ; then
91    asladdcflags=
92    case $build in
93      *-linux*)
94        asladdcflags="-DNON_STDIO"
95        case $CC in
96          pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
97            asladdcflags="$asladdcflags -DNO_fpu_control";;
98        esac
99        ;;
100      *-cygwin*) # ToDo: If on Cygwin but not using -mno-cygwin, we should not define -DNo_Control87 -DNO_RUSAGE
101        asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
102        ;;
103      *-mingw32)
104        asladdcflags="-DNON_STDIO -DNo_Control87 -DNO_RUSAGE"
105        ;;
106    esac
107
108# On BlueGene disable dynamic library loading
109    if test x"$enable_bg" = xyes; then
110      asladdcflags="$asladdcflags -DNO_FUNCADD"
111    fi
112
113# Do the following for now to make sure we are not interupting compilation
114# of ASL because of warning message:
115    bla=
116    for i in $CFLAGS; do
117      if test "$i" != "-Werror"; then
118        bla="$bla $i"
119      fi
120    done
121    ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
122
123#   Somehow, -qtune=auto makes ASL segfault on AIX compiler, so take them out
124    case $CC in
125      xlc* | */xlc* | mpxlc* | */mpxlc*)
126        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'`
127        ;;
128      pgcc* | */pgcc*)
129        ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed 's/-fast/-O1/g'`
130        ;;
131    esac
132
133    AC_MSG_CHECKING([whether $am_make is the GNU make])
134    rm -rf conftest.mak
135    ($am_make -v -f conftest.mak > conftest.grp) 2>&5
136    if $EGREP GNU conftest.grp >&5 ; then
137      AC_MSG_RESULT([yes])
138      ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
139    else
140      AC_MSG_RESULT([no])
141    fi
142    rm -f conftest.mak conftest.grp
143  fi
144
145  if test x"$AR" = x; then
146    AR=ar
147  fi
148
149  ASLMAKEFILECMDS="sed -e 's%ar \$\$(ARFLAGS)%$AR \$\$(ARFLAGS)%' makefile.u | sed -e 's%ar ruv%$AR ruv%' "
150  if test "$EXEEXT" = ".exe"; then
151    ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's/a.out/a.exe/'"
152  fi
153  case $build in
154    *-cygwin*)
155      ASLMAKEFILECMDS="$ASLMAKEFILECMDS | sed 's%s/System_details/\`uname -sr\`/%s|System_details|\`uname -sr\`|%'" ;;
156  esac
157  ASLMAKEFILECMDS="$ASLMAKEFILECMDS > makefile"
158
159  AC_ARG_VAR(ASLMAKEFLAGS,[Compilation flags necessary for compiling the AMPL solver library])
160  AC_SUBST(ASLMAKEFILECMDS)
161
162fi
163
164AM_CONDITIONAL(MSVC_COMPILE, test x$msvc_compile = xyes)
165
166AC_CONFIG_FILES([Makefile compile_MS_ASL])
167
168AC_COIN_FINALIZE
169
170# Finally, we need to make sure that compile_MS_ASL is executable
171chmod a+x compile_MS_ASL
Note: See TracBrowser for help on using the repository browser.