From e1bb74164df5e3fcb2f26c74f45bb30260db2fc9 Mon Sep 17 00:00:00 2001 From: glenlow Date: Tue, 4 Mar 2008 12:03:00 +0000 Subject: [PATCH] once more into the breach to integrate the GDI+ plugin: must specify Platform SDK directories during configure, correct dependency rules for patched/unpatched headers, pass GDI+ import library direct to linker --- plugin/gdiplus/Makefile.am | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/plugin/gdiplus/Makefile.am b/plugin/gdiplus/Makefile.am index 19c0bfa73..ce558de2f 100644 --- a/plugin/gdiplus/Makefile.am +++ b/plugin/gdiplus/Makefile.am @@ -9,6 +9,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/graph \ -I$(top_srcdir)/lib/cdt +PATCHES = GdiPlusEnums.h.patch GdiPlusHeaders.h.patch GdiPlusimageAttributes.h.patch GdiPlusImaging.h.patch +PATCHED_HEADS = $(PATCHES:.h.patch=.h) + if WITH_GDIPLUS noinst_LTLIBRARIES = libgvplugin_gdiplus_C.la if WITH_WIN32 @@ -18,25 +21,33 @@ pkglib_LTLIBRARIES = libgvplugin_gdiplus.la endif endif +nodist_libgvplugin_gdiplus_C_la_SOURCES = GdiPlus*.h libgvplugin_gdiplus_C_la_SOURCES = \ gvplugin_gdiplus.cpp \ gvrender_gdiplus.cpp -libgvplugin_gdiplus_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO -L "$(GDIPLUS_PLATFORMSDK)/lib" -nodist_libgvplugin_gdiplus_la_SOURCES = $(nodist_libgvplugin_gdiplus_C_la_SOURCES) +# libtool doesn't want to run with actual Windows import libs, so we force GdiPlus.lib through to the linker +libgvplugin_gdiplus_la_LDFLAGS = -version-info @GVPLUGIN_VERSION_INFO@ -Wl,"$(PLATFORMSDKLIB)\GdiPlus.lib" +nodist_libgvplugin_gdiplus_la_SOURCES = GdiPlus*.h libgvplugin_gdiplus_la_SOURCES = $(libgvplugin_gdiplus_C_la_SOURCES) -libgvplugin_gdiplus_la_LIBADD = -lgdiplus -lgdi32 -lole32 -lstdc++ +libgvplugin_gdiplus_la_LIBADD = -lgdi32 -lole32 -lstdc++ $(top_builddir)/lib/gvc/libgvc.la if WITH_WIN32 libgvplugin_gdiplus_la_LDFLAGS += -no-undefined endif -libgvplugin_gdiplus.la libgvplugin_gdiplus_C.la: GdiPlusHeaders - -# these targets are created on the build platform, not on the dist platform -.PHONY: GdiPlusHeaders -GdiPlusHeaders: gdiplus.diff - cp $(GDIPLUS_PLATFORMSDK)/include/*.h . - patch -p0 < gdiplus.diff +# object code is dependent on all the local GDI+ headers +gvrender_gdiplus.lo : $(GDIPLUS_HEADS) -EXTRA_DIST = gdiplus.diff +# patched GDI+ headers are dependent on the patches +$(PATCHED_HEADS) : %.h : %.h.patch + +# all the local GDI+ headers are dependent on the originals in PlatformSDK +# if the GDI+ header needs to be patched, patch it, else just copy it over +$(GDIPLUS_HEADS) : %.h : $(PLATFORMSDKINCLUDE_ESCAPED)/%.h + if expr "$(PATCHED_HEADS)" : '.*$*.h' >/dev/null 2>&1; \ + then patch -o $*.h "$(PLATFORMSDKINCLUDE)\$*.h" $*.h.patch; \ + else cp "$(PLATFORMSDKINCLUDE)\$*.h" $*.h; \ + fi + +EXTRA_DIST = $(PATCHES) -- 2.40.0