diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 115 |
1 files changed, 75 insertions, 40 deletions
diff --git a/configure.in b/configure.in index 3154af05..8e971dde 100644 --- a/configure.in +++ b/configure.in | |||
@@ -1303,18 +1303,16 @@ then | |||
1303 | ac_cv_swap_conv=2048 | 1303 | ac_cv_swap_conv=2048 |
1304 | AC_MSG_RESULT([using IRIX format swap]) | 1304 | AC_MSG_RESULT([using IRIX format swap]) |
1305 | 1305 | ||
1306 | elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null] | ||
1307 | then | ||
1308 | ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"] | ||
1309 | ac_cv_swap_conv=2048 | ||
1310 | AC_MSG_RESULT([using Solaris format swap]) | ||
1311 | |||
1312 | elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null] | 1306 | elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null] |
1313 | then | 1307 | then |
1314 | ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"] | 1308 | ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"] |
1315 | ac_cv_swap_conv=2048 | 1309 | ac_cv_swap_conv=2048 |
1316 | AC_MSG_RESULT([using Unixware format swap]) | 1310 | AC_MSG_RESULT([using Unixware format swap]) |
1317 | 1311 | else | |
1312 | dnl if we don't know what format swap's output is | ||
1313 | dnl we might as well pretend we didn't see it | ||
1314 | ac_cv_have_swap="" | ||
1315 | ac_cv_swap_command="" | ||
1318 | fi | 1316 | fi |
1319 | fi | 1317 | fi |
1320 | dnl end if for PATH_TO_SWAP | 1318 | dnl end if for PATH_TO_SWAP |
@@ -1362,46 +1360,83 @@ fi | |||
1362 | dnl end if for PATH_TO_SWAPINFO | 1360 | dnl end if for PATH_TO_SWAPINFO |
1363 | fi | 1361 | fi |
1364 | 1362 | ||
1365 | AC_PATH_PROG(PATH_TO_SWAPCTL,swapctl,,[$PATH:/sbin]) | 1363 | dnl |
1366 | if (test -n "$PATH_TO_SWAPCTL") | 1364 | dnl test for swapctl system call, both the 2-arg and 3-arg variants |
1367 | then | 1365 | dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared |
1368 | AC_MSG_CHECKING([for $PATH_TO_SWAPCTL format]) | 1366 | dnl in the various BSD's |
1369 | if [$PATH_TO_SWAPCTL -l 2>&1 >/dev/null] | 1367 | dnl |
1368 | |||
1369 | AC_CHECK_HEADERS([sys/swap.h sys/stat.h sys/param.h]) | ||
1370 | AC_CHECK_DECLS([swapctl],,,[ | ||
1371 | #include <unistd.h> | ||
1372 | #include <sys/types.h> | ||
1373 | #include <sys/stat.h> | ||
1374 | #include <sys/swap.h> | ||
1375 | ]) | ||
1376 | AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[ | ||
1377 | #include <sys/types.h> | ||
1378 | #include <sys/stat.h> | ||
1379 | #include <sys/swap.h> | ||
1380 | ]) | ||
1381 | AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[ | ||
1382 | #include <unistd.h> | ||
1383 | #include <sys/types.h> | ||
1384 | #include <sys/stat.h> | ||
1385 | #include <sys/swap.h> | ||
1386 | ]) | ||
1387 | |||
1388 | if test "$ac_cv_have_decl_swapctl" = "yes"; | ||
1370 | then | 1389 | then |
1371 | ac_cv_have_swap=yes | 1390 | EXTRAS="$EXTRAS check_swap" |
1372 | ac_cv_swap_command="$PATH_TO_SWAPCTL -l" | 1391 | AC_MSG_CHECKING([for 2-arg (SVR4) swapctl]) |
1373 | if [$PATH_TO_SWAPCTL -l 2>/dev/null | \ | 1392 | if test "$ac_cv_type_swaptbl_t" = "yes" -a \ |
1374 | egrep -i "^Device +1K-blocks +Used +Avail +Capacity +Priority" >/dev/null ] | 1393 | "$ac_cv_type_swapent_t" = "yes"; |
1375 | then | 1394 | then |
1376 | ac_cv_swap_format=["%*s %llu %*d %llu %*d"] | 1395 | AC_MSG_RESULT([yes]) |
1377 | ac_cv_swap_conv=1024 | 1396 | ac_cv_check_swap_swapctl_svr4="1"; |
1378 | AC_MSG_RESULT([using 1K BSD format swapctl]) | 1397 | AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1, |
1379 | 1398 | [Define if 2-argument SVR4 swapctl exists]) | |
1380 | elif [$PATH_TO_SWAPCTL -l 2>/dev/null | \ | 1399 | else |
1381 | egrep -i "^Device +512-blocks +Used +Avail +Capacity +Priority" >/dev/null ] | 1400 | AC_MSG_RESULT([no]) |
1401 | AC_MSG_CHECKING([for 3-arg (*BSD) swapctl]) | ||
1402 | if test "$ac_cv_member_struct_swapent_se_nblks" = "yes"; | ||
1403 | then | ||
1404 | AC_MSG_RESULT([yes]) | ||
1405 | AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1, | ||
1406 | [Define if 3-argument BSD swapctl exists]) | ||
1407 | else | ||
1408 | AC_MSG_RESULT([no]) | ||
1409 | fi | ||
1410 | fi | ||
1411 | AC_MSG_CHECKING([for whether swapctl uses blocks or pages]) | ||
1412 | if test "$ac_cv_check_swap_swapctl_svr4" = "1"; | ||
1382 | then | 1413 | then |
1383 | ac_cv_swap_format=["%*s %llu %*d %llu %*d"] | 1414 | dnl |
1415 | dnl the SVR4 spec returns values in pages | ||
1416 | dnl | ||
1417 | AC_MSG_RESULT([page]) | ||
1418 | AC_CHECK_DECLS([sysconf]) | ||
1419 | AC_MSG_CHECKING([for system page size]) | ||
1420 | if test "$ac_cv_have_decl_sysconf" = "yes"; | ||
1421 | then | ||
1422 | AC_MSG_RESULT([determined by sysconf(3)]) | ||
1423 | ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))" | ||
1424 | else | ||
1425 | AC_MSG_WARN([don't know. guessing 4096k]) | ||
1426 | ac_cv_swap_conv=256 | ||
1427 | fi | ||
1428 | else | ||
1429 | dnl | ||
1430 | dnl the BSD spec returns values in blocks | ||
1431 | dnl | ||
1432 | AC_MSG_RESULT([blocks (assuming 512b)]) | ||
1384 | ac_cv_swap_conv=2048 | 1433 | ac_cv_swap_conv=2048 |
1385 | AC_MSG_RESULT([using 512 byte BSD format swapctl]) | ||
1386 | fi | 1434 | fi |
1435 | AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv, | ||
1436 | [Conversion factor to MB]) | ||
1387 | fi | 1437 | fi |
1388 | dnl end if for PATH_TO_SWAPCTL | ||
1389 | fi | ||
1390 | |||
1391 | dnl | ||
1392 | dnl test for swapctl system call, as found in tru64 and solaris | ||
1393 | dnl note: the way the ifdef logic in check_swap is right now, | ||
1394 | dnl this will only affect systems that don't pass one of the | ||
1395 | dnl earlier tests. | ||
1396 | dnl | ||
1397 | AC_CHECK_HEADERS([sys/swap.h sys/stat.h sys/param.h]) | ||
1398 | AC_CHECK_DECLS([swapctl],,,[ | ||
1399 | #include <sys/types.h> | ||
1400 | #include <sys/stat.h> | ||
1401 | #include <sys/swap.h> | ||
1402 | ]) | ||
1403 | dnl | 1438 | dnl |
1404 | dnl end test for swapctl system call | 1439 | dnl end tests for the swapctl system calls |
1405 | dnl | 1440 | dnl |
1406 | 1441 | ||
1407 | 1442 | ||