- Timestamp:
- Jun 29, 2014 10:10:34 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/coin.m4
r3249 r3251 1275 1275 ]) 1276 1276 1277 ####################################################################### 1278 # COIN_CHECK_LIBM # 1279 ####################################################################### 1280 1281 # Check for the math library. 1282 # For a (space separated) list of arguments X, this macro adds the flags 1283 # for linking against the math library to a X_LIBS. 1284 1285 AC_DEFUN([AC_COIN_CHECK_LIBM], 1286 [AC_REQUIRE([AC_PROG_CC]) 1287 1288 coin_save_LIBS="$LIBS" 1289 1290 AC_LANG_PUSH(C) 1291 AC_SEARCH_LIBS([cos],[m], 1292 [m4_foreach_w([myvar], [$1], [m4_toupper(myvar)_LIBS="-lm $m4_toupper(myvar)_LIBS"])] 1293 ) 1294 AC_LANG_POP(C) 1295 1296 LIBS="$coin_save_LIBS" 1297 1298 ]) # AC_COIN_CHECK_LIBM 1299 1300 ########################################################################### 1301 # COIN_CHECK_ZLIB # 1302 ########################################################################### 1303 1304 # This macro checks for the libz library. If found, it sets the automake 1305 # conditional COIN_HAS_ZLIB and defines the C preprocessor variable 1306 # COIN_HAS_ZLIB. Further, for a (space separated) list of arguments X, 1307 # it adds the linker flag to the variables X_LIBS. 1308 1309 AC_DEFUN([AC_COIN_CHECK_ZLIB], 1310 [AC_REQUIRE([AC_PROG_CC]) 1311 1312 coin_has_zlib=no 1313 1314 AC_ARG_ENABLE([zlib], 1315 [AC_HELP_STRING([--disable-zlib],[do not compile with compression library zlib])], 1316 [coin_enable_zlib=$enableval], 1317 [coin_enable_zlib=yes]) 1318 1319 if test $coin_enable_zlib = yes; then 1320 AC_LANG_PUSH(C) 1321 AC_CHECK_HEADER([zlib.h],[coin_has_zlib=yes]) 1322 1323 if test $coin_has_zlib = yes; then 1324 AC_CHECK_LIB([z],[gzopen],[:],[coin_has_zlib=no]) 1325 fi 1326 1327 if test $coin_has_zlib = yes; then 1328 m4_foreach_w([myvar], [$1], [m4_toupper(myvar)_LIBS="-lz $m4_toupper(myvar)_LIBS"]) 1329 AC_DEFINE([COIN_HAS_ZLIB],[1],[Define to 1 if zlib is available]) 1330 fi 1331 AC_LANG_POP(C) 1332 fi 1333 1334 AM_CONDITIONAL(COIN_HAS_ZLIB, test x$coin_has_zlib = xyes) 1335 ]) # AC_COIN_CHECK_ZLIB 1336 1337 1338 ########################################################################### 1339 # COIN_CHECK_BZLIB # 1340 ########################################################################### 1341 1342 # This macro checks for the libbz2 library. If found, it defines the C 1343 # preprocessor variable COIN_HAS_BZLIB. Further, for a (space separated) list 1344 # of arguments X, it adds the linker flag to the variables X_LIBS. 1345 1346 AC_DEFUN([AC_COIN_CHECK_BZLIB], 1347 [AC_REQUIRE([AC_PROG_CC]) 1348 1349 AC_ARG_ENABLE([bzlib], 1350 [AC_HELP_STRING([--disable-bzlib],[do not compile with compression library bzlib])], 1351 [coin_enable_bzlib=$enableval], 1352 [coin_enable_bzlib=yes]) 1353 1354 coin_has_bzlib=no 1355 if test $coin_enable_bzlib = yes; then 1356 AC_LANG_PUSH(C) 1357 AC_CHECK_HEADER([bzlib.h],[coin_has_bzlib=yes]) 1358 1359 if test $coin_has_bzlib = yes; then 1360 AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],[:],[coin_has_bzlib=no]) 1361 fi 1362 1363 if test $coin_has_bzlib = yes; then 1364 m4_foreach_w([myvar], [$1], [m4_toupper(myvar)_LIBS="-lbz2 $m4_toupper(myvar)_LIBS"]) 1365 AC_DEFINE([COIN_HAS_BZLIB],[1],[Define to 1 if bzlib is available]) 1366 fi 1367 AC_LANG_POP(C) 1368 fi 1369 ]) # AC_COIN_CHECK_BZLIB 1370 1371 1372 ########################################################################### 1373 # COIN_CHECK_GNU_READLINE # 1374 ########################################################################### 1375 1376 # This macro checks for GNU's readline. It verifies that the header 1377 # readline/readline.h is available, and that the -lreadline library 1378 # contains "readline". It is assumed that #include <stdio.h> is included 1379 # in the source file before the #include<readline/readline.h> 1380 # If found, it defines the C preprocessor variable COIN_HAS_READLINE. 1381 # Further, for a (space separated) list of arguments X, it adds the 1382 # linker flag to the variable X_LIBS, X_PCLIBS, and X_LIBS_INSTALLED. 1383 1384 AC_DEFUN([AC_COIN_CHECK_GNU_READLINE], 1385 [AC_REQUIRE([AC_PROG_CC]) 1386 1387 AC_ARG_ENABLE([readline], 1388 [AC_HELP_STRING([--disable-readline],[do not compile with readline library])], 1389 [coin_enable_readline=$enableval], 1390 [coin_enable_readline=yes]) 1391 1392 coin_has_readline=no 1393 if test $coin_enable_readline = yes; then 1394 AC_LANG_PUSH(C) 1395 AC_CHECK_HEADER([readline/readline.h],[coin_has_readline=yes],[],[#include <stdio.h>]) 1396 1397 coin_save_LIBS="$LIBS" 1398 LIBS= 1399 # First we check if tputs and friends are available 1400 if test $coin_has_readline = yes; then 1401 AC_SEARCH_LIBS([tputs],[ncurses termcap curses],[],[coin_has_readline=no]) 1402 fi 1403 1404 # Now we check for readline 1405 if test $coin_has_readline = yes; then 1406 AC_CHECK_LIB([readline],[readline],[],[coin_has_readline=no]) 1407 fi 1408 1409 if test $coin_has_readline = yes; then 1410 m4_foreach_w([myvar], [$1], [m4_toupper(myvar)_LIBS="-lreadline $LIBS $m4_toupper(myvar)_LIBS"]) 1411 AC_DEFINE([COIN_HAS_READLINE],[1],[Define to 1 if readline is available]) 1412 fi 1413 1414 LIBS="$coin_save_LIBS" 1415 AC_LANG_POP(C) 1416 fi 1417 ]) # AC_COIN_CHECK_GNU_READLINE 1418 1419 ########################################################################### 1420 # COIN_CHECK_GMP # 1421 ########################################################################### 1422 1423 # This macro checks for the gmp library. If found, it defines the C 1424 # preprocessor variable COIN_HAS_GMP. Further, for a (space separated) list 1425 # of arguments X, it adds the linker flag to the variables X_LIBS. 1426 1427 AC_DEFUN([AC_COIN_CHECK_GMP], 1428 [AC_REQUIRE([AC_PROG_CC]) 1429 1430 AC_ARG_ENABLE([gmp], 1431 [AC_HELP_STRING([--disable-gmp],[do not compile with GNU multiple precision library])], 1432 [coin_enable_gmp=$enableval], 1433 [coin_enable_gmp=yes]) 1434 1435 coin_has_gmp=no 1436 if test $coin_enable_gmp = yes; then 1437 AC_LANG_PUSH(C) 1438 AC_CHECK_HEADER([gmp.h],[AC_CHECK_LIB([gmp],[__gmpz_init],[coin_has_gmp=yes])]) 1439 1440 if test $coin_has_gmp = yes ; then 1441 m4_foreach_w([myvar], [$1], [m4_toupper(myvar)_LIBS="-lgmp $m4_toupper(myvar)_LIBS"]) 1442 AC_DEFINE([COIN_HAS_GMP],[1],[Define to 1 if GMP is available]) 1443 fi 1444 AC_LANG_POP(C) 1445 fi 1446 ]) # AC_COIN_CHECK_GMP 1447 1277 1448 1278 1449 ###########################################################################
Note: See TracChangeset
for help on using the changeset viewer.