[syslog-ng] Newer libtool and autoconf versions?

Corinna Vinschen vinschen at redhat.com
Fri Dec 17 14:56:42 CET 2010


On Dec 17 14:07, Corinna Vinschen wrote:
> On Dec 13 20:39, Corinna Vinschen wrote:
> > On Dec 13 20:13, Balazs Scheidler wrote:
> > > On Fri, 2010-12-10 at 17:57 +0100, Corinna Vinschen wrote:
> > > > On Dec 10 10:30, Corinna Vinschen wrote:
> > > > I just got the hint that the libtool --mode=link option "-module" is
> > > > supposed to do exactly this on Cygwin.
> > > > [...]
> > > > Would that be ok with you?
> > > 
> > > It used to be "-avoid-version -module" but it was removed by this
> > > commit:
> > > 
> > > Author: Balazs Scheidler <bazsi at balabit.hu>  2010-09-27 15:51:22
> > > Committer: Balazs Scheidler <bazsi at balabit.hu>  2010-09-27 15:51:22
> > > Parent: f437439a9c28555271b1298eeaf6e962ec626cc1 (use -avoid-version for modules)
> > > Follows: v3.2alpha1
> > > Precedes: v3.2beta1
> > > 
> > >     modules: don't use -module libtool option
> > >     
> > >     As it causes a libtool warning when linking the module explicitly to
> > >     a program and it worked without that on all of our platforms anyway.
> > > 
> > > The problem is that I'm linking pdbtool against the libdbparser.so file
> > > and the unit tests and using -module causes a lot of warnings during
> > > compilation.
> > > 
> > > Do you perhaps have an idea how otherwise work around the warning?
> > 
> > Does the -export-dynamic option when linking pdbtool help, perhaps?
> 
> Here's how you avoid the warning:
> 
> diff --git a/configure.in b/configure.in
> index ea671be..0e534f8 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -156,7 +156,7 @@ AC_PROG_YACC
>  AM_PROG_LEX
>  AC_PROG_MAKE_SET
>  PKG_PROG_PKG_CONFIG
> -LT_INIT([disable-static])
> +LT_INIT([dlopen disable-static])
>  
>  dnl ***************************************************************************
>  dnl Validate yacc
> diff --git a/modules/dbparser/Makefile.am b/modules/dbparser/Makefile.am
> index 2a08c29..76a6cef 100644
> --- a/modules/dbparser/Makefile.am
> +++ b/modules/dbparser/Makefile.am
> @@ -26,7 +26,7 @@ libdbparser_la_LDFLAGS = -avoid-version -module
>  bin_PROGRAMS = pdbtool
>  pdbtool_SOURCES = pdbtool.c patternize.c patternize.h
>  pdbtool_CPPFLAGS = $(AM_CPPFLAGS) @OPENSSL_CFLAGS@
> -pdbtool_LDADD = ../../lib/libsyslog-ng.la libdbparser.la @OPENSSL_LIBS@ @DEPS_LIBS@
> +pdbtool_LDADD = ../../lib/libsyslog-ng.la -dlpreopen libdbparser.la @OPENSSL_LIBS@ @DEPS_LIBS@
>  
>  BUILT_SOURCES = dbparser-grammar.y dbparser-grammar.c dbparser-grammar.h
>  EXTRA_DIST = $(BUILT_SOURCES) radix-find.c dbparser-grammar.ym

I'm going to prepare another patch for bugzilla #104, which contains the
whole thing:

- Add "dlopen" to LT_INIT.
- Add -module to the module LDFLAGS.
- Add -dlpreopen to the pdbtool link line.

Plus:

- Add -no-undefined to the shared libs LDFLAGS so that you can build on
  Cygwin with just "make" as well.  Right now you have to call "make
  CCLD='$(CC) -no-undefined'", which is rather annoying.

I tested this change on Cygwin and on Fedora 14, so I'm pretty confident
that it works.

This also requires a change to the patch in bugzilla #103.  So far it
still mentiones the CCLD='$(CC) -no-undefined' stuff, which will be
obsolete with the aforementioned changes to #104.

Even with these changes there will still be a problem with pdbtool on
Cygwin.  Since we have no static libs, and since it's not possible to
link statically against a DLL, pdbtool requires cygdbparser.dll
(equiv. libdbparser.so on Linux) to be in $PATH.  Given that the
modules are in /usr/lib/syslog-ng, that's not feasible.

Two possible solutions come to mind:

- Either enable static libs for the dbparser libs and link pdbtool
  statically.

- Or, install pdbtool into /usr/lib/syslog-ng along the modules, and
  make /usr/bin/pdbtool a symlink to /usr/lib/syslog-ng/pdbtool.

Thoughts?


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


More information about the syslog-ng mailing list