Browse code

Link .la files first, this should avoid linking to old libclamav as in bb #931.

A linker warning on OpenBSD has shown the real cause of this:
/usr/bin/ld: warning: libclamunrar_iface.so.3.3, needed by
../libclamav/.libs/libclamav.so.4.1, may conflict with libclamunrar_iface.so.4.1

When -L/usr/local/lib is needed (because of either bz2, gmp, zlib)
it was the first on the linker command-line.
If multiple -L are on the linker line they don't override each-other,
all -L directories are searched.
So "-L/usr/local/lib -lgmp -L../libclamunrar/.libs/ -lclamunrar"
means to link to libclamunrar in /usr/local/lib first, which causes linking
to the old library.
If we pass the .la files first to the linker, we avoid linking to old libraries.



git-svn: trunk@3835

Török Edvin authored on 2008/05/05 05:00:59
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sun May  4 21:57:33 EEST 2008 (edwin)
2
+------------------------------------
3
+  * libclamav/Makefile.am: link .la files first, this
4
+	should avoid linking to old libclamav as in bb #931
5
+
1 6
 Sat May  3 14:46:41 CEST 2008 (tk)
2 7
 ----------------------------------
3 8
   * libclamav/readdb.h: read daily.cfg stored inside .cld containers (bb#1006)
... ...
@@ -21,9 +21,9 @@ SUBDIRS = lzma .
21 21
 AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma
22 22
 
23 23
 if ENABLE_UNRAR
24
-libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la
24
+libclamav_la_LIBADD = $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
25 25
 else
26
-libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la
26
+libclamav_la_LIBADD = lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
27 27
 endif
28 28
 
29 29
 libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
... ...
@@ -75,8 +75,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
75 75
 libLTLIBRARIES_INSTALL = $(INSTALL)
76 76
 LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
77 77
 @ENABLE_UNRAR_FALSE@libclamav_la_DEPENDENCIES = lzma/liblzma.la
78
-@ENABLE_UNRAR_TRUE@libclamav_la_DEPENDENCIES = lzma/liblzma.la \
79
-@ENABLE_UNRAR_TRUE@	$(top_builddir)/libclamunrar_iface/libclamunrar_iface.la
78
+@ENABLE_UNRAR_TRUE@libclamav_la_DEPENDENCIES = $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la \
79
+@ENABLE_UNRAR_TRUE@	lzma/liblzma.la
80 80
 am_libclamav_la_OBJECTS = matcher-ac.lo matcher-bm.lo matcher.lo \
81 81
 	md5.lo others.lo readdb.lo cvd.lo dsig.lo str.lo scanners.lo \
82 82
 	textdet.lo filetypes.lo rtf.lo blob.lo mbox.lo message.lo \
... ...
@@ -264,8 +264,8 @@ top_builddir = @top_builddir@
264 264
 top_srcdir = @top_srcdir@
265 265
 SUBDIRS = lzma .
266 266
 AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma
267
-@ENABLE_UNRAR_FALSE@libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la
268
-@ENABLE_UNRAR_TRUE@libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la
267
+@ENABLE_UNRAR_FALSE@libclamav_la_LIBADD = lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
268
+@ENABLE_UNRAR_TRUE@libclamav_la_LIBADD = $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
269 269
 libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ \
270 270
 	-no-undefined $(am__append_1)
271 271
 include_HEADERS = clamav.h