]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix the handling of Windows resources in shared libraries.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Mar 2009 12:39:32 +0000 (12:39 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:16:02 +0000 (12:16 +0200)
gettext-runtime/ChangeLog
gettext-runtime/configure.ac
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/Makefile.in

index f4f309eea1b98e7c6e470daf53183d4072869e3f..04020b5e67c5365286fb1634c56fb8330960d24d 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-25  Bruno Haible  <bruno@clisp.org>
+
+       Fix the handling of Windows resources in shared libraries.
+       * configure.ac: Invoke LT_LANG for 'WIndows Resource'.
+
 2009-01-14  Bruno Haible  <bruno@clisp.org>
 
        * configure.ac: More consistent m4 quoting.
index 0b793593f83470ff87829c084d246ab1c371c8fb..f58febc426fd4a8e43566b2ec633ffa15502a5c2 100644 (file)
@@ -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
index 3075fe93f15f3024794839412c3ea15451e5a108..070a5b7c42aac953f9df3ccfacaf139d224e4cc1 100644 (file)
@@ -1,3 +1,11 @@
+2009-03-25  Bruno Haible  <bruno@clisp.org>
+
+       * 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  <meyering@redhat.com>
 
        * vasnprintf.c (divide): Fix typo in comment.
index d37445438addadd113e64a715dbf898277bbb20e..3ff8cd9d68548782472e1d10ecaf50b8726ddbc7 100644 (file)
@@ -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