From 0507c822047f7f0af9b03b33a577d83ff0918de1 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 24 May 2021 20:57:53 -0400 Subject: [PATCH] [build] adjustments for autotools on Mac OS X (mod_auth_api.c would be part of mod_auth.c and mod_vhostdb_api.c would be part of mod_vhostdb.c if not for MacOS) MacOS modules can link against .dylib, but not against other modules MacOS link with -module produces a .so, which lighttpd uses MacOS link without -module procudes a .dylib, but name *must* have prefix "lib...", which lighttpd "mod_*" do not have. Other lighttpd build configs (CMake, SCONS, meson) might not work on MacOS. Patches (which do not make a huge mess of things) welcome. --- src/Makefile.am | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 90a695fc..6e0355c2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -112,6 +112,9 @@ liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(LIBEV_CFLAGS) liblightcomp_la_LDFLAGS = $(common_ldflags) liblightcomp_la_LIBADD = $(PCRE_LIB) $(CRYPTO_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(ATTR_LIB) common_libadd = liblightcomp.la +if !LIGHTTPD_STATIC +common_src += mod_auth_api.c mod_vhostdb_api.c +endif else src += $(common_src) common_ldflags = -avoid-version @@ -173,7 +176,10 @@ mod_trigger_b4_dl_la_LIBADD = $(GDBM_LIB) $(MEMCACHED_LIB) $(common_libadd) endif lib_LTLIBRARIES += mod_vhostdb.la -mod_vhostdb_la_SOURCES = mod_vhostdb.c mod_vhostdb_api.c +mod_vhostdb_la_SOURCES = mod_vhostdb.c +if !NO_RDYNAMIC +mod_vhostdb_la_SOURCES += mod_vhostdb_api.c +endif mod_vhostdb_la_LDFLAGS = $(common_module_ldflags) mod_vhostdb_la_LIBADD = $(common_libadd) @@ -332,7 +338,10 @@ mod_deflate_la_LDFLAGS = $(BROTLI_CFLAGS) $(common_module_ldflags) mod_deflate_la_LIBADD = $(Z_LIB) $(ZSTD_LIB) $(BZ_LIB) $(BROTLI_LIBS) $(common_libadd) lib_LTLIBRARIES += mod_auth.la -mod_auth_la_SOURCES = mod_auth.c mod_auth_api.c +mod_auth_la_SOURCES = mod_auth.c +if !NO_RDYNAMIC +mod_auth_la_SOURCES += mod_auth_api.c +endif mod_auth_la_LDFLAGS = $(common_module_ldflags) mod_auth_la_LIBADD = $(CRYPTO_LIB) $(common_libadd)