]> Pileus Git - ~andy/gtk/blob - configure.in
Removed mistakenly added generated sgml
[~andy/gtk] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(gdk/gdktypes.h)
3
4 # In the following, there are a the following variants
5 # of GLib cflags and libs variables
6 #
7 # GLIB_CFLAGS:  cflags for compiling libraries and example progs
8 # GLIB_LIBS:    libraries for linking example programs
9 # GLIB_DEPLIBS: libraries for linking libraries against
10 # glib_cflags:  cflags to store in gtk-config
11 # glib_libs:    libs to store in gtk-config
12 # glib_thread_cflags: cflags to store in gtk-config for gtk-config gthread
13 # glib_thread_libs:   libs to store in gtk-config for gtk-config gthread
14
15 # Save this value here, since automake will set cflags later
16 cflags_set=${CFLAGS+set}
17
18 dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
19 dnl are available for $ac_help expansion (don't we all *love* autoconf?)
20 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
21 #
22 # Making releases:
23 #   GTK_MICRO_VERSION += 1;
24 #   GTK_INTERFACE_AGE += 1;
25 #   GTK_BINARY_AGE += 1;
26 # if any functions have been added, set GTK_INTERFACE_AGE to 0.
27 # if backwards compatibility has been broken,
28 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
29 #
30 GTK_MAJOR_VERSION=1
31 GTK_MINOR_VERSION=3
32 GTK_MICRO_VERSION=0
33 GTK_INTERFACE_AGE=0
34 GTK_BINARY_AGE=0
35 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
36 dnl
37 AC_DIVERT_POP()dnl
38
39 AC_SUBST(GTK_MAJOR_VERSION)
40 AC_SUBST(GTK_MINOR_VERSION)
41 AC_SUBST(GTK_MICRO_VERSION)
42 AC_SUBST(GTK_INTERFACE_AGE)
43 AC_SUBST(GTK_BINARY_AGE)
44 AC_SUBST(GTK_VERSION)
45
46 # libtool versioning
47 LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
48 LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
49 LT_REVISION=$GTK_INTERFACE_AGE
50 LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
51 AC_SUBST(LT_RELEASE)
52 AC_SUBST(LT_CURRENT)
53 AC_SUBST(LT_REVISION)
54 AC_SUBST(LT_AGE)
55
56 # For automake.
57 VERSION=$GTK_VERSION
58 PACKAGE=gtk+
59
60 # Save this value here, since automake will set cflags later
61 cflags_set=${CFLAGS+set}
62
63 dnl Initialize automake stuff
64 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
65
66 # Specify a configuration file
67 AM_CONFIG_HEADER(config.h)
68
69 dnl Initialize libtool
70 AM_PROG_LIBTOOL
71
72 dnl Initialize maintainer mode
73 AM_MAINTAINER_MODE
74
75 AC_CANONICAL_HOST
76
77 dnl figure debugging default, prior to $ac_help setup
78 dnl
79 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
80 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
81         debug_default=yes
82 else
83         debug_default=minimum
84 fi
85 AC_DIVERT_POP()dnl
86
87 dnl declare --enable-* args and collect ac_help strings
88 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
89 AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available [default=yes]],
90                    echo $enable_shm, enable_shm="yes")
91 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
92                     , enable_ansi=no)
93 AC_ARG_WITH(glib, [  --with-glib=DIR         Use uninstalled copy of glib])
94 AC_ARG_ENABLE(xim, [  --enable-xim            support XIM [default=yes]],
95                         , enable_xim="yes")
96 AC_ARG_ENABLE(xim_inst, [  --disable-xim-inst      does not use xim instantiate callback],
97                         , enable_xim_inst="maybe")
98 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
99 AC_ARG_WITH(locale, [  --with-locale=LOCALE    locale name you want to use ])
100
101 AC_ARG_WITH(xinput, [  --with-xinput=[no/gxi/xfree] support XInput ])
102
103 gdktarget=x11
104 gdktargetlib=libgdk-x11.la
105 gtktargetlib=libgtk-x11.la
106 AC_ARG_WITH(gdktarget, [  --with-gdktarget=[x11/nanox/linux-fb] select GDK target [default=x11] ],
107         gdktarget=$with_gdktarget)
108
109 AC_SUBST(gdktarget)
110 case $gdktarget in
111   x11|nanox|linux-fb) ;;
112   *) AC_MSG_ERROR([Invalid target for GDK: use x11, nanox or linux-fb.]);;
113 esac
114
115 if test "x$enable_debug" = "xyes"; then
116   test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
117   GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
118 else
119   if test "x$enable_debug" = "xno"; then
120     GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DGTK_NO_CHECK_CASTS"
121   else
122     GTK_DEBUG_FLAGS="-DGTK_NO_CHECK_CASTS"
123   fi
124 fi
125
126 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
127
128 # Build time sanity check...
129 AM_SANITY_CHECK
130
131 # Checks for programs.
132 AC_PROG_CC
133 AC_ISC_POSIX
134 AM_PROG_CC_STDC
135 AC_PROG_INSTALL
136 AC_PROG_MAKE_SET
137
138 changequote(,)dnl
139 if test "x$GCC" = "xyes"; then
140   case " $CFLAGS " in
141   *[\ \ ]-Wall[\ \      ]*) ;;
142   *) CFLAGS="$CFLAGS -Wall" ;;
143   esac
144
145   if test "x$enable_ansi" = "xyes"; then
146     case " $CFLAGS " in
147     *[\ \       ]-ansi[\ \      ]*) ;;
148     *) CFLAGS="$CFLAGS -ansi" ;;
149     esac
150
151     case " $CFLAGS " in
152     *[\ \       ]-pedantic[\ \  ]*) ;;
153     *) CFLAGS="$CFLAGS -pedantic" ;;
154     esac
155   fi
156 fi
157 changequote([,])dnl
158
159 # Honor aclocal flags
160 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
161
162 # define a MAINT-like variable REBUILD which is set if Perl
163 # and awk are found, so autogenerated sources can be rebuilt
164
165 AC_PROG_AWK
166 AC_CHECK_PROGS(PERL, perl5 perl)
167
168 # We would like indent, but don't require it.
169 AC_CHECK_PROG(INDENT, indent, indent)
170
171 REBUILD=\#
172 if test "x$enable_rebuilds" = "xyes" && \
173      test -n "$PERL" && \
174      $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
175      test -n "$AWK" ; then
176   REBUILD=
177 fi
178 AC_SUBST(REBUILD)
179
180 AC_CHECK_FUNCS(lstat)
181
182 AC_MSG_CHECKING(whether make is GNU Make)
183 STRIP_BEGIN=
184 STRIP_END=
185 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
186         STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
187         STRIP_END=')'
188         AC_MSG_RESULT(yes)
189 else
190         AC_MSG_RESULT(no)
191 fi
192 STRIP_DUMMY=
193 AC_SUBST(STRIP_DUMMY)
194 AC_SUBST(STRIP_BEGIN)
195 AC_SUBST(STRIP_END)
196
197 # i18n stuff
198 ALL_LINGUAS="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no pl pt pt_BR ro ru sk sl sv tr uk wa zh_TW.Big5 zh_CN.GB2312"
199 AM_GTK_GNU_GETTEXT
200 LIBS="$LIBS $INTLLIBS"
201
202 # AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
203 # this is the directory where the *.{mo,gmo} files are installed
204 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
205 AC_SUBST(gtklocaledir)
206
207 dnl The DU4 header files don't provide library prototypes unless 
208 dnl -std1 is given to the native cc.
209 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
210
211 gtk_save_LIBS=$LIBS
212 LIBS="$LIBS -lm"
213 AC_TRY_RUN([#include <math.h>
214              int main (void) { return (log(1) != log(1.)); }],
215      AC_MSG_RESULT(none needed),
216      gtk_save_CFLAGS="$CFLAGS"
217      CFLAGS="$CFLAGS -std1"
218      AC_TRY_RUN([#include <math.h>
219                  int main (void) { return (log(1) != log(1.)); }],
220          AC_MSG_RESULT(-std1),
221          AC_MSG_RESULT()
222          CFLAGS="$gtk_save_CFLAGS"
223          AC_MSG_WARN(
224                 [No ANSI prototypes found in library. (-std1 didn't work.)]),
225          true
226      ),
227      AC_MSG_RESULT(none needed)
228 )
229 LIBS=$gtk_save_LIBS
230
231 MATH_LIB=-lm
232 GTK_LIBS_EXTRA=
233 AC_MSG_CHECKING(for the BeOS)
234 case $host in
235   *-*-beos*)
236     AC_MSG_RESULT(yes)
237     GTK_LIBS_EXTRA="-L\$(top_builddir_full)/gdk/.libs -lgdk"
238     MATH_LIB=
239   ;;
240   *)
241     AC_MSG_RESULT(no)
242   ;;
243 esac
244 AC_SUBST(MATH_LIB)
245 AC_SUBST(GTK_LIBS_EXTRA)
246
247 dnl NeXTStep cc seems to need this
248 AC_MSG_CHECKING([for extra flags for POSIX compliance])
249 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
250   AC_MSG_RESULT(none needed),
251   gtk_save_CFLAGS="$CFLAGS"
252   CFLAGS="$CFLAGS -posix"
253   AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
254     AC_MSG_RESULT(-posix),
255     AC_MSG_RESULT()
256     CFLAGS="$gtk_save_CFLAGS"
257     AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
258
259 if test x$with_glib = xyes ; then
260   AC_MSG_ERROR([
261 *** Directory must be specified for --with-glib])
262 fi
263
264 if test x$with_glib = x ; then 
265   # Look for separately installed glib
266
267   AM_PATH_GLIB(1.3.1,,
268     AC_MSG_ERROR([
269 *** GLIB 1.3.0 or better is required. The latest version of GLIB
270 *** is always available from ftp://ftp.gtk.org/.]),
271     gobject gmodule gthread)
272
273   # we do not want to make all gtk progs to link to thread libraries.
274   glib_cflags=`$GLIB_CONFIG glib gobject gmodule --cflags`
275   glib_thread_cflags="$GLIB_CFLAGS"
276   glib_libs=`$GLIB_CONFIG glib gobject gmodule --libs`
277   glib_thread_libs="$GLIB_LIBS"
278   GLIB_LIBS="$glib_libs"
279   GLIB_DEPLIBS="$glib_libs"
280 else
281   # Use uninstalled glib (assume they got the version right)
282
283   GLIB_CONFIG=$with_glib/glib-config
284   if test -x $GLIB_CONFIG ; then 
285     :
286   else
287     AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured])
288   fi
289
290   # For use in gtk-config
291   glib_cflags=`$GLIB_CONFIG --cflags gmodule`
292   glib_thread_cflags=`$GLIB_CONFIG --cflags gmodule gthread`
293   glib_libs=`$GLIB_CONFIG --libs gmodule`
294   glib_thread_libs=`$GLIB_CONFIG --libs gmodule gthread`
295
296   glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'`
297
298   # canonicalize relative paths
299   case $with_glib in 
300     /*)
301       glib_dir=$with_glib
302       ;;
303     *)
304       glib_dir="\$(top_builddir)/$with_glib"
305       ;;
306   esac
307
308   GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
309   GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la"
310   GLIB_DEPLIBS=
311
312   AC_SUBST(GLIB_CFLAGS)
313   AC_SUBST(GLIB_LIBS)
314 fi
315
316 AC_SUBST(glib_cflags)
317 AC_SUBST(glib_libs)
318 AC_SUBST(glib_thread_cflags)
319 AC_SUBST(glib_thread_libs)
320 AC_SUBST(GLIB_DEPLIBS)
321
322 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
323 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
324 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
325
326 saved_cflags="$CFLAGS"
327 saved_ldflags="$LDFLAGS"
328
329 if test "x$gdktarget" = "xx11"; then
330   # Find the X11 include and library directories
331   AC_PATH_X
332   AC_PATH_XTRA
333
334   if test "x$x_includes" = "x"; then
335     x_includes="/usr/include"
336   fi
337
338   CFLAGS="$CFLAGS $X_CFLAGS"
339   LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
340
341   if test "x$no_x" = "xyes"; then 
342     AC_MSG_ERROR([
343 *** X libraries or include files not found. Check 'config.log' for 
344 *** more details.])
345   fi
346
347   # Checks for libraries.
348   # Check for the X11 library
349   AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", 
350     AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
351     $X_EXTRA_LIBS)
352
353   if test "x$enable_shm" = "xyes"; then
354     # Check for the Xext library (needed for XShm extention)
355     AC_CHECK_LIB(Xext, XShmAttach, 
356         x_libs="-lXext $x_libs", 
357         # On AIX, it is in XextSam instead, but we still need -lXext
358         AC_CHECK_LIB(XextSam, XShmAttach, 
359             x_libs="-lXextSam -lXext $x_libs", 
360             no_xext_lib=yes, $x_libs),
361         $x_libs)
362   fi
363
364   # Check for shaped window extension
365
366   AC_CHECK_LIB(Xext, XShapeCombineMask,
367       if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
368            x_libs="-lXext $x_libs"
369       fi
370       AC_DEFINE(HAVE_SHAPE_EXT),
371       ,
372       $x_libs)
373
374   # Check for XConvertCase (X11R6 specific)
375
376   AC_CHECK_LIB(X11, XConvertCase,
377       AC_DEFINE(HAVE_XCONVERTCASE),
378       ,
379       $x_libs)
380
381   # Check for XIM support.
382
383   AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
384             : ,
385             enable_xim_inst="no",
386             $x_libs)
387
388   # On Solaris, calling XRegisterIMInstantiateCallback seems to
389   # cause an immediate segfault, so we disable it, unless
390   # the user specifically forces it to be on.
391
392   if test x$enable_xim_inst = xmaybe ; then
393     case host in
394           *-*-solaris*)
395             enable_xim_inst="no"
396             ;;
397           *)
398             enable_xim_inst="yes"
399             ;;
400     esac
401   fi
402
403   if test "x$enable_xim" = "xyes"; then
404     GTK_XIM_FLAGS="-DUSE_XIM"
405     if test "x$enable_xim_inst" = "xyes"; then
406       AC_DEFINE(USE_X11R6_XIM)
407     fi
408   fi
409
410   x_cflags="$X_CFLAGS"
411   x_ldflags="$X_LDFLAGS $X_LIBS"
412
413   # set up things for XInput
414
415   if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
416     AC_DEFINE(XINPUT_GXI)
417     xinput_progs=gxid
418     x_libs="-lXi $x_libs"
419   elif test "x$with_xinput" = "xxfree"; then
420     AC_DEFINE(XINPUT_XFREE)
421     x_libs="-lXi $x_libs"
422   else
423     AC_DEFINE(XINPUT_NONE)
424   fi
425
426   AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
427   AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
428
429   if test "x$enable_shm" = "xyes"; then
430     # Check for shared memory
431     AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
432     AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
433
434     # Check for the X shared memory extension header file
435     AC_MSG_CHECKING(X11/extensions/XShm.h)
436     if test "x$no_xext_lib" = "xyes"; then
437       AC_MSG_RESULT(no)
438       no_xshm=yes
439     else
440       if test -f "$x_includes/X11/extensions/XShm.h"; then
441         AC_MSG_RESULT(yes)
442         AC_DEFINE(HAVE_XSHM_H)
443       else
444         AC_MSG_RESULT(no)
445         no_xshm=yes
446       fi
447     fi
448   fi
449
450   more_cflags="$x_cflags"
451   more_ldflags="$x_ldflags"
452   more_libs="$x_libs"
453   more_includes="$x_includes"
454
455   # these are already defined above
456   #gdktargetlib = "libgdk-x11.la"
457   #gtktargetlib = "libgtk-x11.la"
458
459   AM_CONDITIONAL(USE_X11, true)
460 else
461   AM_CONDITIONAL(USE_X11, false)
462 fi
463
464 if test "x$gdktarget" = "xnanox"; then
465   AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
466   # nano-X may require additional libraries
467   more_cflags=
468   more_ldflags=
469   more_libs="-lnano-X"
470   more_includes=
471
472   gdktargetlib="libgdk-nanox.la"
473   gtktargetlib="libgtk-nanox.la"
474
475   with_xinput=no
476   AC_DEFINE(XINPUT_NONE)
477   x_cflags=
478   x_includes=
479   x_ldflags=
480   x_libs=
481   xinput_progs=
482   AM_CONDITIONAL(USE_NANOX, true)
483 else
484   AM_CONDITIONAL(USE_NANOX, false)
485 fi
486
487 if test "x$gdktarget" = "xlinux-fb"; then
488   more_cflags=
489   more_ldflags=
490   more_libs=
491   more_includes=
492
493   gdktargetlib="libgdk-linux-fb.la"
494   gtktargetlib="libgtk-linux-fb.la"
495
496   with_xinput=no
497   AC_DEFINE(XINPUT_NONE)
498   x_cflags=
499   x_includes=
500   x_ldflags=
501   x_libs=
502   xinput_progs=
503   
504   AM_CONDITIONAL(USE_LINUX_FB, true)
505 else
506   AM_CONDITIONAL(USE_LINUX_FB, false)
507 fi
508
509 #
510 # Check for Pango
511 #
512 AC_PATH_PROG(PANGO_CONFIG, pango-config, no)
513 if test x$PANGO_CONFIG = xno ; then
514   AC_MSG_ERROR([*** pango-config not found])
515 fi
516
517 if test "x$gdktarget" = "xx11"; then
518         PANGO_CFLAGS="`$PANGO_CONFIG --cflags pangox`"
519         PANGO_LIBS="`$PANGO_CONFIG --libs pangox`"
520 else
521         PANGO_CFLAGS="`$PANGO_CONFIG --cflags pango`"
522         PANGO_LIBS="`$PANGO_CONFIG --libs pango`"
523 fi
524 CFLAGS="$CFLAGS $PANGO_CFLAGS"
525 AC_SUBST(PANGO_LIBS)
526 AC_SUBST(PANGO_CFLAGS)
527
528 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
529 *** Pango not found. Pango is required to build
530 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS $x_ldflags $x_libs)
531
532 CFLAGS="$saved_cflags"
533 LDFLAGS="$saved_ldflags"
534
535 AC_SUBST(x_cflags)
536 AC_SUBST(x_includes)
537 AC_SUBST(x_ldflags)
538 AC_SUBST(x_libs)
539 AC_SUBST(xinput_progs)
540
541 AC_SUBST(more_cflags)
542 AC_SUBST(more_includes)
543 AC_SUBST(more_ldflags)
544 AC_SUBST(more_libs)
545 AC_SUBST(gdktargetlib)
546 AC_SUBST(gtktargetlib)
547
548
549 # Check if X_LOCALE definition is necessary
550
551 AC_MSG_CHECKING(need -DX_LOCALE)
552
553 AC_TRY_RUN([
554 #include <stdio.h>
555 #include <locale.h>
556
557 int
558 main ()
559 {
560   return setlocale (LC_ALL, "${with_locale}") == NULL;
561 }],
562 need_x_locale=no,
563 need_x_locale=yes,
564 need_x_locale=no)
565 AC_MSG_RESULT($need_x_locale)
566
567 if test $need_x_locale = yes; then
568   GTK_LOCALE_FLAGS="-DX_LOCALE"
569 fi
570
571 # Checks for header files.
572 AC_HEADER_STDC
573
574 # Checks for typedefs, structures, and compiler characteristics.
575 AC_C_CONST
576
577 # Checks for library functions.
578 AC_TYPE_SIGNAL
579 AC_FUNC_MMAP
580
581 # Check if <sys/select.h> needs to be included for fd_set
582 AC_MSG_CHECKING([for fd_set])
583 AC_TRY_COMPILE([#include <sys/types.h>],
584         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
585 if test $gtk_ok = yes; then
586     AC_MSG_RESULT([yes, found in sys/types.h])
587 else
588     AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
589     if test $gtk_ok = yes; then
590         AC_DEFINE(HAVE_SYS_SELECT_H)
591         AC_MSG_RESULT([yes, found in sys/select.h])
592     else
593         AC_DEFINE(NO_FD_SET)
594         AC_MSG_RESULT(no)
595     fi
596 fi
597
598 # `widechar' tests for gdki18n.h
599 AC_MSG_CHECKING(for wchar.h)
600 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
601 if test $gdk_wchar_h = yes; then
602    AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
603 fi
604 AC_MSG_RESULT($gdk_wchar_h)
605
606 # Check for wctype.h (for iswalnum)
607 AC_MSG_CHECKING(for wctype.h)
608 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
609 if test $gdk_wctype_h = yes; then
610    AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
611 fi
612 AC_MSG_RESULT($gdk_wctype_h)
613
614 # in Solaris 2.5, `iswalnum' is in -lw
615 GDK_WLIBS=
616 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
617
618 oLIBS="$LIBS"
619 LIBS="$LIBS $GDK_WLIBS"
620 # The following is necessary for Linux libc-5.4.38
621 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
622 AC_TRY_LINK([#include <stdlib.h>],[
623 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
624 #  ifdef HAVE_WCTYPE_H
625 #    include <wctype.h>
626 #  else
627 #    ifdef HAVE_WCHAR_H
628 #      include <wchar.h>
629 #    endif
630 #  endif
631 #else
632 #  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
633 #endif
634 iswalnum((wchar_t) 0);
635 ], gdk_working_wctype=yes, gdk_working_wctype=no)
636 LIBS="$oLIBS"
637
638 if test $gdk_working_wctype = no; then
639    AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
640    GDK_WLIBS=
641 fi
642 AC_MSG_RESULT($gdk_working_wctype)
643 AC_SUBST(GDK_WLIBS)
644
645 AC_SUBST(GTK_DEBUG_FLAGS)
646 AC_SUBST(GTK_XIM_FLAGS)
647 AC_SUBST(GTK_LOCALE_FLAGS)
648
649 #
650 # gtk-doc checks
651 #
652
653 dnl Let people disable the gtk-doc stuff.
654 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
655
656 if test x$enable_gtk_doc = xauto ; then
657   if test x$GTKDOC = xtrue ; then
658     enable_gtk_doc=yes
659   else
660     enable_gtk_doc=no
661   fi
662 fi
663
664 dnl NOTE: We need to use a separate automake conditional for this
665 dnl       to make this work with the tarballs.
666 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
667
668 AC_OUTPUT_COMMANDS([
669
670 ## Generate `gdk/gdkconfig.h' in two cases
671 ## 1. `config.status' is run either explicitly, or via configure.
672 ##     Esp. not when it is run in `Makefile' to generate makefiles and
673 ##     config.h
674 ## 2. CONFIG_OTHER is set explicitly
675 ##
676 ## Case 1 is difficult.  We know that `automake' sets one of
677 ## CONFIG_FILES or CONFIG_HEADERS to empty.  This heuristic works
678 ## only when AM_CONFIG_HEADER is set, however.
679
680 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
681   # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
682   CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
683 fi
684 case "$CONFIG_OTHER" in
685 *gdk/gdkconfig.h*)
686         echo creating gdk/gdkconfig.h
687         outfile=gdkconfig.h-tmp
688         cat > $outfile <<\_______EOF
689 /* gdkconfig.h
690  *
691  * This is a generated file.  Please modify `configure.in'
692  */
693
694 #ifndef GDKCONFIG_H
695 #define GDKCONFIG_H
696
697 #ifdef __cplusplus
698 extern "C" {
699 #endif /* __cplusplus */
700
701 _______EOF
702
703         cat >>$outfile <<_______EOF
704 $gdk_windowing
705 $gdk_wc
706 _______EOF
707
708         cat >>$outfile <<_______EOF
709
710 #ifdef __cplusplus
711 }
712 #endif /* __cplusplus */
713
714 #endif /* GDKCONFIG_H */
715 _______EOF
716
717
718         if cmp -s $outfile gdk/gdkconfig.h; then
719           echo gdk/gdkconfig.h is unchanged
720           rm -f $outfile
721         else
722           mv $outfile gdk/gdkconfig.h
723         fi ;;
724 esac
725 ],[
726 # Currently we always use X11 on those systems where we run configure...
727 if test "x$gdktarget" = "xx11" ; then
728   gdk_windowing='
729 #define GDK_WINDOWING_X11'
730 elif test "x$gdktarget" = "xnanox" ; then
731   gdk_windowing='
732 #define GDK_WINDOWING_NANOX'
733 elif test "x$gdktarget" = "xlinux-fb" ; then
734   gdk_windowing='
735 #define GDK_WINDOWING_FB
736 #define GDK_NATIVE_WINDOW_POINTER'
737 fi
738
739 if test x$gdk_wchar_h = xyes; then
740   gdk_wc='
741 #define GDK_HAVE_WCHAR_H 1'
742 fi
743 if test x$gdk_wctype_h = xyes; then
744   gdk_wc="\$gdk_wc
745 #define GDK_HAVE_WCTYPE_H 1"
746 fi
747 if test x$gdk_working_wctype = xno; then
748   gdk_wc="\$gdk_wc
749 #define GDK_HAVE_BROKEN_WCTYPE 1"
750 fi
751
752
753 ])
754
755 AC_PATH_PROG(SGML2HTML, sgml2html, no)
756 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
757
758 AC_OUTPUT([
759 gtk+.spec
760 docs/gtk-config.1
761 Makefile
762 gtk-config
763 po/Makefile.in
764 docs/Makefile
765 docs/reference/Makefile
766 docs/reference/gdk-pixbuf/Makefile
767 docs/tutorial/Makefile
768 docs/faq/Makefile
769 gdk/Makefile
770 gdk/x11/Makefile
771 gdk/win32/Makefile
772 gdk/nanox/Makefile
773 gdk/linux-fb/Makefile
774 gtk/Makefile
775 gtk/gtkfeatures.h
776 gtk/gtkcompat.h
777 modules/Makefile
778 modules/linux-fb/Makefile
779 ], [chmod +x gtk-config])