Ticket #5826: ticket.5826.diff

File ticket.5826.diff, 1021 bytes (added by missionsix, 7 years ago)

Patch file to failback to lib check if pkg-config fails

  • configure.ac

    diff --git configure.ac configure.ac
    index 8670ee4..4696b00 100644
    AC_SEARCH_LIBS([quotacursor_skipidtype], [quota]) 
    115115PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM], , [CHECK_SSL()])
    116116PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM])
    117117PKG_CHECK_MODULES(LIBEVENT, [libevent >= $LIBEVENT_MINIMUM])
    118 PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_MINIMUM])
     118PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_MINIMUM], [found_zlib=yes], [found_zlib=no])
     119if test "x$found_zlib" = "xno" ; then
     120   AC_CHECK_LIB(z, inflate,
     121       [AC_CHECK_HEADER([zlib.h],
     122       [AC_COMPILE_IFELSE(
     123           [AC_LANG_PROGRAM([[
     124                #include <zlib.h>
     125                #if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1230)
     126                // compile error
     127                #endif
     128           ]],[])],
     129           [found_zlib=yes])])])
     130   if test "x$found_zlib" = "xno" ; then
     131      AC_MSG_ERROR([Working zlib library and headers not found])
     132   fi
     133   ZLIBS_LIBS='-z'
     134   AC_SUBST(ZLIB_LIBS)
     135fi
    119136
    120137AC_SYS_LARGEFILE
    121138AC_CHECK_FUNCS([lseek64])