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

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

compile third party code only if not otherwise available

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