diff options
author | Darren Tucker <dtucker@dtucker.net> | 2020-01-23 22:16:51 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-01-23 22:16:51 +1100 |
commit | 633a2af47ee90291aaf93969aeee1e5046074c7c (patch) | |
tree | c29fd0f56a70de5d3602c877434e08c1d1bc6aa5 | |
parent | 7f8e66fea8c4e2a910df9067cb7638999b7764d5 (diff) |
Plumb WITH_ZLIB into configure.
This allows zlib support to be disabled by ./configure --without-zlib.
-rw-r--r-- | configure.ac | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 85e687773..34cd94a7f 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1287,11 +1287,12 @@ AC_CHECK_FUNC([getspnam], , | |||
1287 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], | 1287 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
1288 | [Define if you have the basename function.])]) | 1288 | [Define if you have the basename function.])]) |
1289 | 1289 | ||
1290 | dnl zlib is required | 1290 | dnl zlib defaults to enabled |
1291 | zlib=yes | ||
1291 | AC_ARG_WITH([zlib], | 1292 | AC_ARG_WITH([zlib], |
1292 | [ --with-zlib=PATH Use zlib in PATH], | 1293 | [ --with-zlib=PATH Use zlib in PATH], |
1293 | [ if test "x$withval" = "xno" ; then | 1294 | [ if test "x$withval" = "xno" ; then |
1294 | AC_MSG_ERROR([*** zlib is required ***]) | 1295 | zlib=no |
1295 | elif test "x$withval" != "xyes"; then | 1296 | elif test "x$withval" != "xyes"; then |
1296 | if test -d "$withval/lib"; then | 1297 | if test -d "$withval/lib"; then |
1297 | if test -n "${rpath_opt}"; then | 1298 | if test -n "${rpath_opt}"; then |
@@ -1314,8 +1315,14 @@ AC_ARG_WITH([zlib], | |||
1314 | fi ] | 1315 | fi ] |
1315 | ) | 1316 | ) |
1316 | 1317 | ||
1317 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) | 1318 | AC_MSG_CHECKING([for zlib]) |
1318 | AC_CHECK_LIB([z], [deflate], , | 1319 | if test "x${zlib}" = "xno"; then |
1320 | AC_MSG_RESULT([no]) | ||
1321 | else | ||
1322 | AC_MSG_RESULT([yes]) | ||
1323 | AC_DEFINE([WITH_ZLIB], [1], [Enable zlib]) | ||
1324 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) | ||
1325 | AC_CHECK_LIB([z], [deflate], , | ||
1319 | [ | 1326 | [ |
1320 | saved_CPPFLAGS="$CPPFLAGS" | 1327 | saved_CPPFLAGS="$CPPFLAGS" |
1321 | saved_LDFLAGS="$LDFLAGS" | 1328 | saved_LDFLAGS="$LDFLAGS" |
@@ -1334,18 +1341,18 @@ AC_CHECK_LIB([z], [deflate], , | |||
1334 | ] | 1341 | ] |
1335 | ) | 1342 | ) |
1336 | ] | 1343 | ] |
1337 | ) | 1344 | ) |
1338 | 1345 | ||
1339 | AC_ARG_WITH([zlib-version-check], | 1346 | AC_ARG_WITH([zlib-version-check], |
1340 | [ --without-zlib-version-check Disable zlib version check], | 1347 | [ --without-zlib-version-check Disable zlib version check], |
1341 | [ if test "x$withval" = "xno" ; then | 1348 | [ if test "x$withval" = "xno" ; then |
1342 | zlib_check_nonfatal=1 | 1349 | zlib_check_nonfatal=1 |
1343 | fi | 1350 | fi |
1344 | ] | 1351 | ] |
1345 | ) | 1352 | ) |
1346 | 1353 | ||
1347 | AC_MSG_CHECKING([for possibly buggy zlib]) | 1354 | AC_MSG_CHECKING([for possibly buggy zlib]) |
1348 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | 1355 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
1349 | #include <stdio.h> | 1356 | #include <stdio.h> |
1350 | #include <stdlib.h> | 1357 | #include <stdlib.h> |
1351 | #include <zlib.h> | 1358 | #include <zlib.h> |
@@ -1383,7 +1390,8 @@ See http://www.gzip.org/zlib/ for details.]) | |||
1383 | fi | 1390 | fi |
1384 | ], | 1391 | ], |
1385 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] | 1392 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
1386 | ) | 1393 | ) |
1394 | fi | ||
1387 | 1395 | ||
1388 | dnl UnixWare 2.x | 1396 | dnl UnixWare 2.x |
1389 | AC_CHECK_FUNC([strcasecmp], | 1397 | AC_CHECK_FUNC([strcasecmp], |