From 779a116ff3a4de2333ce647b32a253a80cbfc2a5 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Sat, 16 Dec 2017 07:47:17 +0100 Subject: Support building with legacy zlib versions that do not ship a pkg-config file. --- m4/nx-macros.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'm4') diff --git a/m4/nx-macros.m4 b/m4/nx-macros.m4 index b40f628b0..1c0e1ea7a 100644 --- a/m4/nx-macros.m4 +++ b/m4/nx-macros.m4 @@ -424,3 +424,21 @@ else the JPEG shared library and header files are installed.]) fi ]) # LIBJPEG_FALLBACK_CHECK + +AC_DEFUN([ZLIB_FALLBACK_CHECK],[ +AC_MSG_CHECKING([for zlib shared libary file and headers]) +AC_CHECK_LIB([z], [inflateEnd], + [have_zlib_lib=yes], [have_zlib_lib=no]) +AC_CHECK_HEADERS([zlib.h], + [have_zlib_headers=yes], [have_zlib_headers=no]) + +if test x"$have_zlib_lib" = "xyes" && test x"$have_zlib_headers" = "xyes"; then + AC_MSG_RESULT([yes]) + Z_CFLAGS="" + Z_LIBS="-lz" +else + AC_MSG_RESULT([no]) + AC_MSG_FAILURE([Could not find zlib on your system, make sure +the zlib shared library and header files are installed.]) +fi +]) # ZLIB_FALLBACK_CHECK -- cgit v1.2.3