Skip to content

Commit 0be2421

Browse files
committed
Fix the handling of Windows resources in shared libraries.
1 parent e09e3a7 commit 0be2421

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2009-03-25 Bruno Haible <bruno@clisp.org>
2+
3+
Fix the handling of Windows resources in shared libraries.
4+
* configure.ac: Invoke LT_LANG for 'WIndows Resource'.
5+
* lib/Makefile.in (RC): New variable.
6+
(WINDRES): Remove variable.
7+
(OBJECTS_RES_yes): Add .lo suffix.
8+
(libiconv.res.lo): Renamed from libiconv.res. Use libtool --tag=RC.
9+
(clean): Simplify.
10+
Based on a patch by Roumen Petrov <bugtrack@roumenpetrov.info>.
11+
112
2009-03-14 Bruno Haible <bruno@clisp.org>
213

314
* autogen.sh: Checkout gnulib using 'git' instead of 'cvs'.

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ AC_EXEEXT
7878
dnl check for build configuration
7979

8080
LT_INIT([disable-static win32-dll])
81+
82+
dnl Prepares the libtool configuration for handling of Windows resources, and
83+
dnl sets the RC variable to a program that compiles Windows resource files.
84+
LT_LANG([Windows Resource])
85+
8186
gl_VISIBILITY
8287
AM_ICONV
8388
AM_GNU_GETTEXT([external], [need-ngettext])
@@ -168,7 +173,7 @@ fi
168173
AC_SUBST([DLL_VARIABLE])
169174

170175
dnl On mingw and Cygwin, we can activate special Makefile rules which add
171-
dnl version information to the shared libraries and executables.
176+
dnl version information to the executables.
172177
case "$host_os" in
173178
mingw* | cygwin*) is_woe32=yes ;;
174179
*) is_woe32=no ;;

lib/Makefile.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
3030
LIBTOOL_LINK = $(LIBTOOL) --mode=link
3131
LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
3232
LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
33-
WINDRES = @WINDRES@
33+
# Windows resource compiler (windres). Used via libtool.
34+
RC = @RC@
3435
CP = cp
3536
MV = mv
3637
LN = @LN@
@@ -61,7 +62,7 @@ SOURCES = $(srcdir)/iconv.c $(srcdir)/../libcharset/lib/localcharset.c $(srcdir)
6162
OBJECTS = iconv.lo localcharset.lo relocatable.lo $(OBJECTS_EXP_@WOE32DLL@) $(OBJECTS_RES_@WOE32@)
6263
OBJECTS_EXP_yes = iconv-exports.lo
6364
OBJECTS_EXP_no =
64-
OBJECTS_RES_yes = libiconv.res
65+
OBJECTS_RES_yes = libiconv.res.lo
6566
OBJECTS_RES_no =
6667

6768
all : libiconv.la
@@ -88,8 +89,8 @@ relocatable.lo : $(srcdir)/relocatable.c $(srcdir)/relocatable.h
8889
iconv-exports.lo : $(srcdir)/../woe32dll/iconv-exports.c
8990
$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/../woe32dll/iconv-exports.c
9091

91-
libiconv.res : $(srcdir)/../windows/libiconv.rc
92-
$(WINDRES) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/libiconv.rc -o libiconv.res --output-format=coff
92+
libiconv.res.lo : $(srcdir)/../windows/libiconv.rc
93+
$(LIBTOOL_COMPILE) --tag=RC $(RC) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/libiconv.rc -o libiconv.res.lo --output-format=coff
9394

9495
# Installs the library and include files only. Typically called with only
9596
# $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here.
@@ -125,7 +126,7 @@ check : all
125126
mostlyclean : clean
126127

127128
clean : force
128-
$(RM) *.o *.lo libiconv.res *.a *.la core *.stackdump so_locations
129+
$(RM) *.o *.lo *.a *.la core *.stackdump so_locations
129130
$(RM) -r .libs _libs
130131

131132
distclean : clean

0 commit comments

Comments
 (0)