]> granicus.if.org Git - graphviz/commitdiff
once more into the breach to integrate the GDI+ plugin: must specify Platform SDK...
authorglenlow <devnull@localhost>
Tue, 4 Mar 2008 12:03:00 +0000 (12:03 +0000)
committerglenlow <devnull@localhost>
Tue, 4 Mar 2008 12:03:00 +0000 (12:03 +0000)
plugin/gdiplus/Makefile.am

index 19c0bfa7328673bedb7cc1bb0efbe78407bf1c04..ce558de2f4bfa78f467f52b734e5d5909fe9b125 100644 (file)
@@ -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)