Changeset 215 for stable


Ignore:
Timestamp:
Feb 1, 2007 1:45:00 PM (14 years ago)
Author:
andreasw
Message:

making trunk (rev 214) the new stable version, still in 0.5

Location:
stable/0.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/0.5/coin.m4

    r187 r215  
    231231if test $coin_skip = yes; then
    232232  AC_MSG_RESULT(skipping)
    233 elif test -r $srcdir/$2/$3; then
    234   coin_subdirs="$coin_subdirs $2"
    235   AC_MSG_RESULT(yes)
    236   AC_CONFIG_SUBDIRS($2)
    237233else
    238   AC_MSG_RESULT(no)
     234  coin_tmp=`echo $srcdir/$2/$3`
     235  # There is probably a more elegant way to get the first thing out here...
     236  for i in $coin_tmp; do
     237    coin_tmp2=$i
     238    #break 1
     239  done
     240  if test -r $coin_tmp2; then
     241    coin_subdirs="$coin_subdirs $2"
     242    AC_MSG_RESULT(yes)
     243    AC_CONFIG_SUBDIRS($2)
     244  else
     245    AC_MSG_RESULT(no)
     246  fi
    239247fi
    240248]) # AC_COIN_THIRDPARTY_SUBDIRS
     
    267275AC_DEFUN([AC_COIN_PROJECTDIR_INIT],
    268276[# Initialize the ADDLIBS variable
    269 ADDLIBS='-lm'
     277ADDLIBS="-lm $LIBS"
    270278AC_SUBST(ADDLIBS)
    271279
    272280# Initialize the FADDLIBS variable (which is to be used with a fortran
    273281# compiler and will not include FLIBS)
    274 FADDLIBS=
     282FADDLIBS="$LIBS"
    275283AC_SUBST(FADDLIBS)
    276284
     
    373381
    374382# This macro is included by any PROG_compiler macro, to set the LD
    375 # environment variable on MinWG 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.
    376390
    377391AC_DEFUN([AC_COIN_MINGW_LD_FIX],
     
    382396    fi
    383397    ;;
    384 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
    385406])
    386407
     
    389410###########################################################################
    390411
    391 # This macro is included by any PROG_compiler macro, to enable the
    392 # --enable-doscompile options which is to be used when one wants to
    393 # compile an executable under Cygwin which also runs directly under
    394 # does (without requiring Cygwin1.dll).  Essentially, if enabled and
    395 # 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.
    396428
    397429AC_DEFUN([AC_COIN_ENABLE_DOSCOMPILE],
    398 [AC_ARG_ENABLE([doscompile],
    399 [AC_HELP_STRING([--enable-doscompile],
    400                 [Under Cygwin, compile so that executables run under DOS (default: disabled)])],
    401 [if test "$enable_doscompile = yes"; then
    402   case $build in
    403     *-cygwin*) ;;
    404     *) 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      ;;
    405451  esac
    406 fi],
    407 [enable_doscompile=no])
     452  if test "$enable_doscompile" != no ; then
     453    AC_MSG_NOTICE([DOS compile style is: $enable_doscompile])
     454  fi
    408455])
    409456
     
    412459###########################################################################
    413460
    414 # Find the compile command by running AC_PROG_CXX (with compiler names
    415 # for different operating systems) and put it into CXX (unless it was
    416 # given my the user), and find an appropriate value for CXXFLAGS.  It is
    417 # 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.
    418467
    419468AC_DEFUN([AC_COIN_PROG_CXX],
     
    430479
    431480save_cxxflags="$CXXFLAGS"
     481# For sparc-sun-solaris, promote Studio/Workshop compiler to front of list.
    432482case $build in
    433483  *-cygwin* | *-mingw*)
    434              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" ;;
    435491  *-darwin*) comps="g++ c++ CC" ;;
    436492          *) comps="xlC aCC CC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;;
     
    438494
    439495# We delete the cached value, since the test might not have been
    440 # performed with out choise of compilers earlier
     496# performed with our choice of compilers earlier
    441497$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])
    442499AC_PROG_CXX([$comps])
     500if test -z "$CXX" ; then
     501  AC_MSG_ERROR([Failed to find a C++ compiler!])
     502fi
     503
     504# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
     505case "$CXX" in
     506  cl* | */cl* | CL* | */CL* )
     507    if test "$ac_cv_prog_cxx_g" = yes ; then
     508      ac_cv_prog_cxx_g=no
     509      AC_MSG_NOTICE([Overruling autoconf; cl does not recognise -g.])
     510    fi ;;
     511esac
    443512CXXFLAGS="$save_cxxflags"
    444513
     
    469538        coin_dbg_cxxflags="-g"
    470539        coin_warn_cxxflags="-pedantic-errors -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion"
    471         if test "$enable_doscompile" = yes; then
    472           case $build in
    473             *-cygwin*)
    474               CXXFLAGS="-mno-cygwin"
    475               AC_TRY_LINK([],[int i=0; i++;],
    476                           [coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])
    477               CXXFLAGS=
    478               ;;
    479           esac
    480         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
    481548    esac
    482549  fi
     550
     551# Note that we do not need to cover GCC in the following tests.
     552
    483553  if test -z "$coin_opt_cxxflags"; then
    484554    case $build in
     
    486556        case "$CXX" in
    487557          cl* | */cl* | CL* | */CL*)
    488             coin_opt_cxxflags='-O2'
    489             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'
    490561            coin_dbg_cxxflags='-MTd'
    491562            ;;
     
    500571            # Check if -i_dynamic is necessary (for new glibc library)
    501572            CXXFLAGS=
    502             AC_TRY_LINK([],[int i=0; i++;],[],
     573            AC_TRY_LINK(,[int i=0; i++;],[],
    503574                        [coin_add_cxxflags="-i_dynamic $coin_add_cxxflags"])
    504575            ;;
     
    535606  fi
    536607
     608# Generic flag settings. If these don't work, add a case above.
     609
    537610  if test "$ac_cv_prog_cxx_g" = yes && test -z "$coin_dbg_cxxflags" ; then
    538611    coin_dbg_cxxflags="-g"
     
    550623  fi
    551624
     625# Do final setup of flags based on values determined above.
     626
    552627  if test x${DBG_CXXFLAGS+set} != xset; then
    553628    DBG_CXXFLAGS="$coin_dbg_cxxflags $coin_add_cxxflags $coin_warn_cxxflags"
     
    565640    CXXFLAGS="$OPT_CXXFLAGS"
    566641  fi
     642
     643# Handle the case where CXXFLAGS was set externally.
    567644else
    568645  CXXFLAGS="$CXXFLAGS $ADD_CXXFLAGS $CXXDEFS"
     
    574651  fi
    575652fi
     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
    576670
    577671# Try if CXXFLAGS works
     
    628722  else
    629723    case $build in
    630      *-mingw32 | *-cygwin-* )
     724     *-mingw32 | *-cygwin* )
    631725      case "$CXX" in
    632726      cl* | */cl* | CL* | */CL*)
     
    654748fi
    655749if test -z "$CXXLIBS"; then
    656   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).])
    657751else
    658752  AC_MSG_NOTICE([Assuming that CXXLIBS is \"$CXXLIBS\".])
     
    678772# configure: WARNING: dlfcn.h: in the future, the compiler will take precedence
    679773
     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
    680778AC_DEFUN([AC_COIN_CHECK_HEADER],
    681 [if test x"$4" = x; then
    682   hdr="#include <$1>"
    683 else
    684   hdr="$4"
    685 fi
    686 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])
    687785]) # AC_COIN_CHECK_HEADER
    688786
     
    741839
    742840save_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?
    743845case $build in
    744846  *-cygwin* | *-mingw*)
    745              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" ;;
    746854  *-linux-*) comps="xlc gcc cc pgcc icc" ;;
    747855  *)         comps="xlc_r xlc cc gcc pgcc icc" ;;
     
    749857
    750858# We delete the cached value, since the test might not have been
    751 # performed with out choise of compilers earlier
     859# performed with our choice of compilers earlier
    752860$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])
    753862AC_PROG_CC([$comps])
     863if test -z "$CC" ; then
     864  AC_MSG_ERROR([Failed to find a C compiler!])
     865fi
     866# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
     867case "$CC" in
     868  cl* | */cl* | CL* | */CL* )
     869    if test "$ac_cv_prog_cc_g" = yes ; then
     870      ac_cv_prog_cc_g=no
     871      AC_MSG_NOTICE([Overruling autoconf; cl does not recognise -g.])
     872    fi ;;
     873esac
    754874CFLAGS="$save_cflags"
    755875
     
    778898        coin_dbg_cflags="-g"
    779899        coin_warn_cflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall"
    780         if test "$enable_doscompile" = yes; then
    781           case $build in
    782             *-cygwin*)
    783               CFLAGS="-mno-cygwin"
    784               AC_TRY_LINK([],[int i=0; i++;],
    785                           [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
    786               CFLAGS=
    787             ;;
    788           esac
    789         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
    790908    esac
    791909  fi
     
    795913        case "$CC" in
    796914          cl* | */cl* | CL* | */CL*)
    797             coin_opt_cflags='-O2'
    798             coin_add_cflags='-nologo'
     915            coin_opt_cflags='-MT -O2'
     916            coin_add_cflags='-nologo -wd4996'
    799917            coin_dbg_cflags='-MTd'
    800918            ;;
     
    8841002fi
    8851003
    886 # Check if user wants to have additional CFLAGS options
    887 AC_ARG_VAR(ADD_CFLAGS,[Additional C compiler options])
    888 if test x"$ADD_CFLAGS" != x; then
    889   CFLAGS="$CFLAGS $ADD_CFLAGS"
    890 fi
     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
    8911020
    8921021# Try if CFLAGS works
     
    9271056# Find the compile command by running AC_PROG_F77 (with compiler names
    9281057# for different operating systems) and put it into F77 (unless it was
    929 # given my the user), and find an appropriate value for FFLAGS
     1058# given by the user), and find an appropriate value for FFLAGS
    9301059
    9311060AC_DEFUN([AC_COIN_PROG_F77],
     
    9331062AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    9341063AC_REQUIRE([AC_COIN_PROG_CC])
     1064AC_REQUIRE([AC_COIN_F77_COMPS])
    9351065AC_LANG_PUSH([Fortran 77])
    9361066
     
    9421072
    9431073save_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
    9491074
    9501075# We delete the cached value, since the test might not have been
    951 # performed with out choise of compilers earlier
     1076# performed with our choice of compilers earlier
    9521077$as_unset ac_cv_prog_F77 || test "${ac_cv_prog_F77+set}" != set || { ac_cv_prog_F77=; export ac_cv_prog_F77; }
    953 AC_PROG_F77($comps)
     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
     1089  AC_MSG_WARN([Failed to find a Fortran compiler!])
     1090fi
     1091
    9541092FFLAGS="$save_fflags"
    9551093
     
    9621100fi
    9631101
    964 if test x"$FFLAGS" = x; then
     1102if test "$F77" != "unavailable" && test x"$FFLAGS" = x ; then
    9651103
    9661104  coin_add_fflags=
     
    9731111    coin_add_fflags="-pipe"
    9741112    coin_dbg_fflags="-g"
    975     if test "$enable_doscompile" = yes; then
    976       case $build in
    977         *-cygwin*)
    978           FFLAGS="-mno-cygwin"
    979           AC_TRY_LINK([],[      write(*,*) 'Hello world'],
    980                       [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
    981           FFLAGS=
    982         ;;
    983       esac
    984     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
    9851121  else
    9861122    case $build in
    9871123      *-cygwin* | *-mingw*)
    9881124        case $F77 in
    989           ifort* | */ifort*)
     1125          ifort* | */ifort* | IFORT* | */IFORT* )
    9901126            coin_opt_fflags='-O3'
    9911127            coin_add_fflags='-nologo -MT'
     
    10021138            # Check if -i_dynamic is necessary (for new glibc library)
    10031139            FFLAGS=
    1004             AC_TRY_LINK([],[      write(*,*) 'Hello world'],[],
     1140            AC_TRY_LINK(,[      write(*,*) 'Hello world'],[],
    10051141                        [coin_add_fflags="-i_dynamic $coin_add_fflags"])
    10061142            ;;
     
    10441180    # Try if -O option works if nothing else is set
    10451181    FFLAGS=-O
    1046     AC_TRY_LINK([],[      integer i], [coin_opt_fflags="-O"])
     1182    AC_TRY_LINK(,[      integer i], [coin_opt_fflags="-O"])
    10471183  fi
    10481184
     
    10771213fi
    10781214
     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
    10791231# Try if FFLAGS works
    1080 AC_TRY_LINK([],[      integer i],[],[FFLAGS=])
    1081 if test -z "$FFLAGS"; then
    1082   AC_MSG_WARN([The flags FFLAGS="$FFLAGS" do not work.  I will now just try '-O', but you might want to set FFLAGS manually.])
    1083   FFLAGS='-O'
    1084   AC_TRY_LINK([],[      integer i],[],[FFLAGS=])
     1232if test "$F77" != "unavailable" ; then
     1233  AC_TRY_LINK(,[      integer i],[],[FFLAGS=])
    10851234  if test -z "$FFLAGS"; then
    1086     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
    10871241  fi
    10881242fi
     
    10971251
    10981252case "$F77" in
    1099   ifort*)
     1253  ifort* | */ifort* | IFORT* | */IFORT*)
    11001254    AC_COIN_MINGW_LD_FIX
    11011255    ;;
     
    11351289   *-cygwin* | *-mingw*)
    11361290     case "$F77" in
    1137        ifort* | */ifort*)
     1291       ifort* | */ifort* | IFORT* | */IFORT*)
    11381292           FLIBS="-link libifcorert.lib $LIBS /NODEFAULTLIB:libc.lib";;
    11391293     esac;;
     
    11531307]) # AC_COIN_F77_WRAPPERS
    11541308
     1309###########################################################################
     1310#                             COIN_FIND_F77                               #
     1311###########################################################################
     1312
     1313# Attempt to preempt autoconf by locating an appropriate F77 program. This
     1314# macro will not trigger a fatal error if a suitable compiler cannot be
     1315# found. It should be called before COIN_PROG_F77 or COIN_TRY_FLINK.
     1316
     1317AC_DEFUN([AC_COIN_FIND_F77],
     1318[AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     1319AC_REQUIRE([AC_COIN_F77_COMPS])
     1320AC_MSG_NOTICE([Trying to determine Fortran compiler name])
     1321AC_CHECK_PROGS([F77],[$coin_f77_comps],[unavailable])
     1322])
     1323
     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.
     1327AC_DEFUN([AC_COIN_F77_COMPS],
     1328[case $build in
     1329  *-cygwin* | *-mingw*)
     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" ;;
     1337  *) coin_f77_comps="xlf fort77 gfortran f77 g77 pgf90 pgf77 ifort ifc frt af77" ;;
     1338 esac
     1339])
    11551340
    11561341###########################################################################
     
    11741359AC_DEFUN([AC_COIN_INIT_AUTOMAKE],
    11751360[AC_REQUIRE([AC_PROG_EGREP])
     1361
     1362# AC_MSG_NOTICE([Beginning automake initialisation.])
    11761363# Stuff for automake
    11771364AM_INIT_AUTOMAKE
     
    11821369
    11831370  # 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
     1371  # of the tools are used, and that we know where libtool.m4 is (to
    11851372  # recreate acinclude.m4)
    11861373
    11871374  AC_SUBST(LIBTOOLM4)
    11881375  LIBTOOLM4=
    1189 
    1190   # Check if we have autoconf
    1191   AC_CHECK_PROG([have_autoconf],[autoconf],[yes],[no])
    1192   if test $have_autoconf = no; then
    1193     AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find autoconf in your path.])
    1194   fi
    1195 
    1196   # Check whether autoconf is the correct version
    1197   correct_version='2.59'
    1198   grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
    1199   AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of autoconf])
    1200   autoconf --version > confauto.out 2>&1
    1201   if $EGREP $grep_version confauto.out >/dev/null 2>&1; then
    1202     AC_MSG_RESULT([yes])
    1203   else
     1376  # Normally, $HOME
     1377  AUTOTOOLS_DFLT=$HOME
     1378
     1379  AC_CACHE_CHECK([whether we are using the correct autotools],
     1380                 [ac_cv_use_correct_autotools],
     1381                 [ac_cv_use_correct_autotools=check])
     1382
     1383  if test $ac_cv_use_correct_autotools = check; then
     1384    ac_cv_use_correct_autotools=yes
     1385    # Check if we have autoconf
     1386    AC_CHECK_PROG([have_autoconf],[autoconf],[yes],[no])
     1387    if test $have_autoconf = no; then
     1388      AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find autoconf in your path.])
     1389    fi
     1390
     1391    # Check whether autoconf is the correct version
     1392    correct_version='2.59'
     1393    grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
     1394    AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of autoconf])
     1395    autoconf --version > confauto.out 2>&1
     1396    if $EGREP $grep_version confauto.out >/dev/null 2>&1; then
     1397      AC_MSG_RESULT([yes])
     1398    else
     1399      rm -f confauto.out
     1400      AC_MSG_RESULT([no])
     1401      AC_MSG_ERROR([You don't have the correct version of autoconf as the first one in your path.])
     1402    fi
    12041403    rm -f confauto.out
    1205     AC_MSG_RESULT([no])
    1206     AC_MSG_ERROR([You don't have the correct version of autoconf as the first one in your path.])
    1207   fi
    1208   rm -f confauto.out
    1209 
    1210   # Check if the executable autoconf is picked up from the correct location
    1211   AC_MSG_CHECKING([whether autoconf is coming from the correct location])
    1212   autoconf_dir=`which autoconf | sed -e 's=/autoconf=='`
    1213   autoconf_dir=`cd $autoconf_dir; pwd`
    1214   if test x$AUTOTOOLS_DIR = x; then
    1215     want_dir=$HOME/bin
    1216   else
    1217     want_dir=$AUTOTOOLS_DIR/bin
    1218   fi
    1219   if test $autoconf_dir = `cd $want_dir; pwd`; then
    1220     AC_MSG_RESULT([yes])
    1221   else
     1404
     1405    # Check if the executable autoconf is picked up from the correct location
     1406    AC_MSG_CHECKING([whether autoconf is coming from the correct location])
     1407    autoconf_dir=`which autoconf | sed -e 's=/autoconf=='`
     1408    autoconf_dir=`cd $autoconf_dir; pwd`
     1409    if test x$AUTOTOOLS_DIR = x; then
     1410      want_dir=$AUTOTOOLS_DFLT/bin
     1411    else
     1412      want_dir=$AUTOTOOLS_DIR/bin
     1413    fi
     1414    if test $autoconf_dir = `cd $want_dir; pwd`; then
     1415      AC_MSG_RESULT([yes])
     1416    else
     1417      rm -f confauto.out
     1418      AC_MSG_RESULT([no])
     1419      AC_MSG_ERROR([The autoconf executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin.])
     1420    fi
     1421
     1422    # Check if we have automake
     1423    AC_CHECK_PROG([have_automake],[automake],[yes],[no])
     1424    if test $have_automake = no; then
     1425      AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find automake in your path.])
     1426    fi
     1427 
     1428    # Check whether automake is the correct version
     1429    correct_version='1.9.6'
     1430    grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
     1431    AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of automake])
     1432    automake --version > confauto.out 2>&1
     1433    if $EGREP $grep_version confauto.out >/dev/null 2>&1; then
     1434      AC_MSG_RESULT([yes])
     1435    else
     1436      rm -f confauto.out
     1437      AC_MSG_RESULT([no])
     1438      AC_MSG_ERROR([You don't have the correct version of automake as the first one in your path.])
     1439    fi
    12221440    rm -f confauto.out
    1223     AC_MSG_RESULT([no])
    1224     AC_MSG_ERROR([The autoconf executable should be picked up from \$HOME/bin or \$AUTOTOOLS_DIR/bin.])
    1225   fi
    1226 
    1227   # Check if we have automake
    1228   AC_CHECK_PROG([have_automake],[automake],[yes],[no])
    1229   if test $have_automake = no; then
    1230     AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find automake in your path.])
    1231   fi
    1232  
    1233   # Check whether automake is the correct version
    1234   correct_version='1.9.6'
    1235   grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
    1236   AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of automake])
    1237   automake --version > confauto.out 2>&1
    1238   if $EGREP $grep_version confauto.out >/dev/null 2>&1; then
    1239     AC_MSG_RESULT([yes])
    1240   else
    1241     rm -f confauto.out
    1242     AC_MSG_RESULT([no])
    1243     AC_MSG_ERROR([You don't have the correct version of automake as the first one in your path.])
    1244   fi
    1245   rm -f confauto.out
    1246 
    1247   # Check if the executable automake is picked up from the correct location
    1248   AC_MSG_CHECKING([whether automake is coming from the correct location])
    1249   automake_dir=`which automake | sed -e 's=/automake=='`
    1250   automake_dir=`cd $automake_dir; pwd`
    1251   if test x$AUTOTOOLS_DIR = x; then
    1252     want_dir=$HOME/bin
    1253   else
    1254     want_dir=$AUTOTOOLS_DIR/bin
    1255   fi
    1256   if test $automake_dir = `cd $want_dir; pwd`; then
    1257     AC_MSG_RESULT([yes])
    1258   else
    1259     rm -f confauto.out
    1260     AC_MSG_RESULT([no])
    1261     AC_MSG_ERROR([The automake executable should be picked up from \$HOME/bin or \$AUTOTOOLS_DIR/bin.])
     1441
     1442    # Check if the executable automake is picked up from the correct location
     1443    AC_MSG_CHECKING([whether automake is coming from the correct location])
     1444    automake_dir=`which automake | sed -e 's=/automake=='`
     1445    automake_dir=`cd $automake_dir; pwd`
     1446    if test x$AUTOTOOLS_DIR = x; then
     1447      want_dir=$AUTOTOOLS_DFLT/bin
     1448    else
     1449      want_dir=$AUTOTOOLS_DIR/bin
     1450    fi
     1451    if test $automake_dir = `cd $want_dir; pwd`; then
     1452      AC_MSG_RESULT([yes])
     1453    else
     1454      rm -f confauto.out
     1455      AC_MSG_RESULT([no])
     1456      AC_MSG_ERROR([The automake executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin.])
     1457    fi
     1458
     1459    # Check if this is the correct version of libtool (with escaped dots)
     1460    if test x$AUTOTOOLS_DIR = x; then
     1461      want_dir=$AUTOTOOLS_DFLT/share
     1462    else
     1463      want_dir=$AUTOTOOLS_DIR/share
     1464    fi
     1465    correct_version='1.5.22'
     1466    grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
     1467    AC_CHECK_FILE([$want_dir/libtool/ltmain.sh],
     1468                  [have_ltmain=yes],
     1469                  [have_ltmain=no])
     1470    AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of libtool.])
     1471    if test $have_ltmain = yes; then
     1472    if $EGREP $grep_version $want_dir/libtool/ltmain.sh >/dev/null 2>&1; then
     1473        AC_MSG_RESULT([yes])
     1474      else
     1475        AC_MSG_RESULT([no])
     1476        AC_MSG_ERROR([You don't have the correct version of libtool.])
     1477      fi
     1478    else
     1479      AC_MSG_RESULT([no])
     1480      AC_MSG_ERROR([I cannot find the ltmain.sh file.])
     1481    fi
    12621482  fi
    12631483
    12641484  # Check if we can find the libtool file
    12651485  if test x$AUTOTOOLS_DIR = x; then
    1266     want_dir=$HOME/share
     1486    want_dir=$AUTOTOOLS_DFLT/share
    12671487  else
    12681488    want_dir=$AUTOTOOLS_DIR/share
     
    12721492                [AC_MSG_ERROR([I cannot find the libtool.m4 file.])])
    12731493
    1274   # Check if this is the correct version of libtool (with escaped dots)
    1275   correct_version='1.5.22'
    1276   grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
    1277   AC_CHECK_FILE([$want_dir/libtool/ltmain.sh],
    1278                 [have_ltmain=yes],
    1279                 [have_ltmain=no])
    1280   AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of libtool.])
    1281   if test $have_ltmain = yes; then
    1282     if $EGREP $grep_version $want_dir/libtool/ltmain.sh >/dev/null 2>&1; then
    1283       AC_MSG_RESULT([yes])
    1284     else
    1285       AC_MSG_RESULT([no])
    1286       AC_MSG_ERROR([You don't have the correct version of libtool.])
    1287     fi
    1288   else
    1289     AC_MSG_RESULT([no])
    1290     AC_MSG_ERROR([I cannot find the ltmain.sh file.])
    1291   fi 
    1292 
    12931494  # Check if we have an Externals file
    12941495  if test -r $srcdir/Externals; then
     
    12981499  AC_CHECK_PROG([have_svn],[svn],[yes],[no])
    12991500  if test x$have_svn = xyes; then
    1300     AC_MSG_CHECKING([svn understands https])
    1301     svn --version > confauto.out 2>&1
    1302     if $EGREP https confauto.out >/dev/null 2>&1; then
    1303       AC_MSG_RESULT(yes)
    1304     else
    1305       AC_MSG_RESULT(no)
    1306       have_svn=no
    1307     fi
    1308     rm -f confauto.out
     1501    AC_CACHE_CHECK([whether svn understands https],
     1502                   [ac_cv_svn_understands_https],
     1503                   [svn --version > confauto.out 2>&1
     1504                    if $EGREP https confauto.out >/dev/null 2>&1; then
     1505                      ac_cv_svn_understands_https=yes
     1506                    else
     1507                      ac_cv_svn_understands_https=no
     1508                      have_svn=no
     1509                      ac_cv_prog_have_svn=no
     1510                    fi
     1511                    rm -f confauto.out])
    13091512  fi
    13101513
     
    13521555AM_CONDITIONAL(HAVE_EXTERNALS,
    13531556               test $coin_have_externals = yes && test x$have_svn = xyes)
     1557
     1558# AC_MSG_NOTICE([End automake initialisation.])
     1559
    13541560]) # AC_COIN_INIT_AUTOMAKE
     1561
     1562###########################################################################
     1563#                          COIN_CREATE_LIBTOOL                            #
     1564###########################################################################
     1565
     1566# This does all the tests necessary to create the libtool script in the
     1567# package base directory.  If this is used, then the COIN_INIT_AUTO_TOOLS
     1568# test in the subdirectories will be able to skip the libtool tests and
     1569# just use the one in the package base directory.
     1570
     1571m4_define([AC_COIN_CREATE_LIBTOOL],
     1572[AC_CANONICAL_BUILD
     1573
     1574# Check if user wants to produce debugging code
     1575AC_COIN_DEBUG_COMPILE
     1576
     1577# Get the name of the C compiler and appropriate compiler options
     1578AC_COIN_PROG_CC
     1579
     1580# Get the name of the C++ compiler and appropriate compiler options
     1581AC_COIN_PROG_CXX
     1582
     1583# Get the name of the Fortran compiler and appropriate compiler options
     1584AC_COIN_PROG_F77
     1585
     1586# Initialize automake and libtool
     1587# AC_MSG_NOTICE([Calling INIT_AUTO_TOOLS from CREATE_LIBTOOL.])
     1588AC_COIN_INIT_AUTO_TOOLS
     1589# AC_MSG_NOTICE([Finished INIT_AUTO_TOOLS from CREATE_LIBTOOL.])
     1590])
    13551591
    13561592###########################################################################
     
    13931629])
    13941630
    1395 AC_DEFUN([AC_COIN_INIT_AUTO_TOOLS],
    1396 [AC_BEFORE([AC_COIN_PROG_CXX],[$0])
     1631m4_define([AC_COIN_INIT_AUTO_TOOLS],
     1632[{AC_BEFORE([AC_COIN_PROG_CXX],[$0])
    13971633AC_BEFORE([AC_COIN_PROG_CC],[$0])
    13981634AC_BEFORE([AC_COIN_PROG_F77],[$0])
    1399 AC_REQUIRE([AC_COIN_DISABLE_STATIC])
     1635
     1636# START
     1637AC_COIN_DISABLE_STATIC
    14001638
    14011639# Initialize automake
    14021640AC_COIN_INIT_AUTOMAKE
    14031641
    1404 # Stuff for libtool
    1405 AC_COIN_PROG_LIBTOOL
    1406 
    1407 # set RPATH_FLAGS to the compiler link flags required to hardcode location
    1408 # of the shared objects
    1409 AC_COIN_RPATH_FLAGS($abs_lib_dir)
    1410 ]) # AC_COIN_INIT_AUTO_TOOLS
     1642unset ac_cv_file__________libtool
     1643unset ac_cv_file_______libtool
     1644unset ac_cv_file____libtool
     1645
     1646LIBTOOL=
     1647AC_CHECK_FILE([../libtool],
     1648              [coin_config_dir=..
     1649               LIBTOOL='$(SHELL) $(top_builddir)/../libtool'])
     1650if test "x$LIBTOOL" = x; then
     1651  AC_CHECK_FILE([../../libtool],
     1652                [coin_config_dir=../..
     1653                 LIBTOOL='$(SHELL) $(top_builddir)/../../libtool'])
     1654fi
     1655# if test "x$LIBTOOL" = x; then
     1656#   AC_CHECK_FILE([../../../libtool],
     1657#                 [coin_config_dir=../../..
     1658#                  LIBTOOL='$(SHELL) $(top_builddir)/../../../libtool'])
     1659# fi
     1660
     1661if test "x$LIBTOOL" = x; then
     1662# AC_MSG_NOTICE([Creating libtool script (calling COIN_PROG_LIBTOOL).])
     1663  # Stuff for libtool
     1664  AC_COIN_PROG_LIBTOOL
     1665# AC_MSG_NOTICE([Finished COIN_PROG_LIBTOOL.])
     1666  # set RPATH_FLAGS to the compiler link flags required to hardcode location
     1667  # of the shared objects
     1668  AC_COIN_RPATH_FLAGS($abs_lib_dir)
     1669
     1670else
     1671
     1672  AC_MSG_NOTICE([Using libtool script in directory $coin_config_dir])
     1673  # get all missing information from the config.log file
     1674
     1675  # output variables and defines
     1676  as_save_IFS=$IFS
     1677  IFS='
     1678'
     1679  for oneline in `cat $coin_config_dir/config.status`; do
     1680    case "$oneline" in
     1681         # First some automake conditionals
     1682      s,@am__fastdep* | s,@AR@* | s,@CPP@*  | s,@CPPFLAGS@* | s,@CXXCPP@*  | \
     1683      s,@RANLIB@* | s,@STRIP@* | s,@ac_ct_AR@* | s,@ac_ct_RANLIB@* | \
     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@* )
     1686        command=`echo $oneline | sed -e 's/^s,@//' -e 's/@,/="/' -e 's/,;t t/"/'`
     1687#        echo "$command"
     1688        eval "$command"
     1689        ;;
     1690      s,@DEFS@* )
     1691        command=`echo $oneline | sed -e 's/^s,@DEFS@,/defsline="/' -e 's/,;t t/"/'`
     1692#        echo "$command"
     1693        eval "$command"
     1694        ;;
     1695    esac
     1696  done
     1697  IFS=$as_save_IFS
     1698
     1699  # And some defines (assuming here that the packages base dir
     1700  # doesn't have a config.h file
     1701  for word in $defsline; do
     1702#    echo word $word
     1703    case $word in
     1704      -DHAVE_@<:@A-Z_@:>@*_H=1 | -DSTDC_HEADERS=1 )
     1705        i=`echo $word | sed -e 's/-D/#define /' -e 's/=/ /'`
     1706#        echo dd $i
     1707        echo $i >>confdefs.h
     1708        ;;
     1709    esac
     1710  done
     1711fi
     1712
     1713# AC_MSG_NOTICE([End of INIT_AUTO_TOOLS.])
     1714
     1715# ToDo
     1716# For now, don't use the -no-undefined flag, since the Makefiles are
     1717# not yet set up that way.  But we need to fix this, when we want
     1718# to comile DLLs under Windows.
     1719LT_LDFLAGS=
     1720AC_SUBST(LT_LDFLAGS)
     1721
     1722#END
     1723}])
     1724
    14111725
    14121726###########################################################################
     
    14171731# work on additional platforms
    14181732
     1733AC_DEFUN([AC_COIN_LIBTOOL_WRAPPER],
     1734[AC_BEFORE([AC_COIN_BLA],[$0])
     1735AC_PROG_LIBTOOL])
     1736
     1737AC_DEFUN([AC_COIN_BLA],[echo bla])
     1738
    14191739AC_DEFUN([AC_COIN_PROG_LIBTOOL],
    1420 [AC_REQUIRE([AC_COIN_DLFCN_H])
    1421 
    1422 # We check for this header here in a non-standard way to avoid warning
    1423 # messages
    1424 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)
    14251759
    14261760# Fix bugs in libtool script for Windows native compilation:
     
    14421776#          -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' \
    14431777
    1444 # Correct cygpath for minGW (ToDo!)
    1445 case $build in
    1446   *-mingw*)
    1447     CYGPATH_W=echo
    1448     ;;
    1449 esac
    1450 
    1451 case $build in
    1452   *-cygwin* | *-mingw*)
    1453   case "$CXX" in
    1454     cl* | */cl* | CL* | */CL*)
    1455       AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
    1456       sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1457           -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1458           -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
    1459           -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
    1460           -e 's%lib /OUT:%lib -OUT:%' \
    1461           -e "s%cygpath -w%$CYGPATH_W%" \
    1462           -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%' \
    1463           -e 's/$AR t/lib -nologo -list/' \
    1464           -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
    1465           -e  's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
    1466       libtool > conftest.bla
    1467 
    1468       mv conftest.bla libtool
    1469       chmod 755 libtool
    1470       ;;
    1471     *)
    1472       AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
    1473       sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1474           -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
    1475           -e 's|libext="lib"|libext="a"|' \
    1476       libtool > conftest.bla
    1477 
    1478       mv conftest.bla libtool
    1479       chmod 755 libtool
     1778  # Correct cygpath for minGW (ToDo!)
     1779  AC_MSG_NOTICE([Build is "$build".])
     1780  case $build in
     1781    *-mingw*)
     1782      CYGPATH_W=echo
    14801783      ;;
    14811784  esac
    1482 esac
    1483 
    1484 # ToDo
    1485 # For now, don't use the -no-undefined flag, since the Makefiles are
    1486 # not yet set up that way.  But we need to fix this, when we want
    1487 # to comile DLLs under Windows.
    1488 LT_LDFLAGS=
    1489 AC_SUBST(LT_LDFLAGS)
     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.])
    14901823]) # AC_COIN_PROG_LIBTOOL
    14911824
    14921825# This is a trick to force the check for the dlfcn header to be done before
    14931826# the checks for libtool
    1494 AC_DEFUN([AC_COIN_DLFCN_H],
    1495 [AC_LANG_PUSH(C)
    1496 AC_COIN_CHECK_HEADER([dlfcn.h])
    1497 AC_LANG_POP(C)
    1498 ]) # 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
    14991833
    15001834###########################################################################
     
    15671901AC_SUBST(LIBEXT)
    15681902case "$CC" in
    1569   cl* | */cl* | CL* | */CL*) LIBEXT=lib ;;
     1903  cl* | */cl* | CL* | */CL*)
     1904       LIBEXT=lib ;;
    15701905    *) LIBEXT=a ;;
    15711906esac
     
    18122147if test $coin_vpath_config = yes; then
    18132148  lnkcmd=
    1814   if test "$enable_doscompile" = yes; then
     2149  if test "$enable_doscompile" != no; then
    18152150    lnkcmd=cp
    18162151  fi
     
    19722307                    LIBS="$$2LIB $ADDLIBS"
    19732308                    AC_MSG_CHECKING([whether symbol $4 is available with $2])
     2309                    AC_LANG_PUSH(C)
    19742310# ToDo find out what to do about extern "C"
    19752311#                    AC_TRY_LINK([extern "C" {void $4();}],[$4()],
     
    19782314                                [AC_MSG_RESULT(no)
    19792315                                 AC_MSG_ERROR([Cannot find symbol $4 with $2])])
     2316                    AC_LANG_POP(C)
    19802317                    LIBS="$coin_save_LIBS"
    19812318                  fi])
     
    20522389
    20532390if test "$use_asldir" != no; then
     2391  AC_LANG_PUSH(C)
    20542392  AC_CHECK_LIB(dl,[dlopen],[ASLLIB="$ASLLIB -ldl"],[])
    20552393  coin_has_asl=yes
    20562394  AC_DEFINE([COIN_HAS_ASL],[1],
    20572395            [If defined, the Ampl Solver Library is available.])
     2396  AC_LANG_POP(C)
    20582397else
    20592398  coin_has_asl=no
     
    20762415[case $ac_ext in
    20772416  f)
    2078     AC_TRY_LINK([],[      call $1],[$2],[$3])
     2417    AC_TRY_LINK(,[      call $1],[$2],[$3])
    20792418    ;;
    20802419  c)
     
    21032442    fi
    21042443    ;;
    2105   cc)
     2444  cc|cpp)
    21062445    AC_F77_FUNC($1,cfunc$1)
    21072446    if test x"$coin_need_flibs" = xyes; then
     
    21362475
    21372476# This macro checks for a library containing the BLAS library.  It
    2138 # tried standard libraries, and if none is found to be working, it
     2477# tries standard libraries, and if none is found to be working, it
    21392478# checks whether the BLAS ThirdParty/Blas directory has been configured.
    21402479# It adds to ADDLIBS any flags required to link with an externally provided
     
    21572496    AC_CHECK_FILE([$coin_blasobjdir/Makefile],[],
    21582497                  [AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not configured])])
    2159   else
     2498  elif test "$use_blas" != no ; then
    21602499    AC_MSG_CHECKING([whether user supplied BLASLIB=\"$use_blas\" works])
    21612500    LIBS="$use_blas $LIBS"
     
    21682507else
    21692508# Try to autodetect the library for blas based on build system
     2509  AC_MSG_CHECKING([default locations for BLAS])
    21702510  case $build in
    21712511    *-sgi-*)
     
    21912531                         LIBS="$SAVE_LIBS"])
    21922532      ;;
    2193   esac
    2194   # On cygwin, if enable_doscompile is used, recompile blas because it
    2195   # otherwise links with the cygwin blas which doesn't run under DOS
    2196   if test "$enable_doscompile" != yes; then
    2197     if test -z "$use_blas"; then
    2198       SAVE_LIBS="$LIBS"
    2199       AC_MSG_CHECKING([whether -lblas has BLAS])
    2200       LIBS="-lblas $LIBS"
    2201       AC_COIN_TRY_FLINK([daxpy],
    2202                         [AC_MSG_RESULT([yes])
    2203                          ADDLIBS="-lblas $ADDLIBS"
    2204                          use_blas='-lblas'],
    2205                         [AC_MSG_RESULT([no])
    2206                          LIBS="$SAVE_LIBS"])
    2207     fi
    2208   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.
    22092553  if test -z "$use_blas"; then
     2554    AC_MSG_CHECKING([if BLAS can be built.])
    22102555    AC_CHECK_FILE([$coin_blasobjdir/Makefile],[use_blas=BUILD])
    22112556  fi
     2557fi
     2558
     2559if test "$use_blas" = BUILD; then
     2560  coin_need_flibs=yes
    22122561fi
    22132562
     
    22152564AM_CONDITIONAL([COIN_BUILD_BLAS],[test "$use_blas" = BUILD])
    22162565
    2217 if test x"$use_blas" = x; then
     2566if test x"$use_blas" = x || test "$use_blas" = no; then
    22182567  coin_has_blas=no
    22192568else
     
    22292578
    22302579# This macro checks for a library containing the LAPACK library.  It
    2231 # tried standard libraries, and if none is found to be working, it
     2580# tries standard libraries, and if none is found to be working, it
    22322581# checks whether the LAPACK ThirdParty/Lapack directory has been
    22332582# configured.  It adds to ADDLIBS any flags required to link with an
     
    22502599  if test "$use_lapack" = "BUILD"; then
    22512600    AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[],
    2252                   [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])])
    22532602  else
    22542603    AC_MSG_CHECKING([whether user supplied LAPACKLIB=\"$use_lapack\" works])
     
    22932642                           LIBS="$SAVE_LIBS"])
    22942643        ;;
     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        ;;
    22952661    esac
    22962662  fi
    2297   # On cygwin, if enable_doscompile is used, recompile lapack because it
    2298   # otherwise links with the cygwin lapack which doesn't run under DOS
    2299   if test "$enable_doscompile" != yes; then
    2300     if test -z "$use_lapack"; then
    2301       SAVE_LIBS="$LIBS"
    2302       AC_MSG_CHECKING([whether -llapack has LAPACK])
    2303       LIBS="-llapack $LIBS"
    2304       AC_COIN_TRY_FLINK([dsyev],
    2305                         [AC_MSG_RESULT([yes])
    2306                          ADDLIBS="-llapack $ADDLIBS"
    2307                          use_lapack='-llapack'],
    2308                         [AC_MSG_RESULT([no])
    2309                          LIBS="$SAVE_LIBS"])
    2310     fi
    2311   fi
     2663# If we have no other ideas, consider building LAPACK.
    23122664  if test -z "$use_lapack"; then
    23132665    AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[use_lapack=BUILD])
    23142666  fi
     2667fi
     2668
     2669if test "$use_lapack" = BUILD; then
     2670  coin_need_flibs=yes
    23152671fi
    23162672
  • stable/0.5/run_autotools

    r96 r215  
    5050fi
    5151
     52# Find directories which contain a file configure.ac. When all is said and
     53# done, each entry in dirs will be of the form `./path/to/directory'
     54
    5255if test $# != 0; then
    5356  dirs="$*"
     
    5861    if test -r $dir/configure.ac; then
    5962      dirs="$dirs $dir"
     63    else
     64      echo "$dir/configure.ac doesn't appear to be a regular file; skipping."
    6065    fi
    6166  done
    6267fi
     68
     69# Now compare against the skip entries in COIN_SKIP_PROJECTS. To match the
     70# entries we just collected, add `./' to the front of each skip entry.
     71
     72pos_dirs=$dirs
     73if test x${COIN_SKIP_PROJECTS+set} = xset ; then
     74  dirs=
     75  for dir in $COIN_SKIP_PROJECTS ; do
     76    skip_dirs="$skip_dirs ./$dir"
     77  done
     78  for dir in $pos_dirs ; do
     79    skip=0
     80    for skipdir in $skip_dirs ; do
     81      if test $dir = $skipdir ; then
     82        skip=1
     83        break
     84      fi
     85    done
     86    if test $skip = 0 ; then
     87      dirs="$dirs $dir"
     88    else
     89      echo "$dir listed in COIN_SKIP_PROJECTS; skipping."
     90    fi
     91  done
     92fi
     93
    6394echo Running autotools in $dirs
    6495
Note: See TracChangeset for help on using the changeset viewer.