Changeset 451 for stable/0.5/coin.m4
- Timestamp:
- Aug 8, 2007 10:24:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/0.5/coin.m4
r420 r451 208 208 209 209 ########################################################################### 210 # COIN_CHECK_FILE # 211 ########################################################################### 212 213 # A simple replacement for AC_CHECK_FILE that works for cross compilation 214 215 AC_DEFUN([AC_COIN_CHECK_FILE], 216 [if test -r $1; then 217 $2 218 : 219 else 220 $3 221 : 222 fi 223 ]) 224 225 ########################################################################### 210 226 # COIN_THIRDPARTY_SUBDIRS # 211 227 ########################################################################### … … 319 335 [case "${enableval}" in 320 336 yes) coin_debug_compile=true 321 enable_shared=no 337 if test "${enable_shared+set}" = set; then :; else 338 enable_shared=no 339 fi 322 340 ;; 323 341 no) coin_debug_compile=false … … 1499 1517 correct_version='1.5.22' 1500 1518 grep_version=`echo $correct_version | sed -e 's/\\./\\\\\\./g'` 1501 AC_C HECK_FILE([$want_dir/libtool/ltmain.sh],1502 [have_ltmain=yes],1503 [have_ltmain=no])1519 AC_COIN_CHECK_FILE([$want_dir/libtool/ltmain.sh], 1520 [have_ltmain=yes], 1521 [have_ltmain=no]) 1504 1522 AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of libtool.]) 1505 1523 if test $have_ltmain = yes; then … … 1522 1540 want_dir=$AUTOTOOLS_DIR/share 1523 1541 fi 1524 AC_C HECK_FILE([$want_dir/aclocal/libtool.m4],1525 [LIBTOOLM4="$want_dir/aclocal/libtool.m4"],1526 [AC_MSG_ERROR([I cannot find the libtool.m4 file.])])1542 AC_COIN_CHECK_FILE([$want_dir/aclocal/libtool.m4], 1543 [LIBTOOLM4="$want_dir/aclocal/libtool.m4"], 1544 [AC_MSG_ERROR([I cannot find the libtool.m4 file.])]) 1527 1545 1528 1546 # Check if we have an Externals file … … 1931 1949 1932 1950 ########################################################################### 1951 # COIN_LINK_INPUT_CMD # 1952 ########################################################################### 1953 1954 # This macro determines which command should be used to "link" files 1955 # that are input to the generated executables. On Windows, the codes 1956 # using the native Windows system libraries, cannot understand symbolic 1957 # links, and a copy should be used instead of 'ln -s'. 1958 # The result is stored in coin_link_input_cmd 1959 1960 AC_DEFUN([AC_COIN_LINK_INPUT_CMD], 1961 [AC_REQUIRE([AC_PROG_LN_S]) 1962 AC_BEFORE([AC_COIN_PROG_CC], [$0]) 1963 AC_BEFORE([AC_COIN_ENABLE_DOSCOMPILE], [$0]) 1964 1965 AC_MSG_CHECKING([which command should be used to link input files]) 1966 coin_link_input_cmd="$LN_S" 1967 if test "$enable_doscompile" = mingw; then 1968 coin_link_input_cmd=cp 1969 fi 1970 case "$CC" in 1971 cl* | */cl* | CL* | */CL*) 1972 coin_link_input_cmd=cp ;; 1973 esac 1974 AC_MSG_RESULT($coin_link_input_cmd) 1975 ]) 1976 1977 ########################################################################### 1933 1978 # COIN_FINALIZE # 1934 1979 ########################################################################### … … 1943 1988 AC_DEFUN([AC_COIN_FINALIZE], 1944 1989 [ 1990 AC_REQUIRE([AC_COIN_LINK_INPUT_CMD]) 1945 1991 if test x$coin_skip_ac_output != xyes; then 1946 1992 … … 1984 2030 1985 2031 if test x"$coin_vpath_link_files" = x; then : ; else 1986 lnkcmd= 1987 if test "$enable_doscompile" = mingw; then 1988 lnkcmd=cp 1989 fi 1990 case "$CC" in 1991 cl* | */cl* | CL* | */CL*) 1992 lnkcmd=cp ;; 1993 esac 2032 lnkcmd="$coin_link_input_cmd" 1994 2033 if test "$lnkcmd" = cp; then 1995 2034 AC_MSG_NOTICE(Copying data files for VPATH configuration) 1996 2035 else 1997 AC_PROG_LN_S1998 2036 AC_MSG_NOTICE(Creating VPATH links for data files) 1999 lnkcmd="$LN_S"2000 2037 fi 2001 2038 for file in $coin_vpath_link_files; do … … 2330 2367 # matching automake conditional COIN_HAS_LBRY. LBRYINCDIR should specify the 2331 2368 # directory containing include files for the library. LBRYLIB should specify 2332 # the flags necessary to link to the library. 2369 # the flags necessary to link to the library. A variable coin_has_lbry will 2370 # be set to true or false, as appropriate. A variable lbry_libcheck will be 2371 # be set to yes or no; no indicates link checks should not be attempted. 2333 2372 # 2334 2373 # The macro defines three configure arguments, --with-libraryname-incdir, … … 2404 2443 2405 2444 m4_ifval([$3], 2406 [AC_C HECK_FILE([$$2INCDIR/$3],[],2445 [AC_COIN_CHECK_FILE([$$2INCDIR/$3],[], 2407 2446 [AC_MSG_ERROR([Cannot find file $3 in $$2INCDIR])])]) 2408 2447 … … 2441 2480 2442 2481 ADDLIBS="$$2LIB $ADDLIBS" 2443 AC_DEFINE(COIN_HAS_$2,[1],[Define to 1 if the $1 package is used])2482 AC_DEFINE(COIN_HAS_$2,[1],[Define to 1 if the $1 package is available]) 2444 2483 fi 2445 2484 … … 2498 2537 fi 2499 2538 elif test "$use_asldir" != "no"; then 2500 AC_C HECK_FILE([$use_asldir/$ampllib],[],2501 [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but library missing])])2502 AC_C HECK_FILE([$use_asldir/asl.h],[],2503 [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but header files are missing])])2539 AC_COIN_CHECK_FILE([$use_asldir/$ampllib],[], 2540 [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but library missing])]) 2541 AC_COIN_CHECK_FILE([$use_asldir/asl.h],[], 2542 [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but header files are missing])]) 2504 2543 use_asldir=`cd $use_asldir; pwd` 2505 2544 case $build in … … 2894 2933 2895 2934 # Check if hearders are there 2896 AC_C HECK_FILE([$mumps_dir/include/dmumps_c.h],2897 [],2898 [AC_MSG_ERROR([I cannot find headers for MUMPS])])2935 AC_COIN_CHECK_FILE([$mumps_dir/include/dmumps_c.h], 2936 [], 2937 [AC_MSG_ERROR([I cannot find headers for MUMPS])]) 2899 2938 LIBS="$mumps_dir/lib/libdmumps.$libe $mumps_dir/lib/libpord.$libe $mumps_dir/libseq/libmpiseq.$libe $LIBS" 2900 2939 ADDLIBS="$mumps_dir/lib/libdmumps.$libe $mumps_dir/lib/libpord.$libe $mumps_dir/libseq/libmpiseq.$libe $ADDLIBS" … … 2907 2946 LIBS="$save_LIBS" 2908 2947 AC_LANG_POP(C) 2948 coin_mumpssrcdir="$mumps_dir" 2909 2949 2910 2950 else … … 2951 2991 ]) # AC_COIN_HAS_MUMPS 2952 2992 2993 ########################################################################### 2994 # COIN_HAS_GLPK # 2995 ########################################################################### 2996 # 2997 # This macro checks for the GLPK package. GLPK provides two capabilities, 2998 # an LP and MIP solver (GLPK) and the GNU Mathprog modelling language (GMPL). 2999 # The macro checks for either Glpk or Gmpl, according to the value specified as 3000 # the parameter. Use one of Glpk or Gmpl. Use *exactly* these strings, eh? 3001 # 3002 # 3003 # The macro first uses COIN_HAS_USER_LIBRARY to see if the user has specified 3004 # a preexisting library (this allows the use of any glpk version, if the user 3005 # is fussy). The macro then checks for ThirdParty/Glpk. 3006 # 3007 # This macro will define the following variables for Glpk: 3008 # coin_has_glpk true or false 3009 # GLPKLIB link flags for GLPK (if user supplied) 3010 # GLPKINCDIR location of glpk include files 3011 # COIN_HAS_GLPK Preprocessor symbol, defined to 1 3012 # COIN_HAS_GLPK Automake conditional 3013 # COIN_BUILD_GLPK Automake conditional, defined only if Glpk is to be 3014 # built in ThirdParty/Glpk 3015 # 3016 # With the exception of COIN_BUILD_GLPK, an identical set of variables is 3017 # defined for Gmpl. 3018 3019 AC_DEFUN([AC_COIN_HAS_GLPK], 3020 [ 3021 if test "$PACKAGE_NAME" = ThirdPartyGlpk; then 3022 coin_glpkobjdir=../Glpk 3023 else 3024 coin_glpkobjdir=../ThirdParty/Glpk 3025 fi 3026 coin_glpksrcdir=$abs_source_dir/$coin_glpkobjdir 3027 3028 use_thirdpartyglpk=no 3029 3030 # Check for the requested component. If the user specified an external glpk 3031 # library don't force a ThirdParty build, let the error propagate. 3032 3033 m4_if([$1],[Glpk], 3034 [AC_COIN_HAS_USER_LIBRARY([Glpk],[GLPK],[glpk.h], 3035 [_glp_lpx_simplex glp_lpx_simplex]) 3036 if test x"$coin_has_glpk" = xfalse && test x"$GLPKLIB" = x ; then 3037 use_thirdpartyglpk=try 3038 fi]) 3039 m4_if([$1],[Gmpl], 3040 [AC_COIN_HAS_USER_LIBRARY([Gmpl],[GMPL],[glpmpl.h], 3041 [_glp_mpl_initialize glp_mpl_initialize]) 3042 if test x"$coin_has_gmpl" = xfalse && test x"$GMPLLIB" = x ; then 3043 use_thirdpartyglpk=try 3044 fi]) 3045 3046 # If the user has supplied an external library, use it. Otherwise, consider 3047 # a build in ThirdParty/Glpk. If we build, assume we get both glpk and gmpl. 3048 3049 if test x"$use_thirdpartyglpk" = xtry ; then 3050 MAKEOKFILE=.MakeOk 3051 # Check if the Glpk's ThirdParty project has been configured 3052 if test "$PACKAGE_NAME" != ThirdPartyGlpk; then 3053 if test -r $coin_glpkobjdir/.MakeOk; then 3054 use_thirdpartyglpk=build 3055 else 3056 use_thirdpartyglpk=no 3057 fi 3058 else 3059 use_thirdpartyglpk=build 3060 fi 3061 3062 # If we're building, set the library and include directory variables, create a 3063 # preprocessor symbol, define a variable that says we're using glpk/gmpl, and 3064 # another to indicate a link check is a bad idea (hard to do before the library 3065 # exists). 3066 3067 if test x"$use_thirdpartyglpk" = xbuild ; then 3068 m4_toupper($1INCDIR)="$coin_glpksrcdir/glpk/include" 3069 AC_SUBST(m4_toupper($1INCDIR)) 3070 AC_DEFINE(m4_toupper(COIN_HAS_$1),[1], 3071 [Define to 1 if $1 package is available]) 3072 m4_tolower(coin_has_$1)=true 3073 m4_tolower($1_libcheck)=no 3074 AC_MSG_NOTICE([Using $1 in ThirdParty/Glpk]) 3075 fi 3076 fi 3077 3078 # Define the necessary automake conditionals. 3079 3080 AM_CONDITIONAL(m4_toupper(COIN_HAS_$1), 3081 [test x"$m4_tolower(coin_has_$1)" = xtrue]) 3082 AM_CONDITIONAL([COIN_BUILD_GLPK],[test x"$use_thirdpartyglpk" = xbuild]) 3083 3084 ]) # AC_COIN_HAS_GLPK
Note: See TracChangeset
for help on using the changeset viewer.