Ignore:
Timestamp:
Sep 29, 2007 6:12:30 PM (12 years ago)
Author:
andreasw
Message:

included changes proposed by Lou Hafer for ASL configuration and compilation with MSVC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ThirdParty/ASL/trunk/configure.ac

    r520 r588  
    1 # Copyright (C) 2006 International Business Machines.
     1# Copyright (C) 2007 International Business Machines.
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    66
    77# Author:  Andreas Waechter            IBM    2006-04-13
     8# Revised: Lou Hafer                   SFU    2007-09-15
    89
    910#############################################################################
     
    3132AC_PREFIX_DEFAULT([`pwd`])
    3233
    33 AC_COIN_PROJECTDIR_INIT
    34 
    3534#############################################################################
    3635#                         Standard build tool stuff                         #
     
    4039AC_CANONICAL_BUILD
    4140
    42 #turn off warnings and pedantic mode since they could make trouble on some platforms,
    43 #and we couldn't fix them anyway
     41# A bit of initial setup.
     42AC_COIN_PROJECTDIR_INIT
     43
     44# Turn off warnings and pedantic mode since they could make trouble on some
     45# platforms, and we can't fix issues in third-party code.
    4446coin_skip_warn_cflags=yes
    4547
     
    5153AC_PROG_LN_S
    5254
    53 # Get the name of the C compiler and appropriate compiler options
    54 coin_skip_warn_cflags=yes
     55# Get the name of the C compiler and compiler flags
    5556AC_COIN_PROG_CC
    5657
    57 # Initialize automake
    58 AC_COIN_INIT_AUTOMAKE
    59 
     58# Initialize automake and libtool
     59AC_COIN_INIT_AUTO_TOOLS
     60
     61# See what we're actually going to do for ASL. This will define ampllib.
    6062AC_COIN_HAS_ASL
     63
    6164MAKEOKFILE=.MakeOk
    6265if test $coin_has_asl != no && test "$use_asldir" != BUILD; then
     
    7780if test x$skip_further_test != xyes; then
    7881
    79   # Determine the name of the ASL library
     82# Set a substitutable variable with the library name, and determine the
     83# compilation style.
     84
    8085  AC_SUBST(AMPLSOLVER_A)
     86  AMPLSOLVER_A=$ampllib
    8187  case "$CC" in
    8288    cl* | */cl* | CL* | */CL*)
    83       AMPLSOLVER_A=amplsolv.lib
    8489      msvc_compile=yes ;;
    8590    *)
    86       AMPLSOLVER_A=amplsolver.a
    8791      msvc_compile=no ;;
    8892  esac
     93  AC_MSG_NOTICE([Configuring ASL to build $AMPLSOLVER_A.])
     94
     95# Determine flags to be passed on the command line to (n)make. The main
     96# activity is to groom CFLAGS and set up ASLMAKEFLAGS to pass CFLAGS on the
     97# (n)make command line.
     98# NON_STDIO no longer appears in any source file; removed all mention.
     99# No_Control87 seems to be specific to DEC Alpha. Try leaving it undefined.
     100# -- lh, 070915 --
    89101
    90102  if test -z "$ASLMAKEFLAGS" ; then
     
    92104    case $build in
    93105      *-linux*)
    94         asladdcflags="-DNON_STDIO"
    95106        case $CC in
    96107          pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
     
    98109        esac
    99110        ;;
    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         ;;
    106111    esac
    107112
     113# The critical function for NO_RUSAGE is getrusage(). Use a standard test.
     114# -- lh, 070915 --
     115
     116    AC_MSG_CHECKING([for getrusage])
     117    AC_LANG_PUSH(C)
     118    AC_LINK_IFELSE(
     119      [AC_LANG_PROGRAM([[]],[[getrusage()]])],
     120      [AC_MSG_RESULT([yes])],
     121      [asladdcflags="$asladdcflags -DNO_RUSAGE"
     122       AC_MSG_RESULT([no])])
     123    AC_LANG_POP(C)
     124
    108125# On BlueGene disable dynamic library loading
     126
    109127    if test x"$enable_bg" = xyes; then
    110128      asladdcflags="$asladdcflags -DNO_FUNCADD"
    111129    fi
    112130
    113 # Do the following for now to make sure we are not interupting compilation
    114 # of ASL because of warning message:
     131# Groom CFLAGS before we merge it with asladdcflags.
     132# Remove -Werror if present, to make sure we are not interrupting compilation
     133# of ASL because of warning messages. The cl equivalent is -WX.
     134
    115135    bla=
     136    if test x$msvc_compile = xyes ; then
     137      warnToErr="-WX"
     138    else
     139      warnToErr="-Werror"
     140    fi
    116141    for i in $CFLAGS; do
    117       if test "$i" != "-Werror"; then
     142      if test "$i" != "$warnToErr"; then
    118143        bla="$bla $i"
    119144      fi
     
    121146    ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
    122147
    123 #   Somehow, -qtune=auto makes ASL segfault on AIX compiler, so take them out
     148# Somehow, the flags specified here cause ASL to segfault on the AIX
     149# compiler, so take them out.
     150
    124151    case $CC in
    125152      xlc* | */xlc* | mpxlc* | */mpxlc*)
     
    127154        ;;
    128155      pgcc* | */pgcc*)
    129         ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed 's/-fast/-O1/g'`
     156        ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-fast/-O1/g'`
    130157        ;;
    131158    esac
    132159
    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])
     160# Limit GNU make to one thread. But remember that if we're building with
     161# cl, ultimately we're going to use nmake, which knows nothing of this.
     162
     163    if test x$msvc_compile = xno ; then
     164      rm -rf conftest.mak
     165      ($am_make -v > conftest.grp) 2>&5
     166      if $EGREP GNU conftest.grp >&5 ; then
     167        ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
     168      fi
     169      rm -f conftest.grp
    141170    fi
    142     rm -f conftest.mak conftest.grp
    143171  fi
     172
     173# End if-then to construct ASLMAKEFLAGS
     174
     175  AC_MSG_NOTICE([Command line flags for (n)make \"$ASLMAKEFLAGS\".])
     176
     177# Now create appropriate makefile commands. This applies only to non-msvc
     178# builds. Perhaps convert to a script, following pattern of compile_MS_ASL?
    144179
    145180  if test x"$AR" = x; then
Note: See TracChangeset for help on using the changeset viewer.