From: Evgeny Kotkov Date: Wed, 21 Sep 2016 22:11:00 +0000 (+0000) Subject: mod_brotli: Unbreak building other filter modules without libbrotlienc. X-Git-Tag: 2.5.0-alpha~1138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f621e886e07665fb9edc16d23ec90187cfec9a20;p=apache mod_brotli: Unbreak building other filter modules without libbrotlienc. Don't add -lbrotlienc to the MOD_LDFLAGS unconditionally. And, when adding it, use MOD_BROTLI_LDADD to avoid linking all filter modules against this library. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1761824 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/config.m4 b/modules/filters/config.m4 index 8ed68ab3d2..ca5fbd6629 100644 --- a/modules/filters/config.m4 +++ b/modules/filters/config.m4 @@ -192,13 +192,13 @@ AC_DEFUN([APACHE_CHECK_BROTLI],[ ac_brotli_found="yes" pkglookup="`$PKGCONFIG --cflags-only-I libbrotlienc`" APR_ADDTO(CPPFLAGS, [$pkglookup]) - APR_ADDTO(MOD_CFLAGS, [$pkglookup]) + APR_ADDTO(ac_brotli_mod_cflags, [$pkglookup]) pkglookup="`$PKGCONFIG --libs-only-L libbrotlienc`" APR_ADDTO(LDFLAGS, [$pkglookup]) - APR_ADDTO(MOD_LDFLAGS, [$pkglookup]) + APR_ADDTO(ac_brotli_mod_ldflags, [$pkglookup]) pkglookup="`$PKGCONFIG --libs-only-other libbrotlienc`" APR_ADDTO(LDFLAGS, [$pkglookup]) - APR_ADDTO(MOD_LDFLAGS, [$pkglookup]) + APR_ADDTO(ac_brotli_mod_ldflags, [$pkglookup]) fi PKG_CONFIG_PATH="$saved_PKG_CONFIG_PATH" fi @@ -206,19 +206,15 @@ AC_DEFUN([APACHE_CHECK_BROTLI],[ dnl fall back to the user-supplied directory if not found via pkg-config if test "x$ac_brotli_base" != "x" -a "x$ac_brotli_found" = "x"; then APR_ADDTO(CPPFLAGS, [-I$ac_brotli_base/include]) - APR_ADDTO(MOD_CFLAGS, [-I$ac_brotli_base/include]) + APR_ADDTO(ac_brotli_mod_cflags, [-I$ac_brotli_base/include]) APR_ADDTO(LDFLAGS, [-L$ac_brotli_base/lib]) - APR_ADDTO(MOD_LDFLAGS, [-L$ac_brotli_base/lib]) + APR_ADDTO(ac_brotli_mod_ldflags, [-L$ac_brotli_base/lib]) if test "x$ap_platform_runtime_link_flag" != "x"; then APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ac_brotli_base/lib]) - APR_ADDTO(MOD_LDFLAGS, [$ap_platform_runtime_link_flag$ac_brotli_base/lib]) + APR_ADDTO(ac_brotli_mod_ldflags, [$ap_platform_runtime_link_flag$ac_brotli_base/lib]) fi fi - ac_brotli_libs="${ac_brotli_libs:--lbrotlienc `$apr_config --libs`} " - APR_ADDTO(MOD_LDFLAGS, [$ac_brotli_libs]) - APR_ADDTO(LIBS, [$ac_brotli_libs]) - dnl Run library and function checks liberrors="" AC_CHECK_HEADERS([brotli/encode.h]) @@ -228,23 +224,23 @@ const uint8_t *o = BrotliEncoderTakeOutput((BrotliEncoderState*)0, (size_t*)0);] [AC_MSG_RESULT(OK) ac_cv_brotli="yes"], [AC_MSG_RESULT(FAILED)]) + if test "x$ac_cv_brotli" = "xyes"; then + ac_brotli_libs="${ac_brotli_libs:--lbrotlienc} `$apr_config --libs`" + APR_ADDTO(ac_brotli_mod_ldflags, [$ac_brotli_libs]) + fi dnl restore CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" LDFLAGS="$saved_LDFLAGS" - - dnl cache MOD_LDFLAGS, MOD_CFLAGS - ac_brotli_mod_cflags=$MOD_CFLAGS - ac_brotli_mod_ldflags=$MOD_LDFLAGS ]) if test "x$ac_cv_brotli" = "xyes"; then - APR_ADDTO(MOD_LDFLAGS, [$ac_brotli_mod_ldflags]) + APR_ADDTO(MOD_BROTLI_LDADD, [$ac_brotli_mod_ldflags]) dnl Ouch! libbrotlienc.1.so doesn't link against libm.so (-lm), - dnl although it should. Workaround that in our LDFLAGS: + dnl although it should. Workaround that here: - APR_ADDTO(MOD_LDFLAGS, ["-lm"]) + APR_ADDTO(MOD_BROTLI_LDADD, ["-lm"]) APR_ADDTO(MOD_CFLAGS, [$ac_brotli_mod_cflags]) fi ])