Changeset 209 for trunk/coin.m4


Ignore:
Timestamp:
Jan 24, 2007 2:36:32 AM (14 years ago)
Author:
lou
Message:

Added enhanced --enable-doscompile option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r206 r209  
    381381
    382382# This macro is included by any PROG_compiler macro, to set the LD
    383 # environment variable on MinGW to the correct value (link).
     383# environment variable on MinGW to the correct value (link). But note that
     384# if we're building in cygwin with -mno-cygwin, we still want ld! If we're
     385# building from cygwin with MSVC tools (cl/link), then we do want link and
     386# you'd better have your PATH variable straight, else you'll be doing file
     387# links instead of code links! Arguably, LDFLAGS should include -mno-cygwin
     388# but in practice all linking seems to be handled through the compilers, so
     389# CFLAGS and CXXFLAGS suffice.
    384390
    385391AC_DEFUN([AC_COIN_MINGW_LD_FIX],
     
    390396    fi
    391397    ;;
    392 esac
     398 esac
     399 case $enable_doscompile in
     400   msvc)
     401     if test "x${LD+set}" = xset; then :; else
     402       LD=link
     403     fi
     404     ;;
     405 esac
    393406])
    394407
     
    397410###########################################################################
    398411
    399 # This macro is included by any PROG_compiler macro, to enable the
    400 # --enable-doscompile options which is to be used when one wants to
    401 # compile an executable under Cygwin which also runs directly under
    402 # does (without requiring Cygwin1.dll).  Essentially, if enabled and
    403 # the GNU compilers are used, it switches the --mno-cygwin flag on.
     412# This macro is invoked by any PROG_compiler macro to establish the
     413# --enable-doscompile option, used when one wants to compile an executable
     414# under Cygwin which also runs directly under DOS (without requiring
     415# Cygwin1.dll). The job of this macro is to make sure the option is correct and
     416# to set enable_doscompile. Legal values are mingw, msvc, and no (disabled).
     417# mingw: Fake mingw under cygwin, using GCC tools and -mno-cygwin. The most
     418#        important thing here is that preprocess, compile, and link steps
     419#        *all* see -mno-cygwin.
     420# msvc:  Assume the presence of cl/link. It's the user's responsibility to
     421#        make sure their PATH is correct. In particular, that MSVC link is
     422#        found and not cygwin link (we want to do code linking, not file
     423#        linking).
     424# It's the responsibility of individual PROG_compiler macros to ensure that
     425# they correctly set the compiler search list and preprocess, compile, and
     426# link flags. This is tied to compiler setup because in practice invocations
     427# of the preprocessor and linker are made through the compiler.
    404428
    405429AC_DEFUN([AC_COIN_ENABLE_DOSCOMPILE],
    406 [AC_ARG_ENABLE([doscompile],
    407 [AC_HELP_STRING([--enable-doscompile],
    408                 [Under Cygwin, compile so that executables run under DOS (default: disabled)])],
    409 [if test "$enable_doscompile = yes"; then
    410   case $build in
    411     *-cygwin*) ;;
    412     *) AC_MSG_ERROR([--enable-doscompile option makes only sense under Cygwin]) ;;
     430[AC_REQUIRE([AC_CANONICAL_BUILD])
     431 AC_ARG_ENABLE([doscompile],
     432  [AC_HELP_STRING([--enable-doscompile],
     433                  [Under Cygwin, compile so that executables run under DOS.
     434                   Set to mingw to use gcc/g++/ld with -mno-cygwin.
     435                   Set to msvc to use cl/link.
     436                   Default when mentioned: mingw.
     437                   Default when not mentioned: disabled.])],
     438  [if test "$enable_doscompile" != no; then
     439     case $build in
     440       *-cygwin*) ;;
     441       *) AC_MSG_ERROR([--enable-doscompile option makes sense only under Cygwin]) ;;
     442     esac
     443   fi],
     444  [enable_doscompile=no])
     445 case "$enable_doscompile" in
     446   msvc|mingw|no) ;;
     447   yes) enable_doscompile=mingw ;;
     448   *) AC_MSG_ERROR([Invalid value $enable_doscompile for --enable-doscompile.
     449                    Try configure --help=recursive.])
     450      ;;
    413451  esac
    414 fi],
    415 [enable_doscompile=no])
     452  if test "$enable_doscompile" != no ; then
     453    AC_MSG_NOTICE([DOS compile style is: $enable_doscompile])
     454  fi
    416455])
    417456
     
    420459###########################################################################
    421460
    422 # Find the compile command by running AC_PROG_CXX (with compiler names
    423 # for different operating systems) and put it into CXX (unless it was
    424 # given my the user), and find an appropriate value for CXXFLAGS.  It is
    425 # possible to provide additional -D flags in the variable CXXDEFS.
     461# Find the compile command by running AC_PROG_CXX (with compiler names for
     462# different operating systems) and put it into CXX (unless it was given by the
     463# user). Then find an appropriate value for CXXFLAGS. If either of CXXFLAGS or
     464# PRJCT_CXXFLAGS is defined, that value is used (replace PRJCT with the upper
     465# case name of this project).  It is possible to provide additional -D flags
     466# in the variable CXXDEFS, and additional compilation flags with ADD_CXXFLAGS.
    426467
    427468AC_DEFUN([AC_COIN_PROG_CXX],
     
    438479
    439480save_cxxflags="$CXXFLAGS"
     481# For sparc-sun-solaris, promote Studio/Workshop compiler to front of list.
    440482case $build in
    441483  *-cygwin* | *-mingw*)
    442              comps="g++ cl" ;;
     484             if test "$enable_doscompile" = msvc ; then
     485               comps="cl"
     486             else
     487               comps="g++ cl"
     488             fi ;;
     489  sparc-sun-solaris*)
     490             comps="CC xlC aCC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;;
    443491  *-darwin*) comps="g++ c++ CC" ;;
    444492          *) comps="xlC aCC CC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;;
     
    448496# performed with our choice of compilers earlier
    449497$as_unset ac_cv_prog_CXX || test "${ac_cv_prog_CXX+set}" != set || { ac_cv_prog_CXX=; export ac_cv_prog_CXX; }
     498# AC_MSG_NOTICE([C++ compiler candidates: $comps])
    450499AC_PROG_CXX([$comps])
    451500if test -z "$CXX" ; then
     
    455504# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
    456505case "$CXX" in
    457   cl* | */cl*)
     506  cl* | */cl* | CL* | */CL* )
    458507    if test "$ac_cv_prog_cxx_g" = yes ; then
    459508      ac_cv_prog_cxx_g=no
     
    489538        coin_dbg_cxxflags="-g"
    490539        coin_warn_cxxflags="-pedantic-errors -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion"
    491         if test "$enable_doscompile" = yes; then
    492           case $build in
    493             *-cygwin*)
    494               CXXFLAGS="-mno-cygwin"
    495               AC_TRY_LINK(,[int i=0; i++;],
    496                           [coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])
    497               CXXFLAGS=
    498               ;;
    499           esac
    500         fi
     540        case $enable_doscompile in
     541          mingw)
     542            CXXFLAGS="-mno-cygwin"
     543            AC_TRY_LINK(,[int i=0; i++;],
     544                        [coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])
     545            CXXFLAGS=
     546            ;;
     547        esac
    501548    esac
    502549  fi
     550
     551# Note that we do not need to cover GCC in the following tests.
    503552
    504553  if test -z "$coin_opt_cxxflags"; then
     
    507556        case "$CXX" in
    508557          cl* | */cl* | CL* | */CL*)
    509             coin_opt_cxxflags='-O2'
    510             coin_add_cxxflags='-nologo -EHsc -GR -MT'
     558            # The MT and MTd options are mutually exclusive
     559            coin_opt_cxxflags='-MT -O2'
     560            coin_add_cxxflags='-nologo -EHsc -GR -wd4996'
    511561            coin_dbg_cxxflags='-MTd'
    512562            ;;
     
    556606  fi
    557607
     608# Generic flag settings. If these don't work, add a case above.
     609
    558610  if test "$ac_cv_prog_cxx_g" = yes && test -z "$coin_dbg_cxxflags" ; then
    559611    coin_dbg_cxxflags="-g"
     
    571623  fi
    572624
     625# Do final setup of flags based on values determined above.
     626
    573627  if test x${DBG_CXXFLAGS+set} != xset; then
    574628    DBG_CXXFLAGS="$coin_dbg_cxxflags $coin_add_cxxflags $coin_warn_cxxflags"
     
    586640    CXXFLAGS="$OPT_CXXFLAGS"
    587641  fi
     642
     643# Handle the case where CXXFLAGS was set externally.
    588644else
    589645  CXXFLAGS="$CXXFLAGS $ADD_CXXFLAGS $CXXDEFS"
     
    595651  fi
    596652fi
     653
     654# If CXXFLAGS contains -mno-cygwin, CPPFLAGS must also have it.
     655
     656case "$CXXFLAGS" in
     657  *-mno-cygwin*)
     658    if test x${CPPFLAGS+set} != xset ; then
     659      CPPFLAGS="-mno-cygwin"
     660    else
     661      case "$CPPFLAGS" in
     662        *-mno-cygwin*)
     663          ;;
     664        *)
     665          CPPFLAGS="$CPPFLAGS -mno-cygwin"
     666          ;;
     667      esac
     668    fi ;;
     669esac
    597670
    598671# Try if CXXFLAGS works
     
    675748fi
    676749if test -z "$CXXLIBS"; then
    677   AC_MSG_WARN([Could not automatically determine CXXLIBS (C++ link libraries; necessary if main program is in Fortran of C).])
     750  AC_MSG_WARN([Could not automatically determine CXXLIBS (C++ link libraries; necessary if main program is in Fortran or C).])
    678751else
    679752  AC_MSG_NOTICE([Assuming that CXXLIBS is \"$CXXLIBS\".])
     
    699772# configure: WARNING: dlfcn.h: in the future, the compiler will take precedence
    700773
     774# My guess that the problem lay with CPPFLAGS seems to be correct. With this
     775# macro reduced to a direct call to AC_CHECK_HEADERS, there are no warnings
     776# now that CPPFLAGS contains -mno-cygwin when it needs it. -- lh, 061214 --
     777
    701778AC_DEFUN([AC_COIN_CHECK_HEADER],
    702 [if test x"$4" = x; then
    703   hdr="#include <$1>"
    704 else
    705   hdr="$4"
    706 fi
    707 AC_CHECK_HEADERS([$1],[$2],[$3],[$hdr])
     779[# if test x"$4" = x; then
     780 # hdr="#include <$1>"
     781 # else
     782  hdr="$4"
     783 # fi
     784AC_CHECK_HEADERS([$1],[$2],[$3],[$4])
    708785]) # AC_COIN_CHECK_HEADER
    709786
     
    762839
    763840save_cflags="$CFLAGS"
     841# For sparc-sun-solaris, promote Studio/Workshop compiler to front of list.
     842# ToDo: If Studio/Workshop cc is not present, we may find /usr/ucb/cc, which
     843# is likely to be a non-functional shell. But many installations will have
     844# both cc and gcc, so promoting gcc isn't good either. How to test reliably?
    764845case $build in
    765846  *-cygwin* | *-mingw*)
    766              comps="gcc cl" ;;
     847             if test "$enable_doscompile" = msvc ; then
     848               comps="cl"
     849             else
     850               comps="gcc cl"
     851             fi ;;
     852  sparc-sun-solaris*)
     853             comps="cc xlc gcc pgcc icc" ;;
    767854  *-linux-*) comps="xlc gcc cc pgcc icc" ;;
    768855  *)         comps="xlc_r xlc cc gcc pgcc icc" ;;
     
    772859# performed with our choice of compilers earlier
    773860$as_unset ac_cv_prog_CC || test "${ac_cv_prog_CC+set}" != set || { ac_cv_prog_CC=; export ac_cv_prog_CC; }
     861# AC_MSG_NOTICE([C compiler candidates: $comps])
    774862AC_PROG_CC([$comps])
    775863if test -z "$CC" ; then
     
    810898        coin_dbg_cflags="-g"
    811899        coin_warn_cflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall"
    812         if test "$enable_doscompile" = yes; then
    813           case $build in
    814             *-cygwin*)
    815               CFLAGS="-mno-cygwin"
    816               AC_TRY_LINK([],[int i=0; i++;],
    817                           [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
    818               CFLAGS=
    819             ;;
    820           esac
    821         fi
     900        case $enable_doscompile in
     901          mingw)
     902            CFLAGS="-mno-cygwin"
     903            AC_TRY_LINK([],[int i=0; i++;],
     904                        [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
     905            CFLAGS=
     906          ;;
     907        esac
    822908    esac
    823909  fi
     
    827913        case "$CC" in
    828914          cl* | */cl* | CL* | */CL*)
    829             coin_opt_cflags='-O2'
    830             coin_add_cflags='-nologo'
     915            coin_opt_cflags='-MT -O2'
     916            coin_add_cflags='-nologo -wd4996'
    831917            coin_dbg_cflags='-MTd'
    832918            ;;
     
    9161002fi
    9171003
     1004# If CFLAGS contains -mno-cygwin, CPPFLAGS must also have it.
     1005
     1006case "$CFLAGS" in
     1007  *-mno-cygwin*)
     1008    if test x${CPPFLAGS+set} != xset ; then
     1009      CPPFLAGS="-mno-cygwin"
     1010    else
     1011      case "$CPPFLAGS" in
     1012        *-mno-cygwin*)
     1013          ;;
     1014        *)
     1015          CPPFLAGS="$CPPFLAGS -mno-cygwin"
     1016          ;;
     1017      esac
     1018    fi ;;
     1019esac
     1020
    9181021# Try if CFLAGS works
    9191022save_CFLAGS="$CFLAGS"
     
    9531056# Find the compile command by running AC_PROG_F77 (with compiler names
    9541057# for different operating systems) and put it into F77 (unless it was
    955 # given my the user), and find an appropriate value for FFLAGS
     1058# given by the user), and find an appropriate value for FFLAGS
    9561059
    9571060AC_DEFUN([AC_COIN_PROG_F77],
     
    9691072
    9701073save_fflags="$FFLAGS"
    971 comps="$coin_f77_comps" #This comes from AC_COIN_F77_COMPS
    9721074
    9731075# We delete the cached value, since the test might not have been
    9741076# performed with our choice of compilers earlier
    9751077$as_unset ac_cv_prog_F77 || test "${ac_cv_prog_F77+set}" != set || { ac_cv_prog_F77=; export ac_cv_prog_F77; }
    976 AC_PROG_F77($comps)
    977 if test -z "$F77" ; then
     1078
     1079# This is a real belt-and-suspenders approach. AC_COIN_FIND_F77 will use
     1080# coin_f77_comps to see if there's a program that matches one of the names.
     1081# If there's no such program, F77 = unavailable. If we match the name,
     1082# feed AC_PROG_F77 the same search list, just to be sure it's a functioning
     1083# compiler.
     1084# AC_MSG_NOTICE([Fortran compiler candidates: $coin_f77_comps])
     1085AC_COIN_FIND_F77
     1086if test "$F77" != "unavailable" ; then
     1087  AC_PROG_F77($coin_f77_comps)
     1088else
    9781089  AC_MSG_WARN([Failed to find a Fortran compiler!])
    9791090fi
     1091
    9801092FFLAGS="$save_fflags"
    9811093
     
    9881100fi
    9891101
    990 if test x"$FFLAGS" = x; then
     1102if test "$F77" != "unavailable" && test x"$FFLAGS" = x ; then
    9911103
    9921104  coin_add_fflags=
     
    9991111    coin_add_fflags="-pipe"
    10001112    coin_dbg_fflags="-g"
    1001     if test "$enable_doscompile" = yes; then
    1002       case $build in
    1003         *-cygwin*)
    1004           FFLAGS="-mno-cygwin"
    1005           AC_TRY_LINK(,[      write(*,*) 'Hello world'],
    1006                       [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
    1007           FFLAGS=
    1008         ;;
    1009       esac
    1010     fi
     1113    case $enable_doscompile in
     1114      mingw)
     1115        FFLAGS="-mno-cygwin"
     1116        AC_TRY_LINK(,[      write(*,*) 'Hello world'],
     1117                    [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
     1118        FFLAGS=
     1119      ;;
     1120    esac
    10111121  else
    10121122    case $build in
     
    11031213fi
    11041214
     1215# If FFLAGS contains -mno-cygwin, CPPFLAGS must have it.
     1216case "$FFLAGS" in
     1217  *-mno-cygwin*)
     1218    if test x${CPPFLAGS+set} != xset ; then
     1219      CPPFLAGS="-mno-cygwin"
     1220    else
     1221      case "$CPPFLAGS" in
     1222        *-mno-cygwin*)
     1223          ;;
     1224        *)
     1225          CPPFLAGS="$CPPFLAGS -mno-cygwin"
     1226          ;;
     1227      esac
     1228    fi ;;
     1229esac
     1230
    11051231# Try if FFLAGS works
    1106 AC_TRY_LINK(,[      integer i],[],[FFLAGS=])
    1107 if test -z "$FFLAGS"; then
    1108   AC_MSG_WARN([The flags FFLAGS="$FFLAGS" do not work.  I will now just try '-O', but you might want to set FFLAGS manually.])
    1109   FFLAGS='-O'
     1232if test "$F77" != "unavailable" ; then
    11101233  AC_TRY_LINK(,[      integer i],[],[FFLAGS=])
    11111234  if test -z "$FFLAGS"; then
    1112     AC_MSG_WARN([This value for FFLAGS does not work.  I will continue with empty FFLAGS, but you might want to set FFLAGS manually.])
     1235    AC_MSG_WARN([The flags FFLAGS="$FFLAGS" do not work.  I will now just try '-O', but you might want to set FFLAGS manually.])
     1236    FFLAGS='-O'
     1237    AC_TRY_LINK(,[      integer i],[],[FFLAGS=])
     1238    if test -z "$FFLAGS"; then
     1239      AC_MSG_WARN([This value for FFLAGS does not work.  I will continue with empty FFLAGS, but you might want to set FFLAGS manually.])
     1240    fi
    11131241  fi
    11141242fi
     
    11231251
    11241252case "$F77" in
    1125   ifort*)
     1253  ifort* | */ifort* | IFORT* | */IFORT*)
    11261254    AC_COIN_MINGW_LD_FIX
    11271255    ;;
     
    11611289   *-cygwin* | *-mingw*)
    11621290     case "$F77" in
    1163        ifort* | */ifort* | IFORT* | */IFORT* )
     1291       ifort* | */ifort* | IFORT* | */IFORT*)
    11641292           FLIBS="-link libifcorert.lib $LIBS /NODEFAULTLIB:libc.lib";;
    11651293     esac;;
     
    11941322])
    11951323
    1196 # auxilliary macro to make sure both COIN_PROG_F77 and COIN_FIND_F77
    1197 # use the same search lists for compiler names
     1324# Auxilliary macro to make sure both COIN_PROG_F77 and COIN_FIND_F77 use
     1325# the same search lists for compiler names.
     1326# For sparc-sun-solaris, promote Studio/Workshop compilers to front of list.
    11981327AC_DEFUN([AC_COIN_F77_COMPS],
    11991328[case $build in
    12001329  *-cygwin* | *-mingw*)
    1201      coin_f77_comps="gfortran g77 ifort fl32" ;;
     1330     if test "$enable_doscompile" = msvc ; then
     1331       coin_f77_comps="ifort fl32"
     1332     else
     1333       coin_f77_comps="gfortran g77 ifort fl32"
     1334     fi ;;
     1335  sparc-sun-solaris*)
     1336     coin_f77_comps="f95 f90 f77 xlf fort77 gfortran g77 pgf90 pgf77 ifort ifc frt af77" ;;
    12021337  *) coin_f77_comps="xlf fort77 gfortran f77 g77 pgf90 pgf77 ifort ifc frt af77" ;;
    1203 esac
     1338 esac
    12041339])
    12051340
     
    12241359AC_DEFUN([AC_COIN_INIT_AUTOMAKE],
    12251360[AC_REQUIRE([AC_PROG_EGREP])
     1361
     1362# AC_MSG_NOTICE([Beginning automake initialisation.])
    12261363# Stuff for automake
    12271364AM_INIT_AUTOMAKE
     
    14181555AM_CONDITIONAL(HAVE_EXTERNALS,
    14191556               test $coin_have_externals = yes && test x$have_svn = xyes)
     1557
     1558# AC_MSG_NOTICE([End automake initialisation.])
     1559
    14201560]) # AC_COIN_INIT_AUTOMAKE
    14211561
     
    14451585
    14461586# Initialize automake and libtool
     1587# AC_MSG_NOTICE([Calling INIT_AUTO_TOOLS from CREATE_LIBTOOL.])
    14471588AC_COIN_INIT_AUTO_TOOLS
     1589# AC_MSG_NOTICE([Finished INIT_AUTO_TOOLS from CREATE_LIBTOOL.])
    14481590])
    14491591
     
    15111653                 LIBTOOL='$(SHELL) $(top_builddir)/../../libtool'])
    15121654fi
    1513 #if test "x$LIBTOOL" = x; then
    1514 AC_CHECK_FILE([../../../libtool],
    1515 #                [coin_config_dir=../../..
    1516 #                 LIBTOOL='$(SHELL) $(top_builddir)/../../../libtool'])
    1517 #fi
     1655# if test "x$LIBTOOL" = x; then
     1656 AC_CHECK_FILE([../../../libtool],
     1657#                 [coin_config_dir=../../..
     1658#                  LIBTOOL='$(SHELL) $(top_builddir)/../../../libtool'])
     1659# fi
    15181660
    15191661if test "x$LIBTOOL" = x; then
    1520 
     1662# AC_MSG_NOTICE([Creating libtool script (calling COIN_PROG_LIBTOOL).])
    15211663  # Stuff for libtool
    15221664  AC_COIN_PROG_LIBTOOL
    1523 
     1665# AC_MSG_NOTICE([Finished COIN_PROG_LIBTOOL.])
    15241666  # set RPATH_FLAGS to the compiler link flags required to hardcode location
    15251667  # of the shared objects
     
    15401682      s,@am__fastdep* | s,@AR@* | s,@CPP@*  | s,@CPPFLAGS@* | s,@CXXCPP@*  | \
    15411683      s,@RANLIB@* | s,@STRIP@* | s,@ac_ct_AR@* | s,@ac_ct_RANLIB@* | \
    1542       s,@ac_ct_STRIP@* | s,@host* | s,@LN_S@* | s,@RPATH_FLAGS@* )
     1684      s,@ac_ct_STRIP@* | s,@host* | s,@LN_S@* | s,@RPATH_FLAGS@* | \
     1685      s,@ac_c_preproc_warn_flag@* |  s,@ac_cxx_preproc_warn_flag@* )
    15431686        command=`echo $oneline | sed -e 's/^s,@//' -e 's/@,/="/' -e 's/,;t t/"/'`
    15441687#        echo "$command"
     
    15681711fi
    15691712
     1713# AC_MSG_NOTICE([End of INIT_AUTO_TOOLS.])
     1714
    15701715# ToDo
    15711716# For now, don't use the -no-undefined flag, since the Makefiles are
     
    15931738
    15941739AC_DEFUN([AC_COIN_PROG_LIBTOOL],
    1595 [AC_REQUIRE([AC_COIN_DLFCN_H])
    1596 
    1597 # We check for this header here in a non-standard way to avoid warning
    1598 # messages
    1599 AC_PROG_LIBTOOL
     1740[# No longer needed now that CPPFLAGS is correctly set -- lh, 061214 --
     1741 # AC_REQUIRE([AC_COIN_DLFCN_H])
     1742
     1743# NEW: If libtool exists in the directory higher up, we use that one
     1744#      instead of creating a new one
     1745
     1746# It turns out that the code for AC_PROG_LIBTOOL is somehow AC_REQUIRED
     1747# out in front of this macro body. You'll notice that LIBTOOL is already
     1748# defined here.  We'll have to count on this macro not being called if libtool
     1749# already exists, or at least move the libtool fixes outside the conditional.
     1750# AC_MSG_NOTICE([Entering coin_prog_libtool, LIBTOOL = "$LIBTOOL".])
     1751# This test is therefore removed.  -- lh, 061214 --
     1752# if test "x$LIBTOOL" = x; then
     1753
     1754# AC_MSG_NOTICE([Calling PROG_LIBTOOL.])
     1755  AC_PROG_LIBTOOL
     1756# AC_MSG_NOTICE([Finished PROG_LIBTOOL.])
     1757  AC_SUBST(ac_c_preproc_warn_flag)
     1758  AC_SUBST(ac_cxx_preproc_warn_flag)
    16001759
    16011760# Fix bugs in libtool script for Windows native compilation:
     
    16031762# - paths generated for .lib files is not run through cygpath -w
    16041763
    1605 # Correct cygpath for minGW (ToDo!)
    1606 case $build in
    1607   *-mingw*)
    1608     CYGPATH_W=echo
    1609     ;;
    1610 esac
    1611 
    1612 case $build in
    1613   *-cygwin* | *-mingw*)
    1614   case "$CXX" in
    1615     cl* | */cl* | CL* | */CL*)
    1616       AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
    1617       sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1618           -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1619           -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
    1620           -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
    1621           -e 's%lib /OUT:%lib -OUT:%' \
    1622           -e "s%cygpath -w%$CYGPATH_W%" \
    1623           -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
    1624           -e 's/$AR t/lib -nologo -list/' \
    1625           -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
    1626           -e  's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
    1627       libtool > conftest.bla
    1628 
    1629       mv conftest.bla libtool
    1630       chmod 755 libtool
    1631       ;;
    1632     *)
    1633       AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
    1634       sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1635           -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
    1636           -e 's|libext="lib"|libext="a"|' \
    1637       libtool > conftest.bla
    1638 
    1639       mv conftest.bla libtool
    1640       chmod 755 libtool
     1764
     1765# - lib includes subdirectory information; we want to replace
     1766#
     1767# old_archive_cmds="lib /OUT:\$oldlib\$oldobjs\$old_deplibs"
     1768#
     1769# by
     1770#
     1771# old_archive_cmds="echo \$oldlib | grep .libs >/dev/null; if test \$? = 0; then cd .libs; lib /OUT:\`echo \$oldlib\$oldobjs\$old_deplibs | sed -e s@\.libs/@@g\`; cd .. ; else lib /OUT:\$oldlib\$oldobjs\$old_deplibs ; fi"
     1772#
     1773#          -e 's%old_archive_cmds="lib /OUT:\\\$oldlib\\\$oldobjs\\\$old_deplibs"%old_archive_cmds="echo \\\$oldlib \| grep .libs >/dev/null; if test \\\$? = 0; then cd .libs; lib /OUT:\\\`echo \\\$oldlib\\\$oldobjs\\\$old_deplibs \| sed -e s@\\.libs/@@g\\\`; cd .. ; else lib /OUT:\\\$oldlib\\\$oldobjs\\\$old_deplibs; fi"%' \
     1774
     1775# The following was a hack for chaniing @BACKSLASH to \
     1776#          -e 'sYcompile_command=`\$echo "X\$compile_command" | \$Xsed -e '"'"'s%@OUTPUT@%'"'"'"\$output"'"'"'%g'"'"'`Ycompile_command=`\$echo "X\$compile_command" | \$Xsed -e '"'"'s%@OUTPUT@%'"'"'"\$output"'"'"'%g'"'"' | \$Xsed -e '"'"'s%@BACKSLASH@%\\\\\\\\\\\\\\\\%g'"'"'`Y' \
     1777
     1778  # Correct cygpath for minGW (ToDo!)
     1779  AC_MSG_NOTICE([Build is "$build".])
     1780  case $build in
     1781    *-mingw*)
     1782      CYGPATH_W=echo
    16411783      ;;
    16421784  esac
    1643 esac
     1785
     1786  case $build in
     1787    *-cygwin* | *-mingw*)
     1788    case "$CXX" in
     1789      cl* | */cl* | CL* | */CL*)
     1790        AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
     1791        sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     1792            -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     1793            -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     1794            -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     1795            -e 's%lib /OUT:%lib -OUT:%' \
     1796            -e "s%cygpath -w%$CYGPATH_W%" \
     1797            -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
     1798            -e 's/$AR t/lib -nologo -list/' \
     1799            -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
     1800            -e  's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
     1801        libtool > conftest.bla
     1802
     1803        mv conftest.bla libtool
     1804        chmod 755 libtool
     1805        ;;
     1806      *)
     1807        AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
     1808        sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     1809            -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
     1810            -e 's|libext="lib"|libext="a"|' \
     1811        libtool > conftest.bla
     1812
     1813        mv conftest.bla libtool
     1814        chmod 755 libtool
     1815        ;;
     1816    esac
     1817  esac
     1818# This fi matches the commented `if test "x$LIBTOOL" = x;' up at the head of
     1819# the macro. -- lh, 061214 --
     1820# fi
     1821
     1822# AC_MSG_NOTICE([End libtool initialisation.])
    16441823]) # AC_COIN_PROG_LIBTOOL
    16451824
    16461825# This is a trick to force the check for the dlfcn header to be done before
    16471826# the checks for libtool
    1648 AC_DEFUN([AC_COIN_DLFCN_H],
    1649 [AC_LANG_PUSH(C)
    1650 AC_COIN_CHECK_HEADER([dlfcn.h])
    1651 AC_LANG_POP(C)
    1652 ]) # AC_COIN_DLFCN_H
     1827# No longer needed now that CPPFLAGS is correctly set.  -- lh, 061214 --
     1828# ACDEFUN([AC_COIN_DLFCN_H],
     1829# [AC_LANG_PUSH(C)
     1830# AC_COIN_CHECK_HEADER([dlfcn.h])
     1831# AC_LANG_POP(C)
     1832# ]) # AC_COIN_DLFCN_H
    16531833
    16541834###########################################################################
     
    19672147if test $coin_vpath_config = yes; then
    19682148  lnkcmd=
    1969   if test "$enable_doscompile" = yes; then
     2149  if test "$enable_doscompile" != no; then
    19702150    lnkcmd=cp
    19712151  fi
     
    23272507else
    23282508# Try to autodetect the library for blas based on build system
     2509  AC_MSG_CHECKING([default locations for BLAS])
    23292510  case $build in
    23302511    *-sgi-*)
     
    23502531                         LIBS="$SAVE_LIBS"])
    23512532      ;;
    2352   esac
    2353   # On cygwin, if enable_doscompile is used, recompile blas because it
    2354   # otherwise links with the cygwin blas which doesn't run under DOS
    2355   if test "$enable_doscompile" != yes; then
    2356     if test -z "$use_blas"; then
    2357       SAVE_LIBS="$LIBS"
    2358       AC_MSG_CHECKING([whether -lblas has BLAS])
    2359       LIBS="-lblas $LIBS"
    2360       AC_COIN_TRY_FLINK([daxpy],
    2361                         [AC_MSG_RESULT([yes])
    2362                          ADDLIBS="-lblas $ADDLIBS"
    2363                          use_blas='-lblas'],
    2364                         [AC_MSG_RESULT([no])
    2365                          LIBS="$SAVE_LIBS"])
    2366     fi
    2367   fi
     2533# On cygwin, consider -lblas only if doscompile is disabled. The prebuilt
     2534# library will want to link with cygwin, hence won't run standalone in DOS.
     2535    *-cygwin*)
     2536      if test "$enable_doscompile" = no; then
     2537        if test -z "$use_blas"; then
     2538          SAVE_LIBS="$LIBS"
     2539          AC_MSG_CHECKING([whether -lblas has BLAS])
     2540          LIBS="-lblas $LIBS"
     2541          AC_COIN_TRY_FLINK([daxpy],
     2542                            [AC_MSG_RESULT([yes])
     2543                             ADDLIBS="-lblas $ADDLIBS"
     2544                             use_blas='-lblas'],
     2545                            [AC_MSG_RESULT([no])
     2546                             LIBS="$SAVE_LIBS"])
     2547        fi
     2548      fi
     2549      ;;
     2550    esac
     2551
     2552# If we have no other ideas, consider building BLAS.
    23682553  if test -z "$use_blas"; then
     2554    AC_MSG_CHECKING([if BLAS can be built.])
    23692555    AC_CHECK_FILE([$coin_blasobjdir/Makefile],[use_blas=BUILD])
    23702556  fi
     
    24132599  if test "$use_lapack" = "BUILD"; then
    24142600    AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[],
    2415                   [AC_MSG_ERROR([option \"BUILD\" specified for Lapack, but $coin_lapackobjdir directory is not configured])])
     2601                  [AC_MSG_ERROR([option \"BUILD\" specified for LAPACK, but $coin_lapackobjdir directory is not configured])])
    24162602  else
    24172603    AC_MSG_CHECKING([whether user supplied LAPACKLIB=\"$use_lapack\" works])
     
    24562642                           LIBS="$SAVE_LIBS"])
    24572643        ;;
     2644# On cygwin, do this check only if doscompile is disabled. The prebuilt library
     2645# will want to link with cygwin, hence won't run standalone in DOS.
     2646      *-cygwin*)
     2647        if test "$enable_doscompile" = no; then
     2648          if test -z "$use_lapack"; then
     2649            SAVE_LIBS="$LIBS"
     2650            AC_MSG_CHECKING([whether -llapack has LAPACK])
     2651            LIBS="-llapack $LIBS"
     2652            AC_COIN_TRY_FLINK([dsyev],
     2653                              [AC_MSG_RESULT([yes])
     2654                               ADDLIBS="-llapack $ADDLIBS"
     2655                               use_lapack='-llapack'],
     2656                              [AC_MSG_RESULT([no])
     2657                               LIBS="$SAVE_LIBS"])
     2658          fi
     2659        fi
     2660        ;;
    24582661    esac
    24592662  fi
    2460   # On cygwin, if enable_doscompile is used, recompile lapack because it
    2461   # otherwise links with the cygwin lapack which doesn't run under DOS
    2462   if test "$enable_doscompile" != yes; then
    2463     if test -z "$use_lapack"; then
    2464       SAVE_LIBS="$LIBS"
    2465       AC_MSG_CHECKING([whether -llapack has LAPACK])
    2466       LIBS="-llapack $LIBS"
    2467       AC_COIN_TRY_FLINK([dsyev],
    2468                         [AC_MSG_RESULT([yes])
    2469                          ADDLIBS="-llapack $ADDLIBS"
    2470                          use_lapack='-llapack'],
    2471                         [AC_MSG_RESULT([no])
    2472                          LIBS="$SAVE_LIBS"])
    2473     fi
    2474   fi
     2663# If we have no other ideas, consider building LAPACK.
    24752664  if test -z "$use_lapack"; then
    24762665    AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[use_lapack=BUILD])
Note: See TracChangeset for help on using the changeset viewer.