Changeset 2962


Ignore:
Timestamp:
Sep 17, 2013 5:13:58 AM (6 years ago)
Author:
stefan
Message:

remove --enable-doscompile=mingw

-mno-cygwin does not work on current cygwin systems anymore

introduced option --enable-msvc to replace --enable-doscompile=msvc, but
the latter can still be used, too

effect of --enable-msvc is to

  • reorder compiler preference to prefer Intel/MS compiler over GNU
  • ensure that LD is set to link
  • ensure that cp is used for linking (probably happened anyway)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r2880 r2962  
    230230
    231231AC_DEFUN([AC_COIN_MINGW_LD_FIX],
    232 [case $build in
     232[AC_REQUIRE([AC_COIN_ENABLE_MSVC])
     233 case $build in
    233234  *-mingw*)
    234235    if test "${LD+set}" = set; then :; else
     
    237238    ;;
    238239 esac
    239  case $enable_doscompile in
    240    msvc)
    241      if test "x${LD+set}" = xset; then :; else
    242        LD=link
    243      fi
    244      ;;
    245  esac
     240 if test $enable_msvc = yes ; then
     241   if test "x${LD+set}" = xset; then :; else
     242     LD=link
     243   fi
     244 fi
    246245])
    247246
    248247###########################################################################
    249 #                        COIN_ENABLE_DOSCOMPILE                           #
     248#                          COIN_ENABLE_MSVC                               #
    250249###########################################################################
    251250
    252251# This macro is invoked by any PROG_compiler macro to establish the
    253 # --enable-doscompile option, used when one wants to compile an executable
    254 # under Cygwin which also runs directly under DOS (without requiring
    255 # Cygwin1.dll). The job of this macro is to make sure the option is correct and
    256 # to set enable_doscompile. Legal values are mingw, msvc, and no (disabled).
    257 # mingw: Fake mingw under cygwin, using GCC tools and -mno-cygwin. The most
    258 #        important thing here is that preprocess, compile, and link steps
    259 #        *all* see -mno-cygwin.
    260 # msvc:  Assume the presence of cl/link. It's the user's responsibility to
    261 #        make sure their PATH is correct. In particular, that MSVC link is
    262 #        found and not cygwin link (we want to do code linking, not file
    263 #        linking).
     252# --enable-msvc option.
     253# The job of this macro is to make sure the option is correct and
     254# to set enable_msvc. Legal values are yes and no (disabled).
     255# If set, assume the presence of cl/link. It's the user's responsibility to
     256# make sure their PATH is correct. In particular, that MSVC link is found
     257# and not cygwin link (we want to do code linking, not file linking).
    264258# It's the responsibility of individual PROG_compiler macros to ensure that
    265259# they correctly set the compiler search list and preprocess, compile, and
    266260# link flags. This is tied to compiler setup because in practice invocations
    267261# of the preprocessor and linker are made through the compiler.
    268 
    269 AC_DEFUN([AC_COIN_ENABLE_DOSCOMPILE],
     262# For backward compatibility, we also check for --enable-doscompile=msvc.
     263
     264AC_DEFUN([AC_COIN_ENABLE_MSVC],
    270265[AC_REQUIRE([AC_CANONICAL_BUILD])
    271  AC_ARG_ENABLE([doscompile],
    272   [AC_HELP_STRING([--enable-doscompile],
    273                   [Under Cygwin, compile so that executables run under DOS.
    274                    Set to mingw to use gcc/g++/ld with -mno-cygwin.
    275                    Set to msvc to use cl/link (or icl/link).
    276                    Default when mentioned: mingw.
    277                    Default when not mentioned: disabled.])],
    278   [if test "$enable_doscompile" != no; then
    279      case $build in
    280        *-cygwin* | *-mingw*) ;;
    281        *) AC_MSG_ERROR([--enable-doscompile option makes sense only under Cygwin or MinGW]) ;;
    282      esac
    283    fi],
    284   [enable_doscompile=no])
    285  case "$enable_doscompile" in
    286    mingw)
    287      case $build in
    288        *-mingw*) enable_doscompile=no ;;
    289      esac
    290      ;;
    291    msvc|no) ;;
    292    yes) enable_doscompile=mingw ;;
    293    *) AC_MSG_ERROR([Invalid value $enable_doscompile for --enable-doscompile.
    294                     Try configure --help=recursive.])
    295       ;;
    296   esac
    297   if test "$enable_doscompile" != no ; then
    298     AC_MSG_NOTICE([DOS compile style is: $enable_doscompile])
     266
     267  enable_msvc=no
     268 
     269  AC_ARG_ENABLE([msvc],
     270    [AC_HELP_STRING([--enable-msvc],
     271                    [Prefer (i)cl/ifort/link over GNU on MinGW/Cygwin.])],
     272    [],
     273    [AC_ARG_ENABLE([doscompile],[],
     274       [if test "$enable_doscompile" = msvc ; then
     275          enable_msvc=yes
     276        elif test "$enable_doscompile" != no ; then
     277          AC_MSG_ERROR([--enable-doscompile=$enable_doscompile not supported anymore.])
     278        fi
     279       ])
     280    ])
     281
     282  if test "$enable_msvc" = yes; then
     283    case $build in
     284      *-cygwin* | *-mingw*) ;;
     285      *) AC_MSG_ERROR([--enable-msvc option makes sense only under Cygwin or MinGW]) ;;
     286    esac
    299287  fi
    300288])
     
    313301AC_DEFUN([AC_COIN_PROG_CXX],
    314302[AC_REQUIRE([AC_COIN_PROG_CC]) #Let's try if that overcomes configuration problem with VC++ 6.0
    315 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     303AC_REQUIRE([AC_COIN_ENABLE_MSVC])
    316304AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS])
    317305AC_LANG_PUSH(C++)
     
    328316case $build in
    329317  *-cygwin* | *-mingw*)
    330              if test "$enable_doscompile" = msvc ; then
    331                comps="icl cl"
    332              else
    333                comps="g++ cl"
    334              fi ;;
     318      if test "$enable_msvc" = yes ; then
     319         comps="icl cl g++"
     320      else
     321         comps="g++ icl cl"
     322      fi ;;
    335323  *-*-solaris*)
    336324             comps="CC xlC_r aCC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;;
     
    419407            coin_warn_cxxflags="-pedantic-errors $coin_warn_cxxflags"
    420408            ;;
    421         esac
    422 
    423         case $enable_doscompile in
    424           mingw)
    425             CXXFLAGS="-mno-cygwin"
    426             AC_TRY_LINK(,[int i=0; i++;],[coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])
    427             CXXFLAGS=
    428           ;;
    429409        esac
    430410    esac
     
    800780AC_DEFUN([AC_COIN_PROG_CC],
    801781[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
    802 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     782AC_REQUIRE([AC_COIN_ENABLE_MSVC])
    803783AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS])
    804784AC_LANG_PUSH(C)
     
    834814case $build in
    835815  *-cygwin* | *-mingw*)
    836              if test "$enable_doscompile" = msvc ; then
    837                comps="icl cl"
     816             if test "$enable_msvc" = yes ; then
     817               comps="icl cl gcc"
    838818             else
    839                comps="gcc cl"
     819               comps="gcc icl cl"
    840820             fi ;;
    841821  *-*-solaris*)
     
    915895            ;;
    916896        esac
    917         case $enable_doscompile in
    918           mingw)
    919             CFLAGS="-mno-cygwin"
    920             AC_TRY_LINK([],[int i=0; i++;],
    921                         [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
    922             CFLAGS=
    923           ;;
    924         esac
    925897    esac
    926898  fi
     
    11281100AC_DEFUN([AC_COIN_PROG_F77],
    11291101[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
    1130 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     1102AC_REQUIRE([AC_COIN_ENABLE_MSVC])
    11311103AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS])
    11321104AC_REQUIRE([AC_COIN_PROG_CC])
     
    11801152    coin_add_fflags="-pipe"
    11811153    coin_dbg_fflags="-g -O0"
    1182     case $enable_doscompile in
    1183       mingw)
    1184         FFLAGS="-mno-cygwin"
    1185         AC_TRY_LINK(,[      write(*,*) 'Hello world'],
    1186                     [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
    1187         FFLAGS=
    1188       ;;
    1189     esac
    11901154  else
    11911155    case $build in
     
    14691433
    14701434AC_DEFUN([AC_COIN_FIND_F77],
    1471 [AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     1435[AC_REQUIRE([AC_COIN_ENABLE_MSVC])
    14721436AC_REQUIRE([AC_COIN_F77_COMPS])
    14731437AC_MSG_NOTICE([Trying to determine Fortran compiler name])
     
    14811445[case $build in
    14821446  *-cygwin* | *-mingw*)
    1483      if test "$enable_doscompile" = msvc ; then
    1484        coin_f77_comps="ifort fl32 compile_f2c"
     1447     if test "$enable_msvc" = yes ; then
     1448       coin_f77_comps="ifort fl32 compile_f2c gfortran g95 g77"
    14851449     else
    14861450       coin_f77_comps="gfortran ifort g95 g77 fl32 compile_f2c"
     
    21462110[AC_REQUIRE([AC_PROG_LN_S])
    21472111AC_BEFORE([AC_COIN_PROG_CC], [$0])
    2148 AC_BEFORE([AC_COIN_ENABLE_DOSCOMPILE], [$0])
     2112AC_BEFORE([AC_COIN_ENABLE_MSVC], [$0])
    21492113
    21502114AC_MSG_CHECKING([which command should be used to link input files])
    21512115coin_link_input_cmd="$LN_S"
    2152 if test "$enable_doscompile" = mingw; then
    2153   coin_link_input_cmd=cp
    2154 fi
    21552116case "$CC" in
    21562117  clang* ) ;;
     
    28152776AC_DEFUN([AC_COIN_EXAMPLE_FILES],
    28162777[AC_REQUIRE([AC_COIN_CHECK_VPATH])
    2817 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
     2778AC_REQUIRE([AC_COIN_ENABLE_MSVC])
    28182779AC_REQUIRE([AC_PROG_LN_S])
    28192780
     
    28262787if test $coin_vpath_config = yes; then
    28272788  lnkcmd=
    2828   if test "$enable_doscompile" != no; then
     2789  if test "$enable_msvc" = yes; then
    28292790    lnkcmd=cp
    28302791  fi
     
    41054066# Try to autodetect the library for blas based on build system
    41064067  #AC_MSG_CHECKING([default locations for BLAS])
    4107   skip_lblas_check=no
    41084068  case $build in
    41094069    *-sgi-*)
     
    41464106     
    41474107    *-cygwin* | *-mingw*)
    4148 # On cygwin, consider -lblas only if doscompile is disabled. The prebuilt
    4149 # library will want to link with cygwin, hence won't run standalone in DOS.
    4150       if test "$enable_doscompile" = mingw; then
    4151         skip_lblas_check=yes
    4152       fi
    41534108      case "$CC" in
    41544109        clang* ) ;;
     
    41954150  esac
    41964151
    4197   if test -z "$use_blas" && test $skip_lblas_check = no; then
     4152  if test -z "$use_blas" ; then
    41984153    AC_MSG_CHECKING([whether -lblas has BLAS])
    41994154    coin_need_flibs=no
     
    43204275    LIBS="$coin_save_LIBS"
    43214276  fi
    4322   skip_llapack_check=no
    43234277  if test -z "$use_lapack"; then
    43244278    # Try to autodetect the library for lapack based on build system
     
    43624316        # On cygwin, do this check only if doscompile is disabled. The prebuilt library
    43634317        # will want to link with cygwin, hence won't run standalone in DOS.
    4364        
    4365       *-cygwin*)
    4366         if test "$enable_doscompile" = mingw; then
    4367           skip_llapack_check=yes
    4368         fi
    4369         ;;
    4370        
    43714318    esac
    43724319  fi
    43734320
    4374   if test -z "$use_lapack" && test $skip_llapack_check = no; then
     4321  if test -z "$use_lapack" ; then
    43754322    AC_MSG_CHECKING([whether -llapack has LAPACK])
    43764323    coin_need_flibs=no
Note: See TracChangeset for help on using the changeset viewer.