chiark / gitweb /
squash! Use autoconf to find -linnstorage etc., and link statically
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 30 Jan 2024 20:10:25 +0000 (20:10 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 30 Jan 2024 20:13:59 +0000 (20:13 +0000)
configure
configure.ac

index 320d6a1cdfe6eb0cbb8721371469e9153ea9e981..6cc98a7373ba5890cfa2ab3d6740881b7100a7b6 100755 (executable)
--- a/configure
+++ b/configure
@@ -4146,6 +4146,19 @@ done
 
 LIBS="-Wl,-Bdynamic $LIBS"
 
+# Possibly, we could link dynamically.  But the ABI stability of
+# the inn libraries is questionable.  On Debian only the .a files
+# are in inn2-dev.  The .so's are in inn2.deb, which isn't depended on
+# by inn2-dev, and which doesn't have a # shlibs file for them.
+# So right now we can't sensibly link dynamically.
+#
+# So we pass -Bstatic.
+#
+# Recall that LIBS is generally *prepended* to.  So we need to
+# temporarily put -Bstatic in LDFLAGS so that it ends up before
+# the actual libraries in the following tests.
+LDFLAGS="$LDFLAGS -Wl,-Bstatic"
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing NNTPconnect" >&5
 $as_echo_n "checking for library containing NNTPconnect... " >&6; }
 if ${ac_cv_search_NNTPconnect+:} false; then :
@@ -4267,15 +4280,10 @@ else
 fi
 
 
-# Possibly, we could link dynamically.  But the ABI stability of
-# the inn libraries is questionable.  On Debian only the .a files
-# are in inn2-dev.  The .so's are in inn2.deb, which isn't depended on
-# by inn2-dev, and which doesn't have a # shlibs file for them.
-# So right now we can't sensibly link dynamically.
-#
-# So we pass -Bstatic.  (Recall that LIBS is generally *prepended* to,
-# and that it is automatically included in link lines by automake
+# Now move the -Bstatic to LIBS where it belongs.
+# LDFLAGS and LIBS are automatically included in link lines by automake
 # so nothing is needed in Makefile.am.)
+LDFLAGS="${LDFLAGS% -Wl,-Bstatic}"
 LIBS="-Wl,-Bstatic $LIBS"
 
 ac_config_headers="$ac_config_headers config.h"
index 4f7c559c10bcee6f4bcd653450b28aa1302ffb8b..72c75797e737690e8e2c9896f2f14f99a21db091 100644 (file)
@@ -33,6 +33,19 @@ AC_CHECK_HEADERS(sys/inotify.h)
 
 LIBS="-Wl,-Bdynamic $LIBS"
 
+# Possibly, we could link dynamically.  But the ABI stability of
+# the inn libraries is questionable.  On Debian only the .a files
+# are in inn2-dev.  The .so's are in inn2.deb, which isn't depended on
+# by inn2-dev, and which doesn't have a # shlibs file for them.
+# So right now we can't sensibly link dynamically.
+#
+# So we pass -Bstatic.
+#
+# Recall that LIBS is generally *prepended* to.  So we need to
+# temporarily put -Bstatic in LDFLAGS so that it ends up before
+# the actual libraries in the following tests.
+LDFLAGS="$LDFLAGS -Wl,-Bstatic"
+
 AC_SEARCH_LIBS(NNTPconnect, [inn], [],[
   AC_MSG_ERROR([failed to find libinn])
 ])
@@ -40,15 +53,10 @@ AC_SEARCH_LIBS(SMinit, [innstorage storage], [],[
   AC_MSG_ERROR([Failed to find INN storage library (-linnstorage, -lstorage)])
 ])
 
-# Possibly, we could link dynamically.  But the ABI stability of
-# the inn libraries is questionable.  On Debian only the .a files
-# are in inn2-dev.  The .so's are in inn2.deb, which isn't depended on
-# by inn2-dev, and which doesn't have a # shlibs file for them.
-# So right now we can't sensibly link dynamically.
-#
-# So we pass -Bstatic.  (Recall that LIBS is generally *prepended* to,
-# and that it is automatically included in link lines by automake
+# Now move the -Bstatic to LIBS where it belongs.
+# LDFLAGS and LIBS are automatically included in link lines by automake
 # so nothing is needed in Makefile.am.)
+LDFLAGS="${LDFLAGS% -Wl,-Bstatic}"
 LIBS="-Wl,-Bstatic $LIBS"
 
 AM_CONFIG_HEADER(config.h)