]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_statistic: link with -lm
authorJan Engelhardt <jengelh@medozas.de>
Sat, 3 Sep 2011 11:34:40 +0000 (13:34 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 3 Sep 2011 11:40:55 +0000 (13:40 +0200)
$ ldd -r libxt_statistic.so
undefined symbol: lround        (./libxt_statistic.so)

References: https://bugs.archlinux.org/task/25358
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/GNUmakefile.in
iptables/Makefile.am

index 2b48d8410a631b5a5d13f20896e5d05771d961c4..dbf210cc53757190c205fe05a32e6cabce72108d 100644 (file)
@@ -90,11 +90,14 @@ init%.o: init%.c
 #      Shared libraries
 #
 lib%.so: lib%.oo
-       ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $<;
+       ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $< ${$*_LIBADD};
 
 lib%.oo: ${srcdir}/lib%.c
        ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
 
+# Need the LIBADDs in iptables/Makefile.am too for libxtables_la_LIBADD
+xt_statistic_LIBADD = -lm
+
 
 #
 #      Static bits
index addb15986fa47669416ba34d1d875417212c765a..f6db32d0c7d23640a1dab57672bc6cc4261cbada 100644 (file)
@@ -6,12 +6,17 @@ AM_CPPFLAGS      = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}
 lib_LTLIBRARIES       = libxtables.la
 libxtables_la_SOURCES = xtables.c xtoptions.c
 libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage}
+libxtables_la_LIBADD  =
+if ENABLE_STATIC
+# With --enable-static, shipped extensions are linked into the main executable,
+# so we need all the LIBADDs here too
+libxtables_la_LIBADD += -lm
+endif
 if ENABLE_SHARED
 libxtables_la_CFLAGS  = ${AM_CFLAGS}
-libxtables_la_LIBADD  = -ldl
+libxtables_la_LIBADD += -ldl
 else
 libxtables_la_CFLAGS  = ${AM_CFLAGS} -DNO_SHARED_LIBS=1
-libxtables_la_LIBADD  =
 endif
 
 xtables_multi_SOURCES  = xtables-multi.c iptables-xml.c