summaryrefslogtreecommitdiff
path: root/dbus/Makefile.am
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-09-28 16:58:34 +0100
committerSimon McVittie <smcv@collabora.com>2017-10-09 13:36:39 +0100
commit7250c73e17276c29ab2745699703495a8700f033 (patch)
tree0766569d42e375b4d3c421eab0f765ed2d582ede /dbus/Makefile.am
parent15c4e0d5e2bd5ad1a8ed6d5cc64ab61d375c2505 (diff)
downloaddbus-7250c73e17276c29ab2745699703495a8700f033.tar.gz
Windows: Simplify compiling versioninfo.rc by using libtool facilities
libtool has built-in support for Windows resources, and we even enable it in configure.ac. What it doesn't have is a built-in rule for generating Libtool objects using that built-in support, but we can add one. We have to generate Libtool pseudo-objects (.lo) rather than native object files (.o) so that we get both a PIC object for the shared library and a non-PIC object for the static library. This mimics the libtool invocations used for compiling C and C++. Note that $(RC) is typically i686-w64-mingw32-windres, the same as our project-specific variable $(WINDRES) which was previously used here. Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015 Reviewed-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'dbus/Makefile.am')
-rw-r--r--dbus/Makefile.am22
1 files changed, 5 insertions, 17 deletions
diff --git a/dbus/Makefile.am b/dbus/Makefile.am
index 73587f3d..cbe4539e 100644
--- a/dbus/Makefile.am
+++ b/dbus/Makefile.am
@@ -44,21 +44,8 @@ if DBUS_WIN
SUFFIXES = .rc
-.rc.o:
- $(WINDRES) $< -o $@
-
-# We can't just put versioninfo.rc in SOURCES and let Automake infer
-# how to make versioninfo.o, because libtool wants libtool objects (.lo),
-# not plain COFF objects (.o). Add it to the linker command explicitly
-# instead.
-dbus_res = versioninfo.o
-EXTRA_libdbus_1_la_DEPENDENCIES = $(dbus_res)
-dbus_res_ldflag = -Wl,$(dbus_res)
-
-else
-
-dbus_res =
-dbus_res_ldflag =
+.rc.lo:
+ $(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $< -o $@
endif
@@ -69,7 +56,9 @@ endif
if DBUS_WIN
DBUS_LIB_arch_sources = \
dbus-server-win.c \
- dbus-server-win.h
+ dbus-server-win.h \
+ versioninfo.rc \
+ $(NULL)
if DBUS_WINCE
wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
@@ -303,7 +292,6 @@ libdbus_1_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
$(SYMBOL_EXPORT_LDFLAGS) \
-no-undefined \
- $(dbus_res_ldflag) \
$(NULL)
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) libdbus-1.la