1 dnl Added by setup-gettext. Do not remove this
2 dnl unless you know what you are doing.
3 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
5 # Configure paths for GLIB
6 # Owen Taylor 1997-2001
8 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
9 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gobject or
10 dnl gthread is specified in MODULES, pass to pkg-config
12 AC_DEFUN([AM_PATH_GLIB_2_0],
14 dnl Get the cflags and libraries from pkg-config
16 AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
17 , enable_glibtest=yes)
19 pkg_config_args=glib-2.0
24 pkg_config_args="$pkg_config_args gobject-2.0"
27 pkg_config_args="$pkg_config_args gthread-2.0"
32 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
36 if test x$PKG_CONFIG != xno ; then
37 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
40 echo *** pkg-config too old; version 0.7 or better required.
48 min_glib_version=ifelse([$1], ,2.0.0,$1)
49 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
51 if test x$PKG_CONFIG != xno ; then
52 ## don't try to run the test against uninstalled libtool libs
53 if $PKG_CONFIG --uninstalled $pkg_config_args; then
54 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
58 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
65 if test x"$no_glib" = x ; then
66 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
67 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
68 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
70 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
71 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
72 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
73 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
74 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
75 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
76 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
77 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
78 if test "x$enable_glibtest" = "xyes" ; then
79 ac_save_CFLAGS="$CFLAGS"
81 CFLAGS="$CFLAGS $GLIB_CFLAGS"
82 LIBS="$GLIB_LIBS $LIBS"
84 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
85 dnl checks the results of pkg-config to some extent)
96 int major, minor, micro;
99 system ("touch conf.glibtest");
101 /* HP/UX 9 (%@#!) writes to sscanf strings */
102 tmp_version = g_strdup("$min_glib_version");
103 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
104 printf("%s, bad version string\n", "$min_glib_version");
108 if ((glib_major_version != $glib_config_major_version) ||
109 (glib_minor_version != $glib_config_minor_version) ||
110 (glib_micro_version != $glib_config_micro_version))
112 printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
113 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
114 glib_major_version, glib_minor_version, glib_micro_version);
115 printf ("*** was found! If pkg-config was correct, then it is best\n");
116 printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
117 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
118 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
119 printf("*** required on your system.\n");
120 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
121 printf("*** to point to the correct configuration files\n");
123 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
124 (glib_minor_version != GLIB_MINOR_VERSION) ||
125 (glib_micro_version != GLIB_MICRO_VERSION))
127 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
128 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
129 printf("*** library (version %d.%d.%d)\n",
130 glib_major_version, glib_minor_version, glib_micro_version);
134 if ((glib_major_version > major) ||
135 ((glib_major_version == major) && (glib_minor_version > minor)) ||
136 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
142 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
143 glib_major_version, glib_minor_version, glib_micro_version);
144 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
145 major, minor, micro);
146 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
148 printf("*** If you have already installed a sufficiently new version, this error\n");
149 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
150 printf("*** being found. The easiest way to fix this is to remove the old version\n");
151 printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
152 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
153 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
154 printf("*** so that the correct libraries are found at run-time))\n");
159 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
160 CFLAGS="$ac_save_CFLAGS"
164 if test "x$no_glib" = x ; then
165 AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
166 ifelse([$2], , :, [$2])
169 if test "$PKG_CONFIG" = "no" ; then
170 echo "*** A new enough version of pkg-config was not found."
171 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
173 if test -f conf.glibtest ; then
176 echo "*** Could not run GLIB test program, checking why..."
177 ac_save_CFLAGS="$CFLAGS"
179 CFLAGS="$CFLAGS $GLIB_CFLAGS"
180 LIBS="$LIBS $GLIB_LIBS"
184 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
185 [ echo "*** The test program compiled, but did not run. This usually means"
186 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
187 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
188 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
189 echo "*** to the installed location Also, make sure you have run ldconfig if that"
190 echo "*** is required on your system"
192 echo "*** If you have an old version installed, it is best to remove it, although"
193 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
194 [ echo "*** The test program failed to compile or link. See the file config.log for the"
195 echo "*** exact error that occurred. This usually means GLIB is incorrectly installed."])
196 CFLAGS="$ac_save_CFLAGS"
205 ifelse([$3], , :, [$3])
207 AC_SUBST(GLIB_CFLAGS)
209 AC_SUBST(GLIB_GENMARSHAL)
210 AC_SUBST(GOBJECT_QUERY)
211 AC_SUBST(GLIB_MKENUMS)
214 # Configure paths for GTK+
215 # Owen Taylor 1997-2001
217 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
218 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
219 dnl pass to pkg-config
221 AC_DEFUN([AM_PATH_GTK_2_0],
223 dnl Get the cflags and libraries from pkg-config
225 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
226 , enable_gtktest=yes)
228 pkg_config_args=gtk+-2.0
233 pkg_config_args="$pkg_config_args gthread-2.0"
240 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
242 if test x$PKG_CONFIG != xno ; then
243 if pkg-config --atleast-pkgconfig-version 0.7 ; then
246 echo *** pkg-config too old; version 0.7 or better required.
254 min_gtk_version=ifelse([$1], ,2.0.0,$1)
255 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
257 if test x$PKG_CONFIG != xno ; then
258 ## don't try to run the test against uninstalled libtool libs
259 if $PKG_CONFIG --uninstalled $pkg_config_args; then
260 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
264 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
271 if test x"$no_gtk" = x ; then
272 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
273 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
274 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
275 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
276 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
277 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
278 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
279 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
280 if test "x$enable_gtktest" = "xyes" ; then
281 ac_save_CFLAGS="$CFLAGS"
283 CFLAGS="$CFLAGS $GTK_CFLAGS"
284 LIBS="$GTK_LIBS $LIBS"
286 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
287 dnl checks the results of pkg-config to some extent)
298 int major, minor, micro;
301 system ("touch conf.gtktest");
303 /* HP/UX 9 (%@#!) writes to sscanf strings */
304 tmp_version = g_strdup("$min_gtk_version");
305 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
306 printf("%s, bad version string\n", "$min_gtk_version");
310 if ((gtk_major_version != $gtk_config_major_version) ||
311 (gtk_minor_version != $gtk_config_minor_version) ||
312 (gtk_micro_version != $gtk_config_micro_version))
314 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
315 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
316 gtk_major_version, gtk_minor_version, gtk_micro_version);
317 printf ("*** was found! If pkg-config was correct, then it is best\n");
318 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
319 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
320 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
321 printf("*** required on your system.\n");
322 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
323 printf("*** to point to the correct configuration files\n");
325 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
326 (gtk_minor_version != GTK_MINOR_VERSION) ||
327 (gtk_micro_version != GTK_MICRO_VERSION))
329 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
330 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
331 printf("*** library (version %d.%d.%d)\n",
332 gtk_major_version, gtk_minor_version, gtk_micro_version);
336 if ((gtk_major_version > major) ||
337 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
338 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
344 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
345 gtk_major_version, gtk_minor_version, gtk_micro_version);
346 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
347 major, minor, micro);
348 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
350 printf("*** If you have already installed a sufficiently new version, this error\n");
351 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
352 printf("*** being found. The easiest way to fix this is to remove the old version\n");
353 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
354 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
355 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
356 printf("*** so that the correct libraries are found at run-time))\n");
361 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
362 CFLAGS="$ac_save_CFLAGS"
366 if test "x$no_gtk" = x ; then
367 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
368 ifelse([$2], , :, [$2])
371 if test "$PKG_CONFIG" = "no" ; then
372 echo "*** A new enough version of pkg-config was not found."
373 echo "*** See http://pkgconfig.sourceforge.net"
375 if test -f conf.gtktest ; then
378 echo "*** Could not run GTK+ test program, checking why..."
379 ac_save_CFLAGS="$CFLAGS"
381 CFLAGS="$CFLAGS $GTK_CFLAGS"
382 LIBS="$LIBS $GTK_LIBS"
386 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
387 [ echo "*** The test program compiled, but did not run. This usually means"
388 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
389 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
390 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
391 echo "*** to the installed location Also, make sure you have run ldconfig if that"
392 echo "*** is required on your system"
394 echo "*** If you have an old version installed, it is best to remove it, although"
395 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
396 [ echo "*** The test program failed to compile or link. See the file config.log for the"
397 echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed."])
398 CFLAGS="$ac_save_CFLAGS"
404 ifelse([$3], , :, [$3])
411 dnl ac_var_timeszone_externals.m4
413 # Define 'timezone', 'altzone' and 'daylight'
414 # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html
415 # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the
416 # the external timezone variables 'timezone', 'altzone' and 'daylight' exist,
417 # defining 'HAVE_TIMEZONE', 'HAVE_ALTZONE' and 'HAVE_DAYLIGHT' respectively
418 # (as well as gaining the macros defined by 'AC_STRUCT_TIMEZONE').
419 # Mark R.Bannister <markb@freedomware.co.uk>
420 AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS],
421 [ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
422 AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone,
423 [ AC_TRY_LINK([#include <time.h>], [return (int)timezone;],
424 mb_cv_var_timezone=yes,
425 mb_cv_var_timezone=no)
427 AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone,
428 [ AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
429 mb_cv_var_altzone=yes,
430 mb_cv_var_altzone=no)
432 AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
433 [ AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
434 mb_cv_var_daylight=yes,
435 mb_cv_var_daylight=no)
437 if test $mb_cv_var_timezone = yes; then
438 AC_DEFINE([HAVE_TIMEZONE], 1,
439 [Define if you have the external 'timezone' variable.])
441 if test $mb_cv_var_altzone = yes; then
442 AC_DEFINE([HAVE_ALTZONE], 1,
443 [Define if you have the external 'altzone' variable.])
445 if test $mb_cv_var_daylight = yes; then
446 AC_DEFINE([HAVE_DAYLIGHT], 1,
447 [Define if you have the external 'daylight' variable.])
451 dnl Available from the GNU Autoconf Macro Archive at:
452 dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_perl_modules.html
454 AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
456 # Make sure we have perl
457 if test -z "$PERL"; then
458 AC_CHECK_PROG(PERL,perl,perl)
461 if test "x$PERL" != x; then
462 ac_perl_modules_failed=0
463 for ac_perl_module in $ac_perl_modules; do
464 AC_MSG_CHECKING(for perl module $ac_perl_module)
466 # Would be nice to log result here, but can't rely on autoconf internals
467 $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
468 if test $? -ne 0; then
470 ac_perl_modules_failed=1
476 # Run optional shell commands
477 if test "$ac_perl_modules_failed" = 0; then
485 AC_MSG_WARN(could not find perl)
489 dnl AM_GCONF_SOURCE_2
490 dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
491 dnl (i.e. pass to gconftool-2
492 dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
493 dnl you should install foo.schemas files
496 AC_DEFUN([AM_GCONF_SOURCE_2],
498 if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
499 GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
501 GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
504 AC_ARG_WITH(gconf-source,
505 [ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
507 AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
508 AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
510 if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
511 GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
514 AC_ARG_WITH(gconf-schema-file-dir,
515 [ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
517 AC_SUBST(GCONF_SCHEMA_FILE_DIR)
518 AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
520 AC_ARG_ENABLE(schemas-install,
521 [ --disable-schemas-install Disable the schemas installation],
522 [case ${enableval} in
524 *) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
526 AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])