--- build/crypto.m4.orig 2016-02-10 18:37:41.190531726 -0500 +++ build/crypto.m4 2016-02-10 18:39:09.649293543 -0500 @@ -134,7 +134,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_openssl" = "1"; then - APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lssl -lcrypto]) + APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lssl -lcrypto $APR_LIBS]) apu_have_crypto=1 AC_MSG_CHECKING([for const input buffers in OpenSSL]) @@ -228,7 +228,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_nss" = "1"; then - APR_ADDTO(LDADD_crypto_nss, [$nss_LDFLAGS -lnspr4 -lnss3]) + APR_ADDTO(LDADD_crypto_nss, [$nss_LDFLAGS -lnspr4 -lnss3 $APR_LIBS]) apu_have_crypto=1 fi AC_SUBST(LDADD_crypto_nss) --- build/dbm.m4.orig 2016-02-10 19:03:41.487480877 -0500 +++ build/dbm.m4 2016-02-10 19:04:15.287910203 -0500 @@ -722,7 +722,7 @@ AC_SUBST(apu_db_version) if test "$apu_have_db" = "1"; then - APR_ADDTO(LDADD_dbm_db, [-l$apu_db_lib]) + APR_ADDTO(LDADD_dbm_db, [-l$apu_db_lib $APR_LIBS]) if test -n "apu_db_xtra_libs"; then APR_ADDTO(LDADD_dbm_db, [$apu_db_xtra_libs]) fi --- build/apu-conf.m4.orig 2016-02-10 19:22:03.762271990 -0500 +++ build/apu-conf.m4 2016-02-10 19:24:22.114203976 -0500 @@ -195,7 +195,7 @@ unset ac_cv_lib_${ldaplib_cache_id}___ldap_init AC_CHECK_LIB(${ldaplib}, ldap_init, [ - LDADD_ldap_found="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib} $APR_LIBS" AC_CHECK_LIB(${ldaplib}, ldapssl_client_init, apu_has_ldapssl_client_init="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_client_deinit, apu_has_ldapssl_client_deinit="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_add_trusted_cert, apu_has_ldapssl_add_trusted_cert="1", , ${extralib}) --- build/dbd.m4.apr-link 2012-08-10 15:51:58.000000000 -0400 +++ build/dbd.m4 2016-02-26 16:07:32.766969924 -0500 @@ -147,7 +147,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_pgsql" = "1"; then - APR_ADDTO(LDADD_dbd_pgsql, [$pgsql_LDFLAGS -lpq $pgsql_LIBS]) + APR_ADDTO(LDADD_dbd_pgsql, [$pgsql_LDFLAGS -lpq $pgsql_LIBS $APR_LIBS]) fi AC_SUBST(LDADD_dbd_pgsql) @@ -229,7 +229,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_mysql" = "1"; then - APR_ADDTO(LDADD_dbd_mysql, [$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS]) + APR_ADDTO(LDADD_dbd_mysql, [$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS $APR_LIBS]) fi AC_SUBST(LDADD_dbd_mysql) @@ -273,7 +273,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_sqlite3" = "1"; then - APR_ADDTO(LDADD_dbd_sqlite3, [$sqlite3_LDFLAGS -lsqlite3]) + APR_ADDTO(LDADD_dbd_sqlite3, [$sqlite3_LDFLAGS -lsqlite3 $APR_LIBS]) fi AC_SUBST(LDADD_dbd_sqlite3) @@ -455,7 +455,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_freetds" = "1"; then - APR_ADDTO(LDADD_dbd_freetds, [$sybdb_LDFLAGS -lsybdb]) + APR_ADDTO(LDADD_dbd_freetds, [$sybdb_LDFLAGS -lsybdb $APR_LIBS]) dnl Erm, I needed pcreposix, but I think that dependency has gone dnl from the current code dnl APR_ADDTO(LDADD_dbd_freetds, [-lpcreposix]) @@ -552,7 +552,7 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_odbc" = "1"; then - APR_ADDTO(LDADD_dbd_odbc, [$odbc_LDFLAGS -lodbc $odbc_LIBS]) + APR_ADDTO(LDADD_dbd_odbc, [$odbc_LDFLAGS -lodbc $odbc_LIBS $APR_LIBS]) fi AC_SUBST(LDADD_dbd_odbc)