This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor zlib's spkg-configure, start on a macro for zlib.pc
this is WIP.
- Loading branch information
Showing
1 changed file
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,38 @@ | ||
AC_DEFUN([SAGE_ZLIB_GEN_PC],[dnl generate zlib.pc | ||
AX_ABSOLUTE_HEADER([zlib.h]) | ||
AS_IF([test x$gl_cv_absolute_zlib_h = x], [ | ||
AC_MSG_ERROR(m4_normalize([ | ||
failed to find absolute path to zlib.h despite it being reported found | ||
])) | ||
]) | ||
AC_SUBST(SAGE_ZLIB_INCLUDE, [`AS_DIRNAME($gl_cv_absolute_zlib_h)`]) | ||
dnl now the same for the full path to libz... | ||
dnl ... | ||
]) | ||
|
||
SAGE_SPKG_CONFIGURE([zlib], [ | ||
AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no]) | ||
AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) | ||
if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"; then | ||
PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2], [], [ | ||
dnl inflateValidate is needed for Sage's libpng, newer than 1.2; this ensures | ||
dnl we have the minimum required for building zlib version | ||
AC_CHECK_LIB([z], [inflateValidate], [], [sage_spkg_install_zlib=yes]) | ||
]) | ||
else | ||
sage_spkg_install_zlib=yes | ||
fi | ||
PKG_CHECK_MODULES([ZLIBANDLIBPNG], [zlib libpng >= 1.2], [ | ||
AC_MSG_NOTICE([Use zlib and libpng from the system, pc files supplied.]) | ||
], [ | ||
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.9], [ | ||
dnl inflateValidate is needed for Sage's libpng, newer than 1.2; this ensures | ||
dnl we have the minimum required for building zlib version | ||
AC_MSG_NOTICE([Use zlib the system, pc file supplied.]) | ||
], [dnl no zlib.pc file. try to see if this zlib is still good | ||
AC_CHECK_HEADER([zlib.h], [ | ||
AC_CHECK_LIB([z], [inflateEnd], [ | ||
PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2], [ | ||
dnl hope we found the zlib of system's libpng | ||
SAGE_ZLIB_GEN_PC | ||
], [ | ||
dnl inflateValidate is needed for Sage's libpng (cf. above) | ||
AC_CHECK_LIB([z], [inflateValidate], [ | ||
dnl zlib is good enough to build Sage's libpng | ||
SAGE_ZLIB_GEN_PC | ||
], [sage_spkg_install_zlib=yes]) | ||
]) | ||
], [sage_spkg_install_zlib=yes]) | ||
], [sage_spkg_install_zlib=yes]) | ||
]) | ||
]) | ||
]) |