Ignore:
Timestamp:
May 8, 2010 9:54:35 AM (10 years ago)
Author:
stefan
Message:

copy over pkg-config setup and making thirdparty projects installable projects from split branch

File:
1 edited

Legend:

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

    r1411 r1548  
    1 # Copyright (C) 2007 International Business Machines.
     1# Copyright (C) 2007, 2009 International Business Machines.
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    1717
    1818AC_COPYRIGHT([
    19 Copyright 2006 International Business Machines and others.
     19Copyright 2006, 2007, 2009 International Business Machines and others.
    2020All Rights Reserved.
    2121This file is part of the open source package Coin which is distributed
     
    5959AC_COIN_INIT_AUTO_TOOLS
    6060
    61 # See what we're actually going to do for ASL. This will define ampllib.
    62 AC_COIN_HAS_ASL
    63 
    64 MAKEOKFILE=.MakeOk
    65 if test $coin_has_asl != no && test "$use_asldir" != BUILD; then
    66   skip_further_test=yes
    67   rm -f $MAKEOKFILE
    68   AC_MSG_NOTICE([The ASL sources don't need to be compiled])
    69   MAKEOKFILE=
    70 else
    71   touch $MAKEOKFILE
    72 fi
    73 AC_SUBST(MAKEOKFILE)
    74 AM_CONDITIONAL(SKIPMAKE, test -z "$MAKEOKFILE")
     61# Check if pkg-config is available (to setup addlibs file)
     62AC_COIN_HAS_PKGCONFIG
    7563
    7664#############################################################################
     
    7866#############################################################################
    7967
    80 if test x$skip_further_test != xyes; then
     68# Determine the name of the ASL library
    8169
    82 # Set a substitutable variable with the library name, and determine the
    83 # compilation style.
     70# Set a substitutable variable with the library name, and determine the compilation style.
     71AC_SUBST(AMPLSOLVER_A)
     72case "$CC" in
     73  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
     74    AMPLSOLVER_A=amplsolv.lib
     75    msvc_compile=yes
     76    ;;
     77  *)
     78    AMPLSOLVER_A=amplsolver.a
     79    msvc_compile=no
     80    ;;
     81esac
     82AC_MSG_NOTICE([Configuring ASL to build $AMPLSOLVER_A.])
    8483
    85   AC_SUBST(AMPLSOLVER_A)
    86   AMPLSOLVER_A=$ampllib
    87   case "$CC" in
    88     cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
    89       msvc_compile=yes ;;
    90     *)
    91       msvc_compile=no ;;
    92   esac
    93   AC_MSG_NOTICE([Configuring ASL to build $AMPLSOLVER_A.])
     84# Set substitutable variables with the absolute path to the library name
     85# translate to windows style if necessary, but use slashes instead of backslashes
     86ABSPATH_AMPLSOLVER_INSTALLED=`${CYGPATH_W} ${libdir}/coin/ThirdParty/${AMPLSOLVER_A} | sed -e 's/\\\\/\\//g'`
     87curdir=`pwd`
     88ABSPATH_AMPLSOLVER_UNINSTALLED=`${CYGPATH_W} ${curdir}/${AMPLSOLVER_A} | sed -e 's/\\\\/\\//g'`
     89AC_SUBST(ABSPATH_AMPLSOLVER_INSTALLED)
     90AC_SUBST(ABSPATH_AMPLSOLVER_UNINSTALLED)
    9491
    9592# Determine flags to be passed on the command line to (n)make. The main
     
    9996# No_Control87 seems to be specific to DEC Alpha. Try leaving it undefined.
    10097
    101   if test -z "$ASLMAKEFLAGS" ; then
    102     asladdcflags=
    103     case $build in
    104       *-linux*)
    105         case $CC in
    106           pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
    107             asladdcflags="$asladdcflags -DNO_fpu_control";;
    108         esac
    109         ;;
    110     esac
     98if test -z "$ASLMAKEFLAGS" ; then
     99  asladdcflags=
     100  case $build in
     101    *-linux*)
     102      case $CC in
     103        pgcc* | */pgcc* | xlc* | */xlc* | blrts_xlc* | */blrts_xlc*)
     104          asladdcflags="$asladdcflags -DNO_fpu_control";;
     105      esac
     106      ;;
     107  esac
    111108
    112109# Various feature checks. Force the language to be C while we do this to avoid
    113110# issues with C++ (re)declarations.
    114 
    115     AC_LANG_PUSH(C)
     111  AC_LANG_PUSH(C)
    116112
    117113# The critical function for NO_RUSAGE is getrusage(). Use a standard test.
    118114
    119     AC_MSG_CHECKING([for getrusage])
    120     AC_LINK_IFELSE(
    121       [AC_LANG_PROGRAM([[]],[[getrusage()]])],
    122       [AC_MSG_RESULT([yes])],
    123       [asladdcflags="$asladdcflags -DNO_RUSAGE"
    124        AC_MSG_RESULT([no])])
     115  AC_MSG_CHECKING([for getrusage])
     116  AC_LINK_IFELSE(
     117    [AC_LANG_PROGRAM([[]],[[getrusage()]])],
     118    [AC_MSG_RESULT([yes])],
     119    [asladdcflags="$asladdcflags -DNO_RUSAGE"
     120     AC_MSG_RESULT([no])])
    125121
    126122# Check for long long; we need to define NO_LONG_LONG if it's not present.  ASL
     
    131127# system, but it's easy to check.
    132128
    133     AC_CHECK_TYPE([long long],[],
    134       [asladdcflags="$asladdcflags -DNO_LONG_LONG"],[])
     129  AC_CHECK_TYPE([long long],[],
     130    [asladdcflags="$asladdcflags -DNO_LONG_LONG"],[])
    135131
    136132# Back to whatever language we were in.
    137 
    138     AC_LANG_POP(C)
     133  AC_LANG_POP(C)
    139134
    140135# On BlueGene disable dynamic library loading
    141 
    142     if test x"$enable_bg" = xyes; then
    143       asladdcflags="$asladdcflags -DNO_FUNCADD"
    144     fi
     136  if test x"$enable_bg" = xyes; then
     137    asladdcflags="$asladdcflags -DNO_FUNCADD"
     138  fi
    145139
    146140# Groom CFLAGS before we merge it with asladdcflags.
    147141# Remove -Werror if present, to make sure we are not interrupting compilation
    148142# of ASL because of warning messages. The cl equivalent is -WX.
    149 
    150     bla=
    151     if test x$msvc_compile = xyes ; then
    152       warnToErr="-WX"
    153     else
    154       warnToErr="-Werror"
     143  bla=
     144  if test x$msvc_compile = xyes ; then
     145    warnToErr="-WX"
     146  else
     147    warnToErr="-Werror"
     148  fi
     149  for i in $CFLAGS; do
     150    if test "$i" != "$warnToErr"; then
     151      bla="$bla $i"
    155152    fi
    156     for i in $CFLAGS; do
    157       if test "$i" != "$warnToErr"; then
    158         bla="$bla $i"
    159       fi
    160     done
    161     ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
     153  done
     154  ASLMAKEFLAGS="CFLAGS=\"$bla $asladdcflags\""
    162155
    163156# Somehow, the flags specified here cause ASL to segfault on the AIX
    164157# compiler, so take them out.
    165 
    166     case $CC in
    167       xlc* | */xlc* | mpxlc* | */mpxlc*)
    168         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'`
    169         ;;
    170       pgcc* | */pgcc*)
    171         ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-fast/-O1/g'`
    172         ;;
    173     esac
     158  case $CC in
     159    xlc* | */xlc* | mpxlc* | */mpxlc*)
     160      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'`
     161      ;;
     162    pgcc* | */pgcc*)
     163      ASLMAKEFLAGS=`echo $ASLMAKEFLAGS | sed -e 's/-fast/-O1/g'`
     164      ;;
     165  esac
    174166
    175167# Limit GNU make to one thread. But remember that if we're building with
    176168# cl, ultimately we're going to use nmake, which knows nothing of this.
    177 
    178     if test x$msvc_compile = xno ; then
    179       rm -rf conftest.mak
    180       ($am_make -v > conftest.grp) 2>&5
    181       if $EGREP GNU conftest.grp >&5 ; then
    182         ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
    183       fi
    184       rm -f conftest.grp
     169  if test x$msvc_compile = xno ; then
     170    rm -rf conftest.mak
     171    ($am_make -v > conftest.grp) 2>&5
     172    if $EGREP GNU conftest.grp >&5 ; then
     173      ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
    185174    fi
     175    rm -f conftest.grp
    186176  fi
    187 
     177fi
    188178# End if-then to construct ASLMAKEFLAGS. Announce the result.
    189179
    190   AC_MSG_NOTICE([Command line flags for (n)make \"$ASLMAKEFLAGS\".])
    191   AC_ARG_VAR(ASLMAKEFLAGS,
    192         [Compilation flags necessary for compiling the AMPL solver library])
    193 
    194 fi
     180AC_MSG_NOTICE([Command line flags for (n)make \"$ASLMAKEFLAGS\".])
     181AC_ARG_VAR(ASLMAKEFLAGS, [Compilation flags necessary for compiling the AMPL solver library])
    195182
    196183# Set automake conditional and generate the output files.
     
    201188AC_CONFIG_FILES([compile_MS_ASL],[chmod a+x compile_MS_ASL])
    202189AC_CONFIG_FILES([compile_Unix_ASL],[chmod a+x compile_Unix_ASL])
     190AC_CONFIG_FILES([coinasl.pc coinasl-uninstalled.pc])
    203191
    204192AC_COIN_FINALIZE
Note: See TracChangeset for help on using the changeset viewer.