[syslog-ng] Dynamic libs w/ 2.1.2

Nix nix at esperi.org.uk
Mon Nov 17 23:25:43 CET 2008


On 17 Nov 2008, Douglas E. Warner told this:

> configure: error: static GLib libraries not found (a file named libglib-2.0.a), either link GLib dynamically using the
> --enable-dynamic-linking or install a static GLib

I see it. AC_ARG_ENABLE is being used incorrectly, such that
enable_mixed_linking is always turned on, so everything fails unless you
have a static glib (and who has one of those? Not me!)

Balasz, AC_ARG_ENABLE is unusual: the third argument is *always* run,
whether you say --enable-foo or --disable-foo or --enable-foo=bar: you
have to do a bit of conditionalization inside that argument, like so
(with a bit of simplification as well):

commit c4ebe5c665622273c25ee6ecd8a507b92320a384
Author: Nix <nix at esperi.org.uk>
Date:   Mon Nov 17 22:24:26 2008 +0000

    Fix linking arguments.

diff --git a/configure.in b/configure.in
index 4b791b7..18a588a 100644
--- a/configure.in
+++ b/configure.in
@@ -58,15 +58,32 @@ AC_ARG_ENABLE(debug,
 AC_ARG_ENABLE(memtrace, 
               [  --enable-memtrace   Enable alternative leak debugging code.])
               
+enable_dynamic_linking=yes
+enable_static_linking=no
+enable_mixed_linking=no
+
 AC_ARG_ENABLE(dynamic-linking,
-              [  --enable-dynamic-linking        Link glib and eventlog dynamically instead of statically.],[enable_dynamic_linking="yes"; enable_static_linking="no"; enable_mixed_linking="no"],enable_dynamic_linking="yes")
+              [  --enable-dynamic-linking        Link glib and eventlog dynamically instead of statically.],
+              [if test "x$enable_dynamic_linking" != "xno"; then
+                   enable_dynamic_linking="yes";
+               fi])
 
 AC_ARG_ENABLE(static-linking,
-              [  --enable-static-linking         Link everything statically.],[enable_dynamic_linking="no"; enable_static_linking="yes"; enable_mixed_linking="no"],enable_static_linking="no")
+              [  --enable-static-linking         Link everything statically.],
+              [if test "x$enable_static_linking" != "xno"; then
+                   enable_static_linking="yes"; enable_dynamic_linking="no";
+               fi])
 
 AC_ARG_ENABLE(mixed-linking,
-              [  --enable-mixed-linking          Link 3rd party libraries statically, system libraries dynamically],[enable_dynamic_linking="no"; enable_static_linking="no"; enable_mixed_linking="yes"],enable_mixed_linking="no")
+              [  --enable-mixed-linking          Link 3rd party libraries statically, system libraries dynamically],
+              [if test "x$enable_mixed_linking" != "xno"; then
+                   enable_mixed_linking="yes"
+               fi])
+
 
+echo dynamic: $enable_dynamic_linking
+echo static: $enable_static_linking
+echo mixed: $enable_mixed_linking
 AC_ARG_ENABLE(ipv6,
               [  --enable-ipv6           Enable support for IPv6.],,enable_ipv6="auto")
 


More information about the syslog-ng mailing list