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 need 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=2 |
---|
32 | GTK_MICRO_VERSION=10 |
---|
33 | GTK_INTERFACE_AGE=1 |
---|
34 | GTK_BINARY_AGE=10 |
---|
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 | AC_ARG_WITH(native_locale, [ --with-native-locale=[yes/no] Use native locale support [default=no]],,with_native_locale=no) |
---|
103 | |
---|
104 | if test "x$enable_debug" = "xyes"; then |
---|
105 | test "$cflags_set" = set || CFLAGS="$CFLAGS -g" |
---|
106 | GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG" |
---|
107 | else |
---|
108 | if test "x$enable_debug" = "xno"; then |
---|
109 | GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DGTK_NO_CHECK_CASTS" |
---|
110 | else |
---|
111 | GTK_DEBUG_FLAGS="-DGTK_NO_CHECK_CASTS" |
---|
112 | fi |
---|
113 | fi |
---|
114 | |
---|
115 | AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}") |
---|
116 | |
---|
117 | # Build time sanity check... |
---|
118 | AM_SANITY_CHECK |
---|
119 | |
---|
120 | # Checks for programs. |
---|
121 | AC_PROG_CC |
---|
122 | AC_ISC_POSIX |
---|
123 | AM_PROG_CC_STDC |
---|
124 | AC_PROG_INSTALL |
---|
125 | AC_PROG_MAKE_SET |
---|
126 | |
---|
127 | changequote(,)dnl |
---|
128 | if test "x$GCC" = "xyes"; then |
---|
129 | case " $CFLAGS " in |
---|
130 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
131 | *) CFLAGS="$CFLAGS -Wall" ;; |
---|
132 | esac |
---|
133 | |
---|
134 | if test "x$enable_ansi" = "xyes"; then |
---|
135 | case " $CFLAGS " in |
---|
136 | *[\ \ ]-ansi[\ \ ]*) ;; |
---|
137 | *) CFLAGS="$CFLAGS -ansi" ;; |
---|
138 | esac |
---|
139 | |
---|
140 | case " $CFLAGS " in |
---|
141 | *[\ \ ]-pedantic[\ \ ]*) ;; |
---|
142 | *) CFLAGS="$CFLAGS -pedantic" ;; |
---|
143 | esac |
---|
144 | fi |
---|
145 | fi |
---|
146 | changequote([,])dnl |
---|
147 | |
---|
148 | # Honor aclocal flags |
---|
149 | ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" |
---|
150 | |
---|
151 | # define a MAINT-like variable REBUILD which is set if Perl |
---|
152 | # and awk are found, so autogenerated sources can be rebuilt |
---|
153 | |
---|
154 | AC_PROG_AWK |
---|
155 | AC_CHECK_PROGS(PERL, perl5 perl) |
---|
156 | |
---|
157 | # We would like indent, but don't require it. |
---|
158 | AC_CHECK_PROG(INDENT, indent, indent) |
---|
159 | |
---|
160 | REBUILD=\# |
---|
161 | if test "x$enable_rebuilds" = "xyes" && \ |
---|
162 | test -n "$PERL" && \ |
---|
163 | $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \ |
---|
164 | test -n "$AWK" ; then |
---|
165 | REBUILD= |
---|
166 | fi |
---|
167 | AC_SUBST(REBUILD) |
---|
168 | |
---|
169 | AC_MSG_CHECKING(whether make is GNU Make) |
---|
170 | STRIP_BEGIN= |
---|
171 | STRIP_END= |
---|
172 | if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then |
---|
173 | STRIP_BEGIN='$(strip $(STRIP_DUMMY)' |
---|
174 | STRIP_END=')' |
---|
175 | AC_MSG_RESULT(yes) |
---|
176 | else |
---|
177 | AC_MSG_RESULT(no) |
---|
178 | fi |
---|
179 | dnl some Make 3.79 $(strip ) versions are broken and require an empty arg |
---|
180 | STRIP_DUMMY= |
---|
181 | AC_SUBST(STRIP_DUMMY) |
---|
182 | AC_SUBST(STRIP_BEGIN) |
---|
183 | AC_SUBST(STRIP_END) |
---|
184 | |
---|
185 | # i18n stuff |
---|
186 | ALL_LINGUAS="az ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no nn pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_CN.GB2312 zh_TW.Big5" |
---|
187 | AM_GTK_GNU_GETTEXT |
---|
188 | LIBS="$LIBS $INTLLIBS" |
---|
189 | |
---|
190 | # AM_GTK_GNU_GETTEXT above substs $DATADIRNAME |
---|
191 | # this is the directory where the *.{mo,gmo} files are installed |
---|
192 | gtklocaledir='${prefix}/${DATADIRNAME}/locale' |
---|
193 | AC_SUBST(gtklocaledir) |
---|
194 | |
---|
195 | dnl The DU4 header files don't provide library prototypes unless |
---|
196 | dnl -std1 is given to the native cc. |
---|
197 | AC_MSG_CHECKING([for extra flags to get ANSI library prototypes]) |
---|
198 | |
---|
199 | gtk_save_LIBS=$LIBS |
---|
200 | LIBS="$LIBS -lm" |
---|
201 | AC_TRY_RUN([#include <math.h> |
---|
202 | int main (void) { return (log(1) != log(1.)); }], |
---|
203 | AC_MSG_RESULT(none needed), |
---|
204 | gtk_save_CFLAGS=$CFLAGS |
---|
205 | CFLAGS="$CFLAGS -std1" |
---|
206 | AC_TRY_RUN([#include <math.h> |
---|
207 | int main (void) { return (log(1) != log(1.)); }], |
---|
208 | AC_MSG_RESULT(-std1), |
---|
209 | AC_MSG_RESULT() |
---|
210 | CFLAGS=$gtk_save_CFLAGS |
---|
211 | AC_MSG_WARN( |
---|
212 | [No ANSI prototypes found in library. (-std1 didn't work.)]), |
---|
213 | true |
---|
214 | ), |
---|
215 | AC_MSG_RESULT(none needed) |
---|
216 | ) |
---|
217 | LIBS=$gtk_save_LIBS |
---|
218 | |
---|
219 | dnl NeXTStep cc seems to need this |
---|
220 | AC_MSG_CHECKING([for extra flags for POSIX compliance]) |
---|
221 | AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;], |
---|
222 | AC_MSG_RESULT(none needed), |
---|
223 | gtk_save_CFLAGS=$CFLAGS |
---|
224 | CFLAGS="$CFLAGS -posix" |
---|
225 | AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;], |
---|
226 | AC_MSG_RESULT(-posix), |
---|
227 | AC_MSG_RESULT() |
---|
228 | CFLAGS=$gtk_save_CFLAGS |
---|
229 | AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)]))) |
---|
230 | |
---|
231 | if test x$with_glib = xyes ; then |
---|
232 | AC_MSG_ERROR([ |
---|
233 | *** Directory must be specified for --with-glib]) |
---|
234 | fi |
---|
235 | |
---|
236 | if test x$with_glib = x ; then |
---|
237 | # Look for separately installed glib |
---|
238 | |
---|
239 | AM_PATH_GLIB(1.2.8,, |
---|
240 | AC_MSG_ERROR([ |
---|
241 | *** GLIB 1.2.8 or better is required. The latest version of GLIB |
---|
242 | *** is always available from ftp://ftp.gtk.org/.]), |
---|
243 | gmodule gthread) |
---|
244 | |
---|
245 | # we do not want to make all gtk progs to link to thread libraries. |
---|
246 | glib_cflags=`$GLIB_CONFIG glib gmodule --cflags` |
---|
247 | glib_thread_cflags="$GLIB_CFLAGS" |
---|
248 | glib_libs=`$GLIB_CONFIG glib gmodule --libs` |
---|
249 | glib_thread_libs="$GLIB_LIBS" |
---|
250 | GLIB_LIBS="$glib_libs" |
---|
251 | GLIB_DEPLIBS="$glib_libs" |
---|
252 | else |
---|
253 | # Use uninstalled glib (assume they got the version right) |
---|
254 | |
---|
255 | GLIB_CONFIG=$with_glib/glib-config |
---|
256 | if test -x $GLIB_CONFIG ; then |
---|
257 | : |
---|
258 | else |
---|
259 | AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured]) |
---|
260 | fi |
---|
261 | |
---|
262 | # For use in gtk-config |
---|
263 | glib_cflags=`$GLIB_CONFIG --cflags gmodule` |
---|
264 | glib_thread_cflags=`$GLIB_CONFIG --cflags gmodule gthread` |
---|
265 | glib_libs=`$GLIB_CONFIG --libs gmodule` |
---|
266 | glib_thread_libs=`$GLIB_CONFIG --libs gmodule gthread` |
---|
267 | |
---|
268 | glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'` |
---|
269 | |
---|
270 | # canonicalize relative paths |
---|
271 | case $with_glib in |
---|
272 | /*) |
---|
273 | glib_dir=$with_glib |
---|
274 | ;; |
---|
275 | *) |
---|
276 | glib_dir="\$(top_builddir)/$with_glib" |
---|
277 | ;; |
---|
278 | esac |
---|
279 | |
---|
280 | GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule" |
---|
281 | GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la" |
---|
282 | GLIB_DEPLIBS= |
---|
283 | |
---|
284 | AC_SUBST(GLIB_CFLAGS) |
---|
285 | AC_SUBST(GLIB_LIBS) |
---|
286 | fi |
---|
287 | |
---|
288 | AC_SUBST(glib_cflags) |
---|
289 | AC_SUBST(glib_libs) |
---|
290 | AC_SUBST(glib_thread_cflags) |
---|
291 | AC_SUBST(glib_thread_libs) |
---|
292 | AC_SUBST(GLIB_DEPLIBS) |
---|
293 | |
---|
294 | # Find the X11 include and library directories |
---|
295 | AC_PATH_X |
---|
296 | AC_PATH_XTRA |
---|
297 | |
---|
298 | if test "x$x_includes" = "x"; then |
---|
299 | x_includes="/usr/include" |
---|
300 | fi |
---|
301 | |
---|
302 | saved_cflags="$CFLAGS" |
---|
303 | saved_ldflags="$LDFLAGS" |
---|
304 | |
---|
305 | CFLAGS="$CFLAGS $X_CFLAGS" |
---|
306 | LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS" |
---|
307 | |
---|
308 | if test "x$no_x" = "xyes"; then |
---|
309 | AC_MSG_ERROR([ |
---|
310 | *** X libraries or include files not found. Check 'config.log' for |
---|
311 | *** more details.]) |
---|
312 | fi |
---|
313 | |
---|
314 | # Checks for libraries. |
---|
315 | # Check for the X11 library |
---|
316 | AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", |
---|
317 | AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]), |
---|
318 | $X_EXTRA_LIBS) |
---|
319 | |
---|
320 | if test "x$enable_shm" = "xyes"; then |
---|
321 | # Check for the Xext library (needed for XShm extention) |
---|
322 | AC_CHECK_LIB(Xext, XShmAttach, |
---|
323 | x_libs="-lXext $x_libs", |
---|
324 | # On AIX, it is in XextSam instead, but we still need -lXext |
---|
325 | AC_CHECK_LIB(XextSam, XShmAttach, |
---|
326 | x_libs="-lXextSam -lXext $x_libs", |
---|
327 | no_xext_lib=yes, $x_libs), |
---|
328 | $x_libs) |
---|
329 | fi |
---|
330 | |
---|
331 | # Check for shaped window extension |
---|
332 | |
---|
333 | AC_CHECK_LIB(Xext, XShapeCombineMask, |
---|
334 | if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then |
---|
335 | x_libs="-lXext $x_libs" |
---|
336 | fi |
---|
337 | AC_DEFINE(HAVE_SHAPE_EXT), |
---|
338 | , |
---|
339 | $x_libs) |
---|
340 | |
---|
341 | # Check for XConvertCase (X11R6 specific) |
---|
342 | |
---|
343 | AC_CHECK_LIB(X11, XConvertCase, |
---|
344 | AC_DEFINE(HAVE_XCONVERTCASE), |
---|
345 | , |
---|
346 | $x_libs) |
---|
347 | |
---|
348 | # Check for XIM support. |
---|
349 | |
---|
350 | AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback, |
---|
351 | : , |
---|
352 | enable_xim_inst="no", |
---|
353 | $x_libs) |
---|
354 | |
---|
355 | # On Solaris, calling XRegisterIMInstantiateCallback seems to |
---|
356 | # cause an immediate segfault, so we disable it, unless |
---|
357 | # the user specifically forces it to be on. |
---|
358 | |
---|
359 | if test x$enable_xim_inst = xmaybe ; then |
---|
360 | case host in |
---|
361 | *-*-solaris*) |
---|
362 | enable_xim_inst="no" |
---|
363 | ;; |
---|
364 | *) |
---|
365 | enable_xim_inst="yes" |
---|
366 | ;; |
---|
367 | esac |
---|
368 | fi |
---|
369 | |
---|
370 | if test "x$enable_xim" = "xyes"; then |
---|
371 | GTK_XIM_FLAGS="-DUSE_XIM" |
---|
372 | if test "x$enable_xim_inst" = "xyes"; then |
---|
373 | AC_DEFINE(USE_X11R6_XIM) |
---|
374 | fi |
---|
375 | fi |
---|
376 | |
---|
377 | x_cflags="$X_CFLAGS" |
---|
378 | x_ldflags="$X_LDFLAGS $X_LIBS" |
---|
379 | |
---|
380 | # set up things for XInput |
---|
381 | |
---|
382 | if test "x$with_xinput" = "xgxi"; then |
---|
383 | AC_MSG_WARN([ |
---|
384 | *** The generic XInput support has not been tested for several years |
---|
385 | *** and is not known to work with any currently available X servers]) |
---|
386 | AC_DEFINE(XINPUT_GXI) |
---|
387 | xinput_progs=gxid |
---|
388 | x_libs="-lXi $x_libs" |
---|
389 | elif test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then |
---|
390 | AC_DEFINE(XINPUT_XFREE) |
---|
391 | x_libs="-lXi $x_libs" |
---|
392 | else |
---|
393 | AC_DEFINE(XINPUT_NONE) |
---|
394 | fi |
---|
395 | |
---|
396 | CFLAGS="$saved_cflags" |
---|
397 | LDFLAGS="$saved_ldflags" |
---|
398 | |
---|
399 | AC_SUBST(x_cflags) |
---|
400 | AC_SUBST(x_includes) |
---|
401 | AC_SUBST(x_ldflags) |
---|
402 | AC_SUBST(x_libs) |
---|
403 | AC_SUBST(xinput_progs) |
---|
404 | |
---|
405 | if test "x$enable_shm" = "xyes"; then |
---|
406 | # Check for shared memory |
---|
407 | AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes) |
---|
408 | AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes) |
---|
409 | |
---|
410 | # Check for the X shared memory extension header file |
---|
411 | AC_MSG_CHECKING(X11/extensions/XShm.h) |
---|
412 | if test "x$no_xext_lib" = "xyes"; then |
---|
413 | AC_MSG_RESULT(no) |
---|
414 | no_xshm=yes |
---|
415 | else |
---|
416 | if test -f "$x_includes/X11/extensions/XShm.h"; then |
---|
417 | AC_MSG_RESULT(yes) |
---|
418 | AC_DEFINE(HAVE_XSHM_H) |
---|
419 | else |
---|
420 | AC_MSG_RESULT(no) |
---|
421 | no_xshm=yes |
---|
422 | fi |
---|
423 | fi |
---|
424 | fi |
---|
425 | |
---|
426 | # Check if X_LOCALE definition is necessary |
---|
427 | |
---|
428 | AC_MSG_CHECKING(need -DX_LOCALE) |
---|
429 | |
---|
430 | AC_TRY_RUN([ |
---|
431 | #include <stdio.h> |
---|
432 | #include <locale.h> |
---|
433 | |
---|
434 | int |
---|
435 | main () |
---|
436 | { |
---|
437 | return setlocale (LC_ALL, "${with_locale}") == NULL; |
---|
438 | }], |
---|
439 | need_x_locale=no, |
---|
440 | need_x_locale=yes, |
---|
441 | need_x_locale=no) |
---|
442 | AC_MSG_RESULT($need_x_locale) |
---|
443 | |
---|
444 | use_native_locale=no |
---|
445 | if test $need_x_locale = yes; then |
---|
446 | GTK_LOCALE_FLAGS="-DX_LOCALE" |
---|
447 | else |
---|
448 | if test x$with_native_locale = xyes ; then |
---|
449 | AC_MSG_CHECKING(functioning locale support) |
---|
450 | |
---|
451 | AC_TRY_COMPILE([#include <stdlib.h>],[ |
---|
452 | char c; |
---|
453 | if (MB_CUR_MAX == 1) { |
---|
454 | wctomb(&c, 42); |
---|
455 | } |
---|
456 | ],use_native_locale=yes,) |
---|
457 | |
---|
458 | AC_MSG_RESULT($use_native_locale) |
---|
459 | fi |
---|
460 | fi |
---|
461 | |
---|
462 | if test x$use_native_locale = xyes ; then |
---|
463 | AC_MSG_CHECKING(if sizeof(wchar_t) == 4) |
---|
464 | |
---|
465 | AC_TRY_RUN([ |
---|
466 | #include <stdlib.h> |
---|
467 | |
---|
468 | int |
---|
469 | main () |
---|
470 | { |
---|
471 | return (sizeof(wchar_t) == 4) ? 0 : 1; |
---|
472 | }], |
---|
473 | ,use_native_locale=no,:) |
---|
474 | AC_MSG_RESULT($use_native_locale) |
---|
475 | fi |
---|
476 | |
---|
477 | if test $use_native_locale = yes ; then |
---|
478 | AC_DEFINE(USE_NATIVE_LOCALE) |
---|
479 | fi |
---|
480 | |
---|
481 | # Checks for header files. |
---|
482 | AC_HEADER_STDC |
---|
483 | |
---|
484 | # Checks for typedefs, structures, and compiler characteristics. |
---|
485 | AC_C_CONST |
---|
486 | |
---|
487 | # Checks for library functions. |
---|
488 | AC_TYPE_SIGNAL |
---|
489 | AC_FUNC_MMAP |
---|
490 | |
---|
491 | AC_CHECK_FUNCS(getresuid) |
---|
492 | AC_TYPE_UID_T |
---|
493 | |
---|
494 | # Check if <sys/select.h> needs to be included for fd_set |
---|
495 | AC_MSG_CHECKING([for fd_set]) |
---|
496 | AC_TRY_COMPILE([#include <sys/types.h>], |
---|
497 | [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no) |
---|
498 | if test $gtk_ok = yes; then |
---|
499 | AC_MSG_RESULT([yes, found in sys/types.h]) |
---|
500 | else |
---|
501 | AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes) |
---|
502 | if test $gtk_ok = yes; then |
---|
503 | AC_DEFINE(HAVE_SYS_SELECT_H) |
---|
504 | AC_MSG_RESULT([yes, found in sys/select.h]) |
---|
505 | else |
---|
506 | AC_DEFINE(NO_FD_SET) |
---|
507 | AC_MSG_RESULT(no) |
---|
508 | fi |
---|
509 | fi |
---|
510 | |
---|
511 | # Duplicate `widechar' tests from `glib'. |
---|
512 | # Check for wchar.h |
---|
513 | AC_MSG_CHECKING(for wchar.h) |
---|
514 | AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no) |
---|
515 | if test $gtk_ok = yes; then |
---|
516 | AC_DEFINE(HAVE_WCHAR_H,1,[Define if wchar.h exists]) |
---|
517 | fi |
---|
518 | AC_MSG_RESULT($gtk_ok) |
---|
519 | |
---|
520 | # Check for wctype.h (for iswalnum) |
---|
521 | AC_MSG_CHECKING(for wctype.h) |
---|
522 | AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no) |
---|
523 | if test $gtk_ok = yes; then |
---|
524 | AC_DEFINE(HAVE_WCTYPE_H,1,[Define if wctype.h exists]) |
---|
525 | fi |
---|
526 | AC_MSG_RESULT($gtk_ok) |
---|
527 | |
---|
528 | # in Solaris 2.5, `iswalnum' is in -lw |
---|
529 | GDK_WLIBS= |
---|
530 | AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)]) |
---|
531 | |
---|
532 | # The following is necessary for Linux libc-5.4.38 |
---|
533 | oLIBS="$LIBS" |
---|
534 | LIBS="$LIBS $GDK_WLIBS" |
---|
535 | AC_MSG_CHECKING(if iswalnum() and friends are properly defined) |
---|
536 | AC_TRY_LINK([#include <stdlib.h>],[ |
---|
537 | #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H)) |
---|
538 | # ifdef HAVE_WCTYPE_H |
---|
539 | # include <wctype.h> |
---|
540 | # else |
---|
541 | # ifdef HAVE_WCHAR_H |
---|
542 | # include <wchar.h> |
---|
543 | # endif |
---|
544 | # endif |
---|
545 | #else |
---|
546 | # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c)) |
---|
547 | #endif |
---|
548 | iswalnum((wchar_t) 0); |
---|
549 | ], gtk_ok=yes, gtk_ok=no) |
---|
550 | LIBS="$oLIBS" |
---|
551 | |
---|
552 | if test $gtk_ok = no; then |
---|
553 | AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Define if the wctype function is broken]) |
---|
554 | GDK_WLIBS= |
---|
555 | fi |
---|
556 | AC_MSG_RESULT($gtk_ok) |
---|
557 | AC_SUBST(GDK_WLIBS) |
---|
558 | |
---|
559 | AC_SUBST(GTK_DEBUG_FLAGS) |
---|
560 | AC_SUBST(GTK_XIM_FLAGS) |
---|
561 | AC_SUBST(GTK_LOCALE_FLAGS) |
---|
562 | |
---|
563 | AC_OUTPUT([ |
---|
564 | gtk+.spec |
---|
565 | docs/gtk-config.1 |
---|
566 | Makefile |
---|
567 | gtk-config |
---|
568 | po/Makefile.in |
---|
569 | docs/Makefile |
---|
570 | gdk/Makefile |
---|
571 | gtk/Makefile |
---|
572 | gtk/gtkfeatures.h |
---|
573 | gdk.pc |
---|
574 | gtk+.pc |
---|
575 | ], [chmod +x gtk-config]) |
---|