1
# Process this file with autoconf to produce a configure script.
2
# require autoconf 2.54
3
AC_PREREQ(2.54)
4
5
# Making releases:
6
#   GTK_MICRO_VERSION += 1;
7
#   GTK_INTERFACE_AGE += 1;
8
#   GTK_BINARY_AGE += 1;
9
# if any functions have been added, set GTK_INTERFACE_AGE to 0.
10
# if backwards compatibility has been broken,
11
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
12
13
m4_define([gtk_major_version], [2])
14
m4_define([gtk_minor_version], [17])
15
m4_define([gtk_micro_version], [7])
16
m4_define([gtk_interface_age], [0])
17
m4_define([gtk_binary_age],
18
          [m4_eval(100 * gtk_minor_version + gtk_micro_version)])
19
m4_define([gtk_version],
20
          [gtk_major_version.gtk_minor_version.gtk_micro_version])
21
# This is the X.Y used in -lgtk-FOO-X.Y
22
m4_define([gtk_api_version], [2.0])
23
24
# Define a string for the earliest version that this release has
25
# backwards binary compatibility with for all interfaces a module
26
# might. Unless we add module-only API with lower stability
27
# guarantees, this should be unchanged until we break binary compat
28
# for GTK+.
29
#
30
#GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
31
m4_define([gtk_binary_version], [2.10.0])
32
33
# required versions of other packages
34
m4_define([glib_required_version], [2.21.3])
35
m4_define([pango_required_version], [1.20])
36
m4_define([atk_required_version], [1.13.0])
37
m4_define([cairo_required_version], [1.6])
38
39
40
AC_INIT([gtk+], [gtk_version],
41
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B],
42
	[gtk+])
43
44
AC_CONFIG_SRCDIR([gdk/gdktypes.h])
45
46
# Save this value here, since automake will set cflags later
47
cflags_set=${CFLAGS+set}
48
49
AM_INIT_AUTOMAKE(no-define)
50
AM_CONFIG_HEADER(config.h)
51
52
#
53
# For each of the libraries we build, we define the following
54
 
55
# substituted variables:
56
#
57
# foo_PACKAGES:     pkg-config packages this library requires
58
# foo_EXTRA_LIBS:   Libraries this module requires not pulled in by pkg-config
59
# foo_EXTRA_CFLAGS: cflags this module requires not pulled in by pkg-config
60
# foo_DEP_LIBS:     All libraries this module requires
61
# foo_DEP_CFLAGS:   All cflags this module requires
62
63
64
GTK_MAJOR_VERSION=gtk_major_version
65
GTK_MINOR_VERSION=gtk_minor_version
66
GTK_MICRO_VERSION=gtk_micro_version
67
GTK_INTERFACE_AGE=gtk_interface_age
68
GTK_BINARY_AGE=gtk_binary_age
69
GTK_VERSION=gtk_version
70
GTK_API_VERSION=gtk_api_version
71
GTK_BINARY_VERSION=gtk_binary_version
72
AC_SUBST(GTK_MAJOR_VERSION)
73
AC_SUBST(GTK_MINOR_VERSION)
74
AC_SUBST(GTK_MICRO_VERSION)
75
AC_SUBST(GTK_INTERFACE_AGE)
76
AC_SUBST(GTK_BINARY_AGE)
77
AC_SUBST(GTK_API_VERSION)
78
AC_SUBST(GTK_VERSION)
79
AC_SUBST(GTK_BINARY_VERSION)
80
81
# libtool versioning
82
#LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
83
#LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
84
#LT_REVISION=$GTK_INTERFACE_AGE
85
#LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
86
#LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
87
88
m4_define([lt_current], [m4_eval(100 * gtk_minor_version + gtk_micro_version - gtk_interface_age)])
89
m4_define([lt_revision], [gtk_interface_age])
90
m4_define([lt_age], [m4_eval(gtk_binary_age - gtk_interface_age)])
91
LT_VERSION_INFO="lt_current:lt_revision:lt_age"
92
LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
93
AC_SUBST(LT_VERSION_INFO)
94
AC_SUBST(LT_CURRENT_MINUS_AGE)
95
96
m4_define([gail_lt_current],[18])
97
m4_define([gail_lt_revision],[1])
98
m4_define([gail_lt_age],[0])
99
m4_define([gail_lt_version_info],[gail_lt_current:gail_lt_revision:gail_lt_age])
100
m4_define([gail_lt_current_minus_age],[m4_eval(gail_lt_current - gail_lt_age)])
101
AC_SUBST([GAIL_LT_VERSION_INFO],[gail_lt_version_info])
102
AC_SUBST([GAIL_LT_CURRENT_MINUS_AGE],[gail_lt_current_minus_age])
103
104
#
105
# gdk-pixbuf gets versioned separately, and for now, using standard
106
# libtool versioning, not GTK+-style versioning
107
#
108
GDK_PIXBUF_MAJOR=gtk_major_version
109
GDK_PIXBUF_MINOR=gtk_minor_version
110
GDK_PIXBUF_MICRO=gtk_micro_version
111
GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
112
AC_SUBST(GDK_PIXBUF_MAJOR)
113
AC_SUBST(GDK_PIXBUF_MINOR)
114
AC_SUBST(GDK_PIXBUF_MICRO)
115
AC_SUBST(GDK_PIXBUF_VERSION)
116
117
GETTEXT_PACKAGE=gtk20
118
AC_SUBST(GETTEXT_PACKAGE)
119
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
120
                   [The prefix for our gettext translation domains.])
121
122
AC_CANONICAL_HOST
123
124
MATH_LIB=-lm
125
AC_MSG_CHECKING([for native Win32])
126
LIB_EXE_MACHINE_FLAG=X86
127
case "$host" in
128
  *-*-mingw*)
129
    os_win32=yes
130
    gio_can_sniff=no
131
    MATH_LIB=
132
    case "$host" in
133
    x86_64-*-*)
134
      LIB_EXE_MACHINE_FLAG=X64
135
      ;;
136
    esac
137
    ;;
138
  *)
139
    os_win32=no
140
    ;;
141
esac
142
AC_MSG_RESULT([$os_win32])
143
144
AC_SUBST(LIB_EXE_MACHINE_FLAG)
145
146
case $host in
147
  *-*-linux*)
148
    os_linux=yes
149
    ;;
150
esac
151
152
dnl Initialize libtool
153
AC_PROG_CC
154
AM_DISABLE_STATIC
155
156
dnl 
157
dnl Check for a working C++ compiler, but do not bail out, if none is found.
158
dnl We use this for an automated test for C++ header correctness.
159
dnl 
160
AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
161
AC_LANG_SAVE
162
AC_LANG_CPLUSPLUS
163
164
AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
165
AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
166
167
gtk_save_cxxflags="$CXXFLAGS"
168
CXXFLAGS="$CXXFLAGS -x objective-c++"
169
AC_TRY_COMPILE([@interface Foo @end],,OBJC=yes,OBJC=no)
170
AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" = "yes")
171
CXXFLAGS="$gtk_save_cxxflags"
172
AC_LANG_RESTORE
173
174
if test "$os_win32" = "yes"; then
175
  if test x$enable_static = xyes -o x$enable_static = x; then
176
    AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
177
    enable_static=no
178
  fi
179
  if test x$enable_shared = xno; then
180
    AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
181
  fi
182
  enable_shared=yes
183
fi
184
185
AC_LIBTOOL_WIN32_DLL
186
AM_PROG_LIBTOOL
187
dnl when using libtool 2.x create libtool early, because it's used in configure
188
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
189
190
191
# Make sure we use 64-bit versions of various file stuff.
192
AC_SYS_LARGEFILE
193
194
AM_PROG_AS
195
AC_PATH_PROG(NM, nm, nm)
196
197
dnl Initialize maintainer mode
198
AM_MAINTAINER_MODE
199
200
AC_MSG_CHECKING([for some Win32 platform])
201
case "$host" in
202
  *-*-mingw*|*-*-cygwin*)
203
    platform_win32=yes
204
    ;;
205
  *)
206
    platform_win32=no
207
    ;;
208
esac
209
AC_MSG_RESULT([$platform_win32])
210
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
211
212
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
213
AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
214
AM_CONDITIONAL(OS_LINUX, test "$os_linux" = "yes")
215
216
if test "$os_win32" = "yes"; then
217
  AC_CHECK_TOOL(WINDRES, windres, no)
218
  if test "$WINDRES" = no; then
219
    AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
220
  fi
221
  AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
222
fi
223
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
224
225
m4_define([debug_default],
226
          m4_if(m4_eval(gtk_minor_version % 2), [1], [yes], [minimum]))
227
228
dnl declare --enable-* args and collect ac_help strings
229
AC_ARG_ENABLE(debug,
230
              AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
231
                             [turn on debugging @<:@default=debug_default@:>@]),,
232
              enable_debug=debug_default)
233
AC_ARG_ENABLE(shm,
234
              [AC_HELP_STRING([--enable-shm],
235
                              [support shared memory if available [default=yes]])],,
236
              [enable_shm="yes"])
237
AC_ARG_ENABLE(xkb,
238
              [AC_HELP_STRING([--enable-xkb],
239
                              [support XKB [default=maybe]])],,
240
              [enable_xkb="maybe"])
241
AC_ARG_ENABLE(xinerama,
242
              [AC_HELP_STRING([--enable-xinerama],
243
	                      [support xinerama extension if available [default=yes]])],,
244
              [enable_xinerama="yes"])
245
AC_ARG_ENABLE(rebuilds,
246
              [AC_HELP_STRING([--disable-rebuilds],
247
                              [disable all source autogeneration rules])],,
248
              [enable_rebuilds=yes])
249
AC_ARG_ENABLE(visibility,
250
              [AC_HELP_STRING([--disable-visibility],
251
                              [don't use ELF visibility attributes])],,
252
              [enable_visibility=yes])
253
254
AC_ARG_WITH(xinput,
255
            [AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
256
257
if test "$platform_win32" = yes; then
258
  gdktarget=win32
259
else
260
  gdktarget=x11
261
fi
262
263
AC_ARG_WITH(gdktarget, [  --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target],
264
	gdktarget=$with_gdktarget)
265
266
AC_SUBST(gdktarget)
267
case $gdktarget in
268
  x11|win32|quartz|directfb) ;;
269
  *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);;
270
esac
271
272
gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
273
gtktargetlib=libgtk-$gdktarget-$GTK_API_VERSION.la
274
275
AC_SUBST(gdktargetlib)
276
AC_SUBST(gtktargetlib)
277
278
if test "x$enable_debug" = "xyes"; then
279
  test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
280
  GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES" 
281
else
282
  if test "x$enable_debug" = "xno"; then
283
    GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
284
  else
285
    GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
286
  fi
287
fi
288
289
290
if test "x$enable_visibility" = "xno"; then
291
  GTK_DEBUG_FLAGS="$GTK_DEBUG_FLAGS -DDISABLE_VISIBILITY"
292
fi
293
294
295
AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
296
                   [Define if debugging is enabled])
297
298
			
299
# Build time sanity check...
300
AM_SANITY_CHECK
301
302
# Checks for programs.
303
AC_ISC_POSIX
304
AM_PROG_CC_STDC
305
AC_PROG_INSTALL
306
AC_PROG_MAKE_SET
307
308
changequote(,)dnl
309
if test "x$GCC" = "xyes"; then
310
  case " $CFLAGS " in
311
  *[\ \	]-Wall[\ \	]*) ;;
312
  *) CFLAGS="$CFLAGS -Wall" ;;
313
  esac
314
315
  if test "x$enable_ansi" = "xyes"; then
316
    case " $CFLAGS " in
317
    *[\ \	]-ansi[\ \	]*) ;;
318
    *) CFLAGS="$CFLAGS -ansi" ;;
319
    esac
320
321
    case " $CFLAGS " in
322
    *[\ \	]-pedantic[\ \	]*) ;;
323
    *) CFLAGS="$CFLAGS -pedantic" ;;
324
    esac
325
  fi
326
fi
327
changequote([,])dnl
328
329
CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
330
331
# Ensure MSVC-compatible struct packing convention is used when
332
# compiling for Win32 with gcc.
333
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
334
# gcc2 uses "-fnative-struct".
335
if test x"$os_win32" = xyes; then
336
  if test x"$GCC" = xyes; then
337
    msnative_struct=''
338
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
339
    if test -z "$ac_cv_prog_CC"; then
340
      our_gcc="$CC"
341
    else
342
      our_gcc="$ac_cv_prog_CC"
343
    fi
344
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
345
      2.)
346
	if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
347
	  msnative_struct='-fnative-struct'
348
	fi
349
	;;
350
      *)
351
	if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
352
	  msnative_struct='-mms-bitfields'
353
	fi
354
	;;
355
    esac
356
    if test x"$msnative_struct" = x ; then
357
      AC_MSG_RESULT([no way])
358
      AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
359
    else
360
      CFLAGS="$CFLAGS $msnative_struct"
361
      AC_MSG_RESULT([${msnative_struct}])
362
    fi
363
  fi
364
fi
365
366
# Honor aclocal flags
367
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
368
369
## Initial sanity check, done here so that users get told they 
370
## have the wrong dependencies as early in the process as possible.
371
## Later on we actually use the cflags/libs from separate pkg-config
372
## calls. Oh, also the later pkg-config calls don't include 
373
## the version requirements since those make the module lists 
374
## annoying to construct
375
PKG_CHECK_MODULES(BASE_DEPENDENCIES,
376
  [glib-2.0 >= glib_required_version dnl
377
   atk >= atk_required_version dnl
378
   pango >= pango_required_version dnl
379
   cairo >= cairo_required_version])
380
381
## In addition to checking that cairo is present, we also need to
382
## check that the correct cairo backend is there. E.g. if the GDK
383
## target is win32 we need the cairo-win32 backend and so on.
384
cairo_backend=$gdktarget
385
386
# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
387
# backend names are identical.
388
if test "x$cairo_backend" = "xx11"; then
389
   cairo_backend=xlib
390
fi
391
PKG_CHECK_MODULES(CAIRO_BACKEND,
392
  [cairo-$cairo_backend >= cairo_required_version])
393
394
if test "$os_win32" != yes; then
395
    # libtool option to control which symbols are exported
396
    # right now, symbols starting with _ are not exported
397
    LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
398
else
399
    # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
400
    LIBTOOL_EXPORT_OPTIONS=
401
fi
402
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
403
404
dnl ******************************************************
405
dnl * See whether to include shared library dependencies *
406
dnl ******************************************************
407
408
AC_ARG_ENABLE(explicit-deps, 
409
              [AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
410
                              [use explicit dependencies in .pc files [default=auto]])],,
411
              [enable_explicit_deps=auto])
412
413
AC_MSG_CHECKING([Whether to write dependencies into .pc files])
414
case $enable_explicit_deps in
415
  auto)
416
    export SED
417
    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
418
    if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
419
      enable_explicit_deps=yes  
420
    else
421
      enable_explicit_deps=no  
422
    fi
423
  ;;
424
  yes|no) 
425
  ;;
426
  *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
427
  ;;
428
esac
429
AC_MSG_RESULT($enable_explicit_deps)
430
431
AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
432
433
# define a MAINT-like variable REBUILD which is set if Perl
434
# and awk are found, so autogenerated sources can be rebuilt
435
436
AC_PATH_PROGS(PERL, perl5 perl)
437
438
# We would like indent, but don't require it.
439
AC_CHECK_PROG(INDENT, indent, indent)
440
441
REBUILD=\#
442
if test "x$enable_rebuilds" = "xyes" && \
443
     test -n "$PERL" && \
444
     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
445
  REBUILD=
446
fi
447
AC_SUBST(REBUILD)
448
449
AC_CHECK_FUNCS(lstat mkstemp flockfile getc_unlocked)
450
AC_CHECK_FUNCS(localtime_r)
451
452
# _NL_TIME_FIRST_WEEKDAY is an enum and not a define
453
AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
454
AC_TRY_LINK([#include <langinfo.h>], [
455
char c;
456
c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
457
], gtk_ok=yes, gtk_ok=no)
458
AC_MSG_RESULT($gtk_ok)
459
if test "$gtk_ok" = "yes"; then
460
  AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
461
	    [Define if _NL_TIME_FIRST_WEEKDAY is available])
462
fi
463
464
# _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
465
AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
466
AC_TRY_LINK([#include <langinfo.h>], [
467
char c;
468
c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
469
], gtk_ok=yes, gtk_ok=no)
470
AC_MSG_RESULT($gtk_ok)
471
if test "$gtk_ok" = "yes"; then
472
  AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
473
	    [Define if _NL_MEASUREMENT_MEASUREMENT is available])
474
fi
475
476
# _NL_PAPER_HEIGHT is an enum and not a define
477
AC_MSG_CHECKING([for _NL_PAPER_HEIGHT])
478
AC_TRY_LINK([#include <langinfo.h>], [
479
char c;
480
c = *((unsigned char *)  nl_langinfo(_NL_PAPER_HEIGHT));
481
], gtk_ok=yes, gtk_ok=no)
482
AC_MSG_RESULT($gtk_ok)
483
if test "$gtk_ok" = "yes"; then
484
  AC_DEFINE([HAVE__NL_PAPER_HEIGHT], [1],
485
	    [Define if _NL_PAPER_HEIGHT is available])
486
fi
487
488
# _NL_PAPER_WIDTH is an enum and not a define
489
AC_MSG_CHECKING([for _NL_PAPER_WIDTH])
490
AC_TRY_LINK([#include <langinfo.h>], [
491
char c;
492
c = *((unsigned char *)  nl_langinfo(_NL_PAPER_WIDTH));
493
], gtk_ok=yes, gtk_ok=no)
494
AC_MSG_RESULT($gtk_ok)
495
if test "$gtk_ok" = "yes"; then
496
  AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1],
497
	    [Define if _NL_PAPER_WIDTH is available])
498
fi
499
	
500
# sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
501
AC_MSG_CHECKING(for sigsetjmp)
502
AC_TRY_LINK([#include <setjmp.h>], [
503
sigjmp_buf env;
504
sigsetjmp(env, 0);
505
], gtk_ok=yes, gtk_ok=no)
506
AC_MSG_RESULT($gtk_ok)
507
if test "$gtk_ok" = "yes"; then
508
  AC_DEFINE(HAVE_SIGSETJMP, 1,
509
            [Define to 1 if sigsetjmp is available])
510
fi
511
512
# i18n stuff
513
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
514
AM_GLIB_GNU_GETTEXT
515
LIBS="$LIBS $INTLLIBS"
516
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
517
        sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
518
      esac])
519
520
dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
521
dnl po-properties/POTFILES during configure; see GNOME #573515.
522
dnl
523
dnl Generate list of files to be processed by xgettext which will
524
dnl be included in po-properties/Makefile.
525
test -d po-properties || mkdir po-properties
526
if test "x$srcdir" != "x."; then
527
  if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
528
    popropsrcprefix="$srcdir/"
529
  else
530
    popropsrcprefix="../$srcdir/"
531
  fi
532
else
533
  popropsrcprefix="../"
534
fi
535
rm -f po-properties/POTFILES
536
sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$popropsrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
537
< $srcdir/po-properties/POTFILES.in > po-properties/POTFILES
538
dnl (End of adapted AM_GLIB_GNU_GETTEXT snippet.)
539
540
AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR)
541
542
dnl The DU4 header files don't provide library prototypes unless 
543
dnl -std1 is given to the native cc.
544
AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
545
546
gtk_save_LIBS=$LIBS
547
LIBS="$LIBS -lm"
548
AC_TRY_RUN([#include <math.h>
549
             int main (void) { return (log(1) != log(1.)); }],
550
     AC_MSG_RESULT(none needed),
551
     gtk_save_CFLAGS="$CFLAGS"
552
     CFLAGS="$CFLAGS -std1"
553
     AC_TRY_RUN([#include <math.h>
554
	         int main (void) { return (log(1) != log(1.)); }],
555
         AC_MSG_RESULT(-std1),
556
         AC_MSG_RESULT()
557
         CFLAGS="$gtk_save_CFLAGS"
558
         AC_MSG_WARN(
559
                [No ANSI prototypes found in library. (-std1 didn't work.)]),
560
	 true
561
     ),
562
     AC_MSG_RESULT(none needed)
563
)
564
LIBS=$gtk_save_LIBS
565
566
AC_MSG_CHECKING(for the BeOS)
567
case $host in
568
  *-*-beos*)
569
    AC_MSG_RESULT(yes)
570
    MATH_LIB=
571
  ;;
572
  *)
573
    AC_MSG_RESULT(no)
574
  ;;
575
esac
576
577
#
578
# see bug 162979
579
#
580
AC_MSG_CHECKING(for HP-UX)
581
case $host_os in
582
  hpux9* | hpux10* | hpux11*)
583
    AC_MSG_RESULT(yes)
584
    CFLAGS="$CFLAGS -DHPPEX -DSHMLINK"
585
  ;;
586
  *)
587
    AC_MSG_RESULT(no)
588
  ;;
589
esac
590
591
dnl NeXTStep cc seems to need this
592
AC_MSG_CHECKING([for extra flags for POSIX compliance])
593
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
594
  AC_MSG_RESULT(none needed),
595
  gtk_save_CFLAGS="$CFLAGS"
596
  CFLAGS="$CFLAGS -posix"
597
  AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
598
    AC_MSG_RESULT(-posix),
599
    AC_MSG_RESULT()
600
    CFLAGS="$gtk_save_CFLAGS"
601
    AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
602
603
#
604
# Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
605
# 
606
607
GLIB_PACKAGES="gobject-2.0 gmodule-no-export-2.0"
608
609
AM_PATH_GLIB_2_0(glib_required_version, :,
610
  AC_MSG_ERROR([
611
*** GLIB glib_required_version or better is required. The latest version of 
612
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
613
  gobject gmodule-no-export gthread)
614
615
# See if it's safe to turn G_DISABLE_DEPRECATED on.
616
GLIB_VERSION_MAJOR_MINOR=`$PKG_CONFIG --modversion glib-2.0 | sed "s/\.@<:@^.@:>@*\$//"`
617
GLIB_REQUIRED_VERSION_MAJOR_MINOR=`echo glib_required_version | sed "s/\.@<:@^.@:>@*\$//"`
618
if test "x$GLIB_VERSION_MAJOR_MINOR" = "x$GLIB_REQUIRED_VERSION_MAJOR_MINOR"; then
619
  CFLAGS="-DG_DISABLE_DEPRECATED $CFLAGS"
620
fi
621
622
CFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CFLAGS"
623
624
625
dnl
626
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
627
dnl
628
gtk_save_LIBS=$LIBS
629
LIBS="$LIBS $GLIB_LIBS"
630
AC_CHECK_FUNCS(bind_textdomain_codeset)
631
LIBS=$gtk_save_LIBS
632
633
AC_CHECK_HEADERS(pwd.h,
634
                 AC_DEFINE(HAVE_PWD_H, 1,
635
                           [Define to 1 if pwd.h is available]))
636
AC_CHECK_HEADERS(sys/time.h,
637
                 AC_DEFINE(HAVE_SYS_TIME_H, 1,
638
                           [Define to 1 if time.h is available]))
639
AC_CHECK_HEADERS(unistd.h,
640
                 AC_DEFINE(HAVE_UNISTD_H, 1,
641
                           [Define to 1 if unistd.h is available]))
642
AC_CHECK_HEADERS(ftw.h,
643
                 AC_DEFINE(HAVE_FTW_H, 1,
644
                           [Define to 1 if ftw.h is available]))
645
646
AC_MSG_CHECKING([for GNU ftw extensions])
647
AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
648
#define _GNU_SOURCE
649
#include <ftw.h>], [int flags = FTW_ACTIONRETVAL;], gtk_ok=yes, gtk_ok=no)
650
if test $gtk_ok = yes; then
651
    AC_MSG_RESULT([yes])
652
    AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
653
else
654
    AC_MSG_RESULT([no])
655
fi
656
657
saved_cflags="$CFLAGS"
658
saved_ldflags="$LDFLAGS"
659
660
661
# Checks for header files.
662
AC_HEADER_STDC
663
664
# Checks for typedefs, structures, and compiler characteristics.
665
AC_C_CONST
666
667
# Checks for library functions.
668
AC_TYPE_SIGNAL
669
AC_FUNC_MMAP
670
671
AC_CHECK_FUNCS(mallinfo)
672
AC_CHECK_FUNCS(getresuid)
673
AC_TYPE_UID_T
674
675
# Check if <sys/select.h> needs to be included for fd_set
676
AC_MSG_CHECKING([for fd_set])
677
AC_TRY_COMPILE([#include <sys/types.h>],
678
        [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
679
if test $gtk_ok = yes; then
680
    AC_MSG_RESULT([yes, found in sys/types.h])
681
else
682
    AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
683
    if test $gtk_ok = yes; then
684
        AC_DEFINE(HAVE_SYS_SELECT_H, 1,
685
                  [Define to 1 if sys/select.h is available])
686
        AC_MSG_RESULT([yes, found in sys/select.h])
687
    else
688
	AC_DEFINE(NO_FD_SET, 1,
689
                  [Define to 1 if fd_set is not available])
690
	AC_MSG_RESULT(no)
691
    fi
692
fi
693
694
# `widechar' tests for gdki18n.h
695
AC_MSG_CHECKING(for wchar.h)
696
AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
697
if test $gdk_wchar_h = yes; then
698
   AC_DEFINE(HAVE_WCHAR_H, 1, [Have wchar.h include file])
699
fi
700
AC_MSG_RESULT($gdk_wchar_h)
701
702
# Check for wctype.h (for iswalnum)
703
AC_MSG_CHECKING(for wctype.h)
704
AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
705
if test $gdk_wctype_h = yes; then
706
   AC_DEFINE(HAVE_WCTYPE_H, 1, [Have wctype.h include file])
707
fi
708
AC_MSG_RESULT($gdk_wctype_h)
709
710
# in Solaris 2.5, `iswalnum' is in -lw
711
GDK_WLIBS=
712
AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
713
714
oLIBS="$LIBS"
715
LIBS="$LIBS $GDK_WLIBS"
716
# The following is necessary for Linux libc-5.4.38
717
AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
718
AC_TRY_LINK([#include <stdlib.h>],[
719
#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
720
#  ifdef HAVE_WCTYPE_H
721
#    include <wctype.h>
722
#  else
723
#    ifdef HAVE_WCHAR_H
724
#      include <wchar.h>
725
#    endif
726
#  endif
727
#else
728
#  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
729
#endif
730
iswalnum((wchar_t) 0);
731
], gdk_working_wctype=yes, gdk_working_wctype=no)
732
LIBS="$oLIBS"
733
734
if test $gdk_working_wctype = no; then
735
   AC_DEFINE(HAVE_BROKEN_WCTYPE, 1, [Is the wctype implementation broken])
736
   GDK_WLIBS=
737
fi
738
AC_MSG_RESULT($gdk_working_wctype)
739
AC_SUBST(GDK_WLIBS)
740
741
# Check for uxtheme.h (for MS-Windows Engine)
742
AC_MSG_CHECKING(for uxtheme.h)
743
AC_TRY_CPP([#include <uxtheme.h>], gtk_uxtheme_h=yes, gtk_uxtheme_h=no)
744
if test $gtk_uxtheme_h = yes; then
745
   AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
746
fi
747
AC_MSG_RESULT($gtk_uxtheme_h)
748
749
# Checks for gdkspawn
750
AC_CHECK_HEADERS(crt_externs.h)
751
AC_CHECK_FUNCS(_NSGetEnviron)
752
753
754
##################################################
755
# Checks for gdk-pixbuf
756
##################################################
757
758
dnl ********************************************************
759
dnl * See whether we need to load our modules as .la files *
760
dnl ********************************************************
761
762
use_la_modules=false
763
case $host in
764
  *-aix*) use_la_modules=true
765
esac
766
767
if $use_la_modules ; then
768
   AC_DEFINE(USE_LA_MODULES, 1,
769
             [Whether to load modules via .la files rather than directly])
770
fi
771
772
773
AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
774
775
AC_ARG_ENABLE(modules,
776
              [AC_HELP_STRING([--disable-modules],
777
                              [disable dynamic module loading])])
778
779
dynworks=false
780
deps=
781
if test x$enable_modules = xno; then
782
    AC_MSG_RESULT(no)
783
else
784
    AC_MSG_RESULT(yes)
785
    AC_MSG_CHECKING(whether dynamic modules work)
786
    ## for loop is to strip newline 
787
    tmp=`$PKG_CONFIG --variable=gmodule_supported gmodule-no-export-2.0`
788
    for I in $tmp; do
789
        dynworks=$I
790
    done
791
792
    dnl Now we check to see if our libtool supports shared lib deps
793
    dnl (in a rather ugly way even)
794
    if $dynworks; then
795
        pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
796
        pixbuf_deplibs_check=`$pixbuf_libtool_config | \
797
            grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
798
            sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
799
        if test "x$pixbuf_deplibs_check" = "xnone" || \
800
           test "x$pixbuf_deplibs_check" = "xunknown" || \
801
           test "x$pixbuf_deplibs_check" = "x"; then
802
            dynworks=false
803
        fi
804
    fi
805
806
    if $dynworks; then
807
        AC_DEFINE(USE_GMODULE, 1,
808
                  [Define to 1 if gmodule works and should be used])
809
        AC_MSG_RESULT(yes)
810
    else
811
        AC_MSG_RESULT(no)
812
    fi
813
fi
814
815
dnl We allow people to disable image loaders explicitely, but if they don't we error
816
dnl out so that people don't accidentally build without them.
817
818
AC_ARG_WITH(libpng,
819
            [AC_HELP_STRING([--without-libpng],
820
                            [disable PNG loader for gdk-pixbuf])])
821
AC_ARG_WITH(libjpeg,
822
            [AC_HELP_STRING([--without-libjpeg],
823
                            [disable JPEG loader for gdk-pixbuf])])
824
AC_ARG_WITH(libtiff,
825
            [AC_HELP_STRING([--without-libtiff],
826
                            [disable TIFF loader for gdk-pixbuf])])
827
AC_ARG_WITH(libjasper,
828
            [AC_HELP_STRING([--with-libjasper],
829
                            [enable JPEG2000 loader for gdk-pixbuf])])
830
831
AC_ARG_ENABLE(gdiplus,
832
            [AC_HELP_STRING([--enable-gdiplus],
833
                            [enble GDI+ loaders for gdk-pixbuf (currently known to be broken)])],,
834
	    [enable_gdiplus=no])
835
836
AM_CONDITIONAL(BUILD_GDIPLUS_LOADERS, [ test x$os_win32 = xyes && test x$enable_gdiplus != xno ])
837
838
dnl Test for libtiff
839
if test x$os_win32 = xno || test x$enable_gdiplus = xno; then
840
  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
841
    AC_CHECK_LIB(tiff, TIFFReadRGBAImageOriented,
842
      [AC_CHECK_HEADER(tiffio.h,
843
        TIFF='tiff'; LIBTIFF='-ltiff',
844
        AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
845
      [AC_CHECK_LIB(tiff, TIFFWriteScanline,
846
        [AC_CHECK_HEADER(tiffio.h,
847
          TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
848
          AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
849
        [AC_CHECK_LIB(tiff34, TIFFFlushData,
850
          [AC_CHECK_HEADER(tiffio.h,
851
            TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
852
            AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
853
        AC_MSG_WARN(*** TIFF loader will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
854
  fi
855
856
  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
857
     AC_MSG_ERROR([
858
*** Checks for TIFF loader failed. You can build without it by passing 
859
*** --without-libtiff to configure but some programs using GTK+ may
860
*** not work properly])
861
  fi
862
fi
863
864
dnl Test for libjpeg
865
if test x$os_win32 = xno || test x$enable_gdiplus = xno; then
866
  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
867
    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
868
      jpeg_ok=yes,
869
      jpeg_ok=no
870
      AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
871
    if test "$jpeg_ok" = yes; then
872
      AC_MSG_CHECKING([for jpeglib.h])
873
      AC_TRY_CPP(
874
[#include <stdio.h>
875
#undef PACKAGE
876
#undef VERSION
877
#undef HAVE_STDLIB_H
878
#include <jpeglib.h>],
879
        jpeg_ok=yes,
880
        jpeg_ok=no)
881
      AC_MSG_RESULT($jpeg_ok)
882
      if test "$jpeg_ok" = yes; then
883
        LIBJPEG='-ljpeg'
884
        AC_CHECK_LIB(jpeg, jpeg_simple_progression,     
885
          AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1,
886
                    [Define to 1 is libjpeg supports progressive JPEG]),
887
          AC_MSG_WARN(JPEG library does not support progressive saving.))
888
      else
889
          AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
890
      fi
891
    fi
892
  fi
893
894
  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
895
     AC_MSG_ERROR([
896
*** Checks for JPEG loader failed. You can build without it by passing 
897
*** --without-libjpeg to configure but some programs using GTK+ may
898
*** not work properly])
899
  fi
900
fi
901
902
dnl Test for libpng
903
  if test x$with_libpng != xno && test -z "$LIBPNG"; then
904
    AC_MSG_CHECKING(for libpng12)
905
    if $PKG_CONFIG --exists libpng12 ; then
906
        AC_MSG_RESULT(yes)
907
        PNG='png'
908
	PNG_DEP_CFLAGS_PACKAGES=libpng12
909
	LIBPNG=`$PKG_CONFIG --libs libpng12`
910
    else
911
      AC_MSG_RESULT(no)
912
      AC_CHECK_LIB(png, png_read_info,
913
        [AC_CHECK_HEADER(png.h,
914
          png_ok=yes,
915
          png_ok=no)],
916
        AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
917
      if test "$png_ok" = yes; then
918
        AC_MSG_CHECKING([for png_structp in png.h])
919
        AC_TRY_COMPILE([#include <png.h>],
920
          [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
921
          png_ok=yes,
922
          png_ok=no)
923
        AC_MSG_RESULT($png_ok)
924
        if test "$png_ok" = yes; then
925
          PNG='png'; LIBPNG='-lpng -lz'
926
        else
927
          AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
928
        fi
929
      else
930
       AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
931
      fi
932
    fi
933
  fi
934
935
  if test x$with_libpng != xno && test -z "$LIBPNG"; then
936
     AC_MSG_ERROR([
937
*** Checks for PNG loader failed. You can build without it by passing 
938
*** --without-libpng to configure but many programs using GTK+ will
939
*** not work properly. The PNG loader is also needed if you are compiling
940
*** from CVS.])
941
  fi
942
943
dnl Test for libjasper
944
  if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
945
    AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg)
946
  fi
947
948
  if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
949
     AC_MSG_ERROR([
950
*** Checks for JPEG2000 loader failed. You can build without it by passing 
951
*** --without-libjasper to configure])
952
  fi
953
954
AC_SUBST(LIBTIFF)
955
AC_SUBST(LIBJPEG)
956
AC_SUBST(LIBPNG)
957
AC_SUBST(LIBJASPER)
958
959
AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
960
961
#
962
# Allow building some or all gdk-pixbuf loaders included
963
#
964
AC_MSG_CHECKING(pixbuf loaders to build)
965
966
dnl due to an autoconf bug, commas in the first arg to
967
dnl AC_HELP_STRING cause problems.
968
dnl AC_HELP_STRING([--with-included-loaders=LOADER1 LOADER2 ...],
969
dnl                [build the specified loaders into gdk-pixbuf])
970
AC_ARG_WITH(included_loaders,
971
[  --with-included-loaders=LOADER1,LOADER2,...
972
                          build the specified loaders into gdk-pixbuf])
973
974
if $dynworks; then 
975
   :
976
else
977
   ## if the option was specified, leave it; otherwise disable included loaders
978
   if test x$with_included_loaders = xno; then
979
           with_included_loaders=yes
980
   fi
981
fi
982
983
# Use the traditional png loader instead of the GDI+ one on Windows,
984
# because some important apps like GIMP need to read and write
985
# arbitrary tEXt chunks which doesn't seem to be possible through GDI+
986
987
all_loaders="ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm"
988
if test x$with_libjasper != xno; then
989
  all_loaders="$all_loaders,jasper"
990
fi
991
if test x$os_win32 = xyes && test x$enable_gdiplus != xno; then
992
  # Skip PNG, see comment above
993
  gdip_formats="bmp emf gif ico jpeg tiff wmf"
994
  for f in $gdip_formats; do
995
    all_loaders="$all_loaders,gdip-$f"
996
  done
997
else
998
  all_loaders="$all_loaders,bmp,gif,ico,jpeg,tiff"
999
fi
1000
included_loaders=""
1001
# If no loaders specified, include all
1002
if test "x$with_included_loaders" = xyes ; then
1003
  included_loaders="$all_loaders"
1004
else
1005
  included_loaders="$with_included_loaders"
1006
fi
1007
1008
AC_MSG_RESULT($included_loaders)
1009
1010
INCLUDED_LOADER_OBJ=
1011
INCLUDED_LOADER_DEFINE=
1012
1013
IFS="${IFS= 	}"; gtk_save_ifs="$IFS"; IFS=","
1014
for loader in $included_loaders; do
1015
 if echo "$all_loaders" | egrep "(^|,)$loader(\$|,)" > /dev/null; then
1016
   :
1017
 else
1018
   AC_MSG_ERROR([the specified loader $loader does not exist])
1019
 fi
1020
1021
 loader_underscores=`echo $loader | sed -e 's/-/_/g'`
1022
 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libstatic-pixbufloader-$loader.la"
1023
1024
 # Don't bother defining separate -DINCLUDE_gdip_foo for each gdip-foo loader
1025
 case $loader in
1026
   gdip-*) ;;
1027
   *) INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader_underscores";;
1028
 esac
1029
 eval INCLUDE_$loader_underscores=yes
1030
done
1031
1032
# Just define one -DINCLUDE_gdiplus for all the gdip-foo loaders
1033
# (except gdip-png, which isn't built at all)
1034
if test x"$INCLUDE_gdip_ico" = xyes; then
1035
  INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_gdiplus"
1036
fi
1037
1038
IFS="$gtk_save_ifs"
1039
AC_SUBST(INCLUDED_LOADER_OBJ)
1040
AC_SUBST(INCLUDED_LOADER_DEFINE)
1041
1042
AM_CONDITIONAL(INCLUDE_PNG, [test x"$INCLUDE_png" = xyes])
1043
AM_CONDITIONAL(INCLUDE_BMP, [test x"$INCLUDE_bmp" = xyes])
1044
AM_CONDITIONAL(INCLUDE_WBMP, [test x"$INCLUDE_wbmp" = xyes])
1045
AM_CONDITIONAL(INCLUDE_GIF, [test x"$INCLUDE_gif" = xyes])
1046
AM_CONDITIONAL(INCLUDE_ICO, [test x"$INCLUDE_ico" = xyes])
1047
AM_CONDITIONAL(INCLUDE_ANI, [test x"$INCLUDE_ani" = xyes])
1048
AM_CONDITIONAL(INCLUDE_JPEG, [test x"$INCLUDE_jpeg" = xyes])
1049
AM_CONDITIONAL(INCLUDE_PNM, [test x"$INCLUDE_pnm" = xyes])
1050
AM_CONDITIONAL(INCLUDE_RAS, [test x"$INCLUDE_ras" = xyes])
1051
AM_CONDITIONAL(INCLUDE_TIFF, [test x"$INCLUDE_tiff" = xyes])
1052
AM_CONDITIONAL(INCLUDE_XPM, [test x"$INCLUDE_xpm" = xyes])
1053
AM_CONDITIONAL(INCLUDE_XBM, [test x"$INCLUDE_xbm" = xyes])
1054
AM_CONDITIONAL(INCLUDE_TGA, [test x"$INCLUDE_tga" = xyes])
1055
AM_CONDITIONAL(INCLUDE_PCX, [test x"$INCLUDE_pcx" = xyes])
1056
AM_CONDITIONAL(INCLUDE_ICNS, [test x"$INCLUDE_icns" = xyes])
1057
AM_CONDITIONAL(INCLUDE_JASPER, [test x"$INCLUDE_jasper" = xyes])
1058
# As all GDI+ loaders are either built-in or not, arbitrarily just
1059
# check one of the variables here
1060
AM_CONDITIONAL(INCLUDE_GDIPLUS, [test x"$INCLUDE_gdip_ico" = xyes])
1061
1062
if test x$gio_can_sniff = x; then
1063
  AC_MSG_CHECKING([if gio can sniff png])
1064
  gtk_save_LIBS="$LIBS"
1065
  gtk_save_CFLAGS="$CFLAGS"
1066
  LIBS="`$PKG_CONFIG --libs gio-2.0`"
1067
  CFLAGS="`$PKG_CONFIG --cflags gio-2.0`"
1068
  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1069
  #include <gio/gio.h>
1070
  static const gsize data_size = 159;
1071
  static const guint8 data[] = 
1072
  {
1073
    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 
1074
    0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 
1075
    0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xde, 0x00, 0x00, 0x00, 
1076
    0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, 
1077
    0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 
1078
    0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 
1079
    0x49, 0x4d, 0x45, 0x07, 0xd8, 0x07, 0x0f, 0x10, 0x08, 0x15, 0x61, 0xd8, 
1080
    0x35, 0x37, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 
1081
    0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 
1082
    0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 
1083
    0x81, 0x0e, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x49, 0x44, 0x41, 0x54, 0x08, 
1084
    0xd7, 0x63, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc, 
1085
    0xcc, 0x59, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 
1086
    0x42, 0x60, 0x82
1087
  };
1088
  int
1089
  main (int argc, char **argv)
1090
  {
1091
    char *content_type;
1092
    char *image_png;
1093
    content_type = g_content_type_guess (NULL, data, data_size, NULL);  
1094
    image_png = g_content_type_from_mime_type ("image/png");
1095
    return !!strcmp (content_type, image_png);
1096
  }]])],
1097
    [gio_can_sniff=yes
1098
     AC_DEFINE(GDK_PIXBUF_USE_GIO_MIME, 1, [Define if gio can sniff image data])],
1099
    [gio_can_sniff=no])
1100
  AC_MSG_RESULT($gio_can_sniff)
1101
  LIBS="$gtk_save_LIBS"
1102
  CFLAGS="$gtk_save_CFLAGS"
1103
fi
1104
1105
#
1106
# Allow building some or all immodules included
1107
#
1108
AC_MSG_CHECKING(immodules to build)
1109
1110
dnl due to an autoconf bug, commas in the first arg to
1111
dnl AC_HELP_STRING cause problems.
1112
dnl AC_HELP_STRING([--with-included-immodules=MODULE1 MODULE2 ...],
1113
dnl                [build the specified input method modules into gtk])
1114
AC_ARG_WITH(included_immodules,
1115
[  --with-included-immodules=MODULE1,MODULE2,...
1116
                          build the specified input methods into gtk])
1117
1118
if $dynworks; then 
1119
   :
1120
else
1121
   ## if the option was specified, leave it; otherwise disable included immodules
1122
   if test x$with_included_immodules = xno; then
1123
           with_included_immodules=yes
1124
   fi
1125
fi
1126
1127
all_immodules="am-et,cedilla,cyrillic-translit"
1128
if test "$gdktarget" = "win32"; then
1129
   all_immodules="${all_immodules},ime"
1130
fi
1131
all_immodules="${all_immodules},inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr"
1132
if test "$gdktarget" = "x11"; then
1133
   all_immodules="${all_immodules},xim"
1134
fi
1135
1136
included_immodules=""
1137
# If the switch specified without listing any specific ones, include all
1138
if test "x$with_included_immodules" = xyes ; then
1139
  included_immodules="$all_immodules"
1140
else
1141
  included_immodules="$with_included_immodules"
1142
fi
1143
1144
AC_MSG_RESULT($included_immodules)
1145
AM_CONDITIONAL(HAVE_INCLUDED_IMMMODULES, test "x$included_immodules" != x)
1146
1147
INCLUDED_IMMODULE_OBJ=
1148
INCLUDED_IMMODULE_DEFINE=
1149
1150
IFS="${IFS= 	}"; gtk_save_ifs="$IFS"; IFS=","
1151
for immodule in $included_immodules; do
1152
 immodule_underscores=`echo $immodule | sed -e 's/-/_/g'`
1153
 if echo "$all_immodules" | egrep "(^|,)$immodule(\$|,)" > /dev/null; then
1154
   :
1155
 else
1156
   AC_MSG_ERROR([the specified input method $immodule does not exist])
1157
 fi
1158
1159
 INCLUDED_IMMODULE_OBJ="$INCLUDED_IMMODULE_OBJ ../modules/input/libstatic-im-$immodule.la"
1160
 INCLUDED_IMMODULE_DEFINE="$INCLUDED_IMMODULE_DEFINE -DINCLUDE_IM_$immodule_underscores"
1161
 eval INCLUDE_$immodule_underscores=yes
1162
done
1163
IFS="$gtk_save_ifs"
1164
AC_SUBST(INCLUDED_IMMODULE_OBJ)
1165
AC_SUBST(INCLUDED_IMMODULE_DEFINE)
1166
1167
AM_CONDITIONAL(INCLUDE_IM_AM_ET, [test x"$INCLUDE_am_et" = xyes])
1168
AM_CONDITIONAL(INCLUDE_IM_CEDILLA, [test x"$INCLUDE_cedilla" = xyes])
1169
AM_CONDITIONAL(INCLUDE_IM_CYRILLIC_TRANSLIT, [test x"$INCLUDE_cyrillic_translit" = xyes])
1170
AM_CONDITIONAL(INCLUDE_IM_IME, [test x"$INCLUDE_ime" = xyes])
1171
AM_CONDITIONAL(INCLUDE_IM_INUKTITUT, [test x"$INCLUDE_inuktitut" = xyes])
1172
AM_CONDITIONAL(INCLUDE_IM_IPA, [test x"$INCLUDE_ipa" = xyes])
1173
AM_CONDITIONAL(INCLUDE_IM_MULTIPRESS, [test x"$INCLUDE_multipress" = xyes])
1174
AM_CONDITIONAL(INCLUDE_IM_THAI, [test x"$INCLUDE_thai" = xyes])
1175
AM_CONDITIONAL(INCLUDE_IM_TI_ER, [test x"$INCLUDE_ti_er" = xyes])
1176
AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
1177
AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
1178
AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
1179
1180
AC_HEADER_SYS_WAIT
1181
1182
AC_TYPE_SIGNAL
1183
1184
AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
1185
AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
1186
AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
1187
AM_CONDITIONAL(HAVE_JASPER, test "x$LIBJASPER" != x)
1188
1189
if $dynworks ; then
1190
  STATIC_LIB_DEPS=
1191
  if echo "$included_loaders" | egrep '(^|,)tiff($|,)' > /dev/null; then
1192
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
1193
  fi
1194
  if echo "$included_loaders" | egrep '(^|,)jpeg($|,)' > /dev/null; then
1195
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
1196
  fi
1197
  if echo "$included_loaders" | egrep '(^|,)png($|,)' > /dev/null; then
1198
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
1199
  fi
1200
  if echo "$included_loaders" | egrep '(^|,)jasper($|,)' > /dev/null; then
1201
    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJASPER"
1202
  fi
1203
else
1204
  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG $LIBJASPER"
1205
fi
1206
1207
# Checks to see whether we should include mediaLib
1208
# support.
1209
#
1210
AC_CHECK_HEADER(sys/systeminfo.h,
1211
                AC_DEFINE(HAVE_SYS_SYSTEMINFO_H, 1, 
1212
                          [Define to 1 if sys/systeminfo.h is available]))
1213
AC_CHECK_HEADER(sys/sysinfo.h,
1214
                AC_DEFINE(HAVE_SYS_SYSINFO_H, 1,
1215
                          [Define to 1 if sys/sysinfo.h is available]))
1216
1217
AC_MSG_CHECKING(for mediaLib 2.3)
1218
use_mlib25=no
1219
# Check for a mediaLib 2.3 function since that is what the GTK+ mediaLib
1220
# patch requires.
1221
AC_CHECK_LIB(mlib, mlib_ImageSetStruct, use_mlib=yes, use_mlib=no)
1222
if test $use_mlib = yes; then
1223
    AC_DEFINE(USE_MEDIALIB, 1,
1224
              [Define to 1 if medialib is available and should be used])
1225
    MEDIA_LIB=-lmlib
1226
1227
    AC_MSG_CHECKING(for mediaLib 2.5)
1228
    # Check for a mediaLib 2.5 function since that is what is needed for
1229
    # gdk_rgb_convert integration.
1230
    AC_CHECK_LIB(mlib, mlib_VideoColorRGBint_to_BGRAint, use_mlib25=yes, use_mlib25=no)
1231
    if test $use_mlib25 = yes; then
1232
        AC_DEFINE(USE_MEDIALIB25, 1,
1233
                  [Define to 1 if medialib 2.5 is available])
1234
    fi
1235
fi
1236
AM_CONDITIONAL(USE_MEDIALIB, test $use_mlib = yes)
1237
AM_CONDITIONAL(USE_MEDIALIB25, test $use_mlib25 = yes)
1238
1239
# Checks to see if we should compile in MMX support (there will be
1240
# a runtime test when the code is actually run to see if it should
1241
# be used - this just checks if we can compile it.)
1242
#
1243
# This code is partially taken from Mesa
1244
#
1245
AC_MSG_CHECKING(for x86 platform)
1246
case $host_cpu in
1247
  i386|i486|i586|i686|i786|k6|k7)
1248
	use_x86_asm=yes
1249
        ;;
1250
   *)
1251
  	use_x86_asm=no
1252
esac
1253
AC_MSG_RESULT($use_x86_asm)
1254
1255
use_mmx_asm=no
1256
if test $use_x86_asm = yes; then
1257
    save_ac_ext=$ac_ext
1258
    ac_ext=S
1259
    
1260
    AC_MSG_CHECKING(compiler support for MMX)
1261
    cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
1262
    if AC_TRY_EVAL(ac_compile); then
1263
        use_mmx_asm=yes
1264
    fi
1265
1266
    rm -rf conftest*
1267
1268
    ac_ext=$save_ac_ext
1269
    if test $use_mmx_asm = yes; then
1270
      AC_DEFINE(USE_MMX, 1,
1271
                [Define to 1 if XXM is available and should be used])
1272
      AC_MSG_RESULT(yes)
1273
    else
1274
      AC_MSG_RESULT(no)
1275
    fi
1276
fi
1277
1278
AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
1279
1280
REBUILD_PNGS=
1281
if test -z "$LIBPNG" && test x"$os_win32" = xno -o x$enable_gdiplus = xno; then
1282
  REBUILD_PNGS=#
1283
fi
1284
1285
dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
1286
1287
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
1288
1289
if test $cross_compiling = yes; then
1290
  AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
1291
  AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
1292
  if test x$GTK_UPDATE_ICON_CACHE = xno; then
1293
    REBUILD_PNGS=#
1294
  fi
1295
fi
1296
1297
if test ! -f $srcdir/gtk/gtkbuiltincache.h && 
1298
   test "x$REBUILD_PNGS" = "x#" ; then
1299
     AC_MSG_ERROR([
1300
*** gtkbuiltincache.h is not in the tree, and cannot be built
1301
*** because you don't have libpng, or (when cross-compiling) you 
1302
*** don't have a prebuilt gtk-update-icon-cache on the build system.])
1303
fi
1304
1305
AC_SUBST(REBUILD_PNGS)
1306
1307
GDK_PIXBUF_PACKAGES="gmodule-no-export-2.0 gobject-2.0 gio-2.0"
1308
GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB $MEDIA_LIB"
1309
GDK_PIXBUF_EXTRA_CFLAGS= 
1310
GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1311
GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $PNG_DEP_CFLAGS_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
1312
1313
########################################
1314
# Windowing system checks
1315
########################################
1316
1317
GDK_PIXBUF_XLIB_PACKAGES=
1318
GDK_PIXBUF_XLIB_EXTRA_CFLAGS=
1319
GDK_PIXBUF_XLIB_EXTRA_LIBS=
1320
	
1321
GDK_EXTRA_LIBS="$GDK_WLIBS"
1322
GDK_EXTRA_CFLAGS=
1323
	
1324
# GTK+ uses some X calls, so needs to link against X directly
1325
GTK_DEP_PACKAGES_FOR_X=
1326
GTK_DEP_LIBS_FOR_X=
1327
1328
if test "x$gdktarget" = "xx11"; then
1329
  X_PACKAGES=fontconfig
1330
1331
  #
1332
  # We use fontconfig very peripherally when decoding the default
1333
  # settings.
1334
  #
1335
  if $PKG_CONFIG --exists fontconfig; then : ; else
1336
    AC_MSG_ERROR([
1337
*** fontconfig (http://www.fontconfig.org) is required by the X11 backend.])
1338
  fi
1339
1340
  #
1341
  # Check for basic X packages; we use pkg-config if available
1342
  #
1343
  if $PKG_CONFIG --exists x11 xext xrender; then
1344
    have_base_x_pc=true
1345
    X_PACKAGES="$X_PACKAGES x11 xext xrender"
1346
    x_libs="`$PKG_CONFIG --libs x11 xext xrender`"
1347
    X_CFLAGS="`$PKG_CONFIG --cflags x11 xext xrender`"
1348
    
1349
    # Strip out any .la files that pkg-config might give us (this happens
1350
    # with -uninstalled.pc files)
1351
    x_libs_for_checks=
1352
    for I in $x_libs ; do
1353
      case $I in 
1354
        *.la) ;;
1355
        *) x_libs_for_checks="$x_libs_for_checks $I" ;;
1356
      esac
1357
    done
1358
    
1359
    GDK_PIXBUF_XLIB_PACKAGES="x11"
1360
    GTK_PACKAGES_FOR_X="x11"
1361
  else
1362
    have_base_x_pc=false
1363
    AC_PATH_XTRA
1364
    if test x$no_x = xyes ; then
1365
      AC_MSG_ERROR([X development libraries not found])
1366
    fi
1367
    
1368
    x_cflags="$X_CFLAGS"
1369
    x_libs_for_checks="$X_LIBS -lXext -lXrender -lX11 $X_EXTRA_LIBS"
1370
1371
    GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
1372
    GDK_PIXBUF_XLIB_EXTRA_LIBS="$X_LIBS -lX11 $X_EXTRA_LIBS"
1373
    GTK_DEP_LIBS_FOR_X="$X_LIBS -lXrender -lX11 $X_EXTRA_LIBS"
1374
  fi
1375
1376
  # Extra libraries found during checks (-lXinerama, etc), not from pkg-config.
1377
  x_extra_libs=
1378
1379
  gtk_save_cppflags="$CPPFLAGS"
1380
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1381
1382
  gtk_save_LIBS=$LIBS
1383
  LIBS="$x_libs_for_checks $LIBS"
1384
  
1385
  # Sanity check for the X11 and Xext libraries. While everything we need from
1386
  # Xext is optional, the chances a system has *none* of these things is so
1387
  # small that we just unconditionally require it.
1388
  AC_CHECK_FUNC(XOpenDisplay, :,
1389
                AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
1390
  AC_CHECK_FUNC(XextFindDisplay, :,
1391
                AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
1392
  AC_CHECK_FUNC(XRenderQueryExtension, :,
1393
                AC_MSG_ERROR([*** libXrender not found. Check 'config.log' for more details.]))
1394
1395
  # Check for xReply
1396
1397
  AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
1398
  AC_TRY_COMPILE([#include <X11/Xlibint.h>],
1399
      [xReply *rep;],
1400
      [AC_MSG_RESULT([no])],
1401
      [AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
1402
#include <X11/Xlibint.h>],
1403
           [xReply *rep;],
1404
           [AC_MSG_RESULT([yes])
1405
            AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
1406
                      [Define if <X11/extensions/XIproto.h> needed for xReply])],
1407
           [AC_MSG_RESULT([unknown])
1408
            AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
1409
1410
  # Check for XConvertCase, XInternAtoms (X11R6 specific)
1411
1412
  AC_CHECK_FUNCS(XConvertCase XInternAtoms)
1413
1414
  # Generic X11R6 check needed for XIM support; we could
1415
  # probably use this to replace the above, but we'll
1416
  # leave the separate checks for XConvertCase and XInternAtoms 
1417
  # for clarity
1418
  
1419
  have_x11r6=false
1420
  AC_CHECK_FUNC(XAddConnectionWatch,
1421
      have_x11r6=true)
1422
1423
  if $have_x11r6; then
1424
    AC_DEFINE(HAVE_X11R6, 1, [Define if we have X11R6])
1425
  fi
1426
  AM_CONDITIONAL(HAVE_X11R6, $have_x11r6)
1427
1428
  # Check for XKB support.
1429
1430
  if test "x$enable_xkb" = "xyes"; then
1431
        AC_MSG_WARN(XKB support explicitly enabled)
1432
        AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
1433
  elif test "x$enable_xkb" = "xmaybe"; then
1434
        AC_CHECK_FUNC(XkbQueryExtension,
1435
                      AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]))
1436
  else
1437
        AC_MSG_WARN(XKB support explicitly disabled)
1438
  fi
1439
1440
  # Check for shaped window extension
1441
1442
  AC_CHECK_FUNC(XShapeCombineMask, :,
1443
     [AC_MSG_ERROR([Shape extension not found, check your development headers])])
1444
1445
  # X SYNC check
1446
  gtk_save_CFLAGS="$CFLAGS"
1447
  CFLAGS="$CFLAGS $x_cflags"
1448
  
1449
  AC_CHECK_FUNC(XSyncQueryExtension,
1450
      [AC_CHECK_HEADER(X11/extensions/sync.h,
1451
	  AC_DEFINE(HAVE_XSYNC, 1, [Have the SYNC extension library]),
1452
	  :, [#include <X11/Xlib.h>])])
1453
1454
  CFLAGS="$gtk_save_CFLAGS"
1455
1456
  # Xshm checks
1457
1458
  if test "x$enable_shm" = "xyes"; then
1459
     # Check for the XShm extension, normally in Xext
1460
     AC_CHECK_FUNC(XShmAttach,
1461
	:,
1462
	# On AIX, it is in XextSam instead
1463
	[AC_CHECK_LIB(XextSam, XShmAttach, 
1464
	    [GTK_ADD_LIB(x_extra_libs,XextSam)])])
1465
  fi    
1466
1467
  if test "x$enable_shm" = "xyes"; then
1468
    # Check for shared memory
1469
    AC_CHECK_HEADER(sys/ipc.h,
1470
                    AC_DEFINE(HAVE_IPC_H, 1,
1471
                              [Define to 1 if ipc.h is available]),
1472
                    no_sys_ipc=yes)
1473
    AC_CHECK_HEADER(sys/shm.h,
1474
                    AC_DEFINE(HAVE_SHM_H, 1,
1475
                              [Define to 1 if shm.h is available]),
1476
                    no_sys_shm=yes)
1477
1478
    # Check for the X shared memory extension header file
1479
    have_xshm=no 
1480
    AC_MSG_CHECKING(X11/extensions/XShm.h)
1481
    if test "x$no_xext_lib" = "xyes"; then
1482
      :
1483
    else
1484
      gtk_save_CFLAGS="$CFLAGS"
1485
      CFLAGS="$CFLAGS $x_cflags"
1486
      AC_TRY_COMPILE([
1487
#include <stdlib.h>
1488
#include <sys/types.h>
1489
#include <sys/ipc.h>
1490
#include <sys/shm.h>
1491
#include <X11/Xlib.h>
1492
#include <X11/Xutil.h>
1493
#include <X11/extensions/XShm.h>
1494
], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
1495
      CFLAGS="$gtk_save_CFLAGS"
1496
    fi
1497
    AC_MSG_RESULT($have_xshm)
1498
    if test $have_xshm = yes ; then
1499
      AC_DEFINE(HAVE_XSHM_H, 1,
1500
                [Define to 1 if xshm.h is available])
1501
    fi
1502
  fi
1503
1504
  if test "x$enable_xinerama" = "xyes"; then
1505
    # Check for Xinerama extension (Solaris impl or Xfree impl)
1506
    gtk_save_cppflags="$CPPFLAGS"
1507
    CPPFLAGS="$CPPFLAGS $x_cflags"
1508
  
1509
    # Check for XFree
1510
    AC_MSG_CHECKING(for Xinerama support on XFree86)
1511
	  
1512
    have_xfree_xinerama=false
1513
    if $PKG_CONFIG --exists xinerama ; then
1514
       have_xfree_xinerama=true
1515
       X_PACKAGES="$X_PACKAGES xinerama"
1516
    else    
1517
       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
1518
	   [AC_CHECK_HEADER(X11/extensions/Xinerama.h, 
1519
	   [GTK_ADD_LIB(x_extra_libs,Xinerama)
1520
	   have_xfree_xinerama=true], :,
1521
           [#include <X11/Xlib.h>])])
1522
    fi
1523
1524
    if $have_xfree_xinerama ; then
1525
      AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
1526
                [Define to 1 if XFree Xinerama is available])
1527
      AC_DEFINE(HAVE_XINERAMA, 1,
1528
                [Define to 1 is Xinerama is available])
1529
      AC_MSG_RESULT(yes)
1530
    else
1531
      AC_MSG_RESULT(no)
1532
1533
      case "$host" in
1534
        *-*-solaris*)
1535
            # Check for solaris
1536
	    AC_MSG_CHECKING(for Xinerama support on Solaris)
1537
	  
1538
	    have_solaris_xinerama=false
1539
	    AC_CHECK_FUNC(XineramaGetInfo,
1540
	        [AC_CHECK_HEADER(X11/extensions/xinerama.h,
1541
  	  	    [have_solaris_xinerama=true], :,
1542
		    [#include <X11/Xlib.h>])])
1543
		
1544
            if $have_solaris_xinerama ; then
1545
              AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
1546
                        [Define to 1 if solaris xinerama is available])
1547
	      AC_DEFINE(HAVE_XINERAMA, 1,
1548
                        [Define to 1 if xinerama is available])
1549
              AC_MSG_RESULT(yes)
1550
            else
1551
              AC_MSG_RESULT(no)
1552
            fi
1553
            ;;
1554
        *)
1555
            ;;
1556
      esac
1557
    fi
1558
  fi
1559
  
1560
  # set up things for XInput
1561
1562
  if test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then
1563
    AC_DEFINE(XINPUT_XFREE, 1,
1564
              [Define to 1 if XFree XInput should be used])
1565
    
1566
    if $PKG_CONFIG --exists xi ; then
1567
      X_PACKAGES="$X_PACKAGES xi"
1568
    else
1569
      GTK_ADD_LIB(x_extra_libs, Xi)
1570
    fi
1571
  else
1572
    AC_DEFINE(XINPUT_NONE, 1,
1573
              [Define to 1 if no XInput should be used])
1574
  fi
1575
1576
  AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree || test x$with_xinput = xyes)
1577
1578
  # Check for the RANDR extension
1579
  if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
1580
     AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
1581
1582
     X_PACKAGES="$X_PACKAGES xrandr"
1583
  fi
1584
       
1585
  # Checks for Xcursor library
1586
  
1587
  if $PKG_CONFIG --exists xcursor ; then
1588
    AC_DEFINE(HAVE_XCURSOR, 1, [Have the Xcursor library])
1589
    
1590
    X_PACKAGES="$X_PACKAGES xcursor"
1591
  fi
1592
1593
  # Checks for XFixes extension
1594
  
1595
  if $PKG_CONFIG --exists xfixes ; then
1596
    AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
1597
    
1598
    X_PACKAGES="$X_PACKAGES xfixes"
1599
    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
1600
  fi
1601
1602
  # Checks for Xcomposite extension
1603
1604
  if $PKG_CONFIG --exists xcomposite ; then
1605
    AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
1606
1607
    X_PACKAGES="$X_PACKAGES xcomposite"
1608
    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
1609
  fi
1610
1611
  # Checks for Xdamage extension
1612
1613
  if $PKG_CONFIG --exists xdamage ; then
1614
    AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
1615
1616
    X_PACKAGES="$X_PACKAGES xdamage"
1617
    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
1618
  fi
1619
1620
  if $have_base_x_pc ; then
1621
    GDK_EXTRA_LIBS="$x_extra_libs"
1622
  else
1623
    GDK_EXTRA_LIBS="$X_LIBS $x_extra_libs -lXext -lX11 $GDK_EXTRA_LIBS"
1624
  fi
1625
1626
  CPPFLAGS="$gtk_save_cppflags"
1627
  LIBS="$gtk_save_libs"
1628
1629
  AM_CONDITIONAL(USE_X11, true)
1630
else
1631
  XPACKAGES=
1632
1633
  AM_CONDITIONAL(XINPUT_XFREE, false)
1634
  AM_CONDITIONAL(USE_X11, false)
1635
  AM_CONDITIONAL(HAVE_X11R6, false)
1636
fi
1637
1638
if test "x$gdktarget" = "xwin32"; then
1639
  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
1640
  AM_CONDITIONAL(USE_WIN32, true)
1641
else
1642
  AM_CONDITIONAL(USE_WIN32, false)
1643
fi
1644
1645
if test "x$gdktarget" = "xquartz"; then
1646
  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
1647
  AM_CONDITIONAL(USE_QUARTZ, true)
1648
else
1649
  AM_CONDITIONAL(USE_QUARTZ, false)
1650
fi
1651
1652
GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1653
GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
1654
1655
AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
1656
AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
1657
AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
1658
AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
1659
AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
1660
1661
if test "x$gdktarget" = "xdirectfb"; then
1662
  DIRECTFB_REQUIRED_VERSION=1.0.0
1663
  AC_MSG_CHECKING(for DirectFB)
1664
1665
  PKG_CHECK_MODULES(DIRECTFB, [directfb >= $DIRECTFB_REQUIRED_VERSION])
1666
  AM_CONDITIONAL(USE_DIRECTFB, true)
1667
else
1668
  AM_CONDITIONAL(USE_DIRECTFB, false)
1669
fi
1670
1671
1672
# Check for Pango flags
1673
1674
if test "x$gdktarget" = "xwin32"; then
1675
	PANGO_PACKAGES="pangowin32 pangocairo"
1676
else
1677
	PANGO_PACKAGES="pango pangocairo"
1678
fi
1679
1680
AC_MSG_CHECKING(Pango flags)
1681
if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
1682
        PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
1683
        PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1684
1685
        AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1686
else
1687
        AC_MSG_ERROR([
1688
*** Pango not found. Pango built with Cairo support is required
1689
*** to build GTK+. See http://www.pango.org for Pango information.
1690
])
1691
fi
1692
1693
CFLAGS="$CFLAGS $PANGO_CFLAGS"
1694
1695
if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1696
        :
1697
else
1698
	gtk_save_LIBS="$LIBS"
1699
        LIBS="$PANGO_LIBS $LIBS"
1700
        AC_TRY_LINK_FUNC(pango_context_new, :, AC_MSG_ERROR([
1701
*** Can't link to Pango. Pango is required to build
1702
*** GTK+. For more information see http://www.pango.org]))
1703
        LIBS="$gtk_save_LIBS"
1704
fi
1705
1706
CFLAGS="$saved_cflags"
1707
LDFLAGS="$saved_ldflags"
1708
1709
GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 $X_PACKAGES cairo-$cairo_backend"
1710
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1711
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1712
#
1713
# If we aren't writing explicit dependencies, then don't put the extra libraries we need
1714
# into the pkg-config files
1715
#
1716
if test $enable_explicit_deps != yes ; then
1717
  GDK_PACKAGES="$PANGO_PACKAGES"
1718
  GDK_EXTRA_LIBS=
1719
fi
1720
1721
AC_SUBST(GDK_PACKAGES)
1722
AC_SUBST(GDK_EXTRA_LIBS)
1723
AC_SUBST(GDK_EXTRA_CFLAGS)
1724
AC_SUBST(GDK_DEP_LIBS)
1725
AC_SUBST(GDK_DEP_CFLAGS)
1726
1727
1728
########################################
1729
# Check for Accessibility Toolkit flags
1730
########################################
1731
1732
ATK_PACKAGES=atk
1733
AC_MSG_CHECKING(ATK flags)
1734
if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1735
        ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1736
        ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1737
1738
        AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1739
else
1740
        AC_MSG_ERROR([
1741
*** Accessibility Toolkit not found. Accessibility Toolkit is required
1742
*** to build GTK+.
1743
])
1744
fi
1745
1746
if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1747
        :
1748
else
1749
	gtk_save_LIBS="$LIBS"
1750
        LIBS="$ATK_LIBS $LIBS"
1751
        AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
1752
                *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1753
                *** to build GTK+]))
1754
        LIBS="$gtk_save_LIBS"
1755
fi
1756
1757
GTK_PACKAGES="atk cairo gio-2.0"
1758
if test "x$gdktarget" = "xx11"; then
1759
  GTK_PACKAGES="$GTK_PACKAGES pangoft2"
1760
fi
1761
GTK_EXTRA_LIBS=
1762
GTK_EXTRA_CFLAGS= 
1763
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1764
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1765
1766
if test x"$os_win32" = xyes; then
1767
  GTK_EXTRA_CFLAGS="$msnative_struct"
1768
fi
1769
1770
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
1771
ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
1772
PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
1773
CAIRO_PREFIX="`pkg-config --variable=prefix cairo`"
1774
1775
if test $enable_explicit_deps != yes ; then
1776
  GDK_PIXBUF_EXTRA_LIBS=
1777
fi
1778
1779
AC_SUBST(GDK_PIXBUF_PACKAGES)
1780
AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
1781
AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
1782
AC_SUBST(GDK_PIXBUF_DEP_LIBS)
1783
AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
1784
1785
AC_SUBST(GTK_PACKAGES)
1786
AC_SUBST(GTK_EXTRA_LIBS)
1787
AC_SUBST(GTK_EXTRA_CFLAGS)
1788
AC_SUBST(GTK_DEP_LIBS)
1789
AC_SUBST(GTK_DEP_CFLAGS)
1790
1791
AC_SUBST(GLIB_PREFIX)
1792
AC_SUBST(ATK_PREFIX)
1793
AC_SUBST(PANGO_PREFIX)
1794
AC_SUBST(CAIRO_PREFIX)
1795
1796
AC_SUBST(GTK_DEBUG_FLAGS)
1797
AC_SUBST(GTK_XIM_FLAGS)
1798
1799
########################
1800
# Checks needed for gail
1801
########################
1802
1803
old_LIBS="$LIBS"
1804
dnl Checks for inet libraries:
1805
AC_SEARCH_LIBS(gethostent, nsl)
1806
AC_SEARCH_LIBS(setsockopt, socket)
1807
AC_SEARCH_LIBS(connect, inet)
1808
1809
dnl check for the sockaddr_un.sun_len member
1810
AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
1811
		[struct_sockaddr_un_sun_len=true],
1812
		[struct_sockaddr_un_suin_len=false],
1813
		[#include <sys/types.h>
1814
		 #include <sys/un.h>]
1815
		)
1816
case $struct_sockaddr_un_sun_len in 
1817
	true)
1818
		AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_UN_SUN_LEN, 1,
1819
		                   [Have the sockaddr_un.sun_len member])
1820
		;;
1821
	*)
1822
		;;
1823
esac
1824
1825
GAIL_INET_LIBS="$LIBS"
1826
AC_SUBST([GAIL_INET_LIBS])
1827
1828
LIBS="$old_LIBS"
1829
1830
################################################################
1831
# Printing system checks
1832
################################################################
1833
1834
AC_ARG_ENABLE(cups,
1835
              [AC_HELP_STRING([--disable-cups]
1836
                              [disable cups print backend])],,
1837
              [enable_cups=auto])
1838
1839
if test "x$enable_cups" = "xauto"
1840
then
1841
  AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
1842
  if test "x$CUPS_CONFIG" != "xno"; then
1843
    CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
1844
    CUPS_LIBS=`$CUPS_CONFIG --libs`
1845
1846
    CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
1847
    CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
1848
    CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
1849
1850
    if test $CUPS_API_MAJOR -gt 1 -o \
1851
            $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then
1852
      AC_DEFINE(HAVE_CUPS_API_1_2, 1, 
1853
                [Define to 1 if CUPS 1.2 API is available])
1854
    fi
1855
1856
    AC_SUBST(CUPS_API_MAJOR)
1857
    AC_SUBST(CUPS_API_MINOR)
1858
    AC_SUBST(CUPS_CFLAGS)
1859
    AC_SUBST(CUPS_LIBS)
1860
1861
    AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
1862
  fi
1863
  AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
1864
1865
  gtk_save_cflags="$CFLAGS"
1866
  CFLAGS="$CUPS_CFLAGS"
1867
  AC_TRY_COMPILE([#include <cups/http.h>],
1868
                 [http_t http; char *s = http.authstring;],
1869
                 [AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
1870
                            [Define if cups http_t authstring field is accessible])],)
1871
  CFLAGS="$gtk_save_cflags"
1872
1873
  AC_SUBST(HAVE_HTTP_AUTHSTRING)
1874
1875
  gtk_save_libs="$LIBS"
1876
  LIBS="$CUPS_LIBS"
1877
  AC_CHECK_FUNCS(httpGetAuthString)
1878
  LIBS="$gtk_save_libs"
1879
1880
else
1881
  AM_CONDITIONAL(HAVE_CUPS, false)
1882
fi
1883
1884
# Checks to see if we should compile with PAPI backend for GTK+
1885
#
1886
1887
AC_ARG_ENABLE(papi,
1888
              [AC_HELP_STRING([--disable-papi]
1889
                              [disable papi print backend])],,
1890
             [enable_papi=auto])
1891
1892
if test "x$enable_papi" = "xauto"
1893
then
1894
  AC_MSG_CHECKING(libpapi)
1895
  AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
1896
  if test $have_papi = yes; then
1897
    AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
1898
  fi
1899
  AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
1900
else
1901
  AM_CONDITIONAL(HAVE_PAPI, false)
1902
fi
1903
1904
AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno")
1905
1906
gtk_save_cppflags="$CPPFLAGS"
1907
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
1908
1909
AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
1910
*** Can't find cairo-pdf.h. You must build Cairo with the pdf
1911
*** backend enabled.]))
1912
1913
if test "$os_win32" != "yes"; then
1914
  AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([
1915
*** Can't find cairo-ps.h. You must build Cairo with the 
1916
*** postscript backend enabled.]))
1917
fi   
1918
1919
CPPFLAGS="$gtk_save_cppflags"
1920
     
1921
			  	
1922
AC_ARG_ENABLE(test-print-backend,
1923
              [AC_HELP_STRING([--enable-test-print-backend],
1924
                              [build test print backend])],,
1925
              [enable_test_print_backend=no])
1926
AM_CONDITIONAL(TEST_PRINT_BACKEND, test "x$enable_test_print_backend" != "xno")
1927
1928
1929
################################################################
1930
# Strip -export-dynamic from the link lines of various libraries
1931
################################################################
1932
1933
#
1934
# pkg-config --libs gmodule includes the "export_dynamic" flag,
1935
#  but this flag is only meaningful for executables. For libraries
1936
#  the effect is undefined; what it causes on Linux is that the
1937
#  export list from -export-symbols-regex is ignored and everything
1938
#  is exported
1939
#
1940
# We are using gmodule-no-export now, but I'm leaving the stripping
1941
# code in place for now, since pango and atk still require gmodule.
1942
export SED
1943
export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
1944
if test -n "$export_dynamic"; then
1945
  GDK_PIXBUF_DEP_LIBS=`echo $GDK_PIXBUF_DEP_LIBS | sed -e "s/$export_dynamic//"`
1946
  GDK_PIXBUF_XLIB_DEP_LIBS=`echo $GDK_PIXBUF_XLIB_DEP_LIBS | sed -e "s/$export_dynamic//"`
1947
  GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
1948
  GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
1949
fi
1950
1951
1952
##################################################
1953
# Checks for gtk-doc and docbook-tools
1954
##################################################
1955
1956
GTK_DOC_CHECK([1.11])
1957
1958
AC_CHECK_PROG(DB2HTML, db2html, true, false)
1959
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1960
1961
AC_ARG_ENABLE(man,
1962
              [AC_HELP_STRING([--enable-man],
1963
                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
1964
              enable_man=no)
1965
1966
if test "${enable_man}" != no; then
1967
  dnl
1968
  dnl Check for xsltproc
1969
  dnl
1970
  AC_PATH_PROG([XSLTPROC], [xsltproc])
1971
  if test -z "$XSLTPROC"; then
1972
    enable_man=no
1973
  fi
1974
1975
  dnl check for DocBook DTD and stylesheets in the local catalog.
1976
  JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
1977
     [DocBook XML DTD V4.1.2],,enable_man=no)
1978
  JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
1979
     [DocBook XSL Stylesheets],,enable_man=no)
1980
fi
1981
1982
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
1983
1984
1985
##################################################
1986
# Output commands
1987
##################################################
1988
1989
AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [
1990
	outfile=gdkconfig.h-tmp
1991
	cat > $outfile <<\_______EOF
1992
/* gdkconfig.h
1993
 *
1994
 * This is a generated file.  Please modify `configure.in'
1995
 */
1996
1997
#ifndef GDKCONFIG_H
1998
#define GDKCONFIG_H
1999
2000
#ifdef __cplusplus
2001
extern "C" {
2002
#endif /* __cplusplus */
2003
2004
#ifndef GSEAL
2005
/* introduce GSEAL() here for all of Gdk and Gtk+ without the need to modify GLib */
2006
#  ifdef GSEAL_ENABLE
2007
#    define GSEAL(ident)      _g_sealed__ ## ident
2008
#  else
2009
#    define GSEAL(ident)      ident
2010
#  endif
2011
#endif /* !GSEAL */
2012
2013
_______EOF
2014
2015
	cat >>$outfile <<_______EOF
2016
$gdk_windowing
2017
$gdk_wc
2018
_______EOF
2019
2020
	cat >>$outfile <<_______EOF
2021
2022
#ifdef __cplusplus
2023
}
2024
#endif /* __cplusplus */
2025
2026
#endif /* GDKCONFIG_H */
2027
_______EOF
2028
2029
2030
	if cmp -s $outfile gdk/gdkconfig.h; then
2031
          AC_MSG_NOTICE([gdk/gdkconfig.h is unchanged])
2032
	  rm -f $outfile
2033
	else
2034
	  mv $outfile gdk/gdkconfig.h
2035
	fi
2036
],[
2037
if test "x$gdktarget" = "xx11" ; then
2038
  gdk_windowing='
2039
#define GDK_WINDOWING_X11'
2040
elif test "x$gdktarget" = "xwin32" ; then
2041
  gdk_windowing='
2042
#define GDK_NATIVE_WINDOW_POINTER
2043
2044
#define GDK_WINDOWING_WIN32'
2045
elif test "x$gdktarget" = "xquartz" ; then
2046
  gdk_windowing='
2047
#define GDK_WINDOWING_QUARTZ'
2048
elif test "x$gdktarget" = "xdirectfb" ; then
2049
  gdk_windowing='
2050
#define GDK_WINDOWING_DIRECTFB'
2051
fi
2052
2053
if test x$gdk_wchar_h = xyes; then
2054
  gdk_wc='
2055
#define GDK_HAVE_WCHAR_H 1'
2056
fi
2057
if test x$gdk_wctype_h = xyes; then
2058
  gdk_wc="\$gdk_wc
2059
#define GDK_HAVE_WCTYPE_H 1"
2060
fi
2061
if test x$gdk_working_wctype = xno; then
2062
  gdk_wc="\$gdk_wc
2063
#define GDK_HAVE_BROKEN_WCTYPE 1"
2064
fi
2065
2066
2067
])
2068
2069
AC_CONFIG_FILES([
2070
config.h.win32
2071
gtk-zip.sh
2072
Makefile
2073
gdk-pixbuf-2.0.pc
2074
gdk-2.0.pc
2075
gtk+-2.0.pc
2076
gtk+-unix-print-2.0.pc
2077
gail.pc
2078
gdk-pixbuf-2.0-uninstalled.pc
2079
gdk-2.0-uninstalled.pc
2080
gtk+-2.0-uninstalled.pc
2081
gail-uninstalled.pc
2082
m4macros/Makefile
2083
po/Makefile.in
2084
po-properties/Makefile.in
2085
demos/Makefile
2086
demos/gtk-demo/Makefile
2087
demos/gtk-demo/geninclude.pl
2088
tests/Makefile
2089
docs/Makefile
2090
docs/reference/Makefile
2091
docs/reference/gdk-pixbuf/Makefile
2092
docs/reference/gdk-pixbuf/version.xml
2093
docs/reference/gdk/Makefile
2094
docs/reference/gdk/version.xml
2095
docs/reference/gtk/Makefile
2096
docs/reference/gtk/version.xml
2097
docs/reference/libgail-util/Makefile
2098
docs/faq/Makefile
2099
docs/tools/Makefile
2100
docs/tutorial/Makefile
2101
gdk-pixbuf/Makefile
2102
gdk-pixbuf/gdk_pixbuf.rc
2103
gdk-pixbuf/gdk-pixbuf-features.h
2104
gdk-pixbuf/pixops/Makefile
2105
gdk/Makefile
2106
gdk/x11/Makefile
2107
gdk/win32/Makefile
2108
gdk/win32/rc/Makefile
2109
gdk/win32/rc/gdk.rc
2110
gdk/quartz/Makefile
2111
gdk/directfb/Makefile
2112
gdk/tests/Makefile
2113
gtk/Makefile
2114
gtk/makefile.msc
2115
gtk/gtkversion.h
2116
gtk/gtk-win32.rc
2117
gtk/theme-bits/Makefile
2118
gtk/tests/Makefile
2119
modules/Makefile
2120
modules/other/Makefile
2121
modules/other/gail/Makefile
2122
modules/other/gail/libgail-util/Makefile
2123
modules/other/gail/tests/Makefile
2124
modules/engines/Makefile
2125
modules/engines/pixbuf/Makefile
2126
modules/engines/ms-windows/Makefile
2127
modules/engines/ms-windows/Theme/Makefile
2128
modules/engines/ms-windows/Theme/gtk-2.0/Makefile
2129
modules/input/Makefile
2130
modules/printbackends/Makefile
2131
modules/printbackends/cups/Makefile
2132
modules/printbackends/lpr/Makefile
2133
modules/printbackends/file/Makefile
2134
modules/printbackends/papi/Makefile
2135
modules/printbackends/test/Makefile
2136
perf/Makefile
2137
contrib/Makefile
2138
contrib/gdk-pixbuf-xlib/Makefile
2139
contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc
2140
])
2141
2142
AC_OUTPUT
2143
2144
echo "configuration:
2145
        target: $gdktarget"