1 | # Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(gdk-pixbuf/gdk-pixbuf.c) |
---|
3 | |
---|
4 | # Save this value here, since automake will set cflags later |
---|
5 | cflags_set=${CFLAGS+set} |
---|
6 | |
---|
7 | AM_CONFIG_HEADER(config.h) |
---|
8 | |
---|
9 | GDK_PIXBUF_MAJOR=0 |
---|
10 | GDK_PIXBUF_MINOR=22 |
---|
11 | GDK_PIXBUF_MICRO=0 |
---|
12 | GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}" |
---|
13 | AM_INIT_AUTOMAKE(gdk-pixbuf, ${GDK_PIXBUF_VERSION}) |
---|
14 | |
---|
15 | AC_SUBST(GDK_PIXBUF_MAJOR) |
---|
16 | AC_SUBST(GDK_PIXBUF_MINOR) |
---|
17 | AC_SUBST(GDK_PIXBUF_MICRO) |
---|
18 | AC_SUBST(GDK_PIXBUF_VERSION) |
---|
19 | AM_PROG_LIBTOOL |
---|
20 | |
---|
21 | AC_PROG_CC |
---|
22 | AC_ISC_POSIX |
---|
23 | AM_PROG_CC_STDC |
---|
24 | AC_PROG_INSTALL |
---|
25 | AC_PROG_LN_S |
---|
26 | AC_PROG_MAKE_SET |
---|
27 | AC_PROG_CPP |
---|
28 | AC_PATH_XTRA |
---|
29 | |
---|
30 | dnl Initialize maintainer mode |
---|
31 | AM_MAINTAINER_MODE |
---|
32 | |
---|
33 | AM_PATH_GLIB(1.2.0,,,gmodule) |
---|
34 | AM_PATH_GTK(1.2.0) |
---|
35 | |
---|
36 | AC_MSG_CHECKING(whether make is GNU Make) |
---|
37 | STRIP_BEGIN= |
---|
38 | STRIP_END= |
---|
39 | if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then |
---|
40 | STRIP_BEGIN='$(strip $(STRIP_DUMMY)' |
---|
41 | STRIP_END=')' |
---|
42 | AC_MSG_RESULT(yes) |
---|
43 | else |
---|
44 | AC_MSG_RESULT(no) |
---|
45 | fi |
---|
46 | STRIP_DUMMY= |
---|
47 | AC_SUBST(STRIP_DUMMY) |
---|
48 | AC_SUBST(STRIP_BEGIN) |
---|
49 | AC_SUBST(STRIP_END) |
---|
50 | |
---|
51 | AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) |
---|
52 | if test x$GNOME_CONFIG != xno; then |
---|
53 | echo "Building the GnomeCanvasPixbuf library" |
---|
54 | GNOME_LIBS=`$GNOME_CONFIG --libs gnomeui` |
---|
55 | GNOME_CFLAGS=`$GNOME_CONFIG --cflags gnomeui` |
---|
56 | BUILD_CANVAS=yes |
---|
57 | else |
---|
58 | echo "Not building GnomeCanvasPixbuf library" |
---|
59 | BUILD_CANVAS=no |
---|
60 | fi |
---|
61 | |
---|
62 | AM_CONDITIONAL(BUILD_CANVAS_ITEM, test $BUILD_CANVAS = yes) |
---|
63 | |
---|
64 | AC_SUBST(GNOME_LIBS) |
---|
65 | AC_SUBST(GNOME_CFLAGS) |
---|
66 | |
---|
67 | AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf) |
---|
68 | |
---|
69 | AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[ |
---|
70 | if test x$withval = xyes; then |
---|
71 | with_modules=yes |
---|
72 | else |
---|
73 | with_modules=no |
---|
74 | fi |
---|
75 | ]) |
---|
76 | |
---|
77 | dynworks=false |
---|
78 | deps= |
---|
79 | if test x$with_modules = xno; then |
---|
80 | AC_MSG_RESULT(no) |
---|
81 | else |
---|
82 | AC_MSG_RESULT(yes) |
---|
83 | AC_MSG_CHECKING(whether dynamic modules work) |
---|
84 | oLIBS="$LIBS" |
---|
85 | oCFLAGS="$CFLAGS" |
---|
86 | CFLAGS="$GLIB_CFLAGS" |
---|
87 | LIBS="$GLIB_LIBS" |
---|
88 | AC_TRY_RUN([ |
---|
89 | #include <glib.h> |
---|
90 | #include <gmodule.h> |
---|
91 | main () |
---|
92 | { |
---|
93 | if (g_module_supported ()) |
---|
94 | exit (0); |
---|
95 | else |
---|
96 | exit (1); |
---|
97 | } |
---|
98 | ], dynworks=true) |
---|
99 | LIBS="$oLIBS" |
---|
100 | CFLAGS="$oCFLAGS" |
---|
101 | fi |
---|
102 | |
---|
103 | dnl Now we check to see if our libtool supports shared lib deps |
---|
104 | dnl (in a rather ugly way even) |
---|
105 | if $dynworks; then |
---|
106 | pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config" |
---|
107 | pixbuf_deplibs_check=`$pixbuf_libtool_config | \ |
---|
108 | grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \ |
---|
109 | sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'` |
---|
110 | if test "x$pixbuf_deplibs_check" = "xnone" || \ |
---|
111 | test "x$pixbuf_deplibs_check" = "xunknown" || \ |
---|
112 | test "x$pixbuf_deplibs_check" = "x"; then |
---|
113 | dynworks=false |
---|
114 | fi |
---|
115 | fi |
---|
116 | |
---|
117 | if $dynworks; then |
---|
118 | AC_DEFINE(USE_GMODULE) |
---|
119 | GMODULE_LIBS="`glib-config --libs gmodule`" |
---|
120 | GMODULE_FLAGS="`glib-config --cflags gmodule`" |
---|
121 | AC_SUBST(GMODULE_LIBS) |
---|
122 | AC_SUBST(GMODULE_FLAGS) |
---|
123 | AC_MSG_RESULT(yes) |
---|
124 | else |
---|
125 | AC_MSG_RESULT(no) |
---|
126 | fi |
---|
127 | |
---|
128 | dnl Check for location of rgb.txt file (works without, but better with) |
---|
129 | AC_MSG_CHECKING([for location of rgb.txt database]) |
---|
130 | |
---|
131 | dnl default to this.. |
---|
132 | path_rgb_txt=/usr/lib/X11/rgb.txt |
---|
133 | |
---|
134 | if test -r ${x_libraries}/X11/rgb.txt; then |
---|
135 | path_rgb_txt="${x_libraries}/X11/rgb.txt" |
---|
136 | else |
---|
137 | for d in /usr/lib/X11 /usr/local/lib/X11 /usr/openwin/lib; do |
---|
138 | if test -r $d/rgb.txt; then |
---|
139 | path_rgb_txt="$d/rgb.txt" |
---|
140 | break |
---|
141 | fi |
---|
142 | done |
---|
143 | fi |
---|
144 | AC_MSG_RESULT([$path_rgb_txt]) |
---|
145 | AC_DEFINE_UNQUOTED(PATH_RGB_TXT,"$path_rgb_txt") |
---|
146 | |
---|
147 | dnl Test for libtiff |
---|
148 | if test -z "$LIBTIFF"; then |
---|
149 | AC_CHECK_LIB(tiff, TIFFReadScanline, |
---|
150 | AC_CHECK_HEADER(tiffio.h, |
---|
151 | TIFF='tiff'; LIBTIFF='-ltiff', |
---|
152 | AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)), |
---|
153 | AC_CHECK_LIB(tiff, TIFFWriteScanline, |
---|
154 | AC_CHECK_HEADER(tiffio.h, |
---|
155 | TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz', |
---|
156 | AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)), |
---|
157 | AC_CHECK_LIB(tiff34, TIFFFlushData, |
---|
158 | AC_CHECK_HEADER(tiffio.h, |
---|
159 | TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz', |
---|
160 | AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)), |
---|
161 | AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm) |
---|
162 | fi |
---|
163 | |
---|
164 | dnl Test for libjpeg |
---|
165 | if test -z "$LIBJPEG"; then |
---|
166 | AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, |
---|
167 | jpeg_ok=yes, |
---|
168 | jpeg_ok=no |
---|
169 | AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***)) |
---|
170 | if test "$jpeg_ok" = yes; then |
---|
171 | AC_MSG_CHECKING([for jpeglib.h]) |
---|
172 | AC_TRY_CPP( |
---|
173 | [#include <stdio.h> |
---|
174 | #undef PACKAGE |
---|
175 | #undef VERSION |
---|
176 | #include <jpeglib.h>], |
---|
177 | jpeg_ok=yes, |
---|
178 | jpeg_ok=no) |
---|
179 | AC_MSG_RESULT($jpeg_ok) |
---|
180 | if test "$jpeg_ok" = yes; then |
---|
181 | LIBJPEG='-ljpeg' |
---|
182 | AC_CHECK_LIB(jpeg, jpeg_simple_progression, |
---|
183 | AC_DEFINE(HAVE_PROGRESSIVE_JPEG), |
---|
184 | AC_MSG_WARN(JPEG library does not support progressive saving.)) |
---|
185 | else |
---|
186 | AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***) |
---|
187 | fi |
---|
188 | fi |
---|
189 | fi |
---|
190 | |
---|
191 | dnl Test for libpng |
---|
192 | if test -z "$LIBPNG"; then |
---|
193 | AC_CHECK_LIB(png, png_read_info, |
---|
194 | AC_CHECK_HEADER(png.h, |
---|
195 | png_ok=yes, |
---|
196 | png_ok=no), |
---|
197 | AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm) |
---|
198 | if test "$png_ok" = yes; then |
---|
199 | AC_MSG_CHECKING([for png_structp in png.h]) |
---|
200 | AC_TRY_COMPILE([#include <png.h>], |
---|
201 | [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;], |
---|
202 | png_ok=yes, |
---|
203 | png_ok=no) |
---|
204 | AC_MSG_RESULT($png_ok) |
---|
205 | if test "$png_ok" = yes; then |
---|
206 | PNG='png'; LIBPNG='-lpng -lz' |
---|
207 | else |
---|
208 | AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***) |
---|
209 | fi |
---|
210 | else |
---|
211 | AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***) |
---|
212 | fi |
---|
213 | fi |
---|
214 | |
---|
215 | deps="$LIBTIFF $LIBJPEG $LIBPNG" |
---|
216 | |
---|
217 | AC_SUBST(LIBTIFF) |
---|
218 | AC_SUBST(LIBJPEG) |
---|
219 | AC_SUBST(LIBPNG) |
---|
220 | |
---|
221 | AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks) |
---|
222 | |
---|
223 | AC_HEADER_STDC |
---|
224 | AC_HEADER_DIRENT |
---|
225 | AC_HEADER_SYS_WAIT |
---|
226 | |
---|
227 | AC_TYPE_SIGNAL |
---|
228 | |
---|
229 | AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x) |
---|
230 | AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x) |
---|
231 | AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x) |
---|
232 | |
---|
233 | GDK_PIXBUF_LIBDIR='-L${libdir}' |
---|
234 | GDK_PIXBUF_INCLUDEDIR="-I${includedir}/gdk-pixbuf-1.0 $GTK_CFLAGS" |
---|
235 | GDK_PIXBUF_LIBS="$GLIB_LIBS -lgdk_pixbuf $GTK_LIBS" |
---|
236 | AC_SUBST(STATIC_LIB_DEPS) |
---|
237 | STATIC_LIB_DEPS="$deps" |
---|
238 | |
---|
239 | GDK_PIXBUF_XLIB_LIBDIR=$GDK_PIXBUF_LIBDIR |
---|
240 | GDK_PIXBUF_XLIB_INCLUDEDIR=$GDK_PIXBUF_INCLUDEDIR |
---|
241 | GDK_PIXBUF_XLIB_LIBS="$GLIB_LIBS -lgdk_pixbuf_xlib $X11_LIBS" |
---|
242 | |
---|
243 | GNOMECANVASPIXBUF_LIBDIR=$GDK_PIXBUF_LIBDIR |
---|
244 | GNOMECANVASPIXBUF_INCLUDEDIR=$GDK_PIXBUF_INCLUDEDIR |
---|
245 | GNOMECANVASPIXBUF_LIBS="$GDK_PIXBUF_LIBS -lgnomecanvaspixbuf" |
---|
246 | |
---|
247 | AC_SUBST(GDK_PIXBUF_LIBDIR) |
---|
248 | AC_SUBST(GDK_PIXBUF_INCLUDEDIR) |
---|
249 | AC_SUBST(GDK_PIXBUF_LIBS) |
---|
250 | |
---|
251 | AC_SUBST(GDK_PIXBUF_XLIB_LIBDIR) |
---|
252 | AC_SUBST(GDK_PIXBUF_XLIB_INCLUDEDIR) |
---|
253 | AC_SUBST(GDK_PIXBUF_XLIB_LIBS) |
---|
254 | |
---|
255 | AC_SUBST(GNOMECANVASPIXBUF_LIBDIR) |
---|
256 | AC_SUBST(GNOMECANVASPIXBUF_INCLUDEDIR) |
---|
257 | AC_SUBST(GNOMECANVASPIXBUF_LIBS) |
---|
258 | |
---|
259 | ################################################## |
---|
260 | # Checks for gtk-doc and docbook-tools |
---|
261 | ################################################## |
---|
262 | |
---|
263 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) |
---|
264 | |
---|
265 | if test "x$with_html_dir" = "x" ; then |
---|
266 | HTML_DIR='${datadir}/gnome/html' |
---|
267 | else |
---|
268 | HTML_DIR=$with_html_dir |
---|
269 | fi |
---|
270 | |
---|
271 | AC_SUBST(HTML_DIR) |
---|
272 | |
---|
273 | AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) |
---|
274 | |
---|
275 | gtk_doc_min_version=0.6 |
---|
276 | if $GTKDOC ; then |
---|
277 | gtk_doc_version=`gtkdoc-mkdb --version` |
---|
278 | AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version]) |
---|
279 | if perl <<EOF ; then |
---|
280 | exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) && |
---|
281 | ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1); |
---|
282 | EOF |
---|
283 | AC_MSG_RESULT(yes) |
---|
284 | else |
---|
285 | AC_MSG_RESULT(no) |
---|
286 | GTKDOC=false |
---|
287 | fi |
---|
288 | fi |
---|
289 | |
---|
290 | AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC) |
---|
291 | AC_SUBST(HAVE_GTK_DOC) |
---|
292 | |
---|
293 | AC_CHECK_PROG(DB2HTML, db2html, true, false) |
---|
294 | AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) |
---|
295 | |
---|
296 | dnl Let people disable the gtk-doc stuff. |
---|
297 | AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) |
---|
298 | |
---|
299 | if test x$enable_gtk_doc = xauto ; then |
---|
300 | if test x$GTKDOC = xtrue ; then |
---|
301 | enable_gtk_doc=yes |
---|
302 | else |
---|
303 | enable_gtk_doc=no |
---|
304 | fi |
---|
305 | fi |
---|
306 | |
---|
307 | dnl NOTE: We need to use a separate automake conditional for this |
---|
308 | dnl to make this work with the tarballs. |
---|
309 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
310 | |
---|
311 | # |
---|
312 | # Checks to see if we should compile in MMX support (there will be |
---|
313 | # a runtime test when the code is actually run to see if it should |
---|
314 | # be used - this just checks if we can compile it.) |
---|
315 | # |
---|
316 | # This code is partially taken from Mesa |
---|
317 | # |
---|
318 | dnl Let people disable the MMX optimization |
---|
319 | AC_ARG_ENABLE(mmx, [ --disable-mmx Don't use MMX optimization [default=auto]], enable_mmx="$enableval", enable_mmx=auto) |
---|
320 | |
---|
321 | AC_MSG_CHECKING(for x86 platform) |
---|
322 | case $host_cpu in |
---|
323 | i386|i486|i586|i686|i786|k6|k7) |
---|
324 | use_x86_asm=yes |
---|
325 | ;; |
---|
326 | *) |
---|
327 | use_x86_asm=no |
---|
328 | esac |
---|
329 | AC_MSG_RESULT($use_x86_asm) |
---|
330 | |
---|
331 | dnl Are we going to use MMX extensions |
---|
332 | use_mmx_asm=no |
---|
333 | |
---|
334 | AC_MSG_CHECKING(compiler support for MMX) |
---|
335 | |
---|
336 | if test x$enable_mmx = xauto ; then |
---|
337 | if test $use_x86_asm = yes; then |
---|
338 | save_ac_ext=$ac_ext |
---|
339 | ac_ext=S |
---|
340 | |
---|
341 | cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S |
---|
342 | if AC_TRY_EVAL(ac_compile); then |
---|
343 | use_mmx_asm=yes |
---|
344 | fi |
---|
345 | dnl rm -f conftest.[oS] |
---|
346 | |
---|
347 | ac_ext=$save_ac_ext |
---|
348 | fi |
---|
349 | |
---|
350 | dnl Enforce usage of MMX extensions |
---|
351 | elif test x$enable_mmx = xyes ; then |
---|
352 | use_mmx_asm=yes |
---|
353 | else |
---|
354 | use_mmx_asm=no |
---|
355 | fi |
---|
356 | |
---|
357 | if test $use_mmx_asm = yes; then |
---|
358 | AC_DEFINE(USE_MMX) |
---|
359 | AC_MSG_RESULT(yes) |
---|
360 | else |
---|
361 | AC_MSG_RESULT(no) |
---|
362 | fi |
---|
363 | |
---|
364 | AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes) |
---|
365 | |
---|
366 | # Output files |
---|
367 | |
---|
368 | AC_OUTPUT([ |
---|
369 | Makefile |
---|
370 | gdk-pixbuf.spec |
---|
371 | gdk-pixbuf/Makefile |
---|
372 | gdk-pixbuf/gdk-pixbuf-features.h |
---|
373 | gdk-pixbuf/pixops/Makefile |
---|
374 | gdk-pixbuf-config |
---|
375 | demo/Makefile |
---|
376 | doc/Makefile |
---|
377 | ]) |
---|