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 gmodule, 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 gmodule-2.0"
27 pkg_config_args="$pkg_config_args gobject-2.0"
30 pkg_config_args="$pkg_config_args gthread-2.0"
35 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
39 if test x$PKG_CONFIG != xno ; then
40 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
43 echo *** pkg-config too old; version 0.7 or better required.
51 min_glib_version=ifelse([$1], ,2.0.0,$1)
52 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
54 if test x$PKG_CONFIG != xno ; then
55 ## don't try to run the test against uninstalled libtool libs
56 if $PKG_CONFIG --uninstalled $pkg_config_args; then
57 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
61 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
68 if test x"$no_glib" = x ; then
69 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
70 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
71 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
73 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
74 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
75 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
76 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
77 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
78 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
79 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
80 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
81 if test "x$enable_glibtest" = "xyes" ; then
82 ac_save_CFLAGS="$CFLAGS"
84 CFLAGS="$CFLAGS $GLIB_CFLAGS"
85 LIBS="$GLIB_LIBS $LIBS"
87 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
88 dnl checks the results of pkg-config to some extent)
99 int major, minor, micro;
102 system ("touch conf.glibtest");
104 /* HP/UX 9 (%@#!) writes to sscanf strings */
105 tmp_version = g_strdup("$min_glib_version");
106 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
107 printf("%s, bad version string\n", "$min_glib_version");
111 if ((glib_major_version != $glib_config_major_version) ||
112 (glib_minor_version != $glib_config_minor_version) ||
113 (glib_micro_version != $glib_config_micro_version))
115 printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
116 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
117 glib_major_version, glib_minor_version, glib_micro_version);
118 printf ("*** was found! If pkg-config was correct, then it is best\n");
119 printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
120 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
121 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
122 printf("*** required on your system.\n");
123 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
124 printf("*** to point to the correct configuration files\n");
126 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
127 (glib_minor_version != GLIB_MINOR_VERSION) ||
128 (glib_micro_version != GLIB_MICRO_VERSION))
130 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
131 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
132 printf("*** library (version %d.%d.%d)\n",
133 glib_major_version, glib_minor_version, glib_micro_version);
137 if ((glib_major_version > major) ||
138 ((glib_major_version == major) && (glib_minor_version > minor)) ||
139 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
145 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
146 glib_major_version, glib_minor_version, glib_micro_version);
147 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
148 major, minor, micro);
149 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
151 printf("*** If you have already installed a sufficiently new version, this error\n");
152 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
153 printf("*** being found. The easiest way to fix this is to remove the old version\n");
154 printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
155 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
156 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
157 printf("*** so that the correct libraries are found at run-time))\n");
162 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
163 CFLAGS="$ac_save_CFLAGS"
167 if test "x$no_glib" = x ; then
168 AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
169 ifelse([$2], , :, [$2])
172 if test "$PKG_CONFIG" = "no" ; then
173 echo "*** A new enough version of pkg-config was not found."
174 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
176 if test -f conf.glibtest ; then
179 echo "*** Could not run GLIB test program, checking why..."
180 ac_save_CFLAGS="$CFLAGS"
182 CFLAGS="$CFLAGS $GLIB_CFLAGS"
183 LIBS="$LIBS $GLIB_LIBS"
187 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
188 [ echo "*** The test program compiled, but did not run. This usually means"
189 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
190 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
191 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
192 echo "*** to the installed location Also, make sure you have run ldconfig if that"
193 echo "*** is required on your system"
195 echo "*** If you have an old version installed, it is best to remove it, although"
196 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
197 [ echo "*** The test program failed to compile or link. See the file config.log for the"
198 echo "*** exact error that occurred. This usually means GLIB is incorrectly installed."])
199 CFLAGS="$ac_save_CFLAGS"
208 ifelse([$3], , :, [$3])
210 AC_SUBST(GLIB_CFLAGS)
212 AC_SUBST(GLIB_GENMARSHAL)
213 AC_SUBST(GOBJECT_QUERY)
214 AC_SUBST(GLIB_MKENUMS)
217 # Configure paths for GTK+
218 # Owen Taylor 1997-2001
220 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
221 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
222 dnl pass to pkg-config
224 AC_DEFUN([AM_PATH_GTK_2_0],
226 dnl Get the cflags and libraries from pkg-config
228 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
229 , enable_gtktest=yes)
231 pkg_config_args=gtk+-2.0
236 pkg_config_args="$pkg_config_args gthread-2.0"
243 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
245 if test x$PKG_CONFIG != xno ; then
246 if pkg-config --atleast-pkgconfig-version 0.7 ; then
249 echo *** pkg-config too old; version 0.7 or better required.
257 min_gtk_version=ifelse([$1], ,2.0.0,$1)
258 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
260 if test x$PKG_CONFIG != xno ; then
261 ## don't try to run the test against uninstalled libtool libs
262 if $PKG_CONFIG --uninstalled $pkg_config_args; then
263 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
267 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
274 if test x"$no_gtk" = x ; then
275 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
276 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
277 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
278 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
279 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
280 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
281 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
282 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
283 if test "x$enable_gtktest" = "xyes" ; then
284 ac_save_CFLAGS="$CFLAGS"
286 CFLAGS="$CFLAGS $GTK_CFLAGS"
287 LIBS="$GTK_LIBS $LIBS"
289 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
290 dnl checks the results of pkg-config to some extent)
301 int major, minor, micro;
304 system ("touch conf.gtktest");
306 /* HP/UX 9 (%@#!) writes to sscanf strings */
307 tmp_version = g_strdup("$min_gtk_version");
308 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
309 printf("%s, bad version string\n", "$min_gtk_version");
313 if ((gtk_major_version != $gtk_config_major_version) ||
314 (gtk_minor_version != $gtk_config_minor_version) ||
315 (gtk_micro_version != $gtk_config_micro_version))
317 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
318 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
319 gtk_major_version, gtk_minor_version, gtk_micro_version);
320 printf ("*** was found! If pkg-config was correct, then it is best\n");
321 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
322 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
323 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
324 printf("*** required on your system.\n");
325 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
326 printf("*** to point to the correct configuration files\n");
328 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
329 (gtk_minor_version != GTK_MINOR_VERSION) ||
330 (gtk_micro_version != GTK_MICRO_VERSION))
332 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
333 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
334 printf("*** library (version %d.%d.%d)\n",
335 gtk_major_version, gtk_minor_version, gtk_micro_version);
339 if ((gtk_major_version > major) ||
340 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
341 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
347 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
348 gtk_major_version, gtk_minor_version, gtk_micro_version);
349 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
350 major, minor, micro);
351 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
353 printf("*** If you have already installed a sufficiently new version, this error\n");
354 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
355 printf("*** being found. The easiest way to fix this is to remove the old version\n");
356 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
357 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
358 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
359 printf("*** so that the correct libraries are found at run-time))\n");
364 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
365 CFLAGS="$ac_save_CFLAGS"
369 if test "x$no_gtk" = x ; then
370 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
371 ifelse([$2], , :, [$2])
374 if test "$PKG_CONFIG" = "no" ; then
375 echo "*** A new enough version of pkg-config was not found."
376 echo "*** See http://pkgconfig.sourceforge.net"
378 if test -f conf.gtktest ; then
381 echo "*** Could not run GTK+ test program, checking why..."
382 ac_save_CFLAGS="$CFLAGS"
384 CFLAGS="$CFLAGS $GTK_CFLAGS"
385 LIBS="$LIBS $GTK_LIBS"
389 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
390 [ echo "*** The test program compiled, but did not run. This usually means"
391 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
392 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
393 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
394 echo "*** to the installed location Also, make sure you have run ldconfig if that"
395 echo "*** is required on your system"
397 echo "*** If you have an old version installed, it is best to remove it, although"
398 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
399 [ echo "*** The test program failed to compile or link. See the file config.log for the"
400 echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed."])
401 CFLAGS="$ac_save_CFLAGS"
407 ifelse([$3], , :, [$3])
414 dnl ac_var_timeszone_externals.m4
416 # Define 'timezone', 'altzone' and 'daylight'
417 # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html
418 # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the
419 # the external timezone variables 'timezone', 'altzone' and 'daylight' exist,
420 # defining 'HAVE_TIMEZONE', 'HAVE_ALTZONE' and 'HAVE_DAYLIGHT' respectively
421 # (as well as gaining the macros defined by 'AC_STRUCT_TIMEZONE').
422 # Mark R.Bannister <markb@freedomware.co.uk>
423 AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS],
424 [ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
425 AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone,
426 [ AC_TRY_LINK([#include <time.h>], [return (int)timezone;],
427 mb_cv_var_timezone=yes,
428 mb_cv_var_timezone=no)
430 AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone,
431 [ AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
432 mb_cv_var_altzone=yes,
433 mb_cv_var_altzone=no)
435 AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
436 [ AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
437 mb_cv_var_daylight=yes,
438 mb_cv_var_daylight=no)
440 if test $mb_cv_var_timezone = yes; then
441 AC_DEFINE([HAVE_TIMEZONE], 1,
442 [Define if you have the external 'timezone' variable.])
444 if test $mb_cv_var_altzone = yes; then
445 AC_DEFINE([HAVE_ALTZONE], 1,
446 [Define if you have the external 'altzone' variable.])
448 if test $mb_cv_var_daylight = yes; then
449 AC_DEFINE([HAVE_DAYLIGHT], 1,
450 [Define if you have the external 'daylight' variable.])
454 dnl Available from the GNU Autoconf Macro Archive at:
455 dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_perl_modules.html
457 AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
459 # Make sure we have perl
460 if test -z "$PERL"; then
461 AC_CHECK_PROG(PERL,perl,perl)
464 if test "x$PERL" != x; then
465 ac_perl_modules_failed=0
466 for ac_perl_module in $ac_perl_modules; do
467 AC_MSG_CHECKING(for perl module $ac_perl_module)
469 # Would be nice to log result here, but can't rely on autoconf internals
470 $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
471 if test $? -ne 0; then
473 ac_perl_modules_failed=1
479 # Run optional shell commands
480 if test "$ac_perl_modules_failed" = 0; then
488 AC_MSG_WARN(could not find perl)
492 dnl AM_GCONF_SOURCE_2
493 dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
494 dnl (i.e. pass to gconftool-2
495 dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
496 dnl you should install foo.schemas files
499 AC_DEFUN([AM_GCONF_SOURCE_2],
501 if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
502 GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
504 GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
507 AC_ARG_WITH(gconf-source,
508 [ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
510 AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
511 AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
513 if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
514 GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
517 AC_ARG_WITH(gconf-schema-file-dir,
518 [ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
520 AC_SUBST(GCONF_SCHEMA_FILE_DIR)
521 AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
523 AC_ARG_ENABLE(schemas-install,
524 [ --disable-schemas-install Disable the schemas installation],
525 [case ${enableval} in
527 *) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
529 AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])