Changeset 117


Ignore:
Timestamp:
Oct 18, 2006 12:16:16 AM (13 years ago)
Author:
andreasw
Message:

bugfix for BuildTools? tickets #16 and #26

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/0.5/coin.m4

    r97 r117  
    386386
    387387###########################################################################
     388#                        COIN_ENABLE_DOSCOMPILE                           #
     389###########################################################################
     390
     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.
     396
     397AC_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]) ;;
     405  esac
     406fi],
     407[enable_doscompile=no])
     408])
     409
     410###########################################################################
    388411#                             COIN_PROG_CXX                               #
    389412###########################################################################
     
    396419AC_DEFUN([AC_COIN_PROG_CXX],
    397420[AC_REQUIRE([AC_COIN_PROG_CC]) #Let's try if that overcomes configuration problem with VC++ 6.0
     421AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    398422AC_LANG_PUSH(C++)
    399423
     
    445469        coin_dbg_cxxflags="-g"
    446470        coin_warn_cxxflags="-pedantic-errors -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion"
    447 
    448         case $build in
    449           *-cygwin*)
    450             CXXFLAGS="-mno-cygwin"
    451             AC_TRY_LINK([],[int i=0; i++;],
    452                         [coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])
    453             CXXFLAGS=
    454             ;;
    455         esac
    456         ;;
     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
    457481    esac
    458482  fi
     
    688712AC_DEFUN([AC_COIN_PROG_CC],
    689713[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
     714AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    690715AC_LANG_PUSH(C)
    691716
     
    748773        coin_dbg_cflags="-g"
    749774        coin_warn_cflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall"
    750 
    751         case $build in
    752           *-cygwin*)
    753             CFLAGS="-mno-cygwin"
    754             AC_TRY_LINK([],[int i=0; i++;],
    755                         [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
    756             CFLAGS=
    757           ;;
    758         esac
    759         ;;
     775        if test "$enable_doscompile" = yes; then
     776          case $build in
     777            *-cygwin*)
     778              CFLAGS="-mno-cygwin"
     779              AC_TRY_LINK([],[int i=0; i++;],
     780                          [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
     781              CFLAGS=
     782            ;;
     783          esac
     784        fi
    760785    esac
    761786  fi
     
    896921AC_DEFUN([AC_COIN_PROG_F77],
    897922[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
     923AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
    898924AC_LANG_PUSH([Fortran 77])
    899925
     
    936962    coin_add_fflags="-pipe"
    937963    coin_dbg_fflags="-g"
    938     case $build in
    939       *-cygwin*)
    940         FFLAGS="-mno-cygwin"
    941         AC_TRY_LINK([],[      write(*,*) 'Hello world'],
    942                     [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
    943         FFLAGS=
    944       ;;
    945     esac
     964    if test "$enable_doscompile" = yes; then
     965      case $build in
     966        *-cygwin*)
     967          FFLAGS="-mno-cygwin"
     968          AC_TRY_LINK([],[      write(*,*) 'Hello world'],
     969                      [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
     970          FFLAGS=
     971        ;;
     972      esac
     973    fi
    946974  else
    947975    case $build in
     
    17491777done
    17501778if test $coin_vpath_config = yes; then
    1751   AC_PROG_LN_S
    1752   AC_MSG_NOTICE([Creating links to the example files ($1)])
     1779  if test "$enable_doscompile" = yes; then
     1780    lnkcmd=cp
     1781    AC_MSG_NOTICE([Copying example files ($1)])
     1782  else
     1783    AC_PROG_LN_S
     1784    AC_MSG_NOTICE([Creating links to the example files ($1)])
     1785    lnkcmd="$LN_S"
     1786  fi
    17531787  for file in $EXAMPLE_FILES; do
    17541788    rm -f $file
    1755     $LN_S $srcdir/$file $file
     1789    $lnkcmd $srcdir/$file $file
    17561790  done
    17571791  EXAMPLE_CLEAN_FILES='$1'
     
    21172151      ;;
    21182152  esac
    2119   # On cygwin, unless otherwise specified, recompile blas because it
     2153  # On cygwin, if enable_doscompile is used, recompile blas because it
    21202154  # otherwise links with the cygwin blas which doesn't run under DOS
    2121   case $build in
    2122     *-cygwin*) ;;
    2123     *)
    2124       if test -z "$use_blas"; then
    2125         SAVE_LIBS="$LIBS"
    2126         AC_MSG_CHECKING([whether -lblas has BLAS])
    2127         LIBS="-lblas $LIBS"
    2128         AC_COIN_TRY_FLINK([daxpy],
    2129                           [AC_MSG_RESULT([yes])
    2130                            ADDLIBS="-lblas $ADDLIBS"
    2131                            use_blas='-lblas'],
    2132                           [AC_MSG_RESULT([no])
    2133                            LIBS="$SAVE_LIBS"])
    2134       fi
    2135       ;;
    2136   esac
     2155  if test "$enable_doscompile" != yes; then
     2156    if test -z "$use_blas"; then
     2157      SAVE_LIBS="$LIBS"
     2158      AC_MSG_CHECKING([whether -lblas has BLAS])
     2159      LIBS="-lblas $LIBS"
     2160      AC_COIN_TRY_FLINK([daxpy],
     2161                        [AC_MSG_RESULT([yes])
     2162                         ADDLIBS="-lblas $ADDLIBS"
     2163                         use_blas='-lblas'],
     2164                        [AC_MSG_RESULT([no])
     2165                         LIBS="$SAVE_LIBS"])
     2166    fi
     2167  fi
    21372168  if test -z "$use_blas"; then
    21382169    AC_CHECK_FILE([$coin_blasobjdir/Makefile],[use_blas=BUILD])
     
    22232254    esac
    22242255  fi
    2225   # On cygwin, unless otherwise specified, recompile lapack because it
     2256  # On cygwin, if enable_doscompile is used, recompile lapack because it
    22262257  # otherwise links with the cygwin lapack which doesn't run under DOS
    2227   case $build in
    2228     *-cygwin*) ;;
    2229     *)
    2230       if test -z "$use_lapack"; then
    2231         SAVE_LIBS="$LIBS"
    2232         AC_MSG_CHECKING([whether -llapack has LAPACK])
    2233         LIBS="-llapack $LIBS"
    2234         AC_COIN_TRY_FLINK([dsyev],
    2235                           [AC_MSG_RESULT([yes])
    2236                            ADDLIBS="-llapack $ADDLIBS"
    2237                            use_lapack='-llapack'],
    2238                           [AC_MSG_RESULT([no])
    2239                            LIBS="$SAVE_LIBS"])
    2240       fi
    2241       ;;
    2242   esac
     2258  if test "$enable_doscompile" != yes; then
     2259    if test -z "$use_lapack"; then
     2260      SAVE_LIBS="$LIBS"
     2261      AC_MSG_CHECKING([whether -llapack has LAPACK])
     2262      LIBS="-llapack $LIBS"
     2263      AC_COIN_TRY_FLINK([dsyev],
     2264                        [AC_MSG_RESULT([yes])
     2265                         ADDLIBS="-llapack $ADDLIBS"
     2266                         use_lapack='-llapack'],
     2267                        [AC_MSG_RESULT([no])
     2268                         LIBS="$SAVE_LIBS"])
     2269    fi
     2270  fi
    22432271  if test -z "$use_lapack"; then
    22442272    AC_CHECK_FILE([$coin_lapackobjdir/Makefile],[use_lapack=BUILD])
Note: See TracChangeset for help on using the changeset viewer.