Changeset 2659
- Timestamp:
- Dec 1, 2012 1:33:08 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/coin.m4
r2618 r2659 303 303 [AC_REQUIRE([AC_COIN_PROG_CC]) #Let's try if that overcomes configuration problem with VC++ 6.0 304 304 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE]) 305 AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS]) 305 306 AC_LANG_PUSH(C++) 306 307 … … 576 577 esac 577 578 579 # check whether to add flag for static linking against standard libraries to LDFLAGS 580 if test x$use_static_standardlibs != xno ; then 581 case $build in 582 *-mingw*) 583 static_standardlib_flag=-static 584 ;; 585 *) 586 static_standardlib_flag=-static-libstdc++ 587 ;; 588 esac 589 case " $LDFLAGS " in 590 *" $static_standardlib_flag "* ) ;; 591 *) 592 AC_MSG_CHECKING([whether linking with $static_standardlib_flag works]) 593 coin_save_LDFLAGS="$LDFLAGS" 594 LDFLAGS="$LDFLAGS $static_standardlib_flag" 595 AC_LINK_IFELSE( 596 [AC_LANG_PROGRAM(, [int i=0;])], 597 [AC_MSG_RESULT(yes)], 598 [AC_MSG_RESULT(no) 599 LDFLAGS="$coin_save_LDFLAGS" 600 if test $use_static_standardlibs = yes ; then 601 AC_MSG_ERROR([failed to link with $static_standardlib_flag]) 602 fi 603 ]) 604 ;; 605 esac 606 fi 607 578 608 AC_LANG_POP(C++) 579 609 ]) # AC_COIN_PROG_CXX … … 691 721 692 722 ########################################################################### 723 # COIN_ENABLE_STATICSTDLIBS # 724 ########################################################################### 725 726 # This macro defines the --enable-static-standardlibs flag and determines 727 # its default value according to the setting of --enable-shared. 728 # That is, if static libraries are build, then we also try to link against 729 # static standard libraries, unless the corresponding flags do not work. 730 731 AC_DEFUN([AC_COIN_ENABLE_STATICSTDLIBS], 732 [ 733 734 # check whether to add flags for static linking against standard libraries 735 AC_ARG_ENABLE([static-standardlibs], 736 [AC_HELP_STRING([--enable-static-standardlibs], 737 [whether to link against static standard libraries (libgcc, libgfortran, libstdc++)])], 738 [case "$enableval" in 739 no | yes | auto ) ;; 740 *) 741 AC_MSG_ERROR([invalid argument for --enable-static-standardlibs: $enableval]) ;; 742 esac 743 use_static_standardlibs=$enableval], 744 [if test $enable_shared = yes ; then 745 use_static_standardlibs = no 746 else 747 use_static_standardlibs = auto 748 fi 749 ] 750 ) 751 752 ]); 753 754 ########################################################################### 693 755 # COIN_PROG_CC # 694 756 ########################################################################### … … 702 764 [AC_REQUIRE([AC_COIN_MINGW_LD_FIX]) 703 765 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE]) 766 AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS]) 704 767 AC_LANG_PUSH(C) 705 768 … … 912 975 CFLAGS="$OPT_CFLAGS" 913 976 fi 977 914 978 else 915 979 CFLAGS="$CFLAGS $ADD_CFLAGS $CDEFS" … … 972 1036 esac 973 1037 1038 # check whether to add flags for static linking against standard libraries to LDFLAGS 1039 if test x$use_static_standardlibs != xno ; then 1040 case $build in 1041 *-mingw*) 1042 static_standardlib_flag=-static 1043 ;; 1044 *) 1045 static_standardlib_flag=-static-libgcc 1046 ;; 1047 esac 1048 case " $LDFLAGS " in 1049 *" $static_standardlib_flag "* ) ;; 1050 *) 1051 AC_MSG_CHECKING([whether linking with $static_standardlib_flag works]) 1052 coin_save_LDFLAGS="$LDFLAGS" 1053 LDFLAGS="$LDFLAGS $static_standardlib_flag" 1054 AC_LINK_IFELSE( 1055 [AC_LANG_PROGRAM(, [int i=0;])], 1056 [AC_MSG_RESULT(yes)], 1057 [AC_MSG_RESULT(no) 1058 LDFLAGS="$coin_save_LDFLAGS" 1059 if test $use_static_standardlibs = yes ; then 1060 AC_MSG_ERROR([failed to link with $static_standardlib_flag]) 1061 fi 1062 ]) 1063 ;; 1064 esac 1065 fi 1066 974 1067 AC_LANG_POP(C) 975 1068 ]) # AC_COIN_PROG_CC … … 986 1079 [AC_REQUIRE([AC_COIN_MINGW_LD_FIX]) 987 1080 AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE]) 1081 AC_REQUIRE([AC_COIN_ENABLE_STATICSTDLIBS]) 988 1082 AC_REQUIRE([AC_COIN_PROG_CC]) 989 1083 AC_REQUIRE([AC_COIN_F77_COMPS]) … … 1133 1227 FFLAGS="$OPT_FFLAGS" 1134 1228 fi 1229 1135 1230 else 1136 1231 FFLAGS="$FFLAGS $ADD_FFLAGS" … … 1186 1281 ;; 1187 1282 esac 1283 1284 # check whether to add flag for static linking against standard libraries to LDFLAGS 1285 if test x$use_static_standardlibs != xno ; then 1286 case $build in 1287 *-mingw*) 1288 static_standardlib_flag=-static 1289 ;; 1290 *) 1291 static_standardlib_flag=-static-libgfortran 1292 ;; 1293 esac 1294 case " $LDFLAGS " in 1295 *" $static_standardlib_flag "* ) ;; 1296 *) 1297 AC_MSG_CHECKING([whether linking with $static_standardlib_flag works]) 1298 coin_save_LDFLAGS="$LDFLAGS" 1299 LDFLAGS="$LDFLAGS $static_standardlib_flag" 1300 AC_LINK_IFELSE( 1301 [AC_LANG_PROGRAM(,[ integer i])], 1302 [AC_MSG_RESULT(yes)], 1303 [AC_MSG_RESULT(no) 1304 LDFLAGS="$coin_save_LDFLAGS" 1305 if test $use_static_standardlibs = yes ; then 1306 AC_MSG_ERROR([failed to link with $static_standardlib_flag]) 1307 fi 1308 ]) 1309 ;; 1310 esac 1311 fi 1188 1312 1189 1313 AC_LANG_POP([Fortran 77])
Note: See TracChangeset
for help on using the changeset viewer.