4 dnl new version of FUNC_SELECT
5 dnl - submitted to autoconf maintainer; expected to appear in next version
7 AC_DEFUN([AC_FUNC_SELECT],
8 [AC_CHECK_FUNCS(select)
9 if test "$ac_cv_func_select" = yes; then
10 AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h)
11 AC_MSG_CHECKING([argument types of select()])
12 AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
13 [AC_CACHE_VAL(ac_cv_type_fd_set,dnl
14 [for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
15 for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
16 for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
18 [#ifdef HAVE_SYS_TIME_H
21 #ifdef HAVE_SYS_TYPES_H
22 #include <sys/types.h>
27 #ifdef HAVE_SYS_SELECT_H
28 #include <sys/select.h>
30 #ifdef HAVE_SYS_SOCKET_H
31 #include <sys/socket.h>
33 [extern select ($ac_cv_type_fd_set_size_t,
34 $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
35 $ac_type_timeval *);],
36 [ac_found=yes ; break 3],ac_found=no)
42 if test "$ac_found" = no; then
43 AC_MSG_ERROR([can not determine argument types])
46 AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
47 AH_TEMPLATE([fd_set_size_t],
48 [Define to the type used in argument 1 `select'. Usually this is an `int'.])
49 AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
51 if test "$ac_cv_type_fd_set" != fd_set; then
52 # Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for
53 # FD_SET macros, but insist that you cast the argument to select. I don't
54 # understand why that might be, but it means we cannot define fd_set.
57 <<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
59 [#ifdef HAVE_SYS_TIME_H
62 #ifdef HAVE_SYS_TYPES_H
63 #include <sys/types.h>
68 #ifdef HAVE_SYS_SELECT_H
69 #include <sys/select.h>
71 #ifdef HAVE_SYS_SOCKET_H
72 #include <sys/socket.h>
74 # We found fd_set type in a header, need special cast
75 ac_cast="($ac_cv_type_fd_set *)",dnl
76 # No fd_set type; it is safe to define it
78 [Define to the type used in arguments 2-4 of `select', if not set by system
80 AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
82 AH_TEMPLATE([SELECT_FD_SET_CAST],
83 [Define a suitable cast for arguments 2-4 of `select'. On most systems,
84 this will be the empty string, as select usually takes pointers to fd_set.])
85 AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
91 dnl Checking for typedefs, with extra headers
94 dnl pds_CHECK_TYPE(TYPE, DEFAULT, [HEADERS], [comment])
95 AC_DEFUN([pds_CHECK_TYPE],
96 [AC_REQUIRE([AC_HEADER_STDC])dnl
97 AC_MSG_CHECKING(for $1)
98 AC_CACHE_VAL(ac_cv_type_$1,
100 changequote(<<,>>)dnl
101 <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
102 changequote([,]), [#include <sys/types.h>
107 $3], ac_cv_type_[$1]=yes, ac_cv_type_[$]1=no)])dnl
108 AC_MSG_RESULT($ac_cv_type_[$1])
109 if test $ac_cv_type_[$1] = no; then
110 AH_TEMPLATE([$1],[$4])
111 AC_DEFINE_UNQUOTED($1, $2)
116 dnl Configure-time switch with default
118 dnl Each switch defines an --enable-FOO and --disable-FOO option in
119 dnl the resulting configure script.
122 dnl smr_SWITCH(name, description, default, pos-def, neg-def,
123 dnl pos-def-comment, neg-def-comment)
127 dnl name name of switch; generates --enable-name & --disable-name
129 dnl description help string is set to this prefixed by "enable" or
130 dnl "disable", whichever is the non-default value
131 dnl default either "on" or "off"; specifies default if neither
132 dnl --enable-name nor --disable-name is specified
133 dnl pos-def a symbol to AC_DEFINE if switch is on (optional)
134 dnl neg-def a symbol to AC_DEFINE if switch is off (optional)
136 AC_DEFUN([smr_SWITCH], [
137 AC_MSG_CHECKING(whether to enable [$2])
141 [AC_HELP_STRING([--disable-$1], [disable $2])],
142 [AC_HELP_STRING([--enable-$1], [enable $2])]
144 ifelse([$4], , , [AH_TEMPLATE([$4],[$6])])
145 ifelse([$5], , , [AH_TEMPLATE([$5],[$7])])
146 [ if test "$enableval" = yes; then
148 ifelse($4, , , [AC_DEFINE($4)])
151 ifelse($5, , , [AC_DEFINE($5)])
155 ifelse($4, , , [AC_DEFINE($4)]) ],
157 ifelse($5, , , [AC_DEFINE($5)])])
162 dnl Allow argument for optional libraries; wraps AC_ARG_WITH, to
163 dnl provide a "--with-foo-library" option in the configure script, where foo
164 dnl is presumed to be a library name. The argument given by the user
165 dnl (i.e. "bar" in ./configure --with-foo-library=bar) may be one of three
167 dnl * boolean (no, yes or blank): whether to use library or not
168 dnl * file: assumed to be the name of the library
169 dnl * directory: assumed to *contain* the library
171 dnl The argument is sanity-checked. If all is well, two variables are
172 dnl set: "with_foo" (value is yes, no, or maybe), and "foo_LIBS" (value
173 dnl is either blank, a file, -lfoo, or '-L/some/dir -lfoo'). The idea
174 dnl is: the first tells you whether the library is to be used or not
175 dnl (or the user didn't specify one way or the other) and the second
176 dnl to put on the command line for linking with the library.
179 dnl smr_ARG_WITHLIB(name, libname, description)
181 dnl name name for --with argument ("foo" for libfoo)
182 dnl libname (optional) actual name of library,
183 dnl if different from name
184 dnl description (optional) used to construct help string
186 AC_DEFUN([smr_ARG_WITHLIB], [
188 ifelse($2, , smr_lib=[$1], smr_lib=[$2])
190 AC_ARG_WITH([$1]-library,
192 [ --with-$1-library[=PATH] use $1 library],
193 [ --with-$1-library[=PATH] use $1 library ($3)]),
195 if test "$withval" = yes; then
197 [$1]_LIBS="-l${smr_lib}"
198 elif test "$withval" = no; then
203 if test -f "$withval"; then
205 elif test -d "$withval"; then
206 [$1]_LIBS="-L$withval -l${smr_lib}"
208 AC_MSG_ERROR([--with-$1-library argument must be yes/no, file or directory])
213 [$1]_LIBS="-l${smr_lib}"
217 dnl Check if the include files for a library are accessible, and
218 dnl define the variable "name_CFLAGS" with the proper "-I" flag for
219 dnl the compiler. The user has a chance to specify the includes
220 dnl location, using "--with-foo-includes".
222 dnl This should be used *after* smr_ARG_WITHLIB *and* AC_CHECK_LIB are
226 dnl smr_ARG_WITHINCLUDES(name, header, extra-flags)
228 dnl name library name, MUST same as used with smr_ARG_WITHLIB
229 dnl header a header file required for using the lib
230 dnl extra-flags (optional) flags required when compiling the
231 dnl header, typically more includes; for ex. X_CFLAGS
233 AC_DEFUN([smr_ARG_WITHINCLUDES], [
235 AC_ARG_WITH([$1]-includes,
236 [ --with-$1-includes=DIR set directory for $1 headers],
238 if test -d "$withval"; then
239 [$1]_CFLAGS="-I${withval}"
241 AC_MSG_ERROR([argument must be a directory])
244 dnl We need to put the given include directory into CPPFLAGS temporarily, but
245 dnl then restore CPPFLAGS to its old value.
247 smr_save_CPPFLAGS="$CPPFLAGS"
248 CPPFLAGS="$CPPFLAGS ${[$1]_CFLAGS}"
249 ifelse($3, , , CPPFLAGS="$CPPFLAGS [$3]")
253 CPPFLAGS=$smr_save_CPPFLAGS
257 dnl Probe for an optional library. This macro creates both
258 dnl --with-foo-library and --with-foo-includes options for the configure
259 dnl script. If --with-foo-library is *not* specified, the default is to
260 dnl probe for the library, and use it if found.
263 dnl smr_CHECK_LIB(name, libname, desc, func, header, x-libs, x-flags)
265 dnl name name for --with options
266 dnl libname (optional) real name of library, if different from
268 dnl desc (optional) short descr. of library, for help string
269 dnl func function of library, to probe for
270 dnl header (optional) header required for using library
271 dnl x-libs (optional) extra libraries, if needed to link with lib
272 dnl x-flags (optional) extra flags, if needed to include header files
274 AC_DEFUN([smr_CHECK_LIB],
276 ifelse($2, , smr_lib=[$1], smr_lib=[$2])
277 ifelse($5, , , smr_header=[$5])
278 smr_ARG_WITHLIB($1,$2,$3)
279 if test "$with_$1" != no; then
280 AC_CHECK_LIB(ifelse($2, , $1, $2), $4,
282 smr_havelib=no; problem_$1=": Can't find working lib$smr_lib",
283 ifelse($6, , ${$1_LIBS}, [${$1_LIBS} $6]))
284 if test "$smr_havelib" = yes -a "$smr_header" != ""; then
285 smr_ARG_WITHINCLUDES($1, $smr_header, $7)
286 smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'`
287 if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then
289 problem_$1=": Can't find working $smr_header"
292 if test "$smr_havelib" = yes; then
301 problem_$1=": Explicitly disabled"
305 dnl Defines a boolean variable for config.h depending on a condition.
308 dnl mg_DEFINE_IF_NOT(c-code, cpp-if-cond, var-name, extra-flags, var-comment)
310 dnl c-code the first code part inside main()
311 dnl cpp-if-cond boolean preprocessor condition
312 dnl var-name this variable will be defined if the given condition is false
313 dnl extra-flags (optional) extra flags for compiling, typically more -I glags
316 dnl mg_DEFINE_IF_NOT([#include <features.h>], [defined __USE_BSD], [NON_BSD])
318 AC_DEFUN([mg_DEFINE_IF_NOT], [
319 mg_save_CPPFLAGS="$CPPFLAGS"
320 ifelse($4, , , CPPFLAGS="$CPPFLAGS [$4]")
322 AH_TEMPLATE([$3],[$5])
325 int main(int c, char **v) {
333 ], [:], [AC_DEFINE($3)])
335 CPPFLAGS="$mg_save_CPPFLAGS"
339 dnl --------------------------------------------------------------------------
340 dnl contents of gtk.m4
342 # Configure paths for GTK+
343 # Owen Taylor 97-11-3
345 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
346 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
348 AC_DEFUN([AM_PATH_GTK],
350 dnl Get the cflags and libraries from the gtk-config script
352 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX prefix for GTK files (optional)],
353 gtk_config_prefix="$withval", gtk_config_prefix="")
354 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX exec prefix for GTK files (optional)],
355 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
356 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK program],
357 , enable_gtktest=yes)
359 if test x$gtk_config_exec_prefix != x ; then
360 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
361 if test x${GTK_CONFIG+set} != xset ; then
362 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
365 if test x$gtk_config_prefix != x ; then
366 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
367 if test x${GTK_CONFIG+set} != xset ; then
368 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
372 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
373 min_gtk_version=ifelse([$1], ,0.99.7,$1)
374 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
376 if test "$GTK_CONFIG" = "no" ; then
379 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
380 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
381 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
382 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
383 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
384 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
385 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
386 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
387 if test "x$enable_gtktest" = "xyes" ; then
388 ac_save_CFLAGS="$CFLAGS"
390 CFLAGS="$CFLAGS $GTK_CFLAGS"
391 LIBS="$LIBS $GTK_LIBS"
393 dnl Now check if the installed GTK is sufficiently new. (Also sanity
394 dnl checks the results of gtk-config to some extent
405 int major, minor, micro;
408 system ("touch conf.gtktest");
410 /* HP/UX 9 (%@#!) writes to sscanf strings */
411 tmp_version = g_strdup("$min_gtk_version");
412 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
413 printf("%s, bad version string\n", "$min_gtk_version");
417 if ((gtk_major_version != $gtk_config_major_version) ||
418 (gtk_minor_version != $gtk_config_minor_version) ||
419 (gtk_micro_version != $gtk_config_micro_version))
421 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
422 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
423 gtk_major_version, gtk_minor_version, gtk_micro_version);
424 printf ("*** was found! If gtk-config was correct, then it is best\n");
425 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
426 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
427 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
428 printf("*** required on your system.\n");
429 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
430 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
431 printf("*** before re-running configure\n");
433 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
434 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
435 (gtk_minor_version != GTK_MINOR_VERSION) ||
436 (gtk_micro_version != GTK_MICRO_VERSION))
438 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
439 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
440 printf("*** library (version %d.%d.%d)\n",
441 gtk_major_version, gtk_minor_version, gtk_micro_version);
443 #endif /* defined (GTK_MAJOR_VERSION) ... */
446 if ((gtk_major_version > major) ||
447 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
448 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
454 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
455 gtk_major_version, gtk_minor_version, gtk_micro_version);
456 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
457 major, minor, micro);
458 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
460 printf("*** If you have already installed a sufficiently new version, this error\n");
461 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
462 printf("*** being found. The easiest way to fix this is to remove the old version\n");
463 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
464 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
465 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
466 printf("*** so that the correct libraries are found at run-time))\n");
471 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
472 CFLAGS="$ac_save_CFLAGS"
476 if test "x$no_gtk" = x ; then
478 ifelse([$2], , :, [$2])
481 if test "$GTK_CONFIG" = "no" ; then
482 echo "*** The gtk-config script installed by GTK could not be found"
483 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
484 echo "*** your path, or set the GTK_CONFIG environment variable to the"
485 echo "*** full path to gtk-config."
487 if test -f conf.gtktest ; then
490 echo "*** Could not run GTK test program, checking why..."
491 CFLAGS="$CFLAGS $GTK_CFLAGS"
492 LIBS="$LIBS $GTK_LIBS"
496 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
497 [ echo "*** The test program compiled, but did not run. This usually means"
498 echo "*** that the run-time linker is not finding GTK or finding the wrong"
499 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
500 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
501 echo "*** to the installed location Also, make sure you have run ldconfig if that"
502 echo "*** is required on your system"
504 echo "*** If you have an old version installed, it is best to remove it, although"
505 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
507 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
508 echo "*** came with the system with the command"
510 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
511 [ echo "*** The test program failed to compile or link. See the file config.log for the"
512 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
513 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
514 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
515 CFLAGS="$ac_save_CFLAGS"
521 ifelse([$3], , :, [$3])
529 # Check for gdk-imlib
530 AC_DEFUN([AM_PATH_GDK_IMLIB],
532 dnl Get the cflags and libraries from the imlib-config script
534 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX prefix for IMLIB files (optional)],
535 imlib_prefix="$withval", imlib_prefix="")
536 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX exec prefix for IMLIB files (optional)],
537 imlib_exec_prefix="$withval", imlib_exec_prefix="")
538 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest do not try to compile and run a test IMLIB program],
539 , enable_imlibtest=yes)
541 if test x$imlib_exec_prefix != x ; then
542 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
543 if test x${IMLIBCONF+set} != xset ; then
544 IMLIBCONF=$imlib_exec_prefix/bin/imlib-config
547 if test x$imlib_prefix != x ; then
548 imlib_args="$imlib_args --prefix=$imlib_prefix"
549 if test x${IMLIBCONF+set} != xset ; then
550 IMLIBCONF=$imlib_prefix/bin/imlib-config
554 AC_PATH_PROG(IMLIBCONF, imlib-config, no)
555 min_imlib_version=ifelse([$1], ,1.8.1,$1)
556 AC_MSG_CHECKING(for GDK IMLIB - version >= $min_imlib_version)
558 if test "$IMLIBCONF" = "no" ; then
561 GDK_IMLIB_CFLAGS=`$IMLIBCONF $imlibconf_args --cflags-gdk`
562 GDK_IMLIB_LIBS=`$IMLIBCONF $imlibconf_args --libs-gdk`
564 imlib_major_version=`$IMLIBCONF $imlib_args --version | \
565 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
566 imlib_minor_version=`$IMLIBCONF $imlib_args --version | \
567 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
568 if test "x$enable_imlibtest" = "xyes" ; then
569 ac_save_CFLAGS="$CFLAGS"
571 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
572 LIBS="$LIBS $GDK_IMLIB_LIBS"
574 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
575 dnl checks the results of imlib-config to some extent
581 #include <gdk_imlib.h>
583 /* migo: originally it was GdkImLibColor with incorrect spelling */
584 GdkImlibImage testimage;
591 system ("touch conf.gdkimlibtest");
593 /* HP/UX 9 (%@#!) writes to sscanf strings */
594 tmp_version = g_strdup("$min_imlib_version");
595 if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
596 printf("%s, bad version string\n", "$min_imlib_version");
600 if (($imlib_major_version > major) ||
601 (($imlib_major_version == major) && ($imlib_minor_version > minor)))
607 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
608 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
609 printf("*** best to upgrade to the required version.\n");
610 printf("*** If imlib-config was wrong, set the environment variable IMLIBCONF\n");
611 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
612 printf("*** config.cache before re-running configure\n");
617 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
618 CFLAGS="$ac_save_CFLAGS"
622 if test "x$no_imlib" = x ; then
624 ifelse([$2], , :, [$2])
627 if test "$IMLIBCONF" = "no" ; then
628 (echo "*** The imlib-config script installed by IMLIB could not be found" >&5) 2>/dev/null || \
629 echo "*** The imlib-config script installed by IMLIB could not be found"
630 (echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" >&5) 2>/dev/null || \
631 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
632 (echo "*** your path, or set the IMLIBCONF environment variable to the" >&5) 2>/dev/null || \
633 echo "*** your path, or set the IMLIBCONF environment variable to the"
634 (echo "*** full path to imlib-config." >&5) 2>/dev/null || \
635 echo "*** full path to imlib-config."
637 if test -f conf.gdkimlibtest ; then
640 (echo "*** Could not run IMLIB test program, checking why..." >&5) 2>/dev/null || \
641 echo "*** Could not run IMLIB test program, checking why..."
642 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
643 LIBS="$LIBS $GDK_IMLIB_LIBS"
646 #include <gdk_imlib.h>
648 [ (echo "*** The test program compiled, but did not run. This usually means" >&5) 2>/dev/null || \
649 echo "*** The test program compiled, but did not run. This usually means"
650 (echo "*** that the run-time linker is not finding IMLIB or finding the wrong" >&5) 2>/dev/null || \
651 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
652 (echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" >&5) 2>/dev/null || \
653 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
654 (echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" >&5) 2>/dev/null || \
655 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
656 (echo "*** to the installed location Also, make sure you have run ldconfig if that" >&5) 2>/dev/null || \
657 echo "*** to the installed location Also, make sure you have run ldconfig if that"
658 (echo "*** is required on your system" >&5) 2>/dev/null || \
659 echo "*** is required on your system"
660 (echo "***" >&5) 2>/dev/null || \
662 (echo "*** If you have an old version installed, it is best to remove it, although" >&5) 2>/dev/null || \
663 echo "*** If you have an old version installed, it is best to remove it, although"
664 (echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" >&5) 2>/dev/null || \
665 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
666 [ (echo "*** The test program failed to compile or link. See the file config.log for the" >&5) 2>/dev/null || \
667 echo "*** The test program failed to compile or link. See the file config.log for the"
668 (echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" >&5) 2>/dev/null || \
669 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
670 (echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" >&5) 2>/dev/null || \
671 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
672 (echo "*** may want to edit the imlib-config script: $IMLIBCONF" >&5) 2>/dev/null || \
673 echo "*** may want to edit the imlib-config script: $IMLIBCONF"])
674 CFLAGS="$ac_save_CFLAGS"
680 ifelse([$3], , :, [$3])
682 AC_SUBST(GDK_IMLIB_CFLAGS)
683 AC_SUBST(GDK_IMLIB_LIBS)
684 rm -f conf.gdkimlibtest
688 dnl --------------------------------------------------------------------------
689 dnl from gnome.m4, modified by migo
692 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag])
694 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
698 AC_DEFUN([GNOME_INIT_HOOK],[
700 AC_SUBST(GNOMEUI_LIBS)
701 AC_SUBST(GNOME_LIBDIR)
702 AC_SUBST(GNOME_INCLUDEDIR)
704 AC_ARG_WITH(gnome-includes,
705 [ --with-gnome-includes location of GNOME headers],[
706 CFLAGS="$CFLAGS -I$withval"
709 gnome_prefix=$ac_default_prefix/lib
711 AC_ARG_WITH(gnome-libs,
712 [ --with-gnome-libs location of GNOME libs],[
713 LDFLAGS="$LDFLAGS -L$withval"
714 gnome_prefix=$withval
718 [ --with-gnome no, yes or prefix for GNOME files (for FvwmGtk only)],
719 if test x$withval = xyes; then
721 dnl Note that an empty true branch is not
723 ifelse([$1], [], :, [$1])
725 if test "x$withval" = xno; then
727 problem_gnomelibs=": Explicitly disabled"
730 LDFLAGS="$LDFLAGS -L$withval/lib"
731 CFLAGS="$CFLAGS -I$withval/include"
732 gnome_prefix=$withval/lib
737 if test "x$with_gnomelibs" = xyes; then
738 problem_gnomelibs=": Can't find working gnome-config"
740 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
741 if test "$GNOME_CONFIG" = "no"; then
742 no_gnome_config="yes"
744 AC_MSG_CHECKING(whether $GNOME_CONFIG works)
745 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
747 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
748 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
749 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
750 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
754 no_gnome_config="yes"
758 # migo: disable this destructive logic
759 # if test x$exec_prefix = xNONE; then
760 # if test x$prefix = xNONE; then
761 # gnome_prefix=$ac_default_prefix/lib
763 # gnome_prefix=$prefix/lib
766 # gnome_prefix=`eval echo \`echo $libdir\``
769 if test "$no_gnome_config" = "yes"; then
770 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
771 if test -f $gnome_prefix/gnomeConf.sh; then
773 echo "loading gnome configuration from" \
774 "$gnome_prefix/gnomeConf.sh"
775 . $gnome_prefix/gnomeConf.sh
778 AC_MSG_RESULT(not found)
779 if test x$2 = xfail; then
780 AC_MSG_ERROR([Could not find the gnomeConf.sh file that is generated by gnome-libs install])
787 # test whether gnome can be compiled
788 if test "x$with_gnomelibs" = xyes; then
789 problem_gnomelibs=": Can't compile trivial gnome app"
791 AC_MSG_CHECKING(whether trivial gnome compilation works)
792 my_CPPFLAGS="$CPPFLAGS"
794 CPPFLAGS="$CPPFLAGS $GNOME_INCLUDEDIR $GTK_CFLAGS"
795 LIBS="$LIBS $GNOME_LIBDIR $GNOMEUI_LIBS"
798 int main(int c, char **v) {
799 /* we can not really run this outside of X */
800 if (!c) gnome_init("test-app", "0.0", c, v);
803 [with_gnomelibs=yes],
806 AC_MSG_RESULT($with_gnomelibs)
807 CPPFLAGS="$my_CPPFLAGS"
814 if test "x$with_gnomelibs" = xyes; then
825 # check if iconv second argument use const char.
827 AC_DEFUN([ICONV_SECOND_ARG],[
828 AC_MSG_CHECKING(check if second arg of iconv is const)
833 #if defined(__STDC__)
834 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
838 ], [], use_const=no, use_const=yes)
839 AC_MSG_RESULT($use_const)
840 AH_TEMPLATE([ICONV_ARG_CONST],
841 [define if second arg of iconv use const])
842 if test "x$use_const" = "xyes"; then
843 AC_DEFINE(ICONV_ARG_CONST, const)
845 AC_DEFINE(ICONV_ARG_CONST, )
850 # check for locale_charset if libiconv is used
852 AC_DEFUN([CHECK_LIBCHARSET],[
853 AC_MSG_CHECKING(check for libcharset)
854 ac_save_CFLAGS="$CFLAGS"
856 CFLAGS="$CFLAGS $iconv_CFLAGS"
857 LIBS="$LIBS $iconv_LIBS"
859 #include <libcharset.h>],
861 c = locale_charset ();
864 if test "x$r" = "xyes"; then
865 AC_DEFINE(HAVE_LIBCHARSET)
867 CFLAGS="$ac_save_CFLAGS"
871 #-----------------------------------------------------------------------------
876 AC_DEFUN([AM_CHECK_PKG_CONFIG],
878 dnl Get the cflags and libraries from the freetype-config script
880 AC_ARG_WITH(pkgconfig-prefix,
881 [ --with-pkgconfig-prefix=PFX prefix where pkg-config is installed],
882 pkgconfig_config_prefix="$withval", pkgconfig_config_prefix="")
883 AC_ARG_WITH(pkgconfig-exec-prefix,
884 [ --with-pkgconfig-exec-prefix=PFX exec prefix where pkg-config is installed],
885 pkgconfig_config_exec_prefix="$withval",pkgconfig_config_exec_prefix="")
887 if test x$pkgconfig_config_exec_prefix != x ; then
888 pkgconfig_config_args="$pkgconfig_config_args --exec-prefix=$pkgconfig_config_exec_prefix"
889 if test x${PKG_CONFIG+set} != xset ; then
890 PKG_CONFIG=$pkgconfig_config_exec_prefix/bin/pkg-config
893 if test x$pkgconfig_config_prefix != x ; then
894 pkgconfig_config_args="$pkgconfig_config_args --prefix=$pkgconfig_config_prefix"
895 if test x${PKG_CONFIG+set} != xset ; then
896 PKG_CONFIG=$pkgconfig_config_prefix/bin/pkg-config
899 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
902 #-----------------------------------------------------------------------------
903 # Configure paths for FreeType2
904 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
906 dnl AM_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
907 dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
909 AC_DEFUN([AM_CHECK_FT2],
911 dnl Get the cflags and libraries from the freetype-config script
913 AC_ARG_WITH(freetype-prefix,
914 [ --with-freetype-prefix=PFX prefix where FreeType is installed (for Xft)],
915 ft_config_prefix="$withval", ft_config_prefix="")
916 AC_ARG_WITH(freetype-exec-prefix,
917 [ --with-freetype-exec-prefix=PFX exec prefix where FreeType is installed],
918 ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
919 AC_ARG_ENABLE(freetypetest,
920 [ --disable-freetypetest do not try to compile and run a test FreeType program],
921 [], enable_fttest=yes)
923 if test x$ft_config_exec_prefix != x ; then
924 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
925 if test x${FT2_CONFIG+set} != xset ; then
926 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
929 if test x$ft_config_prefix != x ; then
930 ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
931 if test x${FT2_CONFIG+set} != xset ; then
932 FT2_CONFIG=$ft_config_prefix/bin/freetype-config
935 AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
937 min_ft_version=ifelse([$1], ,6.1.0,$1)
938 AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
940 if test "$FT2_CONFIG" = "no" ; then
943 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
944 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
945 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
946 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
947 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
948 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
949 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
950 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
951 ft_min_major_version=`echo $min_ft_version | \
952 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
953 ft_min_minor_version=`echo $min_ft_version | \
954 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
955 ft_min_micro_version=`echo $min_ft_version | \
956 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
957 if test "x$enable_fttest" = "xyes" ; then
959 if test $ft_config_major_version -lt $ft_min_major_version ; then
962 if test $ft_config_major_version -eq $ft_min_major_version ; then
963 if test $ft_config_minor_version -lt $ft_min_minor_version ; then
966 if test $ft_config_minor_version -eq $ft_min_minor_version ; then
967 if test $ft_config_micro_version -lt $ft_min_micro_version ; then
974 if test "x$ft_config_is_lt" = "xyes" ; then
975 ifelse([$3], , :, [$3])
977 ac_save_CFLAGS="$CFLAGS"
979 CFLAGS="$CFLAGS $FT2_CFLAGS"
980 LIBS="$FT2_LIBS $LIBS"
982 dnl Sanity checks for the results of freetype-config to some extent
985 #include <ft2build.h>
986 #include FT_FREETYPE_H
996 error = FT_Init_FreeType(&library);
1002 FT_Done_FreeType(library);
1006 ],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1007 CFLAGS="$ac_save_CFLAGS"
1008 LIBS="$ac_save_LIBS"
1009 fi # test $ft_config_version -lt $ft_min_version
1010 fi # test "x$enable_fttest" = "xyes"
1011 fi # test "$FT2_CONFIG" = "no"
1012 if test "x$no_ft" = x ; then
1014 ifelse([$2], , :, [$2])
1017 if test "$FT2_CONFIG" = "no" ; then
1018 echo "*** The freetype-config script installed by FreeType 2 could not be found."
1019 echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
1020 echo "*** your path, or set the FT2_CONFIG environment variable to the"
1021 echo "*** full path to freetype-config."
1023 echo "*** The FreeType test program failed to run. If your system uses"
1024 echo "*** shared libraries and they are installed outside the normal"
1025 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1026 echo "*** (or whatever is appropiate for your system) is correctly set."
1030 ifelse([$3], , :, [$3])
1032 AC_SUBST(FT2_CFLAGS)
1036 #-----------------------------------------------------------------------------
1037 # Configure paths for fontconfig
1038 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1039 # modified by olicha for fontconfig
1041 dnl AM_CHECK_FC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1042 dnl Test for fontconfig, and define FC_CFLAGS and FC_LIBS
1044 AC_DEFUN([AM_CHECK_FC],
1046 dnl Get the cflags and libraries from the fontconfig-config script
1048 AC_ARG_WITH(fontconfig-prefix,
1049 [ --with-fontconfig-prefix=PFX prefix where fontconfig is installed (for Xft2)],
1050 fc_config_prefix="$withval", fc_config_prefix="")
1051 AC_ARG_WITH(fontconfig-exec-prefix,
1052 [ --with-fontconfig-exec-prefix=PFX exec prefix where fontconfig is installed],
1053 fc_config_exec_prefix="$withval", fc_config_exec_prefix="")
1054 AC_ARG_ENABLE(fontconfigtest,
1055 [ --disable-fontconfigtest do not try to compile and run a test fontconfig program],
1056 [], enable_fctest=yes)
1058 if test x$fc_config_exec_prefix != x ; then
1059 fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix"
1060 if test x${FC_CONFIG+set} != xset ; then
1061 FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config
1064 if test x$fc_config_prefix != x ; then
1065 fc_config_args="$fc_config_args --prefix=$fc_config_prefix"
1066 if test x${FC_CONFIG+set} != xset ; then
1067 FC_CONFIG=$fc_config_prefix/bin/fontconfig-config
1070 AC_PATH_PROG(FC_CONFIG, fontconfig-config, no)
1072 min_fc_version=ifelse([$1], ,1.0.1,$1)
1073 AC_MSG_CHECKING(for Fontconfig - version >= $min_fc_version)
1075 pkg_config_fontconfig_exists=""
1077 if test "$FC_CONFIG" = "no" ; then
1078 if test "x$PKG_CONFIG" != "xno" ; then
1079 if $PKG_CONFIG --exists 'fontconfig' ; then
1080 if $PKG_CONFIG --exists 'fontconfig >= $1' ; then
1081 FC_CFLAGS=`$PKG_CONFIG --cflags fontconfig`
1082 FC_LIBS=`$PKG_CONFIG --libs fontconfig`
1088 pkg_config_fontconfig_exists="maybe"
1095 FC_CFLAGS=`$FC_CONFIG $fc_config_args --cflags`
1096 FC_LIBS=`$FC_CONFIG $fc_config_args --libs`
1097 fc_config_major_version=`$FC_CONFIG $fc_config_args --version | \
1098 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
1099 fc_config_minor_version=`$FC_CONFIG $fc_config_args --version | \
1100 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
1101 fc_config_micro_version=`$FC_CONFIG $fc_config_args --version | \
1102 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
1103 fc_min_major_version=`echo $min_fc_version | \
1104 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
1105 fc_min_minor_version=`echo $min_fc_version | \
1106 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
1107 fc_min_micro_version=`echo $min_fc_version | \
1108 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
1110 if test $fc_config_major_version -lt $fc_min_major_version ; then
1113 if test $fc_config_major_version -eq $fc_min_major_version ; then
1114 if test $fc_config_minor_version -lt $fc_min_minor_version ; then
1117 if test $fc_config_minor_version -eq $fc_min_minor_version ; then
1118 if test $fc_config_micro_version -lt $fc_min_micro_version ; then
1125 if test "x$fc_config_is_lt" = "xyes" ; then
1130 if test "x$no_fc" = x ; then
1131 if test "x$enable_fctest" = "xyes" ; then
1132 ac_save_CFLAGS="$CFLAGS"
1133 ac_save_LIBS="$LIBS"
1134 CFLAGS="$CFLAGS $FC_CFLAGS $FT2_CFLAGS"
1135 LIBS="$FC_LIBS $LIBS $FT2_LIBS"
1137 dnl Sanity checks for the results of fontconfig-config/pkg-config to some extent
1140 #include <fontconfig/fontconfig.h>
1160 ],, no_fc=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1161 CFLAGS="$ac_save_CFLAGS"
1162 LIBS="$ac_save_LIBS"
1166 if test "x$no_fc" = x; then
1168 ifelse([$2], , :, [$2])
1171 if test "x$fc_config_is_lt" = "xyes"; then
1172 echo "*** Your Fontconfig package version is < $1"
1173 elif test "x$pkg_config_fontconfig_exists" = "xmaybe"; then
1174 echo "*** fontconfig was not found in the pkg-config search path."
1175 echo "*** either fontconfig is not installed or perhaps you should"
1176 echo "*** add the directory containing fontconfig.pc to the "
1177 echo "*** PKG_CONFIG_PATH environment variable."
1178 elif test "$FC_CONFIG" != "no"; then
1179 echo "*** The Fontconfig test program failed to run. If your system uses"
1180 echo "*** shared libraries and they are installed outside the normal"
1181 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1182 echo "*** (or whatever is appropiate for your system) is correctly set."
1186 ifelse([$3], , :, [$3])
1192 #-----------------------------------------------------------------------------
1193 # Configure paths for xft 2
1194 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1195 # modified by olicha for xft
1197 dnl AM_CHECK_XFT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1198 dnl Test for xft, and define XFT_CFLAGS and XFT_LIBS
1200 AC_DEFUN([AM_CHECK_XFT],
1202 dnl Get the cflags and libraries from the xft-config script
1204 AC_ARG_WITH(xft-prefix,
1205 [ --with-xft-prefix=PFX prefix where Xft2 is installed (optional)],
1206 xft_config_prefix="$withval", xft_config_prefix="")
1207 AC_ARG_WITH(xft-exec-prefix,
1208 [ --with-xft-exec-prefix=PFX exec prefix where Xft2 is installed],
1209 xft_config_exec_prefix="$withval", xft_config_exec_prefix="")
1210 AC_ARG_ENABLE(xfttest,
1211 [ --disable-xfttest do not try to compile and run a test Xft program],
1212 [], enable_xfttest=yes)
1214 if test x$xft_config_exec_prefix != x ; then
1215 xft_config_args="$xft_config_args --exec-prefix=$xft_config_exec_prefix"
1216 if test x${XFT_CONFIG+set} != xset ; then
1217 XFT_CONFIG=$xft_config_exec_prefix/bin/xft-config
1220 if test x$xft_config_prefix != x ; then
1221 xft_config_args="$xft_config_args --prefix=$xft_config_prefix"
1222 if test x${XFT_CONFIG+set} != xset ; then
1223 XFT_CONFIG=$xft_config_prefix/bin/xft-config
1226 AC_PATH_PROG(XFT_CONFIG, xft-config, no)
1228 min_xft_version=ifelse([$1], ,2.0.0,$1)
1229 AC_MSG_CHECKING(for Xft - version >= $min_xft_version)
1231 pkg_config_xft_exists=""
1233 if test "$XFT_CONFIG" = "no" ; then
1234 if test "x$PKG_CONFIG" != "xno" ; then
1235 if $PKG_CONFIG --exists 'xft' ; then
1236 if $PKG_CONFIG --exists 'xft >= $1' ; then
1237 XFT_CFLAGS=`$PKG_CONFIG --cflags xft`
1238 XFT_LIBS=`$PKG_CONFIG --libs xft`
1241 xft_config_is_lt=yes
1244 pkg_config_xft_exists="maybe"
1251 XFT_CFLAGS=`$XFT_CONFIG $xft_config_args --cflags`
1252 XFT_LIBS=`$XFT_CONFIG $xft_config_args --libs`
1253 xft_config_major_version=`$XFT_CONFIG $xft_config_args --version | \
1254 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
1255 xft_config_minor_version=`$XFT_CONFIG $xft_config_args --version | \
1256 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
1257 xft_config_micro_version=`$XFT_CONFIG $xft_config_args --version | \
1258 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
1259 xft_min_major_version=`echo $min_xft_version | \
1260 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
1261 xft_min_minor_version=`echo $min_xft_version | \
1262 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
1263 xft_min_micro_version=`echo $min_xft_version | \
1264 sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'`
1266 if test $xft_config_major_version -lt $xft_min_major_version ; then
1267 xft_config_is_lt=yes
1269 if test $xft_config_major_version -eq $xft_min_major_version ; then
1270 if test $xft_config_minor_version -lt $xft_min_minor_version ; then
1271 xft_config_is_lt=yes
1273 if test $xft_config_minor_version -eq $xft_min_minor_version ; then
1274 if test $xft_config_micro_version -lt $xft_min_micro_version ; then
1275 xft_config_is_lt=yes
1281 if test "x$xft_config_is_lt" = "xyes" ; then
1282 ifelse([$3], , :, [$3])
1286 if test "x$no_xft" = x ; then
1287 if test "x$enable_xfttest" = "xyes" ; then
1288 ac_save_CFLAGS="$CFLAGS"
1289 ac_save_LIBS="$LIBS"
1290 CFLAGS="$XFT_CFLAGS $CFLAGS"
1291 LIBS="$XFT_LIBS $LIBS"
1293 dnl Sanity checks for the results of xft-config/pkg-config to some extent
1296 #include <X11/Xft/Xft.h>
1305 result = XftInit(NULL);
1316 ],, no_xft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1317 CFLAGS="$ac_save_CFLAGS"
1318 LIBS="$ac_save_LIBS"
1322 if test "x$no_xft" = x; then
1324 ifelse([$2], , :, [$2])
1327 if test "x$xft_config_is_lt" = "xyes"; then
1328 echo "*** Your xft2 package version is < $1"
1329 elif test "x$pkg_config_fontconfig_exists" = "xmaybe" ; then
1330 echo "*** xft2 was not found in the pkg-config search path."
1331 echo "*** either xft is not installed or perhaps you should"
1332 echo "*** add the directory containing xft.pc to the "
1333 echo "*** PKG_CONFIG_PATH environment variable."
1334 elif test "$XFT_CONFIG" = "no"; then
1335 echo "*** The xft-config script installed by Xft 2 could not be found."
1336 echo "*** If Xft 2 was installed in PREFIX, make sure PREFIX/bin is in"
1337 echo "*** your path, or set the XFT_CONFIG environment variable to the"
1338 echo "*** full path to xft-config."
1340 echo "*** The Xft test program failed to run. If your system uses"
1341 echo "*** shared libraries and they are installed outside the normal"
1342 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1343 echo "*** (or whatever is appropiate for your system) is correctly set."
1347 ifelse([$3], , :, [$3])
1349 AC_SUBST(XFT_CFLAGS)
1353 #-----------------------------------------------------------------------------
1354 # gettext stuff from the gettext package
1356 # Authors: Ulrich Drepper <drepper@cygnus.com>, 1996.
1357 # modified by the fvwm workers
1360 AC_DEFUN([AM_GNU_FGETTEXT],
1362 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1370 dnl check for the necessary stuff in the libc
1371 dnl the pbs is that we can detect this stuff but in fact the included
1372 dnl libintl.h is from gettext
1373 dnl Moreover, we do not try to use other implementation, but we may try
1375 $UNSET ac_cv_header_intl_h
1376 $UNSET ac_cv_func_gettext
1377 $UNSET ac_cv_func_bindtextdomain
1378 $UNSET ac_cv_func_textdomain
1379 dnl a "gnu extension"
1380 $UNSET ac_cv_func_dgettext
1381 #bind_textdomain_codeset
1382 AC_CHECK_HEADER(libintl.h,
1383 [AC_CHECK_FUNCS(gettext bindtextdomain textdomain dgettext,,
1384 found_gettext=no)], found_gettext=no)
1386 AC_MSG_CHECKING([for gnu gettext in libc])
1387 if test x"$found_gettext" = "xyes"; then
1388 problem_gettext=" (libc)"
1389 AC_MSG_RESULT([yes])
1390 AC_MSG_CHECKING(if a simple gettext program link)
1392 #include <libintl.h>
1394 [const char *c; c = gettext("foo");],
1395 found_gettext=yes;problem_gettext=" (libc)", found_gettext=no)
1396 AC_MSG_RESULT($found_gettext)
1401 if test x"$found_gettext" = xno; then
1402 dnl not found, check for libintl
1403 $UNSET ac_cv_header_intl_h
1404 $UNSET ac_cv_lib_intl_bindtextdomain
1405 $UNSET ac_cv_lib_intl_textdomain
1406 $UNSET ac_cv_lib_intl_dgettext
1407 smr_CHECK_LIB(intl, intl, for Native Language Support,
1408 bindtextdomain, libintl.h)
1409 if test x"$intl_LIBS" != x; then
1412 ac_save_CFLAGS="$CFLAGS"
1413 ac_save_LIBS="$LIBS"
1414 AC_CHECK_LIB(intl, textdomain,, no_textdomain=yes,
1415 [$intl_LIBS $iconv_LIBS])
1416 if test "$no_textdomain" != "yes"; then
1417 AC_CHECK_LIB(intl, dgettext,, no_dgettext=yes, [$intl_LIBS $iconv_LIBS])
1418 if test "$no_dgettext" != "yes"; then
1419 CFLAGS="$CFLAGS $intl_LIBS $iconv_LIBS"
1420 LIBS="$LIBS $intl_LIBS $iconv_LIBS"
1421 AC_MSG_CHECKING(if a simple gettext program link)
1423 #include <libintl.h>
1425 [const char *c; c = gettext("foo");],
1426 found_gettext=yes;problem_gettext=" (intl library)", found_gettext=no)
1427 AC_MSG_RESULT($found_gettext)
1430 CFLAGS="$ac_save_CFLAGS"
1431 LIBS="$ac_save_LIBS"
1435 if test "$found_gettext" = "yes"; then
1436 dnl Mark actions to use GNU gettext tools.
1439 dnl We need to process the po/ directory.
1445 dnl Make the po/ variables we use known to autoconf
1449 dnl Checks for all prerequisites of the po subdirectory,
1450 dnl except for USE_NLS.
1451 AC_DEFUN([AM_PO_SUBDIRS],
1453 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1454 AC_REQUIRE([AC_PROG_INSTALL])dnl
1455 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1457 dnl Perform the following tests also if --disable-nls has been given,
1458 dnl because they are needed for "make dist" to work.
1460 dnl Search for GNU msgfmt in the PATH.
1461 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1462 dnl The second test excludes FreeBSD msgfmt.
1463 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1464 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1465 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1467 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1469 dnl Search for GNU xgettext 0.11 or newer in the PATH.
1470 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1471 dnl The second test excludes FreeBSD xgettext.
1472 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1473 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1474 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1476 dnl Remove leftover from FreeBSD xgettext call.
1479 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1480 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1481 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1483 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1484 dnl Test whether we really found GNU msgfmt.
1485 if test "$GMSGFMT" != ":"; then
1486 dnl If it is no GNU msgfmt we define it as : so that the
1487 dnl Makefiles still can work.
1488 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1489 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1492 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1494 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1499 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1500 dnl Test whether we really found GNU xgettext.
1501 if test "$XGETTEXT" != ":"; then
1502 dnl If it is no GNU xgettext we define it as : so that the
1503 dnl Makefiles still can work.
1504 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1505 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1509 [found xgettext program is not GNU xgettext; ignore it])
1512 dnl Remove leftover from FreeBSD xgettext call.
1516 AC_PATH_PROG(MSGUNIQ, msguniq, $MSGUNIQ)
1518 AC_MSG_CHECKING([for NLS fvwm messages catalogs])
1519 AC_MSG_RESULT([$ALL_LINGUAS])
1524 for lang in $ALL_LINGUAS; do
1525 for dom in $ALL_DOMAINS; do
1526 POFILES="$POFILES $dom.$lang.po"
1527 GMOFILES="$GMOFILES $dom.$lang.gmo"
1528 UPDATEPOFILES="$UPDATEPOFILES $dom.$lang.po-update"
1529 DUMMYPOFILES="$DUMMYPOFILES $dom.$lang.nop"
1532 # CATALOGS depends on both $ac_dir and the user's LINGUAS environment variable.
1534 AC_MSG_CHECKING([for NLS desired catalogs to be installed])
1535 #if test "%UNSET%" != "$LINGUAS"; then
1536 # FIXME: How to check if LINGUAS has been *set* to ""
1537 if test -n "$LINGUAS"; then
1538 AC_MSG_RESULT([$LINGUAS])
1540 AC_MSG_RESULT([all])
1542 AC_MSG_CHECKING([for NLS messages catalogs to be installed])
1543 if test -n "$ALL_LINGUAS"; then
1544 for presentlang in $ALL_LINGUAS; do
1546 #if test "%UNSET%" != "$LINGUAS"; then
1547 if test -n "$LINGUAS"; then
1548 desiredlanguages="$LINGUAS"
1550 desiredlanguages="$ALL_LINGUAS"
1552 for desiredlang in $desiredlanguages; do
1553 # Use the presentlang catalog if desiredlang is
1554 # a. equal to presentlang, or
1555 # b. a variant of presentlang (because in this case,
1556 # presentlang can be used as a fallback for messages
1557 # which are not translated in the desiredlang catalog).
1558 case "$desiredlang" in
1559 "$presentlang"*) useit=yes;;
1562 if test $useit = yes; then
1563 INST_LINGUAS="$INST_LINGUAS $presentlang"
1567 AC_MSG_RESULT([$INST_LINGUAS])
1569 if test -n "$INST_LINGUAS"; then
1570 for lang in $INST_LINGUAS; do
1571 CATALOGS="$CATALOGS $lang.gmo"
1578 AC_DEFUN([AM_MKINSTALLDIRS],
1580 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1581 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1582 dnl Try to locate is.
1584 if test -n "$ac_aux_dir"; then
1585 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1587 if test -z "$MKINSTALLDIRS"; then
1588 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1592 # Search path for a program which passes the given test.
1594 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1595 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1596 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1597 [# Extract the first word of "$2", so it can be a program name with args.
1598 set dummy $2; ac_word=[$]2
1599 AC_MSG_CHECKING([for $ac_word])
1600 AC_CACHE_VAL(ac_cv_path_$1,
1603 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1606 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1607 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1608 test -z "$ac_dir" && ac_dir=.
1609 if test -f $ac_dir/$ac_word; then
1611 ac_cv_path_$1="$ac_dir/$ac_word"
1617 dnl If no 4th arg is given, leave the cache variable unset,
1618 dnl so AC_PATH_PROGS will keep looking.
1619 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1624 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1625 AC_MSG_RESULT([$]$1)
1633 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1634 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1637 #-----------------------------------------------------------------------------
1638 # Safety check for mkstemp
1640 AC_DEFUN([AM_SAFETY_CHECK_MKSTEMP],[
1641 AC_CHECK_FUNCS(mkstemp)
1642 has_safety_mkstemp=no
1643 AC_MSG_CHECKING(if mkstemp is safe)
1644 if test x$ac_cv_func_mkstemp != xno; then
1652 char template_orig[128];
1655 sprintf(template, "configure-mkstemp-test.XXXXXX");
1656 strcpy(template_orig, template);
1657 fd = mkstemp(template);
1660 /* could not create temp file */
1663 if (strcmp(template, template_orig) == 0)
1665 /* mkstemp broken */
1673 if (unlink(template))
1677 /* mkstemp works properly */
1681 [has_safety_mkstemp=yes], [has_safety_mkstemp=no])
1683 AH_TEMPLATE([HAVE_SAFETY_MKSTEMP],[Enable the use of mkstemp])
1684 if test x$has_safety_mkstemp = xno; then
1685 AC_MSG_RESULT(no, use our mkstemp)
1688 AC_DEFINE(HAVE_SAFETY_MKSTEMP)