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't determine argument types])
46 AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
47 AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
49 if test "$ac_cv_type_fd_set" != fd_set; then
50 # Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for
51 # FD_SET macros, but insist that you cast the argument to select. I don't
52 # understand why that might be, but it means we cannot define fd_set.
55 <<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
57 [#ifdef HAVE_SYS_TIME_H
60 #ifdef HAVE_SYS_TYPES_H
61 #include <sys/types.h>
66 #ifdef HAVE_SYS_SELECT_H
67 #include <sys/select.h>
69 #ifdef HAVE_SYS_SOCKET_H
70 #include <sys/socket.h>
72 # We found fd_set type in a header, need special cast
73 ac_cast="($ac_cv_type_fd_set *)",dnl
74 # No fd_set type; it is safe to define it
75 AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
77 AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
83 dnl Checking for typedefs, with extra headers
86 dnl pds_CHECK_TYPE(TYPE, DEFAULT, [HEADERS])
87 AC_DEFUN(pds_CHECK_TYPE,
88 [AC_REQUIRE([AC_HEADER_STDC])dnl
89 AC_MSG_CHECKING(for $1)
90 AC_CACHE_VAL(ac_cv_type_$1,
93 <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
94 changequote([,]), [#include <sys/types.h>
99 $3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
100 AC_MSG_RESULT($ac_cv_type_$1)
101 if test $ac_cv_type_$1 = no; then
107 dnl Configure-time switch with default
109 dnl Each switch defines an --enable-FOO and --disable-FOO option in
110 dnl the resulting configure script.
113 dnl smr_SWITCH(name, description, default, pos-def, neg-def)
117 dnl name name of switch; generates --enable-name & --disable-name
119 dnl description help string is set to this prefixed by "enable" or
120 dnl "disable", whichever is the non-default value
121 dnl default either "on" or "off"; specifies default if neither
122 dnl --enable-name nor --disable-name is specified
123 dnl pos-def a symbol to AC_DEFINE if switch is on (optional)
124 dnl neg-def a symbol to AC_DEFINE if switch is off (optional)
126 AC_DEFUN(smr_SWITCH, [
127 AC_MSG_CHECKING(whether to enable $2)
131 [ --disable-[$1]m4_substr([ ], m4_len([$1])) disable [$2]],
132 [ --enable-[$1] m4_substr([ ], m4_len([$1])) enable [$2]]),
133 [ if test "$enableval" = yes; then
135 ifelse($4, , , [AC_DEFINE($4)])
138 ifelse($5, , , [AC_DEFINE($5)])
142 ifelse($4, , , [AC_DEFINE($4)]) ],
144 ifelse($5, , , [AC_DEFINE($5)])]))])
147 dnl Allow argument for optional libraries; wraps AC_ARG_WITH, to
148 dnl provide a "--with-foo-library" option in the configure script, where foo
149 dnl is presumed to be a library name. The argument given by the user
150 dnl (i.e. "bar" in ./configure --with-foo-library=bar) may be one of three
152 dnl * boolean (no, yes or blank): whether to use library or not
153 dnl * file: assumed to be the name of the library
154 dnl * directory: assumed to *contain* the library
156 dnl The argument is sanity-checked. If all is well, two variables are
157 dnl set: "with_foo" (value is yes, no, or maybe), and "foo_LIBS" (value
158 dnl is either blank, a file, -lfoo, or '-L/some/dir -lfoo'). The idea
159 dnl is: the first tells you whether the library is to be used or not
160 dnl (or the user didn't specify one way or the other) and the second
161 dnl to put on the command line for linking with the library.
164 dnl smr_ARG_WITHLIB(name, libname, description)
166 dnl name name for --with argument ("foo" for libfoo)
167 dnl libname (optional) actual name of library,
168 dnl if different from name
169 dnl description (optional) used to construct help string
171 AC_DEFUN(smr_ARG_WITHLIB, [
173 ifelse($2, , smr_lib=[$1], smr_lib=[$2])
175 AC_ARG_WITH([$1]-library,
177 [ --with-$1-library[=PATH] use $1 library],
178 [ --with-$1-library[=PATH] use $1 library ($3)]),
180 if test "$withval" = yes; then
182 [$1]_LIBS="-l${smr_lib}"
183 elif test "$withval" = no; then
188 if test -f "$withval"; then
190 elif test -d "$withval"; then
191 [$1]_LIBS="-L$withval -l${smr_lib}"
193 AC_MSG_ERROR([--with-$1-library argument must be yes/no, file or directory])
198 [$1]_LIBS="-l${smr_lib}"
202 dnl Check if the include files for a library are accessible, and
203 dnl define the variable "name_CFLAGS" with the proper "-I" flag for
204 dnl the compiler. The user has a chance to specify the includes
205 dnl location, using "--with-foo-includes".
207 dnl This should be used *after* smr_ARG_WITHLIB *and* AC_CHECK_LIB are
211 dnl smr_ARG_WITHINCLUDES(name, header, extra-flags)
213 dnl name library name, MUST same as used with smr_ARG_WITHLIB
214 dnl header a header file required for using the lib
215 dnl extra-flags (optional) flags required when compiling the
216 dnl header, typically more includes; for ex. X_CFLAGS
218 AC_DEFUN(smr_ARG_WITHINCLUDES, [
220 AC_ARG_WITH([$1]-includes,
221 [ --with-$1-includes=DIR set directory for $1 headers],
223 if test -d "$withval"; then
224 [$1]_CFLAGS="-I${withval}"
226 AC_MSG_ERROR([argument must be a directory])
229 dnl We need to put the given include directory into CPPFLAGS temporarily, but
230 dnl then restore CPPFLAGS to its old value.
232 smr_save_CPPFLAGS="$CPPFLAGS"
233 CPPFLAGS="$CPPFLAGS ${[$1]_CFLAGS}"
234 ifelse($3, , , CPPFLAGS="$CPPFLAGS [$3]")
238 CPPFLAGS=$smr_save_CPPFLAGS
242 dnl Probe for an optional library. This macro creates both
243 dnl --with-foo-library and --with-foo-includes options for the configure
244 dnl script. If --with-foo-library is *not* specified, the default is to
245 dnl probe for the library, and use it if found.
248 dnl smr_CHECK_LIB(name, libname, desc, func, header, x-libs, x-flags)
250 dnl name name for --with options
251 dnl libname (optional) real name of library, if different from
253 dnl desc (optional) short descr. of library, for help string
254 dnl func function of library, to probe for
255 dnl header (optional) header required for using library
256 dnl x-libs (optional) extra libraries, if needed to link with lib
257 dnl x-flags (optional) extra flags, if needed to include header files
259 AC_DEFUN(smr_CHECK_LIB,
261 ifelse($2, , smr_lib=[$1], smr_lib=[$2])
262 ifelse($5, , , smr_header=[$5])
263 smr_ARG_WITHLIB($1,$2,$3)
264 if test "$with_$1" != no; then
265 AC_CHECK_LIB(ifelse($2, , $1, $2), $4,
267 smr_havelib=no; problem_$1=": Can't find working lib$smr_lib",
268 ifelse($6, , ${$1_LIBS}, [${$1_LIBS} $6]))
269 if test "$smr_havelib" = yes -a "$smr_header" != ""; then
270 smr_ARG_WITHINCLUDES($1, $smr_header, $7)
271 smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'`
272 if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then
274 problem_$1=": Can't find working $smr_header"
277 if test "$smr_havelib" = yes; then
286 problem_$1=": Explicitly disabled"
290 dnl Defines a boolean variable good for acconfig.h depending on a condition.
293 dnl mg_DEFINE_IF_NOT(c-code, cpp-if-cond, var-name, extra-flags)
295 dnl c-code the first code part inside main()
296 dnl cpp-if-cond boolean preprocessor condition
297 dnl var-name this variable will be defined if the given condition is false
298 dnl extra-flags (optional) extra flags for compiling, typically more -I glags
301 dnl mg_DEFINE_IF_NOT([#include <features.h>], [defined __USE_BSD], [NON_BSD])
303 AC_DEFUN(mg_DEFINE_IF_NOT, [
304 mg_save_CPPFLAGS="$CPPFLAGS"
305 ifelse($4, , , CPPFLAGS="$CPPFLAGS [$4]")
309 int main(int c, char **v) {
317 ], [:], [AC_DEFINE($3)])
319 CPPFLAGS="$mg_save_CPPFLAGS"
323 dnl --------------------------------------------------------------------------
324 dnl contents of gtk.m4
326 # Configure paths for GTK+
327 # Owen Taylor 97-11-3
329 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
330 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
332 AC_DEFUN(AM_PATH_GTK,
334 dnl Get the cflags and libraries from the gtk-config script
336 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX prefix for GTK files (optional)],
337 gtk_config_prefix="$withval", gtk_config_prefix="")
338 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX exec prefix for GTK files (optional)],
339 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
340 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK program],
341 , enable_gtktest=yes)
343 if test x$gtk_config_exec_prefix != x ; then
344 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
345 if test x${GTK_CONFIG+set} != xset ; then
346 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
349 if test x$gtk_config_prefix != x ; then
350 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
351 if test x${GTK_CONFIG+set} != xset ; then
352 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
356 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
357 min_gtk_version=ifelse([$1], ,0.99.7,$1)
358 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
360 if test "$GTK_CONFIG" = "no" ; then
363 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
364 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
365 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
366 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
367 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
368 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
369 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
370 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
371 if test "x$enable_gtktest" = "xyes" ; then
372 ac_save_CFLAGS="$CFLAGS"
374 CFLAGS="$CFLAGS $GTK_CFLAGS"
375 LIBS="$LIBS $GTK_LIBS"
377 dnl Now check if the installed GTK is sufficiently new. (Also sanity
378 dnl checks the results of gtk-config to some extent
389 int major, minor, micro;
392 system ("touch conf.gtktest");
394 /* HP/UX 9 (%@#!) writes to sscanf strings */
395 tmp_version = g_strdup("$min_gtk_version");
396 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
397 printf("%s, bad version string\n", "$min_gtk_version");
401 if ((gtk_major_version != $gtk_config_major_version) ||
402 (gtk_minor_version != $gtk_config_minor_version) ||
403 (gtk_micro_version != $gtk_config_micro_version))
405 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
406 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
407 gtk_major_version, gtk_minor_version, gtk_micro_version);
408 printf ("*** was found! If gtk-config was correct, then it is best\n");
409 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
410 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
411 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
412 printf("*** required on your system.\n");
413 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
414 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
415 printf("*** before re-running configure\n");
417 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
418 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
419 (gtk_minor_version != GTK_MINOR_VERSION) ||
420 (gtk_micro_version != GTK_MICRO_VERSION))
422 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
423 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
424 printf("*** library (version %d.%d.%d)\n",
425 gtk_major_version, gtk_minor_version, gtk_micro_version);
427 #endif /* defined (GTK_MAJOR_VERSION) ... */
430 if ((gtk_major_version > major) ||
431 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
432 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
438 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
439 gtk_major_version, gtk_minor_version, gtk_micro_version);
440 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
441 major, minor, micro);
442 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
444 printf("*** If you have already installed a sufficiently new version, this error\n");
445 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
446 printf("*** being found. The easiest way to fix this is to remove the old version\n");
447 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
448 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
449 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
450 printf("*** so that the correct libraries are found at run-time))\n");
455 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
456 CFLAGS="$ac_save_CFLAGS"
460 if test "x$no_gtk" = x ; then
462 ifelse([$2], , :, [$2])
465 if test "$GTK_CONFIG" = "no" ; then
466 echo "*** The gtk-config script installed by GTK could not be found"
467 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
468 echo "*** your path, or set the GTK_CONFIG environment variable to the"
469 echo "*** full path to gtk-config."
471 if test -f conf.gtktest ; then
474 echo "*** Could not run GTK test program, checking why..."
475 CFLAGS="$CFLAGS $GTK_CFLAGS"
476 LIBS="$LIBS $GTK_LIBS"
480 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
481 [ echo "*** The test program compiled, but did not run. This usually means"
482 echo "*** that the run-time linker is not finding GTK or finding the wrong"
483 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
484 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
485 echo "*** to the installed location Also, make sure you have run ldconfig if that"
486 echo "*** is required on your system"
488 echo "*** If you have an old version installed, it is best to remove it, although"
489 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
491 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
492 echo "*** came with the system with the command"
494 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
495 [ echo "*** The test program failed to compile or link. See the file config.log for the"
496 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
497 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
498 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
499 CFLAGS="$ac_save_CFLAGS"
505 ifelse([$3], , :, [$3])
513 dnl --------------------------------------------------------------------------
514 dnl contents of imlib.m4
515 dnl modified by migo - write diagnostics to >&5 (i.e. config.log) not stdout
517 # Configure paths for IMLIB
518 # Frank Belew 98-8-31
519 # stolen from Manish Singh
520 # Shamelessly stolen from Owen Taylor
522 dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
523 dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
525 AC_DEFUN(AM_PATH_IMLIB,
527 dnl Get the cflags and libraries from the imlib-config script
529 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX prefix for IMLIB files (optional)],
530 imlib_prefix="$withval", imlib_prefix="")
531 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX exec prefix for IMLIB files (optional)],
532 imlib_exec_prefix="$withval", imlib_exec_prefix="")
533 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest do not try to compile and run a test IMLIB program],
534 , enable_imlibtest=yes)
536 if test x$imlib_exec_prefix != x ; then
537 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
538 if test x${IMLIBCONF+set} != xset ; then
539 IMLIBCONF=$imlib_exec_prefix/bin/imlib-config
542 if test x$imlib_prefix != x ; then
543 imlib_args="$imlib_args --prefix=$imlib_prefix"
544 if test x${IMLIBCONF+set} != xset ; then
545 IMLIBCONF=$imlib_prefix/bin/imlib-config
549 AC_PATH_PROG(IMLIBCONF, imlib-config, no)
550 min_imlib_version=ifelse([$1], ,1.8.1,$1)
551 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
553 if test "$IMLIBCONF" = "no" ; then
556 IMLIB_CFLAGS=`$IMLIBCONF $imlibconf_args --cflags`
557 IMLIB_LIBS=`$IMLIBCONF $imlibconf_args --libs`
559 imlib_major_version=`$IMLIBCONF $imlib_args --version | \
560 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
561 imlib_minor_version=`$IMLIBCONF $imlib_args --version | \
562 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
563 if test "x$enable_imlibtest" = "xyes" ; then
564 ac_save_CFLAGS="$CFLAGS"
566 CFLAGS="$CFLAGS $IMLIB_CFLAGS"
567 LIBS="$LIBS $IMLIB_LIBS"
569 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
570 dnl checks the results of imlib-config to some extent
578 ImlibImage testimage;
585 system ("touch conf.imlibtest");
587 /* HP/UX 9 (%@#!) writes to sscanf strings */
588 tmp_version = strdup("$min_imlib_version");
589 if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
590 printf("%s, bad version string\n", "$min_imlib_version");
594 if (($imlib_major_version > major) ||
595 (($imlib_major_version == major) && ($imlib_minor_version > minor)))
601 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
602 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
603 printf("*** best to upgrade to the required version.\n");
604 printf("*** If imlib-config was wrong, set the environment variable IMLIBCONF\n");
605 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
606 printf("*** config.cache before re-running configure\n");
611 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
612 CFLAGS="$ac_save_CFLAGS"
616 if test "x$no_imlib" = x ; then
618 ifelse([$2], , :, [$2])
621 if test "$IMLIBCONF" = "no" ; then
622 echo "*** The imlib-config script installed by IMLIB could not be found"
623 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
624 echo "*** your path, or set the IMLIBCONF environment variable to the"
625 echo "*** full path to imlib-config."
627 if test -f conf.imlibtest ; then
630 echo "*** Could not run IMLIB test program, checking why..."
631 CFLAGS="$CFLAGS $IMLIB_CFLAGS"
632 LIBS="$LIBS $IMLIB_LIBS"
637 [ echo "*** The test program compiled, but did not run. This usually means"
638 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
639 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
640 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
641 echo "*** to the installed location Also, make sure you have run ldconfig if that"
642 echo "*** is required on your system"
644 echo "*** If you have an old version installed, it is best to remove it, although"
645 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
646 [ echo "*** The test program failed to compile or link. See the file config.log for the"
647 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
648 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
649 echo "*** may want to edit the imlib-config script: $IMLIBCONF" ])
650 CFLAGS="$ac_save_CFLAGS"
656 ifelse([$3], , :, [$3])
658 AC_SUBST(IMLIB_CFLAGS)
663 # Check for gdk-imlib
664 AC_DEFUN(AM_PATH_GDK_IMLIB,
666 dnl Get the cflags and libraries from the imlib-config script
668 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX prefix for IMLIB files (optional)],
669 imlib_prefix="$withval", imlib_prefix="")
670 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX exec prefix for IMLIB files (optional)],
671 imlib_exec_prefix="$withval", imlib_exec_prefix="")
672 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest do not try to compile and run a test IMLIB program],
673 , enable_imlibtest=yes)
675 if test x$imlib_exec_prefix != x ; then
676 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
677 if test x${IMLIBCONF+set} != xset ; then
678 IMLIBCONF=$imlib_exec_prefix/bin/imlib-config
681 if test x$imlib_prefix != x ; then
682 imlib_args="$imlib_args --prefix=$imlib_prefix"
683 if test x${IMLIBCONF+set} != xset ; then
684 IMLIBCONF=$imlib_prefix/bin/imlib-config
688 AC_PATH_PROG(IMLIBCONF, imlib-config, no)
689 min_imlib_version=ifelse([$1], ,1.8.1,$1)
690 AC_MSG_CHECKING(for GDK IMLIB - version >= $min_imlib_version)
692 if test "$IMLIBCONF" = "no" ; then
695 GDK_IMLIB_CFLAGS=`$IMLIBCONF $imlibconf_args --cflags-gdk`
696 GDK_IMLIB_LIBS=`$IMLIBCONF $imlibconf_args --libs-gdk`
698 imlib_major_version=`$IMLIBCONF $imlib_args --version | \
699 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
700 imlib_minor_version=`$IMLIBCONF $imlib_args --version | \
701 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
702 if test "x$enable_imlibtest" = "xyes" ; then
703 ac_save_CFLAGS="$CFLAGS"
705 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
706 LIBS="$LIBS $GDK_IMLIB_LIBS"
708 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
709 dnl checks the results of imlib-config to some extent
716 #include <gdk_imlib.h>
718 /* migo: originally it was GdkImLibColor with incorrect spelling */
719 GdkImlibImage testimage;
726 system ("touch conf.gdkimlibtest");
728 /* HP/UX 9 (%@#!) writes to sscanf strings */
729 tmp_version = g_strdup("$min_imlib_version");
730 if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
731 printf("%s, bad version string\n", "$min_imlib_version");
735 if (($imlib_major_version > major) ||
736 (($imlib_major_version == major) && ($imlib_minor_version > minor)))
742 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
743 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
744 printf("*** best to upgrade to the required version.\n");
745 printf("*** If imlib-config was wrong, set the environment variable IMLIBCONF\n");
746 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
747 printf("*** config.cache before re-running configure\n");
752 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
753 CFLAGS="$ac_save_CFLAGS"
757 if test "x$no_imlib" = x ; then
759 ifelse([$2], , :, [$2])
762 if test "$IMLIBCONF" = "no" ; then
763 (echo "*** The imlib-config script installed by IMLIB could not be found" >&5) 2>/dev/null || \
764 echo "*** The imlib-config script installed by IMLIB could not be found"
765 (echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" >&5) 2>/dev/null || \
766 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
767 (echo "*** your path, or set the IMLIBCONF environment variable to the" >&5) 2>/dev/null || \
768 echo "*** your path, or set the IMLIBCONF environment variable to the"
769 (echo "*** full path to imlib-config." >&5) 2>/dev/null || \
770 echo "*** full path to imlib-config."
772 if test -f conf.gdkimlibtest ; then
775 (echo "*** Could not run IMLIB test program, checking why..." >&5) 2>/dev/null || \
776 echo "*** Could not run IMLIB test program, checking why..."
777 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
778 LIBS="$LIBS $GDK_IMLIB_LIBS"
782 #include <gdk_imlib.h>
784 [ (echo "*** The test program compiled, but did not run. This usually means" >&5) 2>/dev/null || \
785 echo "*** The test program compiled, but did not run. This usually means"
786 (echo "*** that the run-time linker is not finding IMLIB or finding the wrong" >&5) 2>/dev/null || \
787 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
788 (echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" >&5) 2>/dev/null || \
789 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
790 (echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" >&5) 2>/dev/null || \
791 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
792 (echo "*** to the installed location Also, make sure you have run ldconfig if that" >&5) 2>/dev/null || \
793 echo "*** to the installed location Also, make sure you have run ldconfig if that"
794 (echo "*** is required on your system" >&5) 2>/dev/null || \
795 echo "*** is required on your system"
796 (echo "***" >&5) 2>/dev/null || \
798 (echo "*** If you have an old version installed, it is best to remove it, although" >&5) 2>/dev/null || \
799 echo "*** If you have an old version installed, it is best to remove it, although"
800 (echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" >&5) 2>/dev/null || \
801 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
802 [ (echo "*** The test program failed to compile or link. See the file config.log for the" >&5) 2>/dev/null || \
803 echo "*** The test program failed to compile or link. See the file config.log for the"
804 (echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" >&5) 2>/dev/null || \
805 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
806 (echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" >&5) 2>/dev/null || \
807 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
808 (echo "*** may want to edit the imlib-config script: $IMLIBCONF" >&5) 2>/dev/null || \
809 echo "*** may want to edit the imlib-config script: $IMLIBCONF"])
810 CFLAGS="$ac_save_CFLAGS"
816 ifelse([$3], , :, [$3])
818 AC_SUBST(GDK_IMLIB_CFLAGS)
819 AC_SUBST(GDK_IMLIB_LIBS)
820 rm -f conf.gdkimlibtest
824 dnl --------------------------------------------------------------------------
825 dnl from gnome.m4, modified by migo
828 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag])
830 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
834 AC_DEFUN([GNOME_INIT_HOOK],[
836 AC_SUBST(GNOMEUI_LIBS)
837 AC_SUBST(GNOME_LIBDIR)
838 AC_SUBST(GNOME_INCLUDEDIR)
840 AC_ARG_WITH(gnome-includes,
841 [ --with-gnome-includes location of GNOME headers],[
842 CFLAGS="$CFLAGS -I$withval"
845 gnome_prefix=$ac_default_prefix/lib
847 AC_ARG_WITH(gnome-libs,
848 [ --with-gnome-libs location of GNOME libs],[
849 LDFLAGS="$LDFLAGS -L$withval"
850 gnome_prefix=$withval
854 [ --with-gnome no, yes or prefix for GNOME files (for FvwmGtk only)],
855 if test x$withval = xyes; then
857 dnl Note that an empty true branch is not
859 ifelse([$1], [], :, [$1])
861 if test "x$withval" = xno; then
863 problem_gnomelibs=": Explicitly disabled"
866 LDFLAGS="$LDFLAGS -L$withval/lib"
867 CFLAGS="$CFLAGS -I$withval/include"
868 gnome_prefix=$withval/lib
873 if test "x$with_gnomelibs" = xyes; then
874 problem_gnomelibs=": Can't find working gnome-config"
876 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
877 if test "$GNOME_CONFIG" = "no"; then
878 no_gnome_config="yes"
880 AC_MSG_CHECKING(whether $GNOME_CONFIG works)
881 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
883 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
884 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
885 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
886 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
890 no_gnome_config="yes"
894 # migo: disable this destructive logic
895 # if test x$exec_prefix = xNONE; then
896 # if test x$prefix = xNONE; then
897 # gnome_prefix=$ac_default_prefix/lib
899 # gnome_prefix=$prefix/lib
902 # gnome_prefix=`eval echo \`echo $libdir\``
905 if test "$no_gnome_config" = "yes"; then
906 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
907 if test -f $gnome_prefix/gnomeConf.sh; then
909 echo "loading gnome configuration from" \
910 "$gnome_prefix/gnomeConf.sh"
911 . $gnome_prefix/gnomeConf.sh
914 AC_MSG_RESULT(not found)
915 if test x$2 = xfail; then
916 AC_MSG_ERROR([Could not find the gnomeConf.sh file that is generated by gnome-libs install])
923 # test whether gnome can be compiled
924 if test "x$with_gnomelibs" = xyes; then
925 problem_gnomelibs=": Can't compile trivial gnome app"
927 AC_MSG_CHECKING(whether trivial gnome compilation works)
928 my_CPPFLAGS="$CPPFLAGS"
930 CPPFLAGS="$CPPFLAGS $GNOME_INCLUDEDIR $GTK_CFLAGS"
931 LIBS="$LIBS $GNOME_LIBDIR $GNOMEUI_LIBS"
934 int main(int c, char **v) {
935 /* we can't really run this outside of X */
936 if (!c) gnome_init("test-app", "0.0", c, v);
939 [with_gnomelibs=yes],
942 AC_MSG_RESULT($with_gnomelibs)
943 CPPFLAGS="$my_CPPFLAGS"
950 if test "x$with_gnomelibs" = xyes; then
961 # check if iconv second argument use const char.
963 AC_DEFUN([ICONV_SECOND_ARG],[
964 AC_MSG_CHECKING(check if second arg of iconv is const)
969 #if defined(__STDC__)
970 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
974 ], [], use_const=no, use_const=yes)
975 AC_MSG_RESULT($use_const)
976 if test "x$use_const" = "xyes"; then
977 AC_DEFINE(ICONV_ARG_USE_CONST)
982 # check for locale_charset if libiconv is used
984 AC_DEFUN([CHECK_LIBCHARSET],[
985 AC_MSG_CHECKING(check for libcharset)
986 ac_save_CFLAGS="$CFLAGS"
988 CFLAGS="$CFLAGS $iconv_CFLAGS"
989 LIBS="$LIBS $iconv_LIBS"
991 #include <libcharset.h>],
993 c = locale_charset ();
996 if test "x$r" = "xyes"; then
997 AC_DEFINE(HAVE_LIBCHARSET)
999 CFLAGS="$ac_save_CFLAGS"
1000 LIBS="$ac_save_LIBS"
1003 #-----------------------------------------------------------------------------
1008 AC_DEFUN(AM_CHECK_PKG_CONFIG,
1010 dnl Get the cflags and libraries from the freetype-config script
1012 AC_ARG_WITH(pkgconfig-prefix,
1013 [ --with-pkgconfig-prefix=PFX prefix where pkg-config is installed],
1014 pkgconfig_config_prefix="$withval", pkgconfig_config_prefix="")
1015 AC_ARG_WITH(pkgconfig-exec-prefix,
1016 [ --with-pkgconfig-exec-prefix=PFX exec prefix where pkg-config is installed],
1017 pkgconfig_config_exec_prefix="$withval",pkgconfig_config_exec_prefix="")
1019 if test x$pkgconfig_config_exec_prefix != x ; then
1020 pkgconfig_config_args="$pkgconfig_config_args --exec-prefix=$pkgconfig_config_exec_prefix"
1021 if test x${PKG_CONFIG+set} != xset ; then
1022 PKG_CONFIG=$pkgconfig_config_exec_prefix/bin/pkg-config
1025 if test x$pkgconfig_config_prefix != x ; then
1026 pkgconfig_config_args="$pkgconfig_config_args --prefix=$pkgconfig_config_prefix"
1027 if test x${PKG_CONFIG+set} != xset ; then
1028 PKG_CONFIG=$pkgconfig_config_prefix/bin/pkg-config
1031 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1034 #-----------------------------------------------------------------------------
1035 # Configure paths for FreeType2
1036 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1038 dnl AM_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1039 dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
1041 AC_DEFUN(AM_CHECK_FT2,
1043 dnl Get the cflags and libraries from the freetype-config script
1045 AC_ARG_WITH(freetype-prefix,
1046 [ --with-freetype-prefix=PFX prefix where FreeType is installed (for Xft)],
1047 ft_config_prefix="$withval", ft_config_prefix="")
1048 AC_ARG_WITH(freetype-exec-prefix,
1049 [ --with-freetype-exec-prefix=PFX exec prefix where FreeType is installed],
1050 ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
1051 AC_ARG_ENABLE(freetypetest,
1052 [ --disable-freetypetest do not try to compile and run a test FreeType program],
1053 [], enable_fttest=yes)
1055 if test x$ft_config_exec_prefix != x ; then
1056 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
1057 if test x${FT2_CONFIG+set} != xset ; then
1058 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
1061 if test x$ft_config_prefix != x ; then
1062 ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
1063 if test x${FT2_CONFIG+set} != xset ; then
1064 FT2_CONFIG=$ft_config_prefix/bin/freetype-config
1067 AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
1069 min_ft_version=ifelse([$1], ,6.1.0,$1)
1070 AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
1072 if test "$FT2_CONFIG" = "no" ; then
1075 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
1076 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
1077 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
1078 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1079 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
1080 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1081 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
1082 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1083 ft_min_major_version=`echo $min_ft_version | \
1084 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1085 ft_min_minor_version=`echo $min_ft_version | \
1086 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1087 ft_min_micro_version=`echo $min_ft_version | \
1088 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1089 if test "x$enable_fttest" = "xyes" ; then
1091 if test $ft_config_major_version -lt $ft_min_major_version ; then
1094 if test $ft_config_major_version -eq $ft_min_major_version ; then
1095 if test $ft_config_minor_version -lt $ft_min_minor_version ; then
1098 if test $ft_config_minor_version -eq $ft_min_minor_version ; then
1099 if test $ft_config_micro_version -lt $ft_min_micro_version ; then
1106 if test "x$ft_config_is_lt" = "xyes" ; then
1107 ifelse([$3], , :, [$3])
1109 ac_save_CFLAGS="$CFLAGS"
1110 ac_save_LIBS="$LIBS"
1111 CFLAGS="$CFLAGS $FT2_CFLAGS"
1112 LIBS="$FT2_LIBS $LIBS"
1114 dnl Sanity checks for the results of freetype-config to some extent
1117 #include <ft2build.h>
1118 #include FT_FREETYPE_H
1128 error = FT_Init_FreeType(&library);
1134 FT_Done_FreeType(library);
1138 ],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1139 CFLAGS="$ac_save_CFLAGS"
1140 LIBS="$ac_save_LIBS"
1141 fi # test $ft_config_version -lt $ft_min_version
1142 fi # test "x$enable_fttest" = "xyes"
1143 fi # test "$FT2_CONFIG" = "no"
1144 if test "x$no_ft" = x ; then
1146 ifelse([$2], , :, [$2])
1149 if test "$FT2_CONFIG" = "no" ; then
1150 echo "*** The freetype-config script installed by FreeType 2 could not be found."
1151 echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
1152 echo "*** your path, or set the FT2_CONFIG environment variable to the"
1153 echo "*** full path to freetype-config."
1155 echo "*** The FreeType test program failed to run. If your system uses"
1156 echo "*** shared libraries and they are installed outside the normal"
1157 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1158 echo "*** (or whatever is appropiate for your system) is correctly set."
1162 ifelse([$3], , :, [$3])
1164 AC_SUBST(FT2_CFLAGS)
1168 #-----------------------------------------------------------------------------
1169 # Configure paths for fontconfig
1170 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1171 # modified by olicha for fontconfig
1173 dnl AM_CHECK_FC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1174 dnl Test for fontconfig, and define FC_CFLAGS and FC_LIBS
1176 AC_DEFUN(AM_CHECK_FC,
1178 dnl Get the cflags and libraries from the fontconfig-config script
1180 AC_ARG_WITH(fontconfig-prefix,
1181 [ --with-fontconfig-prefix=PFX prefix where fontconfig is installed (for Xft2)],
1182 fc_config_prefix="$withval", fc_config_prefix="")
1183 AC_ARG_WITH(fontconfig-exec-prefix,
1184 [ --with-fontconfig-exec-prefix=PFX exec prefix where fontconfig is installed],
1185 fc_config_exec_prefix="$withval", fc_config_exec_prefix="")
1186 AC_ARG_ENABLE(fontconfigtest,
1187 [ --disable-fontconfigtest do not try to compile and run a test fontconfig program],
1188 [], enable_fctest=yes)
1190 if test x$fc_config_exec_prefix != x ; then
1191 fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix"
1192 if test x${FC_CONFIG+set} != xset ; then
1193 FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config
1196 if test x$fc_config_prefix != x ; then
1197 fc_config_args="$fc_config_args --prefix=$fc_config_prefix"
1198 if test x${FC_CONFIG+set} != xset ; then
1199 FC_CONFIG=$fc_config_prefix/bin/fontconfig-config
1202 AC_PATH_PROG(FC_CONFIG, fontconfig-config, no)
1204 min_fc_version=ifelse([$1], ,1.0.1,$1)
1205 AC_MSG_CHECKING(for Fontconfig - version >= $min_fc_version)
1207 pkg_config_fontconfig_exists=""
1209 if test "$FC_CONFIG" = "no" ; then
1210 if test "x$PKG_CONFIG" != "xno" ; then
1211 if $PKG_CONFIG --exists 'fontconfig' ; then
1212 if $PKG_CONFIG --exists 'fontconfig >= $1' ; then
1213 FC_CFLAGS=`$PKG_CONFIG --cflags fontconfig`
1214 FC_LIBS=`$PKG_CONFIG --libs fontconfig`
1220 pkg_config_fontconfig_exists="maybe"
1227 FC_CFLAGS=`$FC_CONFIG $fc_config_args --cflags`
1228 FC_LIBS=`$FC_CONFIG $fc_config_args --libs`
1229 fc_config_major_version=`$FC_CONFIG $fc_config_args --version | \
1230 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1231 fc_config_minor_version=`$FC_CONFIG $fc_config_args --version | \
1232 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1233 fc_config_micro_version=`$FC_CONFIG $fc_config_args --version | \
1234 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1235 fc_min_major_version=`echo $min_fc_version | \
1236 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1237 fc_min_minor_version=`echo $min_fc_version | \
1238 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1239 fc_min_micro_version=`echo $min_fc_version | \
1240 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1242 if test $fc_config_major_version -lt $fc_min_major_version ; then
1245 if test $fc_config_major_version -eq $fc_min_major_version ; then
1246 if test $fc_config_minor_version -lt $fc_min_minor_version ; then
1249 if test $fc_config_minor_version -eq $fc_min_minor_version ; then
1250 if test $fc_config_micro_version -lt $fc_min_micro_version ; then
1257 if test "x$fc_config_is_lt" = "xyes" ; then
1262 if test "x$no_fc" = x ; then
1263 if test "x$enable_fctest" = "xyes" ; then
1264 ac_save_CFLAGS="$CFLAGS"
1265 ac_save_LIBS="$LIBS"
1266 CFLAGS="$CFLAGS $FC_CFLAGS $FT2_CFLAGS"
1267 LIBS="$FC_LIBS $LIBS $FT2_LIBS"
1269 dnl Sanity checks for the results of fontconfig-config/pkg-config to some extent
1272 #include <fontconfig/fontconfig.h>
1292 ],, no_fc=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1293 CFLAGS="$ac_save_CFLAGS"
1294 LIBS="$ac_save_LIBS"
1298 if test "x$no_fc" = x; then
1300 ifelse([$2], , :, [$2])
1303 if test "x$fc_config_is_lt" = "xyes"; then
1304 echo "*** Your Fontconfig package version is < $1"
1305 elif test "x$pkg_config_fontconfig_exists" = "xmaybe"; then
1306 echo "*** fontconfig was not found in the pkg-config search path."
1307 echo "*** either fontconfig is not installed or perhaps you should"
1308 echo "*** add the directory containing fontconfig.pc to the "
1309 echo "*** PKG_CONFIG_PATH environment variable."
1310 elif test "$FC_CONFIG" != "no"; then
1311 echo "*** The Fontconfig test program failed to run. If your system uses"
1312 echo "*** shared libraries and they are installed outside the normal"
1313 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1314 echo "*** (or whatever is appropiate for your system) is correctly set."
1318 ifelse([$3], , :, [$3])
1324 #-----------------------------------------------------------------------------
1325 # Configure paths for xft 2
1326 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1327 # modified by olicha for xft
1329 dnl AM_CHECK_XFT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1330 dnl Test for xft, and define XFT_CFLAGS and XFT_LIBS
1332 AC_DEFUN(AM_CHECK_XFT,
1334 dnl Get the cflags and libraries from the xft-config script
1336 AC_ARG_WITH(xft-prefix,
1337 [ --with-xft-prefix=PFX prefix where Xft2 is installed (optional)],
1338 xft_config_prefix="$withval", xft_config_prefix="")
1339 AC_ARG_WITH(xft-exec-prefix,
1340 [ --with-xft-exec-prefix=PFX exec prefix where Xft2 is installed],
1341 xft_config_exec_prefix="$withval", xft_config_exec_prefix="")
1342 AC_ARG_ENABLE(xfttest,
1343 [ --disable-xfttest do not try to compile and run a test Xft program],
1344 [], enable_xfttest=yes)
1346 if test x$xft_config_exec_prefix != x ; then
1347 xft_config_args="$xft_config_args --exec-prefix=$xft_config_exec_prefix"
1348 if test x${XFT_CONFIG+set} != xset ; then
1349 XFT_CONFIG=$xft_config_exec_prefix/bin/xft-config
1352 if test x$xft_config_prefix != x ; then
1353 xft_config_args="$xft_config_args --prefix=$xft_config_prefix"
1354 if test x${XFT_CONFIG+set} != xset ; then
1355 XFT_CONFIG=$xft_config_prefix/bin/xft-config
1358 AC_PATH_PROG(XFT_CONFIG, xft-config, no)
1360 min_xft_version=ifelse([$1], ,2.0.0,$1)
1361 AC_MSG_CHECKING(for Xft - version >= $min_xft_version)
1363 pkg_config_xft_exists=""
1365 if test "$XFT_CONFIG" = "no" ; then
1366 if test "x$PKG_CONFIG" != "xno" ; then
1367 if $PKG_CONFIG --exists 'xft' ; then
1368 if $PKG_CONFIG --exists 'xft >= $1' ; then
1369 XFT_CFLAGS=`$PKG_CONFIG --cflags xft`
1370 XFT_LIBS=`$PKG_CONFIG --libs xft`
1373 xft_config_is_lt=yes
1376 pkg_config_xft_exists="maybe"
1383 XFT_CFLAGS=`$XFT_CONFIG $xft_config_args --cflags`
1384 XFT_LIBS=`$XFT_CONFIG $xft_config_args --libs`
1385 xft_config_major_version=`$XFT_CONFIG $xft_config_args --version | \
1386 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1387 xft_config_minor_version=`$XFT_CONFIG $xft_config_args --version | \
1388 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1389 xft_config_micro_version=`$XFT_CONFIG $xft_config_args --version | \
1390 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1391 xft_min_major_version=`echo $min_xft_version | \
1392 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1393 xft_min_minor_version=`echo $min_xft_version | \
1394 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1395 xft_min_micro_version=`echo $min_xft_version | \
1396 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1398 if test $xft_config_major_version -lt $xft_min_major_version ; then
1399 xft_config_is_lt=yes
1401 if test $xft_config_major_version -eq $xft_min_major_version ; then
1402 if test $xft_config_minor_version -lt $xft_min_minor_version ; then
1403 xft_config_is_lt=yes
1405 if test $xft_config_minor_version -eq $xft_min_minor_version ; then
1406 if test $xft_config_micro_version -lt $xft_min_micro_version ; then
1407 xft_config_is_lt=yes
1413 if test "x$xft_config_is_lt" = "xyes" ; then
1414 ifelse([$3], , :, [$3])
1418 if test "x$no_xft" = x ; then
1419 if test "x$enable_xfttest" = "xyes" ; then
1420 ac_save_CFLAGS="$CFLAGS"
1421 ac_save_LIBS="$LIBS"
1422 CFLAGS="$XFT_CFLAGS $CFLAGS"
1423 LIBS="$XFT_LIBS $LIBS"
1425 dnl Sanity checks for the results of xft-config/pkg-config to some extent
1428 #include <X11/Xft/Xft.h>
1437 result = XftInit(NULL);
1448 ],, no_xft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1449 CFLAGS="$ac_save_CFLAGS"
1450 LIBS="$ac_save_LIBS"
1454 if test "x$no_xft" = x; then
1456 ifelse([$2], , :, [$2])
1459 if test "x$xft_config_is_lt" = "xyes"; then
1460 echo "*** Your xft2 package version is < $1"
1461 elif test "x$pkg_config_fontconfig_exists" = "xmaybe" ; then
1462 echo "*** xft2 was not found in the pkg-config search path."
1463 echo "*** either xft is not installed or perhaps you should"
1464 echo "*** add the directory containing xft.pc to the "
1465 echo "*** PKG_CONFIG_PATH environment variable."
1466 elif test "$XFT_CONFIG" = "no"; then
1467 echo "*** The xft-config script installed by Xft 2 could not be found."
1468 echo "*** If Xft 2 was installed in PREFIX, make sure PREFIX/bin is in"
1469 echo "*** your path, or set the XFT_CONFIG environment variable to the"
1470 echo "*** full path to xft-config."
1472 echo "*** The Xft test program failed to run. If your system uses"
1473 echo "*** shared libraries and they are installed outside the normal"
1474 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1475 echo "*** (or whatever is appropiate for your system) is correctly set."
1479 ifelse([$3], , :, [$3])
1481 AC_SUBST(XFT_CFLAGS)
1485 #-----------------------------------------------------------------------------
1486 # gettext stuff from the gettext package
1488 # Authors: Ulrich Drepper <drepper@cygnus.com>, 1996.
1489 # modified by the fvwm workers
1492 AC_DEFUN([AM_GNU_FGETTEXT],
1494 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1502 dnl check for the necessary stuff in the libc
1503 dnl the pbs is that we can detect this stuff but in fact the included
1504 dnl libintl.h is from gettext
1505 dnl Moreover, we do not try to use other implementation, but we may try
1507 $UNSET ac_cv_header_intl_h
1508 $UNSET ac_cv_func_gettext
1509 $UNSET ac_cv_func_bindtextdomain
1510 $UNSET ac_cv_func_textdomain
1511 dnl a "gnu extension"
1512 $UNSET ac_cv_func_dgettext
1513 #bind_textdomain_codeset
1514 AC_CHECK_HEADER(libintl.h,
1515 [AC_CHECK_FUNCS(gettext bindtextdomain textdomain dgettext,,
1516 found_gettext=no)], found_gettext=no)
1518 AC_MSG_CHECKING([for gnu gettext in libc])
1519 if test x"$found_gettext" = "xyes"; then
1520 problem_gettext=" (libc)"
1521 AC_MSG_RESULT([yes])
1522 AC_MSG_CHECKING(if a simple gettext program link)
1524 #include <libintl.h>
1526 [const char *c; c = gettext("foo");],
1527 found_gettext=yes;problem_gettext=" (libc)", found_gettext=no)
1528 AC_MSG_RESULT($found_gettext)
1533 if test x"$found_gettext" = xno; then
1534 dnl not found, check for libintl
1535 $UNSET ac_cv_header_intl_h
1536 $UNSET ac_cv_lib_intl_bindtextdomain
1537 $UNSET ac_cv_lib_intl_textdomain
1538 $UNSET ac_cv_lib_intl_dgettext
1539 smr_CHECK_LIB(intl, intl, for Native Language Support,
1540 bindtextdomain, libintl.h)
1541 if test x"$intl_LIBS" != x; then
1544 ac_save_CFLAGS="$CFLAGS"
1545 ac_save_LIBS="$LIBS"
1546 AC_CHECK_LIB(intl, textdomain,, no_textdomain=yes,
1547 [$intl_LIBS $iconv_LIBS])
1548 if test "$no_textdomain" != "yes"; then
1549 AC_CHECK_LIB(intl, dgettext,, no_dgettext=yes, [$intl_LIBS $iconv_LIBS])
1550 if test "$no_dgettext" != "yes"; then
1551 CFLAGS="$CFLAGS $intl_LIBS $iconv_LIBS"
1552 LIBS="$LIBS $intl_LIBS $iconv_LIBS"
1553 AC_MSG_CHECKING(if a simple gettext program link)
1555 #include <libintl.h>
1557 [const char *c; c = gettext("foo");],
1558 found_gettext=yes;problem_gettext=" (intl library)", found_gettext=no)
1559 AC_MSG_RESULT($found_gettext)
1562 CFLAGS="$ac_save_CFLAGS"
1563 LIBS="$ac_save_LIBS"
1567 if test "$found_gettext" = "yes"; then
1568 dnl Mark actions to use GNU gettext tools.
1571 dnl We need to process the po/ directory.
1577 dnl Make the po/ variables we use known to autoconf
1581 dnl Checks for all prerequisites of the po subdirectory,
1582 dnl except for USE_NLS.
1583 AC_DEFUN([AM_PO_SUBDIRS],
1585 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1586 AC_REQUIRE([AC_PROG_INSTALL])dnl
1587 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1589 dnl Perform the following tests also if --disable-nls has been given,
1590 dnl because they are needed for "make dist" to work.
1592 dnl Search for GNU msgfmt in the PATH.
1593 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1594 dnl The second test excludes FreeBSD msgfmt.
1595 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1596 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1597 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1599 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1601 dnl Search for GNU xgettext 0.11 or newer in the PATH.
1602 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1603 dnl The second test excludes FreeBSD xgettext.
1604 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1605 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1606 (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)],
1608 dnl Remove leftover from FreeBSD xgettext call.
1611 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1612 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1613 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1615 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1616 dnl Test whether we really found GNU msgfmt.
1617 if test "$GMSGFMT" != ":"; then
1618 dnl If it is no GNU msgfmt we define it as : so that the
1619 dnl Makefiles still can work.
1620 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1621 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1624 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1626 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1631 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1632 dnl Test whether we really found GNU xgettext.
1633 if test "$XGETTEXT" != ":"; then
1634 dnl If it is no GNU xgettext we define it as : so that the
1635 dnl Makefiles still can work.
1636 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1637 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1641 [found xgettext program is not GNU xgettext; ignore it])
1644 dnl Remove leftover from FreeBSD xgettext call.
1648 AC_PATH_PROG(MSGUNIQ, msguniq, $MSGUNIQ)
1650 AC_MSG_CHECKING([for NLS fvwm messages catalogs])
1651 AC_MSG_RESULT([$ALL_LINGUAS])
1656 for lang in $ALL_LINGUAS; do
1657 for dom in $ALL_DOMAINS; do
1658 POFILES="$POFILES $dom.$lang.po"
1659 GMOFILES="$GMOFILES $dom.$lang.gmo"
1660 UPDATEPOFILES="$UPDATEPOFILES $dom.$lang.po-update"
1661 DUMMYPOFILES="$DUMMYPOFILES $dom.$lang.nop"
1664 # CATALOGS depends on both $ac_dir and the user's LINGUAS environment variable.
1666 AC_MSG_CHECKING([for NLS desired catalogs to be installed])
1667 #if test "%UNSET%" != "$LINGUAS"; then
1668 # FIXME: How to check if LINGUAS has been *set* to ""
1669 if test -n "$LINGUAS"; then
1670 AC_MSG_RESULT([$LINGUAS])
1672 AC_MSG_RESULT([all])
1674 AC_MSG_CHECKING([for NLS messages catalogs to be installed])
1675 if test -n "$ALL_LINGUAS"; then
1676 for presentlang in $ALL_LINGUAS; do
1678 #if test "%UNSET%" != "$LINGUAS"; then
1679 if test -n "$LINGUAS"; then
1680 desiredlanguages="$LINGUAS"
1682 desiredlanguages="$ALL_LINGUAS"
1684 for desiredlang in $desiredlanguages; do
1685 # Use the presentlang catalog if desiredlang is
1686 # a. equal to presentlang, or
1687 # b. a variant of presentlang (because in this case,
1688 # presentlang can be used as a fallback for messages
1689 # which are not translated in the desiredlang catalog).
1690 case "$desiredlang" in
1691 "$presentlang"*) useit=yes;;
1694 if test $useit = yes; then
1695 INST_LINGUAS="$INST_LINGUAS $presentlang"
1699 AC_MSG_RESULT([$INST_LINGUAS])
1701 if test -n "$INST_LINGUAS"; then
1702 for lang in $INST_LINGUAS; do
1703 CATALOGS="$CATALOGS $lang.gmo"
1710 AC_DEFUN([AM_MKINSTALLDIRS],
1712 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1713 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1714 dnl Try to locate is.
1716 if test -n "$ac_aux_dir"; then
1717 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1719 if test -z "$MKINSTALLDIRS"; then
1720 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1724 # Search path for a program which passes the given test.
1726 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1727 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1728 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1729 [# Extract the first word of "$2", so it can be a program name with args.
1730 set dummy $2; ac_word=[$]2
1731 AC_MSG_CHECKING([for $ac_word])
1732 AC_CACHE_VAL(ac_cv_path_$1,
1735 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1738 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1739 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1740 test -z "$ac_dir" && ac_dir=.
1741 if test -f $ac_dir/$ac_word; then
1743 ac_cv_path_$1="$ac_dir/$ac_word"
1749 dnl If no 4th arg is given, leave the cache variable unset,
1750 dnl so AC_PATH_PROGS will keep looking.
1751 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1756 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1757 AC_MSG_RESULT([$]$1)
1765 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1766 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1769 #-----------------------------------------------------------------------------
1770 # Safty check for mkstemp
1772 AC_DEFUN([AM_SAFTY_CHECK_MKSTEMP],[
1773 AC_CHECK_FUNCS(mkstemp)
1774 has_safty_mkstemp=no
1775 AC_MSG_CHECKING(if mkstemp is safe)
1776 if test x$ac_cv_func_mkstemp != xno; then
1784 char template_orig[128];
1787 sprintf(template, "configure-mkstemp-test.XXXXXX");
1788 strcpy(template_orig, template);
1789 fd = mkstemp(template);
1792 /* could not create temp file */
1795 if (strcmp(template, template_orig) == 0)
1797 /* mkstemp broken */
1805 if (unlink(template))
1809 /* mkstemp works properly */
1813 [has_safty_mkstemp=yes], [has_safty_mkstemp=no])
1815 if test x$has_safty_mkstemp = xno; then
1816 AC_MSG_RESULT(no, use our mkstemp)
1819 AC_DEFINE(HAVE_SAFTY_MKSTEMP)