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_CONST, const)
979 AC_DEFINE(ICONV_ARG_CONST, )
984 # check for locale_charset if libiconv is used
986 AC_DEFUN([CHECK_LIBCHARSET],[
987 AC_MSG_CHECKING(check for libcharset)
988 ac_save_CFLAGS="$CFLAGS"
990 CFLAGS="$CFLAGS $iconv_CFLAGS"
991 LIBS="$LIBS $iconv_LIBS"
993 #include <libcharset.h>],
995 c = locale_charset ();
998 if test "x$r" = "xyes"; then
999 AC_DEFINE(HAVE_LIBCHARSET)
1001 CFLAGS="$ac_save_CFLAGS"
1002 LIBS="$ac_save_LIBS"
1005 #-----------------------------------------------------------------------------
1010 AC_DEFUN(AM_CHECK_PKG_CONFIG,
1012 dnl Get the cflags and libraries from the freetype-config script
1014 AC_ARG_WITH(pkgconfig-prefix,
1015 [ --with-pkgconfig-prefix=PFX prefix where pkg-config is installed],
1016 pkgconfig_config_prefix="$withval", pkgconfig_config_prefix="")
1017 AC_ARG_WITH(pkgconfig-exec-prefix,
1018 [ --with-pkgconfig-exec-prefix=PFX exec prefix where pkg-config is installed],
1019 pkgconfig_config_exec_prefix="$withval",pkgconfig_config_exec_prefix="")
1021 if test x$pkgconfig_config_exec_prefix != x ; then
1022 pkgconfig_config_args="$pkgconfig_config_args --exec-prefix=$pkgconfig_config_exec_prefix"
1023 if test x${PKG_CONFIG+set} != xset ; then
1024 PKG_CONFIG=$pkgconfig_config_exec_prefix/bin/pkg-config
1027 if test x$pkgconfig_config_prefix != x ; then
1028 pkgconfig_config_args="$pkgconfig_config_args --prefix=$pkgconfig_config_prefix"
1029 if test x${PKG_CONFIG+set} != xset ; then
1030 PKG_CONFIG=$pkgconfig_config_prefix/bin/pkg-config
1033 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1036 #-----------------------------------------------------------------------------
1037 # Configure paths for FreeType2
1038 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1040 dnl AM_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1041 dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
1043 AC_DEFUN(AM_CHECK_FT2,
1045 dnl Get the cflags and libraries from the freetype-config script
1047 AC_ARG_WITH(freetype-prefix,
1048 [ --with-freetype-prefix=PFX prefix where FreeType is installed (for Xft)],
1049 ft_config_prefix="$withval", ft_config_prefix="")
1050 AC_ARG_WITH(freetype-exec-prefix,
1051 [ --with-freetype-exec-prefix=PFX exec prefix where FreeType is installed],
1052 ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
1053 AC_ARG_ENABLE(freetypetest,
1054 [ --disable-freetypetest do not try to compile and run a test FreeType program],
1055 [], enable_fttest=yes)
1057 if test x$ft_config_exec_prefix != x ; then
1058 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
1059 if test x${FT2_CONFIG+set} != xset ; then
1060 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
1063 if test x$ft_config_prefix != x ; then
1064 ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
1065 if test x${FT2_CONFIG+set} != xset ; then
1066 FT2_CONFIG=$ft_config_prefix/bin/freetype-config
1069 AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
1071 min_ft_version=ifelse([$1], ,6.1.0,$1)
1072 AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
1074 if test "$FT2_CONFIG" = "no" ; then
1077 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
1078 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
1079 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
1080 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1081 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
1082 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1083 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
1084 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1085 ft_min_major_version=`echo $min_ft_version | \
1086 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1087 ft_min_minor_version=`echo $min_ft_version | \
1088 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1089 ft_min_micro_version=`echo $min_ft_version | \
1090 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1091 if test "x$enable_fttest" = "xyes" ; then
1093 if test $ft_config_major_version -lt $ft_min_major_version ; then
1096 if test $ft_config_major_version -eq $ft_min_major_version ; then
1097 if test $ft_config_minor_version -lt $ft_min_minor_version ; then
1100 if test $ft_config_minor_version -eq $ft_min_minor_version ; then
1101 if test $ft_config_micro_version -lt $ft_min_micro_version ; then
1108 if test "x$ft_config_is_lt" = "xyes" ; then
1109 ifelse([$3], , :, [$3])
1111 ac_save_CFLAGS="$CFLAGS"
1112 ac_save_LIBS="$LIBS"
1113 CFLAGS="$CFLAGS $FT2_CFLAGS"
1114 LIBS="$FT2_LIBS $LIBS"
1116 dnl Sanity checks for the results of freetype-config to some extent
1119 #include <ft2build.h>
1120 #include FT_FREETYPE_H
1130 error = FT_Init_FreeType(&library);
1136 FT_Done_FreeType(library);
1140 ],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1141 CFLAGS="$ac_save_CFLAGS"
1142 LIBS="$ac_save_LIBS"
1143 fi # test $ft_config_version -lt $ft_min_version
1144 fi # test "x$enable_fttest" = "xyes"
1145 fi # test "$FT2_CONFIG" = "no"
1146 if test "x$no_ft" = x ; then
1148 ifelse([$2], , :, [$2])
1151 if test "$FT2_CONFIG" = "no" ; then
1152 echo "*** The freetype-config script installed by FreeType 2 could not be found."
1153 echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
1154 echo "*** your path, or set the FT2_CONFIG environment variable to the"
1155 echo "*** full path to freetype-config."
1157 echo "*** The FreeType test program failed to run. If your system uses"
1158 echo "*** shared libraries and they are installed outside the normal"
1159 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1160 echo "*** (or whatever is appropiate for your system) is correctly set."
1164 ifelse([$3], , :, [$3])
1166 AC_SUBST(FT2_CFLAGS)
1170 #-----------------------------------------------------------------------------
1171 # Configure paths for fontconfig
1172 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1173 # modified by olicha for fontconfig
1175 dnl AM_CHECK_FC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1176 dnl Test for fontconfig, and define FC_CFLAGS and FC_LIBS
1178 AC_DEFUN(AM_CHECK_FC,
1180 dnl Get the cflags and libraries from the fontconfig-config script
1182 AC_ARG_WITH(fontconfig-prefix,
1183 [ --with-fontconfig-prefix=PFX prefix where fontconfig is installed (for Xft2)],
1184 fc_config_prefix="$withval", fc_config_prefix="")
1185 AC_ARG_WITH(fontconfig-exec-prefix,
1186 [ --with-fontconfig-exec-prefix=PFX exec prefix where fontconfig is installed],
1187 fc_config_exec_prefix="$withval", fc_config_exec_prefix="")
1188 AC_ARG_ENABLE(fontconfigtest,
1189 [ --disable-fontconfigtest do not try to compile and run a test fontconfig program],
1190 [], enable_fctest=yes)
1192 if test x$fc_config_exec_prefix != x ; then
1193 fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix"
1194 if test x${FC_CONFIG+set} != xset ; then
1195 FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config
1198 if test x$fc_config_prefix != x ; then
1199 fc_config_args="$fc_config_args --prefix=$fc_config_prefix"
1200 if test x${FC_CONFIG+set} != xset ; then
1201 FC_CONFIG=$fc_config_prefix/bin/fontconfig-config
1204 AC_PATH_PROG(FC_CONFIG, fontconfig-config, no)
1206 min_fc_version=ifelse([$1], ,1.0.1,$1)
1207 AC_MSG_CHECKING(for Fontconfig - version >= $min_fc_version)
1209 pkg_config_fontconfig_exists=""
1211 if test "$FC_CONFIG" = "no" ; then
1212 if test "x$PKG_CONFIG" != "xno" ; then
1213 if $PKG_CONFIG --exists 'fontconfig' ; then
1214 if $PKG_CONFIG --exists 'fontconfig >= $1' ; then
1215 FC_CFLAGS=`$PKG_CONFIG --cflags fontconfig`
1216 FC_LIBS=`$PKG_CONFIG --libs fontconfig`
1222 pkg_config_fontconfig_exists="maybe"
1229 FC_CFLAGS=`$FC_CONFIG $fc_config_args --cflags`
1230 FC_LIBS=`$FC_CONFIG $fc_config_args --libs`
1231 fc_config_major_version=`$FC_CONFIG $fc_config_args --version | \
1232 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1233 fc_config_minor_version=`$FC_CONFIG $fc_config_args --version | \
1234 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1235 fc_config_micro_version=`$FC_CONFIG $fc_config_args --version | \
1236 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1237 fc_min_major_version=`echo $min_fc_version | \
1238 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1239 fc_min_minor_version=`echo $min_fc_version | \
1240 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1241 fc_min_micro_version=`echo $min_fc_version | \
1242 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1244 if test $fc_config_major_version -lt $fc_min_major_version ; then
1247 if test $fc_config_major_version -eq $fc_min_major_version ; then
1248 if test $fc_config_minor_version -lt $fc_min_minor_version ; then
1251 if test $fc_config_minor_version -eq $fc_min_minor_version ; then
1252 if test $fc_config_micro_version -lt $fc_min_micro_version ; then
1259 if test "x$fc_config_is_lt" = "xyes" ; then
1264 if test "x$no_fc" = x ; then
1265 if test "x$enable_fctest" = "xyes" ; then
1266 ac_save_CFLAGS="$CFLAGS"
1267 ac_save_LIBS="$LIBS"
1268 CFLAGS="$CFLAGS $FC_CFLAGS $FT2_CFLAGS"
1269 LIBS="$FC_LIBS $LIBS $FT2_LIBS"
1271 dnl Sanity checks for the results of fontconfig-config/pkg-config to some extent
1274 #include <fontconfig/fontconfig.h>
1294 ],, no_fc=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1295 CFLAGS="$ac_save_CFLAGS"
1296 LIBS="$ac_save_LIBS"
1300 if test "x$no_fc" = x; then
1302 ifelse([$2], , :, [$2])
1305 if test "x$fc_config_is_lt" = "xyes"; then
1306 echo "*** Your Fontconfig package version is < $1"
1307 elif test "x$pkg_config_fontconfig_exists" = "xmaybe"; then
1308 echo "*** fontconfig was not found in the pkg-config search path."
1309 echo "*** either fontconfig is not installed or perhaps you should"
1310 echo "*** add the directory containing fontconfig.pc to the "
1311 echo "*** PKG_CONFIG_PATH environment variable."
1312 elif test "$FC_CONFIG" != "no"; then
1313 echo "*** The Fontconfig test program failed to run. If your system uses"
1314 echo "*** shared libraries and they are installed outside the normal"
1315 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1316 echo "*** (or whatever is appropiate for your system) is correctly set."
1320 ifelse([$3], , :, [$3])
1326 #-----------------------------------------------------------------------------
1327 # Configure paths for xft 2
1328 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
1329 # modified by olicha for xft
1331 dnl AM_CHECK_XFT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1332 dnl Test for xft, and define XFT_CFLAGS and XFT_LIBS
1334 AC_DEFUN(AM_CHECK_XFT,
1336 dnl Get the cflags and libraries from the xft-config script
1338 AC_ARG_WITH(xft-prefix,
1339 [ --with-xft-prefix=PFX prefix where Xft2 is installed (optional)],
1340 xft_config_prefix="$withval", xft_config_prefix="")
1341 AC_ARG_WITH(xft-exec-prefix,
1342 [ --with-xft-exec-prefix=PFX exec prefix where Xft2 is installed],
1343 xft_config_exec_prefix="$withval", xft_config_exec_prefix="")
1344 AC_ARG_ENABLE(xfttest,
1345 [ --disable-xfttest do not try to compile and run a test Xft program],
1346 [], enable_xfttest=yes)
1348 if test x$xft_config_exec_prefix != x ; then
1349 xft_config_args="$xft_config_args --exec-prefix=$xft_config_exec_prefix"
1350 if test x${XFT_CONFIG+set} != xset ; then
1351 XFT_CONFIG=$xft_config_exec_prefix/bin/xft-config
1354 if test x$xft_config_prefix != x ; then
1355 xft_config_args="$xft_config_args --prefix=$xft_config_prefix"
1356 if test x${XFT_CONFIG+set} != xset ; then
1357 XFT_CONFIG=$xft_config_prefix/bin/xft-config
1360 AC_PATH_PROG(XFT_CONFIG, xft-config, no)
1362 min_xft_version=ifelse([$1], ,2.0.0,$1)
1363 AC_MSG_CHECKING(for Xft - version >= $min_xft_version)
1365 pkg_config_xft_exists=""
1367 if test "$XFT_CONFIG" = "no" ; then
1368 if test "x$PKG_CONFIG" != "xno" ; then
1369 if $PKG_CONFIG --exists 'xft' ; then
1370 if $PKG_CONFIG --exists 'xft >= $1' ; then
1371 XFT_CFLAGS=`$PKG_CONFIG --cflags xft`
1372 XFT_LIBS=`$PKG_CONFIG --libs xft`
1375 xft_config_is_lt=yes
1378 pkg_config_xft_exists="maybe"
1385 XFT_CFLAGS=`$XFT_CONFIG $xft_config_args --cflags`
1386 XFT_LIBS=`$XFT_CONFIG $xft_config_args --libs`
1387 xft_config_major_version=`$XFT_CONFIG $xft_config_args --version | \
1388 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1389 xft_config_minor_version=`$XFT_CONFIG $xft_config_args --version | \
1390 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1391 xft_config_micro_version=`$XFT_CONFIG $xft_config_args --version | \
1392 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1393 xft_min_major_version=`echo $min_xft_version | \
1394 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1395 xft_min_minor_version=`echo $min_xft_version | \
1396 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1397 xft_min_micro_version=`echo $min_xft_version | \
1398 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1400 if test $xft_config_major_version -lt $xft_min_major_version ; then
1401 xft_config_is_lt=yes
1403 if test $xft_config_major_version -eq $xft_min_major_version ; then
1404 if test $xft_config_minor_version -lt $xft_min_minor_version ; then
1405 xft_config_is_lt=yes
1407 if test $xft_config_minor_version -eq $xft_min_minor_version ; then
1408 if test $xft_config_micro_version -lt $xft_min_micro_version ; then
1409 xft_config_is_lt=yes
1415 if test "x$xft_config_is_lt" = "xyes" ; then
1416 ifelse([$3], , :, [$3])
1420 if test "x$no_xft" = x ; then
1421 if test "x$enable_xfttest" = "xyes" ; then
1422 ac_save_CFLAGS="$CFLAGS"
1423 ac_save_LIBS="$LIBS"
1424 CFLAGS="$XFT_CFLAGS $CFLAGS"
1425 LIBS="$XFT_LIBS $LIBS"
1427 dnl Sanity checks for the results of xft-config/pkg-config to some extent
1430 #include <X11/Xft/Xft.h>
1439 result = XftInit(NULL);
1450 ],, no_xft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1451 CFLAGS="$ac_save_CFLAGS"
1452 LIBS="$ac_save_LIBS"
1456 if test "x$no_xft" = x; then
1458 ifelse([$2], , :, [$2])
1461 if test "x$xft_config_is_lt" = "xyes"; then
1462 echo "*** Your xft2 package version is < $1"
1463 elif test "x$pkg_config_fontconfig_exists" = "xmaybe" ; then
1464 echo "*** xft2 was not found in the pkg-config search path."
1465 echo "*** either xft is not installed or perhaps you should"
1466 echo "*** add the directory containing xft.pc to the "
1467 echo "*** PKG_CONFIG_PATH environment variable."
1468 elif test "$XFT_CONFIG" = "no"; then
1469 echo "*** The xft-config script installed by Xft 2 could not be found."
1470 echo "*** If Xft 2 was installed in PREFIX, make sure PREFIX/bin is in"
1471 echo "*** your path, or set the XFT_CONFIG environment variable to the"
1472 echo "*** full path to xft-config."
1474 echo "*** The Xft test program failed to run. If your system uses"
1475 echo "*** shared libraries and they are installed outside the normal"
1476 echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
1477 echo "*** (or whatever is appropiate for your system) is correctly set."
1481 ifelse([$3], , :, [$3])
1483 AC_SUBST(XFT_CFLAGS)
1487 #-----------------------------------------------------------------------------
1488 # gettext stuff from the gettext package
1490 # Authors: Ulrich Drepper <drepper@cygnus.com>, 1996.
1491 # modified by the fvwm workers
1494 AC_DEFUN([AM_GNU_FGETTEXT],
1496 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1504 dnl check for the necessary stuff in the libc
1505 dnl the pbs is that we can detect this stuff but in fact the included
1506 dnl libintl.h is from gettext
1507 dnl Moreover, we do not try to use other implementation, but we may try
1509 $UNSET ac_cv_header_intl_h
1510 $UNSET ac_cv_func_gettext
1511 $UNSET ac_cv_func_bindtextdomain
1512 $UNSET ac_cv_func_textdomain
1513 dnl a "gnu extension"
1514 $UNSET ac_cv_func_dgettext
1515 #bind_textdomain_codeset
1516 AC_CHECK_HEADER(libintl.h,
1517 [AC_CHECK_FUNCS(gettext bindtextdomain textdomain dgettext,,
1518 found_gettext=no)], found_gettext=no)
1520 AC_MSG_CHECKING([for gnu gettext in libc])
1521 if test x"$found_gettext" = "xyes"; then
1522 problem_gettext=" (libc)"
1523 AC_MSG_RESULT([yes])
1524 AC_MSG_CHECKING(if a simple gettext program link)
1526 #include <libintl.h>
1528 [const char *c; c = gettext("foo");],
1529 found_gettext=yes;problem_gettext=" (libc)", found_gettext=no)
1530 AC_MSG_RESULT($found_gettext)
1535 if test x"$found_gettext" = xno; then
1536 dnl not found, check for libintl
1537 $UNSET ac_cv_header_intl_h
1538 $UNSET ac_cv_lib_intl_bindtextdomain
1539 $UNSET ac_cv_lib_intl_textdomain
1540 $UNSET ac_cv_lib_intl_dgettext
1541 smr_CHECK_LIB(intl, intl, for Native Language Support,
1542 bindtextdomain, libintl.h)
1543 if test x"$intl_LIBS" != x; then
1546 ac_save_CFLAGS="$CFLAGS"
1547 ac_save_LIBS="$LIBS"
1548 AC_CHECK_LIB(intl, textdomain,, no_textdomain=yes,
1549 [$intl_LIBS $iconv_LIBS])
1550 if test "$no_textdomain" != "yes"; then
1551 AC_CHECK_LIB(intl, dgettext,, no_dgettext=yes, [$intl_LIBS $iconv_LIBS])
1552 if test "$no_dgettext" != "yes"; then
1553 CFLAGS="$CFLAGS $intl_LIBS $iconv_LIBS"
1554 LIBS="$LIBS $intl_LIBS $iconv_LIBS"
1555 AC_MSG_CHECKING(if a simple gettext program link)
1557 #include <libintl.h>
1559 [const char *c; c = gettext("foo");],
1560 found_gettext=yes;problem_gettext=" (intl library)", found_gettext=no)
1561 AC_MSG_RESULT($found_gettext)
1564 CFLAGS="$ac_save_CFLAGS"
1565 LIBS="$ac_save_LIBS"
1569 if test "$found_gettext" = "yes"; then
1570 dnl Mark actions to use GNU gettext tools.
1573 dnl We need to process the po/ directory.
1579 dnl Make the po/ variables we use known to autoconf
1583 dnl Checks for all prerequisites of the po subdirectory,
1584 dnl except for USE_NLS.
1585 AC_DEFUN([AM_PO_SUBDIRS],
1587 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1588 AC_REQUIRE([AC_PROG_INSTALL])dnl
1589 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1591 dnl Perform the following tests also if --disable-nls has been given,
1592 dnl because they are needed for "make dist" to work.
1594 dnl Search for GNU msgfmt in the PATH.
1595 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1596 dnl The second test excludes FreeBSD msgfmt.
1597 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1598 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1599 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1601 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1603 dnl Search for GNU xgettext 0.11 or newer in the PATH.
1604 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1605 dnl The second test excludes FreeBSD xgettext.
1606 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1607 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1608 (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)],
1610 dnl Remove leftover from FreeBSD xgettext call.
1613 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1614 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1615 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1617 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1618 dnl Test whether we really found GNU msgfmt.
1619 if test "$GMSGFMT" != ":"; then
1620 dnl If it is no GNU msgfmt we define it as : so that the
1621 dnl Makefiles still can work.
1622 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1623 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1626 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1628 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1633 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1634 dnl Test whether we really found GNU xgettext.
1635 if test "$XGETTEXT" != ":"; then
1636 dnl If it is no GNU xgettext we define it as : so that the
1637 dnl Makefiles still can work.
1638 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1639 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1643 [found xgettext program is not GNU xgettext; ignore it])
1646 dnl Remove leftover from FreeBSD xgettext call.
1650 AC_PATH_PROG(MSGUNIQ, msguniq, $MSGUNIQ)
1652 AC_MSG_CHECKING([for NLS fvwm messages catalogs])
1653 AC_MSG_RESULT([$ALL_LINGUAS])
1658 for lang in $ALL_LINGUAS; do
1659 for dom in $ALL_DOMAINS; do
1660 POFILES="$POFILES $dom.$lang.po"
1661 GMOFILES="$GMOFILES $dom.$lang.gmo"
1662 UPDATEPOFILES="$UPDATEPOFILES $dom.$lang.po-update"
1663 DUMMYPOFILES="$DUMMYPOFILES $dom.$lang.nop"
1666 # CATALOGS depends on both $ac_dir and the user's LINGUAS environment variable.
1668 AC_MSG_CHECKING([for NLS desired catalogs to be installed])
1669 #if test "%UNSET%" != "$LINGUAS"; then
1670 # FIXME: How to check if LINGUAS has been *set* to ""
1671 if test -n "$LINGUAS"; then
1672 AC_MSG_RESULT([$LINGUAS])
1674 AC_MSG_RESULT([all])
1676 AC_MSG_CHECKING([for NLS messages catalogs to be installed])
1677 if test -n "$ALL_LINGUAS"; then
1678 for presentlang in $ALL_LINGUAS; do
1680 #if test "%UNSET%" != "$LINGUAS"; then
1681 if test -n "$LINGUAS"; then
1682 desiredlanguages="$LINGUAS"
1684 desiredlanguages="$ALL_LINGUAS"
1686 for desiredlang in $desiredlanguages; do
1687 # Use the presentlang catalog if desiredlang is
1688 # a. equal to presentlang, or
1689 # b. a variant of presentlang (because in this case,
1690 # presentlang can be used as a fallback for messages
1691 # which are not translated in the desiredlang catalog).
1692 case "$desiredlang" in
1693 "$presentlang"*) useit=yes;;
1696 if test $useit = yes; then
1697 INST_LINGUAS="$INST_LINGUAS $presentlang"
1701 AC_MSG_RESULT([$INST_LINGUAS])
1703 if test -n "$INST_LINGUAS"; then
1704 for lang in $INST_LINGUAS; do
1705 CATALOGS="$CATALOGS $lang.gmo"
1712 AC_DEFUN([AM_MKINSTALLDIRS],
1714 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1715 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1716 dnl Try to locate is.
1718 if test -n "$ac_aux_dir"; then
1719 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1721 if test -z "$MKINSTALLDIRS"; then
1722 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1726 # Search path for a program which passes the given test.
1728 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1729 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1730 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1731 [# Extract the first word of "$2", so it can be a program name with args.
1732 set dummy $2; ac_word=[$]2
1733 AC_MSG_CHECKING([for $ac_word])
1734 AC_CACHE_VAL(ac_cv_path_$1,
1737 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1740 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1741 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1742 test -z "$ac_dir" && ac_dir=.
1743 if test -f $ac_dir/$ac_word; then
1745 ac_cv_path_$1="$ac_dir/$ac_word"
1751 dnl If no 4th arg is given, leave the cache variable unset,
1752 dnl so AC_PATH_PROGS will keep looking.
1753 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1758 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1759 AC_MSG_RESULT([$]$1)
1767 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1768 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1771 #-----------------------------------------------------------------------------
1772 # Safty check for mkstemp
1774 AC_DEFUN([AM_SAFTY_CHECK_MKSTEMP],[
1775 AC_CHECK_FUNCS(mkstemp)
1776 has_safty_mkstemp=no
1777 AC_MSG_CHECKING(if mkstemp is safe)
1778 if test x$ac_cv_func_mkstemp != xno; then
1786 char template_orig[128];
1789 sprintf(template, "configure-mkstemp-test.XXXXXX");
1790 strcpy(template_orig, template);
1791 fd = mkstemp(template);
1794 /* could not create temp file */
1797 if (strcmp(template, template_orig) == 0)
1799 /* mkstemp broken */
1807 if (unlink(template))
1811 /* mkstemp works properly */
1815 [has_safty_mkstemp=yes], [has_safty_mkstemp=no])
1817 if test x$has_safty_mkstemp = xno; then
1818 AC_MSG_RESULT(no, use our mkstemp)
1821 AC_DEFINE(HAVE_SAFTY_MKSTEMP)