]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/Makefile.am
Merges from stable branch that had been left out. (#136282, J. Ali Harlow)
[~andy/gtk] / gdk-pixbuf / Makefile.am
1
2 SUBDIRS = pixops
3
4 if PLATFORM_WIN32
5 no_undefined = -no-undefined
6 endif
7
8 if OS_WIN32
9 gdk_pixbuf_def = gdk_pixbuf.def
10 gdk_pixbuf_symbols = -export-symbols $(gdk_pixbuf_def)
11
12 gdk_pixbuf_win32res_lo = gdk_pixbuf-win32res.lo
13
14 gdk_pixbuf-win32res.lo : gdk_pixbuf.rc
15         $(top_srcdir)/build/win32/lt-compile-resource gdk_pixbuf.rc gdk_pixbuf-win32res.lo
16
17 install-libtool-import-lib:
18         $(INSTALL) .libs/libgdk_pixbuf-$(GTK_API_VERSION).dll.a $(DESTDIR)$(libdir)
19 uninstall-libtool-import-lib:
20         -rm $(DESTDIR)$(libdir)/libgdk_pixbuf-$(GTK_API_VERSION).dll.a
21 else
22 install-libtool-import-lib:
23 uninstall-libtool-import-lib:
24 endif
25
26 if MS_LIB_AVAILABLE
27 noinst_DATA = gdk_pixbuf-$(GTK_API_VERSION).lib
28
29 gdk_pixbuf-$(GTK_API_VERSION).lib: libgdk_pixbuf-$(GTK_API_VERSION).la gdk_pixbuf.def
30         lib -name:libgdk_pixbuf-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk_pixbuf.def -out:$@
31
32 install-ms-lib:
33         $(INSTALL) gdk_pixbuf-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
34
35 uninstall-ms-lib:
36         -rm $(DESTDIR)$(libdir)/gdk_pixbuf-$(GTK_API_VERSION).lib
37 else
38 install-ms-lib:
39 uninstall-ms-lib:
40 endif
41
42 lib_LTLIBRARIES =               \
43         libgdk_pixbuf-2.0.la
44
45 loaderdir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/loaders
46
47 module_libs = libgdk_pixbuf-$(GTK_API_VERSION).la $(GDK_PIXBUF_DEP_LIBS)
48
49 #
50 # The PNG plugin.
51 #
52 libpixbufloader_png_la_SOURCES = io-png.c
53 libpixbufloader_png_la_LDFLAGS = -avoid-version -module $(no_undefined)
54 libpixbufloader_png_la_LIBADD = $(LIBPNG) $(module_libs)
55 libpixbufloader_static_png_la_SOURCES = io-png.c
56
57 #
58 # The JPEG loader
59 #
60 libpixbufloader_static_jpeg_la_SOURCES = io-jpeg.c
61 libpixbufloader_jpeg_la_SOURCES = io-jpeg.c
62 libpixbufloader_jpeg_la_LDFLAGS = -avoid-version -module $(no_undefined)
63 libpixbufloader_jpeg_la_LIBADD = $(LIBJPEG) $(module_libs)
64
65 #
66 # The XPM loader
67 #
68 libpixbufloader_static_xpm_la_SOURCES = io-xpm.c
69 libpixbufloader_xpm_la_SOURCES = io-xpm.c
70 libpixbufloader_xpm_la_LDFLAGS = -avoid-version -module $(no_undefined)
71 libpixbufloader_xpm_la_LIBADD = $(module_libs)
72
73 #
74 # The GIF loader
75 #
76 libpixbufloader_static_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
77 libpixbufloader_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
78 libpixbufloader_gif_la_LDFLAGS = -avoid-version -module $(no_undefined)
79 libpixbufloader_gif_la_LIBADD = $(module_libs)
80
81 #
82 # The ICO loader
83 #
84 libpixbufloader_static_ico_la_SOURCES = io-ico.c
85 libpixbufloader_ico_la_SOURCES = io-ico.c
86 libpixbufloader_ico_la_LDFLAGS = -avoid-version -module $(no_undefined)
87 libpixbufloader_ico_la_LIBADD = $(module_libs)
88
89 #
90 # The ANI loader
91 #
92 libpixbufloader_static_ani_la_SOURCES = io-ani.c io-ani-animation.c io-ani-animation.h
93 libpixbufloader_ani_la_SOURCES = io-ani.c io-ani-animation.c io-ani-animation.h
94 libpixbufloader_ani_la_LDFLAGS = -avoid-version -module $(no_undefined)
95 libpixbufloader_ani_la_LIBADD = $(module_libs)
96
97 #
98 # The RAS loader
99 #
100 libpixbufloader_static_ras_la_SOURCES = io-ras.c
101 libpixbufloader_ras_la_SOURCES = io-ras.c
102 libpixbufloader_ras_la_LDFLAGS = -avoid-version -module $(no_undefined)
103 libpixbufloader_ras_la_LIBADD = $(module_libs)
104
105 #
106 # The TIFF loader
107 #
108 libpixbufloader_static_tiff_la_SOURCES = io-tiff.c
109 libpixbufloader_tiff_la_SOURCES = io-tiff.c
110 libpixbufloader_tiff_la_LDFLAGS = -avoid-version -module $(no_undefined)
111 libpixbufloader_tiff_la_LIBADD = $(LIBTIFF) $(module_libs)
112
113 #
114 # The PNM loader
115 #
116 libpixbufloader_static_pnm_la_SOURCES = io-pnm.c
117 libpixbufloader_pnm_la_SOURCES = io-pnm.c
118 libpixbufloader_pnm_la_LDFLAGS = -avoid-version -module $(no_undefined)
119 libpixbufloader_pnm_la_LIBADD = $(module_libs)
120
121 #
122 # The BMP loader
123 #
124 libpixbufloader_static_bmp_la_SOURCES = io-bmp.c
125 libpixbufloader_bmp_la_SOURCES = io-bmp.c
126 libpixbufloader_bmp_la_LDFLAGS = -avoid-version -module $(no_undefined)
127 libpixbufloader_bmp_la_LIBADD = $(module_libs)
128
129 #
130 # The WBMP loader
131 #
132 libpixbufloader_static_wbmp_la_SOURCES = io-wbmp.c
133 libpixbufloader_wbmp_la_SOURCES = io-wbmp.c
134 libpixbufloader_wbmp_la_LDFLAGS = -avoid-version -module $(no_undefined)
135 libpixbufloader_wbmp_la_LIBADD = $(module_libs)
136
137 #
138 # The XBM loader
139 #
140 libpixbufloader_static_xbm_la_SOURCES = io-xbm.c
141 libpixbufloader_xbm_la_SOURCES = io-xbm.c
142 libpixbufloader_xbm_la_LDFLAGS = -avoid-version -module $(no_undefined)
143 libpixbufloader_xbm_la_LIBADD = $(module_libs)
144
145 #
146 # The TGA loader
147 #
148 libpixbufloader_static_tga_la_SOURCES = io-tga.c
149 libpixbufloader_tga_la_SOURCES = io-tga.c
150 libpixbufloader_tga_la_LDFLAGS = -avoid-version -module $(no_undefined)
151 libpixbufloader_tga_la_LIBADD = $(module_libs)
152
153 #
154 # The PCX loader
155 #
156 libpixbufloader_static_pcx_la_SOURCES = io-pcx.c
157 libpixbufloader_pcx_la_SOURCES = io-pcx.c
158 libpixbufloader_pcx_la_LDFLAGS = -avoid-version -module $(no_undefined)
159 libpixbufloader_pcx_la_LIBADD = $(module_libs)
160
161 if HAVE_PNG
162 PNG_LIB = libpixbufloader-png.la
163 STATIC_PNG_LIB = libpixbufloader-static-png.la
164 endif
165
166 if HAVE_JPEG
167 JPEG_LIB = libpixbufloader-jpeg.la
168 STATIC_JPEG_LIB = libpixbufloader-static-jpeg.la
169 endif
170
171 GIF_LIB = libpixbufloader-gif.la
172 STATIC_GIF_LIB = libpixbufloader-static-gif.la
173
174 ICO_LIB = libpixbufloader-ico.la
175 STATIC_ICO_LIB = libpixbufloader-static-ico.la
176
177 ANI_LIB = libpixbufloader-ani.la
178 STATIC_ANI_LIB = libpixbufloader-static-ani.la
179
180 RAS_LIB = libpixbufloader-ras.la
181 STATIC_RAS_LIB = libpixbufloader-static-ras.la
182
183 if HAVE_TIFF
184 TIFF_LIB = libpixbufloader-tiff.la
185 STATIC_TIFF_LIB = libpixbufloader-static-tiff.la
186 endif
187
188 XPM_LIB = libpixbufloader-xpm.la
189 STATIC_XPM_LIB = libpixbufloader-static-xpm.la
190
191 PNM_LIB = libpixbufloader-pnm.la
192 STATIC_PNM_LIB = libpixbufloader-static-pnm.la
193
194 BMP_LIB = libpixbufloader-bmp.la
195 STATIC_BMP_LIB = libpixbufloader-static-bmp.la
196
197 WBMP_LIB = libpixbufloader-wbmp.la
198 STATIC_WBMP_LIB = libpixbufloader-static-wbmp.la
199
200 XBM_LIB = libpixbufloader-xbm.la
201 STATIC_XBM_LIB = libpixbufloader-static-xbm.la
202
203 TGA_LIB = libpixbufloader-tga.la
204 STATIC_TGA_LIB = libpixbufloader-static-tga.la
205
206 PCX_LIB = libpixbufloader-pcx.la
207 STATIC_PCX_LIB = libpixbufloader-static-pcx.la
208
209 if BUILD_DYNAMIC_MODULES
210
211 loader_LTLIBRARIES =    \
212         $(PNG_LIB)      \
213         $(JPEG_LIB)     \
214         $(GIF_LIB)      \
215         $(ICO_LIB)      \
216         $(ANI_LIB)      \
217         $(RAS_LIB)      \
218         $(XPM_LIB)      \
219         $(TIFF_LIB)     \
220         $(PNM_LIB)      \
221         $(BMP_LIB)      \
222         $(WBMP_LIB)     \
223         $(XBM_LIB)      \
224         $(TGA_LIB)      \
225         $(PCX_LIB)
226
227
228 extra_sources = 
229 builtin_objs = 
230 else
231 loader_LTLIBRARIES = 
232
233 noinst_LTLIBRARIES =            \
234         $(STATIC_PNG_LIB)       \
235         $(STATIC_JPEG_LIB)      \
236         $(STATIC_GIF_LIB)       \
237         $(STATIC_ICO_LIB)       \
238         $(STATIC_ANI_LIB)       \
239         $(STATIC_RAS_LIB)       \
240         $(STATIC_XPM_LIB)       \
241         $(STATIC_TIFF_LIB)      \
242         $(STATIC_PNM_LIB)       \
243         $(STATIC_BMP_LIB)       \
244         $(STATIC_WBMP_LIB)      \
245         $(STATIC_XBM_LIB)       \
246         $(STATIC_TGA_LIB)       \
247         $(STATIC_PCX_LIB)
248
249 builtin_objs = @INCLUDED_LOADER_OBJ@
250
251 endif
252
253 DEPS = libgdk_pixbuf-$(GTK_API_VERSION).la
254 INCLUDES = \
255         -DG_LOG_DOMAIN=\"GdkPixbuf\"            \
256         -I$(top_srcdir) -I$(top_builddir)       \
257         -I$(top_srcdir)/gdk-pixbuf              \
258         -I$(top_builddir)/gdk-pixbuf            \
259         -DGTK_SYSCONFDIR=\"$(sysconfdir)\"      \
260         -DGTK_VERSION=\"$(GTK_VERSION)\"        \
261         -DGTK_BINARY_VERSION=\"$(GTK_BINARY_VERSION)\"  \
262         -DG_DISABLE_DEPRECATED                  \
263         -DGDK_PIXBUF_DISABLE_DEPRECATED         \
264         -DGTK_PREFIX=\"$(prefix)\"              \
265         $(INCLUDED_LOADER_DEFINE)               \
266         $(GTK_DEBUG_FLAGS)                      \
267         $(GDK_PIXBUF_DEP_CFLAGS)                \
268         -DGDK_PIXBUF_ENABLE_BACKEND
269
270 AM_CPPFLAGS = "-DPIXBUF_LIBDIR=\"$(loaderdir)\"" "-DBUILT_MODULES_DIR=\"$(srcdir)/.libs\""
271 LDADDS = libgdk_pixbuf-$(GTK_API_VERSION).la
272
273 noinst_PROGRAMS = test-gdk-pixbuf
274 test_gdk_pixbuf_LDADD = $(LDADDS)
275
276 bin_PROGRAMS = gdk-pixbuf-csource gdk-pixbuf-query-loaders
277 gdk_pixbuf_csource_SOURCES = gdk-pixbuf-csource.c
278 gdk_pixbuf_csource_LDADD = $(LDADDS)
279
280 gdk_pixbuf_query_loaders_DEPENDENCIES = $(DEPS)
281 gdk_pixbuf_query_loaders_LDADD = $(LDADDS)
282
283 gdk_pixbuf_query_loaders_SOURCES = queryloaders.c
284
285
286 #
287 # The GdkPixBuf library
288 #
289 libgdk_pixbufincludedir = $(includedir)/gtk-2.0/gdk-pixbuf
290 libgdk_pixbuf_2_0_la_SOURCES =  \
291         gdk-pixbuf-i18n.h       \
292         gdk-pixbuf.c            \
293         gdk-pixbuf-animation.c  \
294         gdk-pixbuf-data.c       \
295         gdk-pixbuf-io.c         \
296         gdk-pixbuf-loader.c     \
297         gdk-pixbuf-scale.c      \
298         gdk-pixbuf-util.c       \
299         gdk-pixdata.c           \
300         gdk-pixbuf-enum-types.c
301
302 libgdk_pixbuf_2_0_la_LDFLAGS = \
303         -version-info $(LT_VERSION_INFO)        \
304         $(LIBTOOL_EXPORT_OPTIONS)               \
305         $(no_undefined)                         \
306         $(gdk_pixbuf_symbols)
307
308
309 libgdk_pixbuf_2_0_la_LIBADD = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_win32res_lo) $(GDK_PIXBUF_DEP_LIBS)
310 libgdk_pixbuf_2_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_def) $(gdk_pixbuf_win32res_lo)
311
312 gdk_pixbuf_headers =                    \
313         gdk-pixbuf.h                    \
314         gdk-pixbuf-io.h                 \
315         gdk-pixbuf-animation.h          \
316         gdk-pixbuf-loader.h
317
318 libgdk_pixbufinclude_HEADERS =          \
319         $(gdk_pixbuf_headers)           \
320         gdk-pixbuf-enum-types.h         \
321         gdk-pixbuf-marshal.h            \
322         gdk-pixbuf-features.h           \
323         gdk-pixdata.h
324
325 noinst_HEADERS =                \
326         gdk-pixbuf-private.h
327
328 BUILT_SOURCES = gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.c \
329   gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c
330
331 CLEANFILES =
332 MAINTAINERCLEANFILES = \
333   gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.c \
334   gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c \
335   gdk-pixbuf.loaders
336
337 #
338 # gdk-pixbuf-enum-types.h
339 #
340 gdk-pixbuf-enum-types.h: s-enum-types-h
341         @true
342
343 s-enum-types-h: @REBUILD@ $(gdk_pixbuf_headers) Makefile
344         ( cd $(srcdir) && glib-mkenums \
345                         --fhead "#ifndef __GDK_PIXBUF_ENUM_TYPES_H__\n#define __GDK_PIXBUF_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
346                         --fprod "/* enumerations from \"@filename@\" */\n" \
347                         --vhead "GType @enum_name@_get_type (void);\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
348                         --ftail "G_END_DECLS\n\n#endif /* __GDK_PIXBUF_ENUM_TYPES_H__ */" \
349                 $(gdk_pixbuf_headers) ) > tmp-gdk-pixbuf-enum-types.h \
350         && (cmp -s tmp-gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.h || cp tmp-gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.h ) \
351         && rm -f tmp-gdk-pixbuf-enum-types.h \
352         && echo timestamp > $(@F)
353
354 CLEANFILES += tmp-gdk-pixbuf-enum-types.h
355 MAINTAINERCLEANFILES += s-enum-types-h
356
357 #
358 # gdk-pixbuf-enum-types.c
359 #
360 gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile
361         (cd $(srcdir) && glib-mkenums \
362                 --fhead "#include <gdk-pixbuf/gdk-pixbuf.h>" \
363                 --fprod "\n/* enumerations from \"@filename@\" */" \
364                 --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"       \
365                 --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
366                 --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
367                   $(gdk_pixbuf_headers)) > gdk-pixbuf-enum-types.c
368
369 #
370 # gdk-pixbuf-marshal.h
371 #
372 gdk-pixbuf-marshal.h: @REBUILD@ stamp-gdk-pixbuf-marshal.h
373         @true
374
375 stamp-gdk-pixbuf-marshal.h: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
376         $(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --header >> xgen-gmh \
377         && (cmp -s xgen-gmh gdk-pixbuf-marshal.h || cp xgen-gmh gdk-pixbuf-marshal.h) \
378         && rm -f xgen-gmh xgen-gmh~ \
379         && echo timestamp > $(@F)
380
381 CLEANFILES += xgen-gmh
382 MAINTAINERCLEANFILES += stamp-gdk-pixbuf-marshal.h
383
384 #
385 # gdk-pixbuf-marshal.c
386 #
387 $(srcdir)/gdk-pixbuf-marshal.c: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
388         $(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body >> xgen-gmc \
389         && cp xgen-gmc gdk-pixbuf-marshal.c \
390         && rm -f xgen-gmc xgen-gmc~
391
392 CLEANFILES += xgen-gmc
393
394 # if srcdir!=builddir, clean out maintainer-clean files from builddir
395 # this allows dist to pass.
396 distclean-local:
397         if test $(srcdir) != .; then \
398           rm -f $(MAINTAINERCLEANFILES); \
399         fi
400
401 EXTRA_DIST =                                    \
402         gdk-pixbuf-csource.1                    \
403         makefile.msc                            \
404         gdk_pixbuf.def                          \
405         gdk_pixbuf.rc                           \
406         gdk-pixbuf-marshal.c                    \
407         gdk-pixbuf-marshal.list                 \
408         pixbufloader_ico.def                    \
409         pixbufloader_ani.def                    \
410         pixbufloader_pnm.def                    \
411         pixbufloader_xpm.def                    \
412         pixbufloader_bmp.def                    \
413         pixbufloader_jpeg.def                   \
414         pixbufloader_ras.def                    \
415         pixbufloader_gif.def                    \
416         pixbufloader_png.def                    \
417         pixbufloader_tiff.def                   \
418         pixbufloader_wbmp.def                   \
419         pixbufloader_xbm.def                    \
420         pixbufloader_tga.def
421
422 if CROSS_COMPILING
423 RUN_QUERY_LOADER_TEST=false
424 else
425 RUN_QUERY_LOADER_TEST=test -z "$(DESTDIR)"
426 endif
427
428 # Running this if cross compiling or if DESTDIR is set is going to
429 # not work at all, so skip it
430 # We use install-data-hook here to workaround a bug in automake and/or libtool
431 # that makes the install target for the loader libraries a dependency on
432 # install-data-am, and not install-exec-am. We need to ensure this gets run
433 # after the libraries are installed in their final locations.
434 install-data-hook: install-ms-lib install-libtool-import-lib
435         @if $(RUN_QUERY_LOADER_TEST) ; then \
436           $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \
437           $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders ; \
438         else \
439           echo "***" ; \
440           echo "*** Warning: gdk-pixbuf.loaders not built" ; \
441           echo "***" ; \
442           echo "*** Generate this file manually on host" ; \
443           echo "*** system using gdk-pixbuf-query-loaders" ; \
444           echo "***" ; \
445         fi
446
447 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
448         rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders
449
450 if CROSS_COMPILING
451 else
452 all-local: gdk-pixbuf.loaders
453 endif
454
455 if BUILD_DYNAMIC_MODULES
456 gdk-pixbuf.loaders: $(loader_LTLIBRARIES) gdk-pixbuf-query-loaders
457         LOADERS=`echo libpixbufloader-*.la` ; \
458         if test "x$$LOADERS" != 'xlibpixbufloader-*.la' ; then \
459           echo "Writing a gdk-pixbuf.loader file to use when running examples before installing gdk-pixbuf."; \
460           $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders $$LOADERS > ./gdk-pixbuf.loaders ;\
461         else \
462           echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
463           touch gdk-pixbuf.loaders; \
464         fi
465 else
466 gdk-pixbuf.loaders: 
467         echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
468         touch gdk-pixbuf.loaders;
469 endif