Changeset 2962 for trunk/coin.m4
- Timestamp:
- Sep 17, 2013 5:13:58 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/coin.m4
r2880 r2962 230 230 231 231 AC_DEFUN([AC_COIN_MINGW_LD_FIX], 232 [case $build in 232 [AC_REQUIRE([AC_COIN_ENABLE_MSVC]) 233 case $build in 233 234 *-mingw*) 234 235 if test "${LD+set}" = set; then :; else … … 237 238 ;; 238 239 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 246 245 ]) 247 246 248 247 ########################################################################### 249 # COIN_ENABLE_DOSCOMPILE #248 # COIN_ENABLE_MSVC # 250 249 ########################################################################### 251 250 252 251 # 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). 264 258 # It's the responsibility of individual PROG_compiler macros to ensure that 265 259 # they correctly set the compiler search list and preprocess, compile, and 266 260 # link flags. This is tied to compiler setup because in practice invocations 267 261 # 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 264 AC_DEFUN([AC_COIN_ENABLE_MSVC], 270 265 [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 299 287 fi 300 288 ]) … … 313 301 AC_DEFUN([AC_COIN_PROG_CXX], 314 302 [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])303 AC_REQUIRE([AC_COIN_ENABLE_MSVC]) 316 304 AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS]) 317 305 AC_LANG_PUSH(C++) … … 328 316 case $build in 329 317 *-cygwin* | *-mingw*) 330 if test "$enable_doscompile" = msvc; then331 comps="icl cl"332 333 comps="g++cl"334 318 if test "$enable_msvc" = yes ; then 319 comps="icl cl g++" 320 else 321 comps="g++ icl cl" 322 fi ;; 335 323 *-*-solaris*) 336 324 comps="CC xlC_r aCC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;; … … 419 407 coin_warn_cxxflags="-pedantic-errors $coin_warn_cxxflags" 420 408 ;; 421 esac422 423 case $enable_doscompile in424 mingw)425 CXXFLAGS="-mno-cygwin"426 AC_TRY_LINK(,[int i=0; i++;],[coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])427 CXXFLAGS=428 ;;429 409 esac 430 410 esac … … 800 780 AC_DEFUN([AC_COIN_PROG_CC], 801 781 [AC_REQUIRE([AC_COIN_MINGW_LD_FIX]) 802 AC_REQUIRE([AC_COIN_ENABLE_ DOSCOMPILE])782 AC_REQUIRE([AC_COIN_ENABLE_MSVC]) 803 783 AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS]) 804 784 AC_LANG_PUSH(C) … … 834 814 case $build in 835 815 *-cygwin* | *-mingw*) 836 if test "$enable_ doscompile" = msvc; then837 comps="icl cl "816 if test "$enable_msvc" = yes ; then 817 comps="icl cl gcc" 838 818 else 839 comps="gcc cl"819 comps="gcc icl cl" 840 820 fi ;; 841 821 *-*-solaris*) … … 915 895 ;; 916 896 esac 917 case $enable_doscompile in918 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 esac925 897 esac 926 898 fi … … 1128 1100 AC_DEFUN([AC_COIN_PROG_F77], 1129 1101 [AC_REQUIRE([AC_COIN_MINGW_LD_FIX]) 1130 AC_REQUIRE([AC_COIN_ENABLE_ DOSCOMPILE])1102 AC_REQUIRE([AC_COIN_ENABLE_MSVC]) 1131 1103 AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS]) 1132 1104 AC_REQUIRE([AC_COIN_PROG_CC]) … … 1180 1152 coin_add_fflags="-pipe" 1181 1153 coin_dbg_fflags="-g -O0" 1182 case $enable_doscompile in1183 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 esac1190 1154 else 1191 1155 case $build in … … 1469 1433 1470 1434 AC_DEFUN([AC_COIN_FIND_F77], 1471 [AC_REQUIRE([AC_COIN_ENABLE_ DOSCOMPILE])1435 [AC_REQUIRE([AC_COIN_ENABLE_MSVC]) 1472 1436 AC_REQUIRE([AC_COIN_F77_COMPS]) 1473 1437 AC_MSG_NOTICE([Trying to determine Fortran compiler name]) … … 1481 1445 [case $build in 1482 1446 *-cygwin* | *-mingw*) 1483 if test "$enable_ doscompile" = msvc; then1484 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" 1485 1449 else 1486 1450 coin_f77_comps="gfortran ifort g95 g77 fl32 compile_f2c" … … 2146 2110 [AC_REQUIRE([AC_PROG_LN_S]) 2147 2111 AC_BEFORE([AC_COIN_PROG_CC], [$0]) 2148 AC_BEFORE([AC_COIN_ENABLE_ DOSCOMPILE], [$0])2112 AC_BEFORE([AC_COIN_ENABLE_MSVC], [$0]) 2149 2113 2150 2114 AC_MSG_CHECKING([which command should be used to link input files]) 2151 2115 coin_link_input_cmd="$LN_S" 2152 if test "$enable_doscompile" = mingw; then2153 coin_link_input_cmd=cp2154 fi2155 2116 case "$CC" in 2156 2117 clang* ) ;; … … 2815 2776 AC_DEFUN([AC_COIN_EXAMPLE_FILES], 2816 2777 [AC_REQUIRE([AC_COIN_CHECK_VPATH]) 2817 AC_REQUIRE([AC_COIN_ENABLE_ DOSCOMPILE])2778 AC_REQUIRE([AC_COIN_ENABLE_MSVC]) 2818 2779 AC_REQUIRE([AC_PROG_LN_S]) 2819 2780 … … 2826 2787 if test $coin_vpath_config = yes; then 2827 2788 lnkcmd= 2828 if test "$enable_ doscompile" != no; then2789 if test "$enable_msvc" = yes; then 2829 2790 lnkcmd=cp 2830 2791 fi … … 4105 4066 # Try to autodetect the library for blas based on build system 4106 4067 #AC_MSG_CHECKING([default locations for BLAS]) 4107 skip_lblas_check=no4108 4068 case $build in 4109 4069 *-sgi-*) … … 4146 4106 4147 4107 *-cygwin* | *-mingw*) 4148 # On cygwin, consider -lblas only if doscompile is disabled. The prebuilt4149 # library will want to link with cygwin, hence won't run standalone in DOS.4150 if test "$enable_doscompile" = mingw; then4151 skip_lblas_check=yes4152 fi4153 4108 case "$CC" in 4154 4109 clang* ) ;; … … 4195 4150 esac 4196 4151 4197 if test -z "$use_blas" && test $skip_lblas_check = no; then4152 if test -z "$use_blas" ; then 4198 4153 AC_MSG_CHECKING([whether -lblas has BLAS]) 4199 4154 coin_need_flibs=no … … 4320 4275 LIBS="$coin_save_LIBS" 4321 4276 fi 4322 skip_llapack_check=no4323 4277 if test -z "$use_lapack"; then 4324 4278 # Try to autodetect the library for lapack based on build system … … 4362 4316 # On cygwin, do this check only if doscompile is disabled. The prebuilt library 4363 4317 # will want to link with cygwin, hence won't run standalone in DOS. 4364 4365 *-cygwin*)4366 if test "$enable_doscompile" = mingw; then4367 skip_llapack_check=yes4368 fi4369 ;;4370 4371 4318 esac 4372 4319 fi 4373 4320 4374 if test -z "$use_lapack" && test $skip_llapack_check = no; then4321 if test -z "$use_lapack" ; then 4375 4322 AC_MSG_CHECKING([whether -llapack has LAPACK]) 4376 4323 coin_need_flibs=no
Note: See TracChangeset
for help on using the changeset viewer.