Link with -no-undefined

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Mon Jun 19 20:43:09 CEST 2006


At Mon, 19 Jun 2006 14:26:48 +0200,
Simon Josefsson <jas at extundo.com> wrote:
> 
> Adding -no-undefined flag to libtool has a side-effect of producing an
> DLL of libgcrypt when cross-compiling to mingw32.
>
> The Libtool documentation for the flag is somewhat confusing, but the
> intention is that the flag is used when the library doesn't need any
> externals symbols, which is true for libgcrypt.

In GPGME, we have something like the below.  We also have a resource
file and a symbol export definition file (eg
libgcrypt/w32-dll/libgcrypt.def).  I think that any port of libgcrypt
to the mingw32 target should have all of these, and whatever else is
required to make libgcrypt work on w32 targets...

Thanks,
Marcus

if HAVE_W32_SYSTEM

LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
     `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
     sed -e 's/-I/--include-dir /g;s/-D/--define /g'`

%.lo : %.rc
        $(LTRCCOMPILE) -i $< -o $@

gpgme_res = versioninfo.lo
gpgme_res_ldflag = -Wl,.libs/versioninfo.o

no_undefined = -no-undefined
export_symbols = -export-symbols $(srcdir)/gpgme.def

install-def-file:
        $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def

uninstall-def-file:
        -rm $(DESTDIR)$(libdir)/gpgme.def

gpgme_deps = $(gpgme_res) gpgme.def
else
gpgme_res =
gpgme_res_ldflag =
no_undefined =
export_symbols =
install-def-file:
uninstall-def-file:

gpgme_deps =
endif

libgpgme_la_LDFLAGS = $(gpgme_res_ldflag) $(no_undefined) $(export_symbols) \
        $(libgpgme_version_script_cmd) -version-info \
        @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
libgpgme_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
        @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
libgpgme_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
        @GPG_ERROR_LIBS@





More information about the Gcrypt-devel mailing list