~ubuntu-branches/ubuntu/maverick/gdk-pixbuf/maverick

« back to all changes in this revision

Viewing changes to .pc/01_old_gir.patch/configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-09-13 18:53:32 UTC
  • mfrom: (1.2.1 experimental) (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100913185332-hjdhqu95obt8g25u
Tags: 2.21.7-1ubuntu1
* New version update.
* debian/patches/01_old_gir.patch:
  - don't require the new gobject-introspection yet
* debian/control.in, debian/rules: 
  - use dh-autoreconf due to the previous change

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Process this file with autoconf to produce a configure script.
 
2
AC_PREREQ([2.63])
 
3
 
 
4
# Making point releases:
 
5
#   gdk_pixbuf_micro_version += 1;
 
6
#   gdk_pixbuf_interface_age += 1;
 
7
#   gdk_pixbuf_binary_age += 1;
 
8
#
 
9
# if any functions have been added, set gdk_pixbuf_interface_age to 0.
 
10
#
 
11
# if backwards compatibility has been broken:
 
12
#   gdk_pixbuf_major_version += 1;
 
13
#   gdk_pixbuf_interface_age = 0;
 
14
#   gdk_pixbuf_binary_age = 0;
 
15
 
 
16
m4_define([gdk_pixbuf_major_version], [2])
 
17
m4_define([gdk_pixbuf_minor_version], [21])
 
18
m4_define([gdk_pixbuf_micro_version], [7])
 
19
m4_define([gdk_pixbuf_interface_age], [0])
 
20
m4_define([gdk_pixbuf_binary_age],
 
21
          [m4_eval(100 * gdk_pixbuf_minor_version + gdk_pixbuf_micro_version)])
 
22
m4_define([gdk_pixbuf_version],
 
23
          [gdk_pixbuf_major_version.gdk_pixbuf_minor_version.gdk_pixbuf_micro_version])
 
24
m4_define([gdk_pixbuf_api_version], [2.0])
 
25
m4_define([gdk_pixbuf_binary_version], [2.10.0])
 
26
 
 
27
 
 
28
# required versions of other packages
 
29
m4_define([glib_required_version], [2.25.9])
 
30
 
 
31
AC_INIT([gdk-pixbuf], [gdk_pixbuf_version],
 
32
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gdk-pixbuf],
 
33
        [gdk-pixbuf])
 
34
 
 
35
AC_CONFIG_HEADER([config.h])
 
36
AC_CONFIG_SRCDIR([gdk-pixbuf/gdk-pixbuf.h])
 
37
AC_CONFIG_MACRO_DIR([m4])
 
38
 
 
39
# Save this value here, since automake will set cflags later
 
40
cflags_set=${CFLAGS+set}
 
41
 
 
42
AM_INIT_AUTOMAKE([1.10 foreign no-define -Wno-portability dist-bzip2])
 
43
AM_MAINTAINER_MODE([enable])
 
44
 
 
45
# Support silent build rules, requires at least automake-1.11. Enable
 
46
# by either passing --enable-silent-rules to configure or passing V=0
 
47
# to make
 
48
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
 
49
 
 
50
#
 
51
# For each of the libraries we build, we define the following
 
52
# substituted variables:
 
53
#
 
54
# foo_PACKAGES:     pkg-config packages this library requires
 
55
# foo_EXTRA_LIBS:   Libraries this module requires not pulled in by pkg-config
 
56
# foo_EXTRA_CFLAGS: cflags this module requires not pulled in by pkg-config
 
57
# foo_DEP_LIBS:     All libraries this module requires
 
58
# foo_DEP_CFLAGS:   All cflags this module requires
 
59
 
 
60
GDK_PIXBUF_MAJOR=gdk_pixbuf_major_version
 
61
GDK_PIXBUF_MINOR=gdk_pixbuf_minor_version
 
62
GDK_PIXBUF_MICRO=gdk_pixbuf_micro_version
 
63
GDK_PIXBUF_VERSION=gdk_pixbuf_version
 
64
GDK_PIXBUF_API_VERSION=gdk_pixbuf_api_version
 
65
GDK_PIXBUF_BINARY_VERSION=gdk_pixbuf_binary_version
 
66
AC_SUBST(GDK_PIXBUF_MAJOR)
 
67
AC_SUBST(GDK_PIXBUF_MINOR)
 
68
AC_SUBST(GDK_PIXBUF_MICRO)
 
69
AC_SUBST(GDK_PIXBUF_VERSION)
 
70
AC_SUBST(GDK_PIXBUF_API_VERSION)
 
71
AC_SUBST(GDK_PIXBUF_BINARY_VERSION)
 
72
 
 
73
# libtool versioning
 
74
#LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
 
75
#LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
 
76
#LT_REVISION=$GTK_INTERFACE_AGE
 
77
#LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
 
78
#LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
 
79
 
 
80
m4_define([lt_current], [m4_eval(100 * gdk_pixbuf_minor_version + gdk_pixbuf_micro_version - gdk_pixbuf_interface_age)])
 
81
m4_define([lt_revision], [gdk_pixbuf_interface_age])
 
82
m4_define([lt_age], [m4_eval(gdk_pixbuf_binary_age - gdk_pixbuf_interface_age)])
 
83
LT_VERSION_INFO="lt_current:lt_revision:lt_age"
 
84
LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
 
85
AC_SUBST(LT_VERSION_INFO)
 
86
AC_SUBST(LT_CURRENT_MINUS_AGE)
 
87
 
 
88
# Checks for programs.
 
89
AC_PROG_CC
 
90
AC_PROG_CC_C_O
 
91
AC_PROG_CC_STDC
 
92
AC_PROG_INSTALL
 
93
AC_PROG_MAKE_SET
 
94
PKG_PROG_PKG_CONFIG
 
95
 
 
96
AC_CANONICAL_HOST
 
97
 
 
98
MATH_LIB=-lm
 
99
AC_MSG_CHECKING([for native Win32])
 
100
LIB_EXE_MACHINE_FLAG=X86
 
101
EXE_MANIFEST_ARCHITECTURE=X86
 
102
case "$host" in
 
103
  *-*-mingw*)
 
104
    os_win32=yes
 
105
    gio_can_sniff=no
 
106
    MATH_LIB=
 
107
    case "$host" in
 
108
    x86_64-*-*)
 
109
      LIB_EXE_MACHINE_FLAG=X64
 
110
      EXE_MANIFEST_ARCHITECTURE=AMD64
 
111
      ;;
 
112
    esac
 
113
    ;;
 
114
  *)
 
115
    os_win32=no
 
116
    ;;
 
117
esac
 
118
AC_MSG_RESULT([$os_win32])
 
119
 
 
120
AC_SUBST(LIB_EXE_MACHINE_FLAG)
 
121
AC_SUBST(EXE_MANIFEST_ARCHITECTURE)
 
122
 
 
123
case $host in
 
124
  *-*-linux*)
 
125
    os_linux=yes
 
126
    ;;
 
127
esac
 
128
 
 
129
if test "$os_win32" = "yes"; then
 
130
  if test x$enable_static = xyes -o x$enable_static = x; then
 
131
    AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
 
132
    enable_static=no
 
133
  fi
 
134
  if test x$enable_shared = xno; then
 
135
    AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
 
136
  fi
 
137
  enable_shared=yes
 
138
fi
 
139
 
 
140
dnl Initialize libtool
 
141
LT_PREREQ([2.2.6])
 
142
LT_INIT([disable-static win32-dll])
 
143
# Create libtool early, because it's used in configure
 
144
LT_OUTPUT
 
145
 
 
146
# Make sure we use 64-bit versions of various file stuff.
 
147
AC_SYS_LARGEFILE
 
148
 
 
149
AM_PROG_AS
 
150
AC_PATH_PROG(NM, nm, nm)
 
151
 
 
152
AC_MSG_CHECKING([for some Win32 platform])
 
153
AS_CASE(["$host"],
 
154
        [*-*-mingw*|*-*-cygwin*], [platform_win32=yes],
 
155
        [platform_win32=no]
 
156
)
 
157
AC_MSG_RESULT([$platform_win32])
 
158
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
 
159
 
 
160
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
 
161
AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
 
162
AM_CONDITIONAL(OS_LINUX, test "$os_linux" = "yes")
 
163
 
 
164
if test "$os_win32" = "yes"; then
 
165
  AC_CHECK_TOOL(WINDRES, windres, no)
 
166
  if test "$WINDRES" = no; then
 
167
    AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
 
168
  fi
 
169
  AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
 
170
fi
 
171
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
 
172
 
 
173
m4_define([debug_default],
 
174
          m4_if(m4_eval(gdk_pixbuf_minor_version % 2), [1], [yes], [minimum]))
 
175
 
 
176
dnl declare --enable-* args and collect ac_help strings
 
177
AC_ARG_ENABLE(debug,
 
178
              AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
 
179
                             [turn on debugging @<:@default=debug_default@:>@]),,
 
180
              enable_debug=debug_default)
 
181
AC_ARG_ENABLE(rebuilds,
 
182
              [AC_HELP_STRING([--disable-rebuilds],
 
183
                              [disable all source autogeneration rules])],,
 
184
              [enable_rebuilds=yes])
 
185
 
 
186
AS_CASE([$enable_debug],
 
187
        [yes],
 
188
        [
 
189
          test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
 
190
          GDK_PIXBUF_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES"
 
191
        ],
 
192
 
 
193
        [no], [GDK_PIXBUF_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
 
194
 
 
195
        [minimum], [GDK_PIXBUF_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"]
 
196
)
 
197
 
 
198
# Build time sanity check...
 
199
AM_SANITY_CHECK
 
200
 
 
201
changequote(,)dnl
 
202
if test "x$GCC" = "xyes"; then
 
203
  case " $CFLAGS " in
 
204
  *[\ \ ]-Wall[\ \      ]*) ;;
 
205
  *) CFLAGS="$CFLAGS -Wall" ;;
 
206
  esac
 
207
 
 
208
  if test "x$enable_ansi" = "xyes"; then
 
209
    case " $CFLAGS " in
 
210
    *[\ \       ]-ansi[\ \      ]*) ;;
 
211
    *) CFLAGS="$CFLAGS -ansi" ;;
 
212
    esac
 
213
 
 
214
    case " $CFLAGS " in
 
215
    *[\ \       ]-pedantic[\ \  ]*) ;;
 
216
    *) CFLAGS="$CFLAGS -pedantic" ;;
 
217
    esac
 
218
  fi
 
219
fi
 
220
changequote([,])dnl
 
221
 
 
222
CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES"
 
223
 
 
224
# Ensure MSVC-compatible struct packing convention is used when
 
225
# compiling for Win32 with gcc.
 
226
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
 
227
# gcc2 uses "-fnative-struct".
 
228
if test x"$os_win32" = xyes; then
 
229
  if test x"$GCC" = xyes; then
 
230
    msnative_struct=''
 
231
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
 
232
    if test -z "$ac_cv_prog_CC"; then
 
233
      our_gcc="$CC"
 
234
    else
 
235
      our_gcc="$ac_cv_prog_CC"
 
236
    fi
 
237
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
 
238
      2.)
 
239
        if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
 
240
          msnative_struct='-fnative-struct'
 
241
        fi
 
242
        ;;
 
243
      *)
 
244
        if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
 
245
          msnative_struct='-mms-bitfields'
 
246
        fi
 
247
        ;;
 
248
    esac
 
249
    if test x"$msnative_struct" = x ; then
 
250
      AC_MSG_RESULT([no way])
 
251
      AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
 
252
    else
 
253
      CFLAGS="$CFLAGS $msnative_struct"
 
254
      AC_MSG_RESULT([${msnative_struct}])
 
255
    fi
 
256
  fi
 
257
fi
 
258
 
 
259
## Initial sanity check, done here so that users get told they
 
260
## have the wrong dependencies as early in the process as possible.
 
261
## Later on we actually use the cflags/libs from separate pkg-config
 
262
## calls. Oh, also the later pkg-config calls don't include
 
263
## the version requirements since those make the module lists
 
264
## annoying to construct
 
265
PKG_CHECK_MODULES(BASE_DEPENDENCIES, [glib-2.0 >= glib_required_version])
 
266
 
 
267
if test "$os_win32" != yes; then
 
268
    # libtool option to control which symbols are exported
 
269
    # right now, symbols starting with _ are not exported
 
270
    LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
 
271
else
 
272
    # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
 
273
    LIBTOOL_EXPORT_OPTIONS=
 
274
fi
 
275
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
 
276
 
 
277
dnl ******************************************************
 
278
dnl * See whether to include shared library dependencies *
 
279
dnl ******************************************************
 
280
 
 
281
AC_ARG_ENABLE(explicit-deps,
 
282
              [AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
 
283
                              [use explicit dependencies in .pc files [default=auto]])],,
 
284
              [enable_explicit_deps=auto])
 
285
 
 
286
AC_MSG_CHECKING([Whether to write dependencies into .pc files])
 
287
case $enable_explicit_deps in
 
288
  auto)
 
289
    export SED
 
290
    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
 
291
    if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
 
292
      enable_explicit_deps=yes
 
293
    else
 
294
      enable_explicit_deps=no
 
295
    fi
 
296
  ;;
 
297
  yes|no)
 
298
  ;;
 
299
  *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
 
300
  ;;
 
301
esac
 
302
AC_MSG_RESULT($enable_explicit_deps)
 
303
 
 
304
AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
 
305
 
 
306
# define a MAINT-like variable REBUILD which is set if Perl
 
307
# and awk are found, so autogenerated sources can be rebuilt
 
308
 
 
309
AC_PATH_PROGS(PERL, perl5 perl)
 
310
 
 
311
REBUILD=\#
 
312
if test "x$enable_rebuilds" = "xyes" && \
 
313
     test -n "$PERL" && \
 
314
     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
 
315
  REBUILD=
 
316
fi
 
317
AC_SUBST(REBUILD)
 
318
 
 
319
# i18n stuff
 
320
AM_GNU_GETTEXT_VERSION([0.17])
 
321
AM_GNU_GETTEXT([external])
 
322
 
 
323
GETTEXT_PACKAGE="$PACKAGE"
 
324
AC_SUBST(GETTEXT_PACKAGE)
 
325
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
 
326
                   [The prefix for our gettext translation domains.])
 
327
 
 
328
dnl The DU4 header files don't provide library prototypes unless
 
329
dnl -std1 is given to the native cc.
 
330
AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
 
331
 
 
332
gtk_save_LIBS=$LIBS
 
333
LIBS="$LIBS -lm"
 
334
AC_TRY_RUN([#include <math.h>
 
335
             int main (void) { return (log(1) != log(1.)); }],
 
336
     AC_MSG_RESULT(none needed),
 
337
     gtk_save_CFLAGS="$CFLAGS"
 
338
     CFLAGS="$CFLAGS -std1"
 
339
     AC_TRY_RUN([#include <math.h>
 
340
                 int main (void) { return (log(1) != log(1.)); }],
 
341
         AC_MSG_RESULT(-std1),
 
342
         AC_MSG_RESULT()
 
343
         CFLAGS="$gtk_save_CFLAGS"
 
344
         AC_MSG_WARN(
 
345
                [No ANSI prototypes found in library. (-std1 didn't work.)]),
 
346
         true
 
347
     ),
 
348
     AC_MSG_RESULT(none needed)
 
349
)
 
350
LIBS=$gtk_save_LIBS
 
351
 
 
352
AC_MSG_CHECKING(for the BeOS)
 
353
case $host in
 
354
  *-*-beos*)
 
355
    AC_MSG_RESULT(yes)
 
356
    MATH_LIB=
 
357
  ;;
 
358
  *)
 
359
    AC_MSG_RESULT(no)
 
360
  ;;
 
361
esac
 
362
 
 
363
AC_SUBST(MATH_LIB)
 
364
#
 
365
# see bug 162979
 
366
#
 
367
AC_MSG_CHECKING(for HP-UX)
 
368
case $host_os in
 
369
  hpux9* | hpux10* | hpux11*)
 
370
    AC_MSG_RESULT(yes)
 
371
    CFLAGS="$CFLAGS -DHPPEX -DSHMLINK"
 
372
  ;;
 
373
  *)
 
374
    AC_MSG_RESULT(no)
 
375
  ;;
 
376
esac
 
377
 
 
378
dnl NeXTStep cc seems to need this
 
379
AC_MSG_CHECKING([for extra flags for POSIX compliance])
 
380
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
 
381
  AC_MSG_RESULT(none needed),
 
382
  gtk_save_CFLAGS="$CFLAGS"
 
383
  CFLAGS="$CFLAGS -posix"
 
384
  AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
 
385
    AC_MSG_RESULT(-posix),
 
386
    AC_MSG_RESULT()
 
387
    CFLAGS="$gtk_save_CFLAGS"
 
388
    AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
 
389
 
 
390
#
 
391
# Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
 
392
#
 
393
 
 
394
GLIB_PACKAGES="gobject-2.0 gio-2.0 gmodule-no-export-2.0"
 
395
 
 
396
AM_PATH_GLIB_2_0(glib_required_version, :,
 
397
  AC_MSG_ERROR([
 
398
*** GLIB glib_required_version or better is required. The latest version of
 
399
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
 
400
  gobject gmodule-no-export gthread)
 
401
 
 
402
# See if it's safe to turn G_DISABLE_DEPRECATED on.
 
403
GLIB_VERSION_MAJOR_MINOR=`$PKG_CONFIG --modversion glib-2.0 | sed "s/\.@<:@^.@:>@*\$//"`
 
404
GLIB_REQUIRED_VERSION_MAJOR_MINOR=`echo glib_required_version | sed "s/\.@<:@^.@:>@*\$//"`
 
405
if test "x$GLIB_VERSION_MAJOR_MINOR" = "x$GLIB_REQUIRED_VERSION_MAJOR_MINOR"; then
 
406
  CFLAGS="-DG_DISABLE_DEPRECATED $CFLAGS"
 
407
fi
 
408
 
 
409
CFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CFLAGS"
 
410
 
 
411
 
 
412
dnl
 
413
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
 
414
dnl
 
415
gtk_save_LIBS=$LIBS
 
416
LIBS="$LIBS $GLIB_LIBS"
 
417
AC_CHECK_FUNCS(bind_textdomain_codeset)
 
418
LIBS=$gtk_save_LIBS
 
419
 
 
420
AC_CHECK_HEADERS(unistd.h,
 
421
                 AC_DEFINE(HAVE_UNISTD_H, 1,
 
422
                           [Define to 1 if unistd.h is available]))
 
423
 
 
424
saved_cflags="$CFLAGS"
 
425
saved_ldflags="$LDFLAGS"
 
426
 
 
427
 
 
428
# Checks for header files.
 
429
AC_HEADER_STDC
 
430
 
 
431
# Checks for typedefs, structures, and compiler characteristics.
 
432
AC_C_CONST
 
433
 
 
434
##################################################
 
435
# Checks for gdk-pixbuf
 
436
##################################################
 
437
 
 
438
dnl ********************************************************
 
439
dnl * See whether we need to load our modules as .la files *
 
440
dnl ********************************************************
 
441
 
 
442
use_la_modules=false
 
443
case $host in
 
444
  *-aix*) use_la_modules=true
 
445
esac
 
446
 
 
447
if $use_la_modules ; then
 
448
   AC_DEFINE(USE_LA_MODULES, 1,
 
449
             [Whether to load modules via .la files rather than directly])
 
450
fi
 
451
 
 
452
 
 
453
AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
 
454
 
 
455
AC_ARG_ENABLE(modules,
 
456
              [AC_HELP_STRING([--disable-modules],
 
457
                              [disable dynamic module loading])])
 
458
 
 
459
dynworks=false
 
460
deps=
 
461
if test x$enable_modules = xno; then
 
462
    AC_MSG_RESULT(no)
 
463
else
 
464
    AC_MSG_RESULT(yes)
 
465
    AC_MSG_CHECKING(whether dynamic modules work)
 
466
    ## for loop is to strip newline
 
467
    tmp=`$PKG_CONFIG --variable=gmodule_supported gmodule-no-export-2.0`
 
468
    for I in $tmp; do
 
469
        dynworks=$I
 
470
    done
 
471
 
 
472
    dnl Now we check to see if our libtool supports shared lib deps
 
473
    dnl (in a rather ugly way even)
 
474
    if $dynworks; then
 
475
        pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
 
476
        pixbuf_deplibs_check=`$pixbuf_libtool_config | \
 
477
            grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
 
478
            sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
 
479
        if test "x$pixbuf_deplibs_check" = "xnone" || \
 
480
           test "x$pixbuf_deplibs_check" = "xunknown" || \
 
481
           test "x$pixbuf_deplibs_check" = "x"; then
 
482
            dynworks=false
 
483
        fi
 
484
    fi
 
485
 
 
486
    if $dynworks; then
 
487
        AC_DEFINE(USE_GMODULE, 1,
 
488
                  [Define to 1 if gmodule works and should be used])
 
489
        AC_MSG_RESULT(yes)
 
490
    else
 
491
        AC_MSG_RESULT(no)
 
492
    fi
 
493
fi
 
494
 
 
495
dnl We allow people to disable image loaders explicitely, but if they don't we error
 
496
dnl out so that people don't accidentally build without them.
 
497
 
 
498
AC_ARG_WITH(libpng,
 
499
            [AC_HELP_STRING([--without-libpng],
 
500
                            [disable PNG loader for gdk-pixbuf])])
 
501
AC_ARG_WITH(libjpeg,
 
502
            [AC_HELP_STRING([--without-libjpeg],
 
503
                            [disable JPEG loader for gdk-pixbuf])])
 
504
AC_ARG_WITH(libtiff,
 
505
            [AC_HELP_STRING([--without-libtiff],
 
506
                            [disable TIFF loader for gdk-pixbuf])])
 
507
AC_ARG_WITH(libjasper,
 
508
            [AC_HELP_STRING([--with-libjasper],
 
509
                            [enable JPEG2000 loader for gdk-pixbuf])])
 
510
 
 
511
AC_ARG_ENABLE(gdiplus,
 
512
            [AC_HELP_STRING([--enable-gdiplus],
 
513
                            [enble GDI+ loaders for gdk-pixbuf (currently known to be broken)])],,
 
514
            [enable_gdiplus=no])
 
515
 
 
516
AM_CONDITIONAL(BUILD_GDIPLUS_LOADERS, [ test x$os_win32 = xyes && test x$enable_gdiplus != xno ])
 
517
 
 
518
dnl Test for libtiff
 
519
if test x$os_win32 = xno || test x$enable_gdiplus = xno; then
 
520
  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
 
521
    AC_CHECK_LIB(tiff, TIFFReadRGBAImageOriented,
 
522
      [AC_CHECK_HEADER(tiffio.h,
 
523
        TIFF='tiff'; LIBTIFF='-ltiff',
 
524
        AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
 
525
      [AC_CHECK_LIB(tiff, TIFFWriteScanline,
 
526
        [AC_CHECK_HEADER(tiffio.h,
 
527
          TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
 
528
          AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
 
529
        [AC_CHECK_LIB(tiff34, TIFFFlushData,
 
530
          [AC_CHECK_HEADER(tiffio.h,
 
531
            TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
 
532
            AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
 
533
        AC_MSG_WARN(*** TIFF loader will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
 
534
  fi
 
535
 
 
536
  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
 
537
     AC_MSG_ERROR([
 
538
*** Checks for TIFF loader failed. You can build without it by passing
 
539
*** --without-libtiff to configure but some programs using GTK+ may
 
540
*** not work properly])
 
541
  fi
 
542
fi
 
543
 
 
544
dnl Test for libjpeg
 
545
if test x$os_win32 = xno || test x$enable_gdiplus = xno; then
 
546
  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
 
547
    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
 
548
      jpeg_ok=yes,
 
549
      jpeg_ok=no
 
550
      AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
 
551
    if test "$jpeg_ok" = yes; then
 
552
      AC_MSG_CHECKING([for jpeglib.h])
 
553
      AC_TRY_CPP(
 
554
[#include <stdio.h>
 
555
#undef PACKAGE
 
556
#undef VERSION
 
557
#undef HAVE_STDLIB_H
 
558
#include <jpeglib.h>],
 
559
        jpeg_ok=yes,
 
560
        jpeg_ok=no)
 
561
      AC_MSG_RESULT($jpeg_ok)
 
562
      if test "$jpeg_ok" = yes; then
 
563
        LIBJPEG='-ljpeg'
 
564
        AC_CHECK_LIB(jpeg, jpeg_simple_progression,
 
565
          AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1,
 
566
                    [Define to 1 is libjpeg supports progressive JPEG]),
 
567
          AC_MSG_WARN(JPEG library does not support progressive saving.))
 
568
      else
 
569
          AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
 
570
      fi
 
571
    fi
 
572
  fi
 
573
 
 
574
  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
 
575
     AC_MSG_ERROR([
 
576
*** Checks for JPEG loader failed. You can build without it by passing
 
577
*** --without-libjpeg to configure but some programs using GTK+ may
 
578
*** not work properly])
 
579
  fi
 
580
fi
 
581
 
 
582
dnl Test for libpng
 
583
  if test x$with_libpng != xno && test -z "$LIBPNG"; then
 
584
    for l in libpng libpng14 libpng12 libpng13 libpng10 ; do
 
585
      AC_MSG_CHECKING(for $l)
 
586
      if $PKG_CONFIG --exists $l ; then
 
587
        AC_MSG_RESULT(yes)
 
588
        PNG='png'
 
589
        PNG_DEP_CFLAGS_PACKAGES=$l
 
590
        LIBPNG=`$PKG_CONFIG --libs $l`
 
591
        break
 
592
      else
 
593
        AC_MSG_RESULT(no)
 
594
      fi
 
595
    done
 
596
    if test x$PNG != xpng; then
 
597
      AC_MSG_RESULT(no)
 
598
      AC_CHECK_LIB(png, png_read_info,
 
599
        [AC_CHECK_HEADER(png.h,
 
600
          png_ok=yes,
 
601
          png_ok=no)],
 
602
        AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
 
603
      if test "$png_ok" = yes; then
 
604
        AC_MSG_CHECKING([for png_structp in png.h])
 
605
        AC_TRY_COMPILE([#include <png.h>],
 
606
          [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
 
607
          png_ok=yes,
 
608
          png_ok=no)
 
609
        AC_MSG_RESULT($png_ok)
 
610
        if test "$png_ok" = yes; then
 
611
          PNG='png'; LIBPNG='-lpng -lz'
 
612
        else
 
613
          AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
 
614
        fi
 
615
      else
 
616
       AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
 
617
      fi
 
618
    fi
 
619
  fi
 
620
 
 
621
  if test x$with_libpng != xno && test -z "$LIBPNG"; then
 
622
     AC_MSG_ERROR([
 
623
*** Checks for PNG loader failed. You can build without it by passing
 
624
*** --without-libpng to configure but many programs using GTK+ will
 
625
*** not work properly. The PNG loader is also needed if you are compiling
 
626
*** from Git.])
 
627
  fi
 
628
 
 
629
dnl Test for libjasper
 
630
  if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
 
631
    AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg -lm)
 
632
  fi
 
633
 
 
634
  if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
 
635
     AC_MSG_ERROR([
 
636
*** Checks for JPEG2000 loader failed. You can build without it by passing
 
637
*** --without-libjasper to configure])
 
638
  fi
 
639
 
 
640
AC_SUBST(LIBTIFF)
 
641
AC_SUBST(LIBJPEG)
 
642
AC_SUBST(LIBPNG)
 
643
AC_SUBST(LIBJASPER)
 
644
 
 
645
AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
 
646
 
 
647
#
 
648
# Allow building some or all gdk-pixbuf loaders included
 
649
#
 
650
AC_MSG_CHECKING(pixbuf loaders to build)
 
651
 
 
652
dnl due to an autoconf bug, commas in the first arg to
 
653
dnl AC_HELP_STRING cause problems.
 
654
dnl AC_HELP_STRING([--with-included-loaders=LOADER1 LOADER2 ...],
 
655
dnl                [build the specified loaders into gdk-pixbuf])
 
656
AC_ARG_WITH(included_loaders,
 
657
[  --with-included-loaders=LOADER1,LOADER2,...
 
658
                          build the specified loaders into gdk-pixbuf])
 
659
 
 
660
if $dynworks; then
 
661
   :
 
662
else
 
663
   ## if the option was specified, leave it; otherwise disable included loaders
 
664
   if test x$with_included_loaders = xno; then
 
665
           with_included_loaders=yes
 
666
   fi
 
667
fi
 
668
 
 
669
# Use the traditional png loader instead of the GDI+ one on Windows,
 
670
# because some important apps like GIMP need to read and write
 
671
# arbitrary tEXt chunks which doesn't seem to be possible through GDI+
 
672
 
 
673
all_loaders="ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm,qtif"
 
674
if test x$with_libjasper != xno; then
 
675
  all_loaders="$all_loaders,jasper"
 
676
fi
 
677
if test x$os_win32 = xyes && test x$enable_gdiplus != xno; then
 
678
  # Skip PNG, see comment above
 
679
  gdip_formats="bmp emf gif ico jpeg tiff wmf"
 
680
  for f in $gdip_formats; do
 
681
    all_loaders="$all_loaders,gdip-$f"
 
682
  done
 
683
else
 
684
  all_loaders="$all_loaders,bmp,gif,ico,jpeg,tiff"
 
685
fi
 
686
included_loaders=""
 
687
# If no loaders specified, include all
 
688
if test "x$with_included_loaders" = xyes ; then
 
689
  included_loaders="$all_loaders"
 
690
else
 
691
  included_loaders="$with_included_loaders"
 
692
fi
 
693
 
 
694
AC_MSG_RESULT($included_loaders)
 
695
 
 
696
INCLUDED_LOADER_OBJ=
 
697
INCLUDED_LOADER_DEFINE=
 
698
 
 
699
IFS="${IFS=     }"; gtk_save_ifs="$IFS"; IFS=","
 
700
for loader in $included_loaders; do
 
701
 if echo "$all_loaders" | egrep "(^|,)$loader(\$|,)" > /dev/null; then
 
702
   :
 
703
 else
 
704
   AC_MSG_ERROR([the specified loader $loader does not exist])
 
705
 fi
 
706
 
 
707
 loader_underscores=`echo $loader | sed -e 's/-/_/g'`
 
708
 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libstatic-pixbufloader-$loader.la"
 
709
 
 
710
 # Don't bother defining separate -DINCLUDE_gdip_foo for each gdip-foo loader
 
711
 case $loader in
 
712
   gdip-*) ;;
 
713
   *) INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader_underscores";;
 
714
 esac
 
715
 eval INCLUDE_$loader_underscores=yes
 
716
done
 
717
 
 
718
# Just define one -DINCLUDE_gdiplus for all the gdip-foo loaders
 
719
# (except gdip-png, which isn't built at all)
 
720
if test x"$INCLUDE_gdip_ico" = xyes; then
 
721
  INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_gdiplus"
 
722
fi
 
723
 
 
724
IFS="$gtk_save_ifs"
 
725
AC_SUBST(INCLUDED_LOADER_OBJ)
 
726
AC_SUBST(INCLUDED_LOADER_DEFINE)
 
727
 
 
728
AM_CONDITIONAL(INCLUDE_PNG, [test x"$INCLUDE_png" = xyes])
 
729
AM_CONDITIONAL(INCLUDE_BMP, [test x"$INCLUDE_bmp" = xyes])
 
730
AM_CONDITIONAL(INCLUDE_WBMP, [test x"$INCLUDE_wbmp" = xyes])
 
731
AM_CONDITIONAL(INCLUDE_GIF, [test x"$INCLUDE_gif" = xyes])
 
732
AM_CONDITIONAL(INCLUDE_ICO, [test x"$INCLUDE_ico" = xyes])
 
733
AM_CONDITIONAL(INCLUDE_ANI, [test x"$INCLUDE_ani" = xyes])
 
734
AM_CONDITIONAL(INCLUDE_JPEG, [test x"$INCLUDE_jpeg" = xyes])
 
735
AM_CONDITIONAL(INCLUDE_PNM, [test x"$INCLUDE_pnm" = xyes])
 
736
AM_CONDITIONAL(INCLUDE_RAS, [test x"$INCLUDE_ras" = xyes])
 
737
AM_CONDITIONAL(INCLUDE_TIFF, [test x"$INCLUDE_tiff" = xyes])
 
738
AM_CONDITIONAL(INCLUDE_XPM, [test x"$INCLUDE_xpm" = xyes])
 
739
AM_CONDITIONAL(INCLUDE_XBM, [test x"$INCLUDE_xbm" = xyes])
 
740
AM_CONDITIONAL(INCLUDE_TGA, [test x"$INCLUDE_tga" = xyes])
 
741
AM_CONDITIONAL(INCLUDE_PCX, [test x"$INCLUDE_pcx" = xyes])
 
742
AM_CONDITIONAL(INCLUDE_ICNS, [test x"$INCLUDE_icns" = xyes])
 
743
AM_CONDITIONAL(INCLUDE_JASPER, [test x"$INCLUDE_jasper" = xyes])
 
744
AM_CONDITIONAL(INCLUDE_QTIF, [test x"$INCLUDE_qtif" = xyes])
 
745
# As all GDI+ loaders are either built-in or not, arbitrarily just
 
746
# check one of the variables here
 
747
AM_CONDITIONAL(INCLUDE_GDIPLUS, [test x"$INCLUDE_gdip_ico" = xyes])
 
748
 
 
749
if test x$gio_can_sniff = x; then
 
750
  AC_MSG_CHECKING([if gio can sniff png])
 
751
  gtk_save_LIBS="$LIBS"
 
752
  gtk_save_CFLAGS="$CFLAGS"
 
753
  LIBS="`$PKG_CONFIG --libs gio-2.0`"
 
754
  CFLAGS="`$PKG_CONFIG --cflags gio-2.0`"
 
755
  AC_RUN_IFELSE([AC_LANG_SOURCE([[
 
756
  #include <gio/gio.h>
 
757
  static const gsize data_size = 159;
 
758
  static const guint8 data[] =
 
759
  {
 
760
    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
 
761
    0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
 
762
    0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xde, 0x00, 0x00, 0x00,
 
763
    0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
 
764
    0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00,
 
765
    0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74,
 
766
    0x49, 0x4d, 0x45, 0x07, 0xd8, 0x07, 0x0f, 0x10, 0x08, 0x15, 0x61, 0xd8,
 
767
    0x35, 0x37, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f,
 
768
    0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
 
769
    0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57,
 
770
    0x81, 0x0e, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x49, 0x44, 0x41, 0x54, 0x08,
 
771
    0xd7, 0x63, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc,
 
772
    0xcc, 0x59, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
 
773
    0x42, 0x60, 0x82
 
774
  };
 
775
  int
 
776
  main (int argc, char **argv)
 
777
  {
 
778
    char *content_type;
 
779
    char *image_png;
 
780
    g_type_init ();
 
781
    content_type = g_content_type_guess (NULL, data, data_size, NULL);
 
782
    image_png = g_content_type_from_mime_type ("image/png");
 
783
    return !!g_strcmp0 (content_type, image_png);
 
784
  }]])],
 
785
    [gio_can_sniff=yes
 
786
     AC_DEFINE(GDK_PIXBUF_USE_GIO_MIME, 1, [Define if gio can sniff image data])],
 
787
    [gio_can_sniff=no])
 
788
  AC_MSG_RESULT($gio_can_sniff)
 
789
  LIBS="$gtk_save_LIBS"
 
790
  CFLAGS="$gtk_save_CFLAGS"
 
791
fi
 
792
 
 
793
AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
 
794
AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
 
795
AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
 
796
AM_CONDITIONAL(HAVE_JASPER, test "x$LIBJASPER" != x)
 
797
 
 
798
if $dynworks ; then
 
799
  STATIC_LIB_DEPS=
 
800
  if echo "$included_loaders" | egrep '(^|,)tiff($|,)' > /dev/null; then
 
801
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
 
802
  fi
 
803
  if echo "$included_loaders" | egrep '(^|,)jpeg($|,)' > /dev/null; then
 
804
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
 
805
  fi
 
806
  if echo "$included_loaders" | egrep '(^|,)png($|,)' > /dev/null; then
 
807
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
 
808
  fi
 
809
  if echo "$included_loaders" | egrep '(^|,)jasper($|,)' > /dev/null; then
 
810
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJASPER"
 
811
  fi
 
812
else
 
813
  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG $LIBJASPER"
 
814
fi
 
815
 
 
816
# Checks to see whether we should include mediaLib
 
817
# support.
 
818
#
 
819
AC_CHECK_HEADER(sys/systeminfo.h,
 
820
                AC_DEFINE(HAVE_SYS_SYSTEMINFO_H, 1,
 
821
                          [Define to 1 if sys/systeminfo.h is available]))
 
822
AC_CHECK_HEADER(sys/sysinfo.h,
 
823
                AC_DEFINE(HAVE_SYS_SYSINFO_H, 1,
 
824
                          [Define to 1 if sys/sysinfo.h is available]))
 
825
 
 
826
AC_MSG_CHECKING(for mediaLib 2.3)
 
827
use_mlib25=no
 
828
# Check for a mediaLib 2.3 function since that is what the GTK+ mediaLib
 
829
# patch requires.
 
830
AC_CHECK_LIB(mlib, mlib_ImageSetStruct, use_mlib=yes, use_mlib=no)
 
831
if test $use_mlib = yes; then
 
832
    AC_DEFINE(USE_MEDIALIB, 1,
 
833
              [Define to 1 if medialib is available and should be used])
 
834
    MEDIA_LIB=-lmlib
 
835
 
 
836
    AC_MSG_CHECKING(for mediaLib 2.5)
 
837
    # Check for a mediaLib 2.5 function since that is what is needed for
 
838
    # gdk_rgb_convert integration.
 
839
    AC_CHECK_LIB(mlib, mlib_VideoColorRGBint_to_BGRAint, use_mlib25=yes, use_mlib25=no)
 
840
    if test $use_mlib25 = yes; then
 
841
        AC_DEFINE(USE_MEDIALIB25, 1,
 
842
                  [Define to 1 if medialib 2.5 is available])
 
843
    fi
 
844
fi
 
845
AM_CONDITIONAL(USE_MEDIALIB, test $use_mlib = yes)
 
846
AM_CONDITIONAL(USE_MEDIALIB25, test $use_mlib25 = yes)
 
847
 
 
848
# Checks to see if we should compile in MMX support (there will be
 
849
# a runtime test when the code is actually run to see if it should
 
850
# be used - this just checks if we can compile it.)
 
851
#
 
852
# This code is partially taken from Mesa
 
853
#
 
854
AC_MSG_CHECKING(for x86 platform)
 
855
case $host_cpu in
 
856
  i386|i486|i586|i686|i786|k6|k7)
 
857
        use_x86_asm=yes
 
858
        ;;
 
859
   *)
 
860
        use_x86_asm=no
 
861
esac
 
862
AC_MSG_RESULT($use_x86_asm)
 
863
 
 
864
use_mmx_asm=no
 
865
if test $use_x86_asm = yes; then
 
866
    save_ac_ext=$ac_ext
 
867
    ac_ext=S
 
868
 
 
869
    AC_MSG_CHECKING(compiler support for MMX)
 
870
    cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
 
871
    if AC_TRY_EVAL(ac_compile); then
 
872
        use_mmx_asm=yes
 
873
    fi
 
874
 
 
875
    rm -rf conftest*
 
876
 
 
877
    ac_ext=$save_ac_ext
 
878
    if test $use_mmx_asm = yes; then
 
879
      AC_DEFINE(USE_MMX, 1,
 
880
                [Define to 1 if XXM is available and should be used])
 
881
      AC_MSG_RESULT(yes)
 
882
    else
 
883
      AC_MSG_RESULT(no)
 
884
    fi
 
885
fi
 
886
 
 
887
AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
 
888
 
 
889
REBUILD_PNGS=
 
890
if test -z "$LIBPNG" && test x"$os_win32" = xno -o x$enable_gdiplus = xno; then
 
891
  REBUILD_PNGS=#
 
892
fi
 
893
 
 
894
dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
 
895
 
 
896
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
 
897
 
 
898
if test $cross_compiling = yes; then
 
899
  AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
 
900
  AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
 
901
  if test x$GTK_UPDATE_ICON_CACHE = xno; then
 
902
    REBUILD_PNGS=#
 
903
  fi
 
904
fi
 
905
 
 
906
GDK_PIXBUF_PACKAGES="gmodule-no-export-2.0 gobject-2.0 gio-2.0"
 
907
GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB $MEDIA_LIB"
 
908
GDK_PIXBUF_EXTRA_CFLAGS=
 
909
GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
 
910
GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $PNG_DEP_CFLAGS_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
 
911
 
 
912
AC_SUBST(PNG_DEP_CFLAGS_PACKAGES)
 
913
AC_SUBST(GDK_PIXBUF_PACKAGES)
 
914
AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
 
915
AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
 
916
AC_SUBST(GDK_PIXBUF_DEP_LIBS)
 
917
AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
 
918
 
 
919
###############
 
920
# Check for X11
 
921
###############
 
922
 
 
923
GDK_PIXBUF_XLIB_PACKAGES=
 
924
GDK_PIXBUF_XLIB_EXTRA_CFLAGS=
 
925
GDK_PIXBUF_XLIB_EXTRA_LIBS=
 
926
 
 
927
if $PKG_CONFIG --exists x11; then
 
928
  AM_CONDITIONAL(USE_X11, true)
 
929
  PKG_CHECK_MODULES(GDK_PIXBUF_XLIB_DEP, x11 gobject-2.0)
 
930
else
 
931
  AM_CONDITIONAL(USE_X11, false)
 
932
fi
 
933
 
 
934
################################################################
 
935
# Strip -export-dynamic from the link lines of various libraries
 
936
################################################################
 
937
 
 
938
#
 
939
# pkg-config --libs gmodule includes the "export_dynamic" flag,
 
940
#  but this flag is only meaningful for executables. For libraries
 
941
#  the effect is undefined; what it causes on Linux is that the
 
942
#  export list from -export-symbols-regex is ignored and everything
 
943
#  is exported
 
944
#
 
945
# We are using gmodule-no-export now, but I'm leaving the stripping
 
946
# code in place for now, since pango and atk still require gmodule.
 
947
export SED
 
948
export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
 
949
if test -n "$export_dynamic"; then
 
950
  GDK_PIXBUF_DEP_LIBS=`echo $GDK_PIXBUF_DEP_LIBS | sed -e "s/$export_dynamic//"`
 
951
fi
 
952
 
 
953
##################################################
 
954
# GObject introspection
 
955
##################################################
 
956
 
 
957
GOBJECT_INTROSPECTION_CHECK([0.9.5])
 
958
 
 
959
##################################################
 
960
# Checks for gtk-doc and docbook-tools
 
961
##################################################
 
962
 
 
963
GTK_DOC_CHECK([1.11])
 
964
 
 
965
AC_CHECK_PROG(DB2HTML, db2html, true, false)
 
966
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
967
 
 
968
AC_ARG_ENABLE(man,
 
969
              [AC_HELP_STRING([--enable-man],
 
970
                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
 
971
              enable_man=no)
 
972
 
 
973
if test "${enable_man}" != no; then
 
974
  dnl
 
975
  dnl Check for xsltproc
 
976
  dnl
 
977
  AC_PATH_PROG([XSLTPROC], [xsltproc])
 
978
  if test -z "$XSLTPROC"; then
 
979
    enable_man=no
 
980
  fi
 
981
fi
 
982
 
 
983
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
 
984
 
 
985
 
 
986
##################################################
 
987
# Check for -Bsymbolic-functions linker flag used
 
988
# to avoid intra-library PLT jumps, if available.
 
989
##################################################
 
990
 
 
991
AC_ARG_ENABLE(Bsymbolic,
 
992
              [AC_HELP_STRING([--disable-Bsymbolic],
 
993
                              [avoid linking with -Bsymbolic])],,
 
994
              [SAVED_LDFLAGS="${LDFLAGS}"
 
995
               AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
 
996
               LDFLAGS=-Wl,-Bsymbolic-functions
 
997
               AC_TRY_LINK([], [int main (void) { return 0; }],
 
998
                           AC_MSG_RESULT(yes)
 
999
                           enable_Bsymbolic=yes,
 
1000
                           AC_MSG_RESULT(no)
 
1001
                           enable_Bsymbolic=no)
 
1002
               LDFLAGS="${SAVED_LDFLAGS}"])
 
1003
 
 
1004
if test "x${enable_Bsymbolic}" == "xyes"; then
 
1005
  GDK_PIXBUF_LINK_FLAGS=-Wl,-Bsymbolic-functions
 
1006
fi
 
1007
 
 
1008
AC_SUBST(GDK_PIXBUF_LINK_FLAGS)
 
1009
 
 
1010
 
 
1011
##################################################
 
1012
# Output commands
 
1013
##################################################
 
1014
 
 
1015
AC_CONFIG_FILES([
 
1016
Makefile
 
1017
gdk-pixbuf-2.0.pc
 
1018
gdk-pixbuf-2.0-uninstalled.pc
 
1019
gdk-pixbuf/Makefile
 
1020
gdk-pixbuf/gdk_pixbuf.rc
 
1021
gdk-pixbuf/gdk-pixbuf-features.h
 
1022
gdk-pixbuf/pixops/Makefile
 
1023
docs/Makefile
 
1024
docs/reference/Makefile
 
1025
docs/reference/gdk-pixbuf/Makefile
 
1026
docs/reference/gdk-pixbuf/version.xml
 
1027
po/Makefile.in
 
1028
tests/Makefile
 
1029
contrib/Makefile
 
1030
contrib/gdk-pixbuf-xlib/Makefile
 
1031
contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc
 
1032
])
 
1033
 
 
1034
AC_OUTPUT