From 79a910eac7edf12b1df90540b3170031974dbacf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 25 Mar 2009 12:39:32 +0000 Subject: [PATCH] Fix the handling of Windows resources in shared libraries. --- gettext-runtime/ChangeLog | 5 +++++ gettext-runtime/configure.ac | 5 +++++ gettext-runtime/intl/ChangeLog | 8 ++++++++ gettext-runtime/intl/Makefile.in | 22 ++++++++++++++++++---- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gettext-runtime/ChangeLog b/gettext-runtime/ChangeLog index f4f309eea..04020b5e6 100644 --- a/gettext-runtime/ChangeLog +++ b/gettext-runtime/ChangeLog @@ -1,3 +1,8 @@ +2009-03-25 Bruno Haible + + Fix the handling of Windows resources in shared libraries. + * configure.ac: Invoke LT_LANG for 'WIndows Resource'. + 2009-01-14 Bruno Haible * configure.ac: More consistent m4 quoting. diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 0b793593f..f58febc42 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -64,8 +64,13 @@ gl_EARLY dnl Check for build configuration. gl_WOE32_DLL + LT_INIT([win32-dll]) +dnl Prepares the libtool configuration for handling of Windows resources, and +dnl sets the RC variable to a program that compiles Windows resource files. +LT_LANG([Windows Resource]) + dnl On mingw and Cygwin, we can activate special Makefile rules which add dnl version information to the shared libraries and executables. case "$host_os" in diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 3075fe93f..070a5b7c4 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,11 @@ +2009-03-25 Bruno Haible + + * Makefile.in (RC): New variable. + (OBJECTS_RES_yes): Add .$lo suffix. + (libintl.res.o): Renamed from libintl.res. + (libintl.res.lo): New rule. + (mostlyclean): Simplify. + 2009-03-23 Jim Meyering * vasnprintf.c (divide): Fix typo in comment. diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index d37445438..3ff8cd9d6 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -72,7 +72,10 @@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext +# Windows resource compiler (windres). Used when libtool is not used. WINDRES = @WINDRES@ +# Windows resource compiler (windres). Used via libtool. +RC = @RC@ # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. @@ -168,7 +171,7 @@ OBJECTS = \ version.$lo \ osdep.$lo \ intl-compat.$lo -OBJECTS_RES_yes = libintl.res +OBJECTS_RES_yes = libintl.res.$lo OBJECTS_RES_no = DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin export.h libintl.rc \ @@ -282,7 +285,7 @@ intl-compat.lo: $(srcdir)/intl-compat.c # inlined here, so that they can be written in a Makefile without requiring a # temporary file. They must contain literal newlines rather than semicolons, # so that they work with the sed-3.02 that is shipped with MSYS. -libintl.res: $(srcdir)/libintl.rc +libintl.res.o: $(srcdir)/libintl.rc nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \ sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ @@ -292,7 +295,18 @@ libintl.res: $(srcdir)/libintl.rc "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ - -i $(srcdir)/libintl.rc -o libintl.res --output-format=coff + -i $(srcdir)/libintl.rc -o libintl.res.o --output-format=coff +libintl.res.lo: $(srcdir)/libintl.rc + nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \ + sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ + $(LIBTOOL) --mode=compile --tag=RC $(RC) \ + "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ + "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ + "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ + "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ + -i $(srcdir)/libintl.rc -o libintl.res.lo --output-format=coff ref-add.sed: $(srcdir)/ref-add.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed @@ -569,7 +583,7 @@ ID: $(HEADERS) $(SOURCES) mostlyclean: - rm -f *.a *.la *.o *.obj *.lo libintl.res core core.* + rm -f *.a *.la *.o *.obj *.lo core core.* rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs -- 2.47.2