From ce60c2671ecab4bcdbee947e030e688ab8788dfd Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 20 Oct 2005 13:05:04 +0000 Subject: [PATCH] 2005-10-20 Marcus Brinkmann * configure.ac: Instead checking for windres and dlltool, invoke AC_LIBTOOL_WIN32_DLL and AC_LIBTOOL_RC. * src/Makefile.am [HAVE_W32_SYSTEM]: Use libtool, which simplifies the rules. --- trunk/ChangeLog | 7 +++++ trunk/configure.ac | 5 ++- trunk/gpgme/Makefile.am | 69 +++++++++++++++++++++++------------------ 3 files changed, 47 insertions(+), 34 deletions(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index d7fa95d..0314602 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,10 @@ +2005-10-20 Marcus Brinkmann + + * configure.ac: Instead checking for windres and dlltool, invoke + AC_LIBTOOL_WIN32_DLL and AC_LIBTOOL_RC. + * src/Makefile.am [HAVE_W32_SYSTEM]: Use libtool, which simplifies + the rules. + 2005-10-01 Marcus Brinkmann Released 1.1.0. diff --git a/trunk/configure.ac b/trunk/configure.ac index 9288b26..831ca31 100644 --- a/trunk/configure.ac +++ b/trunk/configure.ac @@ -69,9 +69,6 @@ AH_VERBATIM([_REENTRANT], #endif]) AC_PROG_CC -AC_CHECK_TOOL(DLLTOOL, dlltool, :) -AC_CHECK_TOOL(WINDRES, windres, :) - AC_SUBST(LIBGPGME_LT_CURRENT) AC_SUBST(LIBGPGME_LT_AGE) @@ -88,6 +85,8 @@ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) # Don't default to build static libs. AC_DISABLE_STATIC +AC_LIBTOOL_WIN32_DLL +AC_LIBTOOL_RC AC_PROG_LIBTOOL # For now we hardcode the use of version scripts. It would be better diff --git a/trunk/gpgme/Makefile.am b/trunk/gpgme/Makefile.am index ef12d46..94b46aa 100644 --- a/trunk/gpgme/Makefile.am +++ b/trunk/gpgme/Makefile.am @@ -89,7 +89,41 @@ libgpgme_pth_la_SOURCES = ath.h ath-pth.c AM_CPPFLAGS = $(assuan_cppflags) @GPG_ERROR_CFLAGS@ -libgpgme_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \ + +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'` + +%.o : %.rc + $(LTRCCOMPILE) -i $< -o $@ + +gpgme_res = versioninfo.o +gpgme_res_ldflag = -Wl,$(gpgme_res) +no_undefined = -no-undefined +export_symbols = -export-symbols $(srcdir)/gpgme.def + +install-def-file: + $(INSTALL) gpg-error.def $(DESTDIR)$(libdir)/gpgme.def + +uninstall-def-file: + -rm $(DESTDIR)$(libdir)/gpgme.def + +libgpgme_la_DEPENDENCIES = $(gpgme_res) gpgme.def + +else +gpgme_res = +gpgme_res_ldflag = +no_undefined = +export_symbols = +install-def-file: +uninstall-def-file: + +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 @@ -116,33 +150,6 @@ libgpgme_pth_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \ status-table.h : gpgme.h $(srcdir)/mkstatus < $(srcdir)/gpgme.h > status-table.h -# Special code to build a DLL. The current libtool (1.5.6) is not -# able to do this properly; we better use gcc's built in magic. -if HAVE_W32_SYSTEM - -w32_o_files = ath.o conversion.o data-compat.o data-fd.o \ - data-mem.o data-stream.o data-user.o data.o debug.o \ - decrypt-verify.o decrypt.o delete.o edit.o encrypt-sign.o \ - encrypt.o engine-gpgsm.o engine.o error.o export.o genkey.o \ - get-env.o gpgme.o import.o key.o keylist.o memrchr.o \ - op-support.o passphrase.o progress.o putc_unlocked.o \ - rungpg.o sign.o signers.o trust-item.o trustlist.o \ - ttyname_r.o vasprintf.o verify.o version.o \ - w32-io.o w32-sema.o w32-util.o \ - wait-global.o wait-private.o wait-user.o wait.o - -all-local: gpgme.dll gpgme.dll.a - -install-exec-hook: - cp gpgme.dll gpgme.dll.a $(DESTDIR)$(libdir)/ - $(STRIP) $(DESTDIR)$(libdir)/gpgme.dll - -gpgme.dll gpgme.dll.a: gpgme.def $(w32_o_files) versioninfo.o - $(CC) -shared -o gpgme.dll $(srcdir)/gpgme.def $(w32_o_files) \ - versioninfo.o @GPG_ERROR_LIBS@ -Wl,--out-implib,gpgme.dll.a - - -.rc.o: - $(WINDRES) `test -f '$<' || echo '$(srcdir)/'`$< $@ - -endif +install-data-local: install-def-file + +uninstall-local: uninstall-def-file -- 2.26.2