On 2009-08-23 03:24, Stephen Gran wrote: > Hi all, > > This patch makes the shared/ subdirectory build a convenience library. >
Hi Stephen, Did you git add shared/Makefile.am? I don't see it in your patch. > This means that on builds, each object file is only built once, then > compiled into a static, partially linked object file. This has obvious > advantages for the build time, as you only build these files once. It > also has advantages for the maintenance of various Makefile.am's, since > you just include the .la file and let libtool do the rest. > > Including inline since I think the list strips attachments.shar > > There are some ifdefs in shared/, CL_NOLIBCLAMAV, and CL_NOTHREADS, with your patch all the code would be built as if those would not be defined. NOLIBCLAMAV is needed by clamav-milter, clamdscan, and clamdtop. I t is particularly important for clamdscan, we don't want clamdscan to link libclamav! AFAICT the NOTHREADS define is only needed to avoid linking programs that don't need pthread with pthread. I'm not particularly fond of the way NOLIBCLAMAV is handled, maybe it would be better to split mis.c into two files, and have 2 shared.la files built: shared_nolibclamav.la, shared_libclamav.la, and have clamdscan link only shared_nolibclamav.la. Not sure what should be done about NOTHREADS, but I think currently these permutations are needed: shared_nolibclamav shared_libclamav shared_threads_libclamav shared_threads_nolibclamav Not all files in shared/ use those defines, so you may avoid rebuilding each with different CFLAGS. > diff --git a/clamav-milter/Makefile.am b/clamav-milter/Makefile.am > index 5613e53..19e00a2 100644 > --- a/clamav-milter/Makefile.am > +++ b/clamav-milter/Makefile.am > @@ -22,14 +22,6 @@ if HAVE_MILTER > sbin_PROGRAMS = clamav-milter > > clamav_milter_SOURCES = \ > - $(top_srcdir)/shared/optparser.c \ > - $(top_srcdir)/shared/optparser.h \ > - $(top_srcdir)/shared/output.c \ > - $(top_srcdir)/shared/output.h \ > - $(top_srcdir)/shared/getopt.c \ > - $(top_srcdir)/shared/getopt.h \ > - $(top_srcdir)/shared/misc.c \ > - $(top_srcdir)/shared/misc.h \ > whitelist.c \ > whitelist.h \ > connpool.c \ > @@ -46,6 +38,6 @@ endif > > DEFS = @DEFS@ -DCL_NOLIBCLAMAV > Here is one such def. > diff --git a/clamscan/Makefile.am b/clamscan/Makefile.am > index c965af4..a296ebe 100644 > --- a/clamscan/Makefile.am > +++ b/clamscan/Makefile.am > @@ -20,16 +20,6 @@ > bin_PROGRAMS = clamscan > > clamscan_SOURCES = \ > - $(top_srcdir)/shared/output.c \ > - $(top_srcdir)/shared/output.h \ > - $(top_srcdir)/shared/getopt.c \ > - $(top_srcdir)/shared/getopt.h \ > - $(top_srcdir)/shared/optparser.c \ > - $(top_srcdir)/shared/optparser.h \ > - $(top_srcdir)/shared/actions.c \ > - $(top_srcdir)/shared/actions.h \ > - $(top_srcdir)/shared/misc.c \ > - $(top_srcdir)/shared/misc.h \ > clamscan.c \ > others.c \ > others.h \ > @@ -38,7 +28,7 @@ clamscan_SOURCES = \ > manager.h > > DEFS = @DEFS@ -DCL_NOTHREADS > And here is another. Best regards, --Edwin _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html Please submit your patches to our Bugzilla: http://bugs.clamav.net
