Changeset 159 for trunk


Ignore:
Timestamp:
Dec 1, 2006 3:05:49 PM (13 years ago)
Author:
andreasw
Message:

added a number of changes suggested by Lou

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r156 r159  
    267267AC_DEFUN([AC_COIN_PROJECTDIR_INIT],
    268268[# Initialize the ADDLIBS variable
    269 ADDLIBS='-lm'
     269ADDLIBS="-lm $LIBS"
    270270AC_SUBST(ADDLIBS)
    271271
    272272# Initialize the FADDLIBS variable (which is to be used with a fortran
    273273# compiler and will not include FLIBS)
    274 FADDLIBS=
     274FADDLIBS="$LIBS"
    275275AC_SUBST(FADDLIBS)
    276276
     
    373373
    374374# This macro is included by any PROG_compiler macro, to set the LD
    375 # environment variable on MinWG to the correct value (link)
     375# environment variable on MinGW to the correct value (link).
    376376
    377377AC_DEFUN([AC_COIN_MINGW_LD_FIX],
     
    438438
    439439# We delete the cached value, since the test might not have been
    440 # performed with out choise of compilers earlier
     440# performed with our choice of compilers earlier
    441441$as_unset ac_cv_prog_CXX || test "${ac_cv_prog_CXX+set}" != set || { ac_cv_prog_CXX=; export ac_cv_prog_CXX; }
    442442AC_PROG_CXX([$comps])
     443if test -z "$CXX" ; then
     444  AC_MSG_ERROR([Failed to find a C++ compiler!])
     445fi
     446
     447# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
     448case "$CXX" in
     449  cl* | */cl*)
     450    if test "$ac_cv_prog_cxx_g" = yes ; then
     451      ac_cv_prog_cxx_g=no
     452      AC_MSG_NOTICE([Overruling autoconf; cl does not recognise -g.])
     453    fi ;;
     454esac
    443455CXXFLAGS="$save_cxxflags"
    444456
     
    481493    esac
    482494  fi
     495
    483496  if test -z "$coin_opt_cxxflags"; then
    484497    case $build in
     
    596609
    597610case "$CXX" in
    598   cl*)
     611  cl* | */cl*)
    599612    AC_COIN_MINGW_LD_FIX
    600613    ;;
     
    628641  else
    629642    case $build in
    630      *-mingw32 | *-cygwin-* )
     643     *-mingw32 | *-cygwin* )
    631644      case "$CXX" in
    632       cl*)
     645      cl* | */cl*)
    633646        CXXLIBS=nothing;;
    634647      esac;;
     
    724737if test x"$CXX" != x; then
    725738  case "$CXX" in
    726     cl*)
     739    cl* | */cl*)
    727740      if test x"$CC" = x; then
    728741        CC="$CXX"
     
    749762
    750763# We delete the cached value, since the test might not have been
    751 # performed with out choise of compilers earlier
     764# performed with our choice of compilers earlier
    752765$as_unset ac_cv_prog_CC || test "${ac_cv_prog_CC+set}" != set || { ac_cv_prog_CC=; export ac_cv_prog_CC; }
    753766AC_PROG_CC([$comps])
     767if test -z "$CC" ; then
     768  AC_MSG_ERROR([Failed to find a C compiler!])
     769fi
     770# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
     771case "$CC" in
     772  cl* | */cl*)
     773    if test "$ac_cv_prog_cc_g" = yes ; then
     774      ac_cv_prog_cc_g=no
     775      AC_MSG_NOTICE([Overruling autoconf; cl does not recognise -g.])
     776    fi ;;
     777esac
    754778CFLAGS="$save_cflags"
    755779
     
    912936# Correct ADDLIBS initialization if we are using the MS compiler
    913937case "$CC" in
    914   cl*)
     938  cl* | */cl*)
    915939    ADDLIBS=
    916940    AC_COIN_MINGW_LD_FIX
     
    933957AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    934958AC_REQUIRE([AC_COIN_PROG_CC])
     959AC_REQUIRE([AC_COIN_F77_COMPS])
    935960AC_LANG_PUSH([Fortran 77])
    936961
     
    942967
    943968save_fflags="$FFLAGS"
    944 case $build in
    945   *-cygwin* | *-mingw*)
    946              comps="gfortran g77 ifort fl32" ;;
    947   *)         comps="xlf fort77 gfortran f77 g77 pgf90 pgf77 ifort ifc frt af77" ;;
    948 esac
     969comps="$coin_f77_comps" #This comes from AC_COIN_F77_COMPS
    949970
    950971# We delete the cached value, since the test might not have been
    951 # performed with out choise of compilers earlier
     972# performed with our choice of compilers earlier
    952973$as_unset ac_cv_prog_F77 || test "${ac_cv_prog_F77+set}" != set || { ac_cv_prog_F77=; export ac_cv_prog_F77; }
    953974AC_PROG_F77($comps)
     975if test -z "$F77" ; then
     976  AC_MSG_WARN([Failed to find a Fortran compiler!])
     977fi
    954978FFLAGS="$save_fflags"
    955979
     
    11531177]) # AC_COIN_F77_WRAPPERS
    11541178
     1179###########################################################################
     1180#                             COIN_FIND_F77                               #
     1181###########################################################################
     1182
     1183# Attempt to preempt autoconf by locating an appropriate F77 program. This
     1184# macro will not trigger a fatal error if a suitable compiler cannot be
     1185# found. It should be called before COIN_PROG_F77 or COIN_TRY_FLINK.
     1186
     1187AC_DEFUN([AC_COIN_FIND_F77],
     1188[AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     1189AC_REQUIRE([AC_COIN_F77_COMPS])
     1190AC_MSG_NOTICE([Trying to determine Fortran compiler name])
     1191AC_CHECK_PROGS([F77],[$coin_f77_comps],[unavailable])
     1192])
     1193
     1194# auxilliary macro to make sure both COIN_PROG_F77 and COIN_FIND_F77
     1195# use the same search lists for compiler names
     1196AC_DEFUN([AC_COIN_F77_COMPS],
     1197[case $build in
     1198  *-cygwin* | *-mingw*)
     1199     coin_f77_comps="gfortran g77 ifort fl32" ;;
     1200  *) coin_f77_comps="xlf fort77 gfortran f77 g77 pgf90 pgf77 ifort ifc frt af77" ;;
     1201esac
     1202])
    11551203
    11561204###########################################################################
     
    11821230
    11831231  # If maintainer mode is chosen, we make sure that the correct versions
    1184   # of the tools are used, and that we know where libtoo.m4 is (to
     1232  # of the tools are used, and that we know where libtool.m4 is (to
    11851233  # recreate acinclude.m4)
    11861234
    11871235  AC_SUBST(LIBTOOLM4)
    11881236  LIBTOOLM4=
     1237  # Normally, $HOME
     1238  AUTOTOOLS_DFLT=$HOME
    11891239
    11901240  # Check if we have autoconf
     
    12131263  autoconf_dir=`cd $autoconf_dir; pwd`
    12141264  if test x$AUTOTOOLS_DIR = x; then
    1215     want_dir=$HOME/bin
     1265    want_dir=$AUTOTOOLS_DFLT/bin
    12161266  else
    12171267    want_dir=$AUTOTOOLS_DIR/bin
     
    12221272    rm -f confauto.out
    12231273    AC_MSG_RESULT([no])
    1224     AC_MSG_ERROR([The autoconf executable should be picked up from \$HOME/bin or \$AUTOTOOLS_DIR/bin.])
     1274    AC_MSG_ERROR([The autoconf executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin.])
    12251275  fi
    12261276
     
    12501300  automake_dir=`cd $automake_dir; pwd`
    12511301  if test x$AUTOTOOLS_DIR = x; then
    1252     want_dir=$HOME/bin
     1302    want_dir=$AUTOTOOLS_DFLT/bin
    12531303  else
    12541304    want_dir=$AUTOTOOLS_DIR/bin
     
    12591309    rm -f confauto.out
    12601310    AC_MSG_RESULT([no])
    1261     AC_MSG_ERROR([The automake executable should be picked up from \$HOME/bin or \$AUTOTOOLS_DIR/bin.])
     1311    AC_MSG_ERROR([The automake executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin.])
    12621312  fi
    12631313
    12641314  # Check if we can find the libtool file
    12651315  if test x$AUTOTOOLS_DIR = x; then
    1266     want_dir=$HOME/share
     1316    want_dir=$AUTOTOOLS_DFLT/share
    12671317  else
    12681318    want_dir=$AUTOTOOLS_DIR/share
     
    15671617AC_SUBST(LIBEXT)
    15681618case "$CC" in
    1569   cl*) LIBEXT=lib ;;
     1619  cl* | */cl*)
     1620       LIBEXT=lib ;;
    15701621    *) LIBEXT=a ;;
    15711622esac
     
    21032154    fi
    21042155    ;;
    2105   cc)
     2156  cc|cpp)
    21062157    AC_F77_FUNC($1,cfunc$1)
    21072158    if test x"$coin_need_flibs" = xyes; then
     
    21362187
    21372188# This macro checks for a library containing the BLAS library.  It
    2138 # tried standard libraries, and if none is found to be working, it
     2189# tries standard libraries, and if none is found to be working, it
    21392190# checks whether the BLAS ThirdParty/Blas directory has been configured.
    21402191# It adds to ADDLIBS any flags required to link with an externally provided
     
    21572208    AC_CHECK_FILE([$coin_blasobjdir/Makefile],[],
    21582209                  [AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not configured])])
    2159   else
     2210  elif test "$use_blas" != no ; then
    21602211    AC_MSG_CHECKING([whether user supplied BLASLIB=\"$use_blas\" works])
    21612212    LIBS="$use_blas $LIBS"
     
    22122263fi
    22132264
     2265if test "$use_blas" = BUILD; then
     2266  coin_need_flibs=yes
     2267fi
     2268
    22142269AM_CONDITIONAL([COIN_HAS_BLAS],[test x"$use_blas" != x])
    22152270AM_CONDITIONAL([COIN_BUILD_BLAS],[test "$use_blas" = BUILD])
    22162271
    2217 if test x"$use_blas" = x; then
     2272if test x"$use_blas" = x || test "$use_blas" = no; then
    22182273  coin_has_blas=no
    22192274else
     
    22292284
    22302285# This macro checks for a library containing the LAPACK library.  It
    2231 # tried standard libraries, and if none is found to be working, it
     2286# tries standard libraries, and if none is found to be working, it
    22322287# checks whether the LAPACK ThirdParty/Lapack directory has been
    22332288# configured.  It adds to ADDLIBS any flags required to link with an
     
    23152370fi
    23162371
     2372if test "$use_lapack" = BUILD; then
     2373  coin_need_flibs=yes
     2374fi
     2375
    23172376AM_CONDITIONAL([COIN_HAS_LAPACK],[test x"$use_lapack" != x])
    23182377AM_CONDITIONAL([COIN_BUILD_LAPACK],[test "$use_lapack" = BUILD])
Note: See TracChangeset for help on using the changeset viewer.