14
15
m4_ifndef([AC_AUTOCONF_VERSION],
15
16
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17
[m4_warning([this file was generated for autoconf 2.68.
17
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18
[m4_warning([this file was generated for autoconf 2.69.
18
19
You have another version of autoconf. It may work, but is not guaranteed to.
19
20
If you have problems, you may need to regenerate the build system entirely.
20
21
To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
24
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
25
dnl (i.e. pass to gconftool-2
26
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
27
dnl you should install foo.schemas files
30
AC_DEFUN([AM_GCONF_SOURCE_2],
32
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
33
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
35
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
38
AC_ARG_WITH([gconf-source],
39
AC_HELP_STRING([--with-gconf-source=sourceaddress],
40
[Config database for installing schema files.]),
41
[GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
43
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
44
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
46
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
47
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
50
AC_ARG_WITH([gconf-schema-file-dir],
51
AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
52
[Directory for installing schema files.]),
53
[GCONF_SCHEMA_FILE_DIR="$withval"],)
55
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
56
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
58
AC_ARG_ENABLE(schemas-install,
59
AC_HELP_STRING([--disable-schemas-install],
60
[Disable the schemas installation]),
63
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
65
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
68
# Configure paths for GLIB
69
# Owen Taylor 1997-2001
71
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
72
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
73
dnl gthread, or gio is specified in MODULES, pass to pkg-config
75
AC_DEFUN([AM_PATH_GLIB_2_0],
77
dnl Get the cflags and libraries from pkg-config
79
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
80
, enable_glibtest=yes)
82
pkg_config_args=glib-2.0
87
pkg_config_args="$pkg_config_args gmodule-2.0"
90
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
93
pkg_config_args="$pkg_config_args gobject-2.0"
96
pkg_config_args="$pkg_config_args gthread-2.0"
99
pkg_config_args="$pkg_config_args $module-2.0"
104
PKG_PROG_PKG_CONFIG([0.16])
108
if test "x$PKG_CONFIG" = x ; then
113
min_glib_version=ifelse([$1], ,2.0.0,$1)
114
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
116
if test x$PKG_CONFIG != xno ; then
117
## don't try to run the test against uninstalled libtool libs
118
if $PKG_CONFIG --uninstalled $pkg_config_args; then
119
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
123
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
130
if test x"$no_glib" = x ; then
131
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
132
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
133
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
134
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
136
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
137
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
138
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
139
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
140
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
141
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
142
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
143
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
144
if test "x$enable_glibtest" = "xyes" ; then
145
ac_save_CFLAGS="$CFLAGS"
147
CFLAGS="$CFLAGS $GLIB_CFLAGS"
148
LIBS="$GLIB_LIBS $LIBS"
150
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
151
dnl checks the results of pkg-config to some extent)
162
unsigned int major, minor, micro;
165
fclose (fopen ("conf.glibtest", "w"));
167
/* HP/UX 9 (%@#!) writes to sscanf strings */
168
tmp_version = g_strdup("$min_glib_version");
169
if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) {
170
printf("%s, bad version string\n", "$min_glib_version");
174
if ((glib_major_version != $glib_config_major_version) ||
175
(glib_minor_version != $glib_config_minor_version) ||
176
(glib_micro_version != $glib_config_micro_version))
178
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
179
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
180
glib_major_version, glib_minor_version, glib_micro_version);
181
printf ("*** was found! If pkg-config was correct, then it is best\n");
182
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
183
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
184
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
185
printf("*** required on your system.\n");
186
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
187
printf("*** to point to the correct configuration files\n");
189
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
190
(glib_minor_version != GLIB_MINOR_VERSION) ||
191
(glib_micro_version != GLIB_MICRO_VERSION))
193
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
194
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
195
printf("*** library (version %d.%d.%d)\n",
196
glib_major_version, glib_minor_version, glib_micro_version);
200
if ((glib_major_version > major) ||
201
((glib_major_version == major) && (glib_minor_version > minor)) ||
202
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
208
printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
209
glib_major_version, glib_minor_version, glib_micro_version);
210
printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
211
major, minor, micro);
212
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
214
printf("*** If you have already installed a sufficiently new version, this error\n");
215
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
216
printf("*** being found. The easiest way to fix this is to remove the old version\n");
217
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
218
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
219
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
220
printf("*** so that the correct libraries are found at run-time))\n");
225
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
226
CFLAGS="$ac_save_CFLAGS"
230
if test "x$no_glib" = x ; then
231
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
232
ifelse([$2], , :, [$2])
235
if test "$PKG_CONFIG" = "no" ; then
236
echo "*** A new enough version of pkg-config was not found."
237
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
239
if test -f conf.glibtest ; then
242
echo "*** Could not run GLIB test program, checking why..."
243
ac_save_CFLAGS="$CFLAGS"
245
CFLAGS="$CFLAGS $GLIB_CFLAGS"
246
LIBS="$LIBS $GLIB_LIBS"
250
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
251
[ echo "*** The test program compiled, but did not run. This usually means"
252
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
253
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
254
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
255
echo "*** to the installed location Also, make sure you have run ldconfig if that"
256
echo "*** is required on your system"
258
echo "*** If you have an old version installed, it is best to remove it, although"
259
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
260
[ echo "*** The test program failed to compile or link. See the file config.log for the"
261
echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
262
CFLAGS="$ac_save_CFLAGS"
271
GLIB_COMPILE_RESOURCES=""
272
ifelse([$3], , :, [$3])
274
AC_SUBST(GLIB_CFLAGS)
276
AC_SUBST(GLIB_GENMARSHAL)
277
AC_SUBST(GOBJECT_QUERY)
278
AC_SUBST(GLIB_MKENUMS)
279
AC_SUBST(GLIB_COMPILE_RESOURCES)
283
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
284
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
286
# This file is free software, distributed under the terms of the GNU
287
# General Public License. As a special exception to the GNU General
288
# Public License, this file may be distributed as part of a program
289
# that contains a configuration script generated by Autoconf, under
290
# the same distribution terms as the rest of that program.
292
# This file can be copied and used freely without restrictions. It can
293
# be used in projects which are not available under the GNU Public License
294
# but which still want to provide support for the GNU gettext functionality.
296
# Macro to add for using GNU gettext.
297
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
299
# Modified to never use included libintl.
300
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
302
# Major rework to remove unused code
303
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
305
# Added better handling of ALL_LINGUAS from GNU gettext version
306
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
308
# Modified to require ngettext
309
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
311
# We need this here as well, since someone might use autoconf-2.5x
312
# to configure GLib then an older version to configure a package
313
# using AM_GLIB_GNU_GETTEXT
317
dnl We go to great lengths to make sure that aclocal won't
318
dnl try to pull in the installed version of these macros
319
dnl when running aclocal in the glib directory.
321
m4_copy([AC_DEFUN],[glib_DEFUN])
322
m4_copy([AC_REQUIRE],[glib_REQUIRE])
324
dnl At the end, if we're not within glib, we'll define the public
325
dnl definitions in terms of our private definitions.
329
#--------------------
330
glib_DEFUN([GLIB_LC_MESSAGES],
331
[AC_CHECK_HEADERS([locale.h])
332
if test $ac_cv_header_locale_h = yes; then
333
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
334
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
335
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
336
if test $am_cv_val_LC_MESSAGES = yes; then
337
AC_DEFINE(HAVE_LC_MESSAGES, 1,
338
[Define if your <locale.h> file defines LC_MESSAGES.])
342
# GLIB_PATH_PROG_WITH_TEST
343
#----------------------------
344
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
345
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
346
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
347
[# Extract the first word of "$2", so it can be a program name with args.
348
set dummy $2; ac_word=[$]2
349
AC_MSG_CHECKING([for $ac_word])
350
AC_CACHE_VAL(ac_cv_path_$1,
353
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
356
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
357
for ac_dir in ifelse([$5], , $PATH, [$5]); do
358
test -z "$ac_dir" && ac_dir=.
359
if test -f $ac_dir/$ac_word; then
361
ac_cv_path_$1="$ac_dir/$ac_word"
367
dnl If no 4th arg is given, leave the cache variable unset,
368
dnl so AC_PATH_PROGS will keep looking.
369
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
374
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
384
glib_DEFUN([GLIB_WITH_NLS],
385
dnl NLS is obligatory
389
gt_cv_have_gettext=no
395
AC_CHECK_HEADER(libintl.h,
396
[gt_cv_func_dgettext_libintl="no"
397
libintl_extra_libs=""
400
# First check in libc
402
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
406
[return !ngettext ("","", 1)],
407
gt_cv_func_ngettext_libc=yes,
408
gt_cv_func_ngettext_libc=no)
411
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
412
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
416
[return !dgettext ("","")],
417
gt_cv_func_dgettext_libc=yes,
418
gt_cv_func_dgettext_libc=no)
422
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
423
AC_CHECK_FUNCS(bind_textdomain_codeset)
427
# If we don't have everything we want, check in libintl
429
if test "$gt_cv_func_dgettext_libc" != "yes" \
430
|| test "$gt_cv_func_ngettext_libc" != "yes" \
431
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
433
AC_CHECK_LIB(intl, bindtextdomain,
434
[AC_CHECK_LIB(intl, ngettext,
435
[AC_CHECK_LIB(intl, dgettext,
436
gt_cv_func_dgettext_libintl=yes)])])
438
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
439
AC_MSG_CHECKING([if -liconv is needed to use gettext])
441
AC_CHECK_LIB(intl, ngettext,
442
[AC_CHECK_LIB(intl, dcgettext,
443
[gt_cv_func_dgettext_libintl=yes
444
libintl_extra_libs=-liconv],
450
# If we found libintl, then check in it for bind_textdomain_codeset();
451
# we'll prefer libc if neither have bind_textdomain_codeset(),
452
# and both have dgettext and ngettext
454
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
455
glib_save_LIBS="$LIBS"
456
LIBS="$LIBS -lintl $libintl_extra_libs"
457
unset ac_cv_func_bind_textdomain_codeset
458
AC_CHECK_FUNCS(bind_textdomain_codeset)
459
LIBS="$glib_save_LIBS"
461
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
462
gt_cv_func_dgettext_libc=no
464
if test "$gt_cv_func_dgettext_libc" = "yes" \
465
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
466
gt_cv_func_dgettext_libintl=no
472
if test "$gt_cv_func_dgettext_libc" = "yes" \
473
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
474
gt_cv_have_gettext=yes
477
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
478
INTLLIBS="-lintl $libintl_extra_libs"
481
if test "$gt_cv_have_gettext" = "yes"; then
482
AC_DEFINE(HAVE_GETTEXT,1,
483
[Define if the GNU gettext() function is already present or preinstalled.])
484
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
485
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
486
if test "$MSGFMT" != "no"; then
487
glib_save_LIBS="$LIBS"
488
LIBS="$LIBS $INTLLIBS"
489
AC_CHECK_FUNCS(dcgettext)
491
AC_MSG_CHECKING([if msgfmt accepts -c])
492
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
495
"Content-Type: text/plain; charset=UTF-8\n"
496
"Project-Id-Version: test 1.0\n"
497
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
498
"Last-Translator: test <foo@bar.xx>\n"
499
"Language-Team: C <LL@li.org>\n"
500
"MIME-Version: 1.0\n"
501
"Content-Transfer-Encoding: 8bit\n"
502
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
503
AC_SUBST(MSGFMT_OPTS)
504
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
505
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
506
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
507
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
508
return _nl_msg_cat_cntr],
513
dnl On Solaris, if bind_textdomain_codeset is in libc,
514
dnl GNU format message catalog is always supported,
515
dnl since both are added to the libc all together.
516
dnl Hence, we'd like to go with DATADIRNAME=share and
517
dnl and CATOBJEXT=.gmo in this case.
518
AC_CHECK_FUNC(bind_textdomain_codeset,
533
LIBS="$glib_save_LIBS"
536
gt_cv_have_gettext=no
541
if test "$gt_cv_have_gettext" = "yes" ; then
542
AC_DEFINE(ENABLE_NLS, 1,
543
[always defined to indicate that i18n is enabled])
546
dnl Test whether we really found GNU xgettext.
547
if test "$XGETTEXT" != ":"; then
548
dnl If it is not GNU xgettext we define it as : so that the
549
dnl Makefiles still can work.
550
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
554
[found xgettext program is not GNU xgettext; ignore it])
559
# We need to process the po/ directory.
563
[case "$CONFIG_FILES" in *po/Makefile.in*)
564
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
567
dnl These rules are solely for the distribution goal. While doing this
568
dnl we only have to keep exactly one list of the available catalogs
570
for lang in $ALL_LINGUAS; do
571
GMOFILES="$GMOFILES $lang.gmo"
572
POFILES="$POFILES $lang.po"
575
dnl Make all variables we use known to autoconf.
578
AC_SUBST(DATADIRNAME)
582
AC_SUBST(PO_IN_DATADIR_TRUE)
583
AC_SUBST(PO_IN_DATADIR_FALSE)
588
# AM_GLIB_GNU_GETTEXT
589
# -------------------
590
# Do checks necessary for use of gettext. If a suitable implementation
591
# of gettext is found in either in libintl or in the C library,
592
# it will set INTLLIBS to the libraries needed for use of gettext
593
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
594
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
595
# on various variables needed by the Makefile.in.in installed by
598
glib_DEFUN([GLIB_GNU_GETTEXT],
599
[AC_REQUIRE([AC_PROG_CC])dnl
600
AC_REQUIRE([AC_HEADER_STDC])dnl
605
if test "$gt_cv_have_gettext" = "yes"; then
606
if test "x$ALL_LINGUAS" = "x"; then
609
AC_MSG_CHECKING(for catalogs to be installed)
611
for presentlang in $ALL_LINGUAS; do
613
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
614
desiredlanguages="$LINGUAS"
616
desiredlanguages="$ALL_LINGUAS"
618
for desiredlang in $desiredlanguages; do
619
# Use the presentlang catalog if desiredlang is
620
# a. equal to presentlang, or
621
# b. a variant of presentlang (because in this case,
622
# presentlang can be used as a fallback for messages
623
# which are not translated in the desiredlang catalog).
624
case "$desiredlang" in
625
"$presentlang"*) useit=yes;;
628
if test $useit = yes; then
629
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
633
AC_MSG_RESULT($LINGUAS)
636
dnl Construct list of names of catalog files to be constructed.
637
if test -n "$LINGUAS"; then
638
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
642
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
643
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
644
dnl Try to locate is.
646
if test -n "$ac_aux_dir"; then
647
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
649
if test -z "$MKINSTALLDIRS"; then
650
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
652
AC_SUBST(MKINSTALLDIRS)
654
dnl Generate list of files to be processed by xgettext which will
655
dnl be included in po/Makefile.
656
test -d po || mkdir po
657
if test "x$srcdir" != "x."; then
658
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
659
posrcprefix="$srcdir/"
661
posrcprefix="../$srcdir/"
667
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
668
< $srcdir/po/POTFILES.in > po/POTFILES
671
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
672
# -------------------------------
673
# Define VARIABLE to the location where catalog files will
674
# be installed by po/Makefile.
675
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
676
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
677
glib_save_prefix="$prefix"
678
glib_save_exec_prefix="$exec_prefix"
679
glib_save_datarootdir="$datarootdir"
680
test "x$prefix" = xNONE && prefix=$ac_default_prefix
681
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
682
datarootdir=`eval echo "${datarootdir}"`
683
if test "x$CATOBJEXT" = "x.mo" ; then
684
localedir=`eval echo "${libdir}/locale"`
686
localedir=`eval echo "${datadir}/locale"`
688
prefix="$glib_save_prefix"
689
exec_prefix="$glib_save_exec_prefix"
690
datarootdir="$glib_save_datarootdir"
691
AC_DEFINE_UNQUOTED($1, "$localedir",
692
[Define the location where the catalogs will be installed])
696
dnl Now the definitions that aclocal will find
698
ifdef(glib_configure_ac,[],[
699
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
700
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
703
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
705
# Create a temporary file with TEST-FILE as its contents and pass the
706
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
707
# 0 and perform ACTION-IF-FAIL for any other exit status.
708
AC_DEFUN([GLIB_RUN_PROG],
709
[cat >conftest.foo <<_ACEOF
712
if AC_RUN_LOG([$1 conftest.foo]); then
713
m4_ifval([$3], [$3], [:])
714
m4_ifvaln([$4], [else $4])dnl
715
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
716
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
720
# nls.m4 serial 5 (gettext-0.18)
721
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
723
dnl This file is free software; the Free Software Foundation
724
dnl gives unlimited permission to copy and/or distribute it,
725
dnl with or without modifications, as long as this notice is preserved.
727
dnl This file can can be used in projects which are not available under
728
dnl the GNU General Public License or the GNU Library General Public
729
dnl License but which still want to provide support for the GNU gettext
731
dnl Please note that the actual code of the GNU gettext library is covered
732
dnl by the GNU Library General Public License, and the rest of the GNU
733
dnl gettext package package is covered by the GNU General Public License.
734
dnl They are *not* in the public domain.
737
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
738
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
744
AC_MSG_CHECKING([whether NLS is requested])
745
dnl Default is enabled NLS
747
[ --disable-nls do not use Native Language Support],
748
USE_NLS=$enableval, USE_NLS=yes)
749
AC_MSG_RESULT([$USE_NLS])
753
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
754
# serial 1 (pkg-config-0.24)
756
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
758
# This program is free software; you can redistribute it and/or modify
759
# it under the terms of the GNU General Public License as published by
760
# the Free Software Foundation; either version 2 of the License, or
761
# (at your option) any later version.
763
# This program is distributed in the hope that it will be useful, but
764
# WITHOUT ANY WARRANTY; without even the implied warranty of
765
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
766
# General Public License for more details.
768
# You should have received a copy of the GNU General Public License
769
# along with this program; if not, write to the Free Software
770
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
772
# As a special exception to the GNU General Public License, if you
773
# distribute this file as part of a program that contains a
774
# configuration script generated by Autoconf, you may include it under
775
# the same distribution terms that you use for the rest of that program.
777
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
778
# ----------------------------------
779
AC_DEFUN([PKG_PROG_PKG_CONFIG],
780
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
781
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
782
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
783
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
784
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
785
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
787
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
788
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
790
if test -n "$PKG_CONFIG"; then
791
_pkg_min_version=m4_default([$1], [0.9.0])
792
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
793
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
800
])# PKG_PROG_PKG_CONFIG
802
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
804
# Check to see whether a particular set of modules exists. Similar
805
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
807
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
808
# only at the first occurence in configure.ac, so if the first place
809
# it's called might be skipped (such as if it is within an "if", you
810
# have to call PKG_CHECK_EXISTS manually
811
# --------------------------------------------------------------
812
AC_DEFUN([PKG_CHECK_EXISTS],
813
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
814
if test -n "$PKG_CONFIG" && \
815
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
816
m4_default([$2], [:])
817
m4_ifvaln([$3], [else
821
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
822
# ---------------------------------------------
823
m4_define([_PKG_CONFIG],
824
[if test -n "$$1"; then
826
elif test -n "$PKG_CONFIG"; then
827
PKG_CHECK_EXISTS([$3],
828
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
829
test "x$?" != "x0" && pkg_failed=yes ],
836
# _PKG_SHORT_ERRORS_SUPPORTED
837
# -----------------------------
838
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
839
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
840
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
841
_pkg_short_errors_supported=yes
843
_pkg_short_errors_supported=no
845
])# _PKG_SHORT_ERRORS_SUPPORTED
848
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
849
# [ACTION-IF-NOT-FOUND])
852
# Note that if there is a possibility the first call to
853
# PKG_CHECK_MODULES might not happen, you should be sure to include an
854
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
857
# --------------------------------------------------------------
858
AC_DEFUN([PKG_CHECK_MODULES],
859
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
860
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
861
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
864
AC_MSG_CHECKING([for $1])
866
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
867
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
869
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
870
and $1[]_LIBS to avoid the need to call pkg-config.
871
See the pkg-config man page for more details.])
873
if test $pkg_failed = yes; then
875
_PKG_SHORT_ERRORS_SUPPORTED
876
if test $_pkg_short_errors_supported = yes; then
877
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
879
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
881
# Put the nasty error message in config.log where it belongs
882
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
884
m4_default([$4], [AC_MSG_ERROR(
885
[Package requirements ($2) were not met:
889
Consider adjusting the PKG_CONFIG_PATH environment variable if you
890
installed software in a non-standard prefix.
894
elif test $pkg_failed = untried; then
896
m4_default([$4], [AC_MSG_FAILURE(
897
[The pkg-config script could not be found or is too old. Make sure it
898
is in your PATH or set the PKG_CONFIG environment variable to the full
903
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
906
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
907
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
911
])# PKG_CHECK_MODULES
913
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
24
916
# This file is free software; the Free Software Foundation
25
917
# gives unlimited permission to copy and/or distribute it,
26
918
# with or without modifications, as long as this notice is preserved.
28
922
# AM_AUTOMAKE_VERSION(VERSION)
29
923
# ----------------------------
30
924
# Automake X.Y traces this macro to ensure aclocal.m4 has been
1051
1991
AC_SUBST([am__untar])
1052
1992
]) # _AM_PROG_TAR
1054
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1055
# serial 1 (pkg-config-0.24)
1057
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1059
# This program is free software; you can redistribute it and/or modify
1060
# it under the terms of the GNU General Public License as published by
1061
# the Free Software Foundation; either version 2 of the License, or
1062
# (at your option) any later version.
1064
# This program is distributed in the hope that it will be useful, but
1065
# WITHOUT ANY WARRANTY; without even the implied warranty of
1066
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1067
# General Public License for more details.
1069
# You should have received a copy of the GNU General Public License
1070
# along with this program; if not, write to the Free Software
1071
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1073
# As a special exception to the GNU General Public License, if you
1074
# distribute this file as part of a program that contains a
1075
# configuration script generated by Autoconf, you may include it under
1076
# the same distribution terms that you use for the rest of that program.
1078
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1079
# ----------------------------------
1080
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1081
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1082
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1083
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1084
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1085
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1087
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1088
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1090
if test -n "$PKG_CONFIG"; then
1091
_pkg_min_version=m4_default([$1], [0.9.0])
1092
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1093
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1094
AC_MSG_RESULT([yes])
1100
])# PKG_PROG_PKG_CONFIG
1102
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1104
# Check to see whether a particular set of modules exists. Similar
1105
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1107
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1108
# only at the first occurence in configure.ac, so if the first place
1109
# it's called might be skipped (such as if it is within an "if", you
1110
# have to call PKG_CHECK_EXISTS manually
1111
# --------------------------------------------------------------
1112
AC_DEFUN([PKG_CHECK_EXISTS],
1113
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1114
if test -n "$PKG_CONFIG" && \
1115
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1116
m4_default([$2], [:])
1117
m4_ifvaln([$3], [else
1121
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1122
# ---------------------------------------------
1123
m4_define([_PKG_CONFIG],
1124
[if test -n "$$1"; then
1126
elif test -n "$PKG_CONFIG"; then
1127
PKG_CHECK_EXISTS([$3],
1128
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1135
# _PKG_SHORT_ERRORS_SUPPORTED
1136
# -----------------------------
1137
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1138
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1139
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1140
_pkg_short_errors_supported=yes
1142
_pkg_short_errors_supported=no
1144
])# _PKG_SHORT_ERRORS_SUPPORTED
1147
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1148
# [ACTION-IF-NOT-FOUND])
1151
# Note that if there is a possibility the first call to
1152
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1153
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1156
# --------------------------------------------------------------
1157
AC_DEFUN([PKG_CHECK_MODULES],
1158
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1159
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1160
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1163
AC_MSG_CHECKING([for $1])
1165
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1166
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1168
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1169
and $1[]_LIBS to avoid the need to call pkg-config.
1170
See the pkg-config man page for more details.])
1172
if test $pkg_failed = yes; then
1174
_PKG_SHORT_ERRORS_SUPPORTED
1175
if test $_pkg_short_errors_supported = yes; then
1176
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1178
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1180
# Put the nasty error message in config.log where it belongs
1181
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1183
m4_default([$4], [AC_MSG_ERROR(
1184
[Package requirements ($2) were not met:
1188
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1189
installed software in a non-standard prefix.
1193
elif test $pkg_failed = untried; then
1195
m4_default([$4], [AC_MSG_FAILURE(
1196
[The pkg-config script could not be found or is too old. Make sure it
1197
is in your PATH or set the PKG_CONFIG environment variable to the full
1202
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1205
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1206
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1207
AC_MSG_RESULT([yes])
1210
])# PKG_CHECK_MODULES
1212
dnl AM_GCONF_SOURCE_2
1213
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
1214
dnl (i.e. pass to gconftool-2
1215
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
1216
dnl you should install foo.schemas files
1219
AC_DEFUN([AM_GCONF_SOURCE_2],
1221
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
1222
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
1224
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
1227
AC_ARG_WITH([gconf-source],
1228
AC_HELP_STRING([--with-gconf-source=sourceaddress],
1229
[Config database for installing schema files.]),
1230
[GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
1232
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
1233
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
1235
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
1236
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
1239
AC_ARG_WITH([gconf-schema-file-dir],
1240
AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
1241
[Directory for installing schema files.]),
1242
[GCONF_SCHEMA_FILE_DIR="$withval"],)
1244
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
1245
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
1247
AC_ARG_ENABLE(schemas-install,
1248
AC_HELP_STRING([--disable-schemas-install],
1249
[Disable the schemas installation]),
1250
[case ${enableval} in
1252
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
1254
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
1257
# Configure paths for GLIB
1258
# Owen Taylor 1997-2001
1260
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1261
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
1262
dnl gthread, or gio is specified in MODULES, pass to pkg-config
1264
AC_DEFUN([AM_PATH_GLIB_2_0],
1266
dnl Get the cflags and libraries from pkg-config
1268
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
1269
, enable_glibtest=yes)
1271
pkg_config_args=glib-2.0
1276
pkg_config_args="$pkg_config_args gmodule-2.0"
1279
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
1282
pkg_config_args="$pkg_config_args gobject-2.0"
1285
pkg_config_args="$pkg_config_args gthread-2.0"
1288
pkg_config_args="$pkg_config_args $module-2.0"
1293
PKG_PROG_PKG_CONFIG([0.16])
1297
if test "x$PKG_CONFIG" = x ; then
1302
min_glib_version=ifelse([$1], ,2.0.0,$1)
1303
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
1305
if test x$PKG_CONFIG != xno ; then
1306
## don't try to run the test against uninstalled libtool libs
1307
if $PKG_CONFIG --uninstalled $pkg_config_args; then
1308
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
1312
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
1319
if test x"$no_glib" = x ; then
1320
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
1321
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
1322
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
1323
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
1325
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
1326
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
1327
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
1328
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1329
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
1330
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1331
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
1332
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1333
if test "x$enable_glibtest" = "xyes" ; then
1334
ac_save_CFLAGS="$CFLAGS"
1335
ac_save_LIBS="$LIBS"
1336
CFLAGS="$CFLAGS $GLIB_CFLAGS"
1337
LIBS="$GLIB_LIBS $LIBS"
1339
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
1340
dnl checks the results of pkg-config to some extent)
1351
unsigned int major, minor, micro;
1354
fclose (fopen ("conf.glibtest", "w"));
1356
/* HP/UX 9 (%@#!) writes to sscanf strings */
1357
tmp_version = g_strdup("$min_glib_version");
1358
if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) {
1359
printf("%s, bad version string\n", "$min_glib_version");
1363
if ((glib_major_version != $glib_config_major_version) ||
1364
(glib_minor_version != $glib_config_minor_version) ||
1365
(glib_micro_version != $glib_config_micro_version))
1367
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
1368
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
1369
glib_major_version, glib_minor_version, glib_micro_version);
1370
printf ("*** was found! If pkg-config was correct, then it is best\n");
1371
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
1372
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1373
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1374
printf("*** required on your system.\n");
1375
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
1376
printf("*** to point to the correct configuration files\n");
1378
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
1379
(glib_minor_version != GLIB_MINOR_VERSION) ||
1380
(glib_micro_version != GLIB_MICRO_VERSION))
1382
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
1383
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
1384
printf("*** library (version %d.%d.%d)\n",
1385
glib_major_version, glib_minor_version, glib_micro_version);
1389
if ((glib_major_version > major) ||
1390
((glib_major_version == major) && (glib_minor_version > minor)) ||
1391
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
1397
printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
1398
glib_major_version, glib_minor_version, glib_micro_version);
1399
printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
1400
major, minor, micro);
1401
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
1403
printf("*** If you have already installed a sufficiently new version, this error\n");
1404
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
1405
printf("*** being found. The easiest way to fix this is to remove the old version\n");
1406
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
1407
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
1408
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1409
printf("*** so that the correct libraries are found at run-time))\n");
1414
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1415
CFLAGS="$ac_save_CFLAGS"
1416
LIBS="$ac_save_LIBS"
1419
if test "x$no_glib" = x ; then
1420
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
1421
ifelse([$2], , :, [$2])
1424
if test "$PKG_CONFIG" = "no" ; then
1425
echo "*** A new enough version of pkg-config was not found."
1426
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
1428
if test -f conf.glibtest ; then
1431
echo "*** Could not run GLIB test program, checking why..."
1432
ac_save_CFLAGS="$CFLAGS"
1433
ac_save_LIBS="$LIBS"
1434
CFLAGS="$CFLAGS $GLIB_CFLAGS"
1435
LIBS="$LIBS $GLIB_LIBS"
1439
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
1440
[ echo "*** The test program compiled, but did not run. This usually means"
1441
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
1442
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
1443
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1444
echo "*** to the installed location Also, make sure you have run ldconfig if that"
1445
echo "*** is required on your system"
1447
echo "*** If you have an old version installed, it is best to remove it, although"
1448
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1449
[ echo "*** The test program failed to compile or link. See the file config.log for the"
1450
echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
1451
CFLAGS="$ac_save_CFLAGS"
1452
LIBS="$ac_save_LIBS"
1460
GLIB_COMPILE_RESOURCES=""
1461
ifelse([$3], , :, [$3])
1463
AC_SUBST(GLIB_CFLAGS)
1465
AC_SUBST(GLIB_GENMARSHAL)
1466
AC_SUBST(GOBJECT_QUERY)
1467
AC_SUBST(GLIB_MKENUMS)
1468
AC_SUBST(GLIB_COMPILE_RESOURCES)
1472
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1473
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1475
# This file is free software, distributed under the terms of the GNU
1476
# General Public License. As a special exception to the GNU General
1477
# Public License, this file may be distributed as part of a program
1478
# that contains a configuration script generated by Autoconf, under
1479
# the same distribution terms as the rest of that program.
1481
# This file can be copied and used freely without restrictions. It can
1482
# be used in projects which are not available under the GNU Public License
1483
# but which still want to provide support for the GNU gettext functionality.
1485
# Macro to add for using GNU gettext.
1486
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1488
# Modified to never use included libintl.
1489
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1491
# Major rework to remove unused code
1492
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1494
# Added better handling of ALL_LINGUAS from GNU gettext version
1495
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1497
# Modified to require ngettext
1498
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1500
# We need this here as well, since someone might use autoconf-2.5x
1501
# to configure GLib then an older version to configure a package
1502
# using AM_GLIB_GNU_GETTEXT
1506
dnl We go to great lengths to make sure that aclocal won't
1507
dnl try to pull in the installed version of these macros
1508
dnl when running aclocal in the glib directory.
1510
m4_copy([AC_DEFUN],[glib_DEFUN])
1511
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1513
dnl At the end, if we're not within glib, we'll define the public
1514
dnl definitions in terms of our private definitions.
1518
#--------------------
1519
glib_DEFUN([GLIB_LC_MESSAGES],
1520
[AC_CHECK_HEADERS([locale.h])
1521
if test $ac_cv_header_locale_h = yes; then
1522
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1523
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1524
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1525
if test $am_cv_val_LC_MESSAGES = yes; then
1526
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1527
[Define if your <locale.h> file defines LC_MESSAGES.])
1531
# GLIB_PATH_PROG_WITH_TEST
1532
#----------------------------
1533
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1534
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1535
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1536
[# Extract the first word of "$2", so it can be a program name with args.
1537
set dummy $2; ac_word=[$]2
1538
AC_MSG_CHECKING([for $ac_word])
1539
AC_CACHE_VAL(ac_cv_path_$1,
1542
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1545
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1546
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1547
test -z "$ac_dir" && ac_dir=.
1548
if test -f $ac_dir/$ac_word; then
1550
ac_cv_path_$1="$ac_dir/$ac_word"
1556
dnl If no 4th arg is given, leave the cache variable unset,
1557
dnl so AC_PATH_PROGS will keep looking.
1558
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1563
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1564
AC_MSG_RESULT([$]$1)
1573
glib_DEFUN([GLIB_WITH_NLS],
1574
dnl NLS is obligatory
1578
gt_cv_have_gettext=no
1584
AC_CHECK_HEADER(libintl.h,
1585
[gt_cv_func_dgettext_libintl="no"
1586
libintl_extra_libs=""
1589
# First check in libc
1591
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1593
#include <libintl.h>
1595
[return !ngettext ("","", 1)],
1596
gt_cv_func_ngettext_libc=yes,
1597
gt_cv_func_ngettext_libc=no)
1600
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1601
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1603
#include <libintl.h>
1605
[return !dgettext ("","")],
1606
gt_cv_func_dgettext_libc=yes,
1607
gt_cv_func_dgettext_libc=no)
1611
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1612
AC_CHECK_FUNCS(bind_textdomain_codeset)
1616
# If we don't have everything we want, check in libintl
1618
if test "$gt_cv_func_dgettext_libc" != "yes" \
1619
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1620
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1622
AC_CHECK_LIB(intl, bindtextdomain,
1623
[AC_CHECK_LIB(intl, ngettext,
1624
[AC_CHECK_LIB(intl, dgettext,
1625
gt_cv_func_dgettext_libintl=yes)])])
1627
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1628
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1630
AC_CHECK_LIB(intl, ngettext,
1631
[AC_CHECK_LIB(intl, dcgettext,
1632
[gt_cv_func_dgettext_libintl=yes
1633
libintl_extra_libs=-liconv],
1639
# If we found libintl, then check in it for bind_textdomain_codeset();
1640
# we'll prefer libc if neither have bind_textdomain_codeset(),
1641
# and both have dgettext and ngettext
1643
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1644
glib_save_LIBS="$LIBS"
1645
LIBS="$LIBS -lintl $libintl_extra_libs"
1646
unset ac_cv_func_bind_textdomain_codeset
1647
AC_CHECK_FUNCS(bind_textdomain_codeset)
1648
LIBS="$glib_save_LIBS"
1650
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1651
gt_cv_func_dgettext_libc=no
1653
if test "$gt_cv_func_dgettext_libc" = "yes" \
1654
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1655
gt_cv_func_dgettext_libintl=no
1661
if test "$gt_cv_func_dgettext_libc" = "yes" \
1662
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1663
gt_cv_have_gettext=yes
1666
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1667
INTLLIBS="-lintl $libintl_extra_libs"
1670
if test "$gt_cv_have_gettext" = "yes"; then
1671
AC_DEFINE(HAVE_GETTEXT,1,
1672
[Define if the GNU gettext() function is already present or preinstalled.])
1673
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1674
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1675
if test "$MSGFMT" != "no"; then
1676
glib_save_LIBS="$LIBS"
1677
LIBS="$LIBS $INTLLIBS"
1678
AC_CHECK_FUNCS(dcgettext)
1680
AC_MSG_CHECKING([if msgfmt accepts -c])
1681
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1684
"Content-Type: text/plain; charset=UTF-8\n"
1685
"Project-Id-Version: test 1.0\n"
1686
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1687
"Last-Translator: test <foo@bar.xx>\n"
1688
"Language-Team: C <LL@li.org>\n"
1689
"MIME-Version: 1.0\n"
1690
"Content-Transfer-Encoding: 8bit\n"
1691
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1692
AC_SUBST(MSGFMT_OPTS)
1693
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1694
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1695
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1696
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1697
return _nl_msg_cat_cntr],
1702
dnl On Solaris, if bind_textdomain_codeset is in libc,
1703
dnl GNU format message catalog is always supported,
1704
dnl since both are added to the libc all together.
1705
dnl Hence, we'd like to go with DATADIRNAME=share and
1706
dnl and CATOBJEXT=.gmo in this case.
1707
AC_CHECK_FUNC(bind_textdomain_codeset,
1722
LIBS="$glib_save_LIBS"
1725
gt_cv_have_gettext=no
1730
if test "$gt_cv_have_gettext" = "yes" ; then
1731
AC_DEFINE(ENABLE_NLS, 1,
1732
[always defined to indicate that i18n is enabled])
1735
dnl Test whether we really found GNU xgettext.
1736
if test "$XGETTEXT" != ":"; then
1737
dnl If it is not GNU xgettext we define it as : so that the
1738
dnl Makefiles still can work.
1739
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1743
[found xgettext program is not GNU xgettext; ignore it])
1748
# We need to process the po/ directory.
1752
[case "$CONFIG_FILES" in *po/Makefile.in*)
1753
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1756
dnl These rules are solely for the distribution goal. While doing this
1757
dnl we only have to keep exactly one list of the available catalogs
1758
dnl in configure.ac.
1759
for lang in $ALL_LINGUAS; do
1760
GMOFILES="$GMOFILES $lang.gmo"
1761
POFILES="$POFILES $lang.po"
1764
dnl Make all variables we use known to autoconf.
1767
AC_SUBST(DATADIRNAME)
1769
AC_SUBST(INSTOBJEXT)
1771
AC_SUBST(PO_IN_DATADIR_TRUE)
1772
AC_SUBST(PO_IN_DATADIR_FALSE)
1777
# AM_GLIB_GNU_GETTEXT
1778
# -------------------
1779
# Do checks necessary for use of gettext. If a suitable implementation
1780
# of gettext is found in either in libintl or in the C library,
1781
# it will set INTLLIBS to the libraries needed for use of gettext
1782
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1783
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1784
# on various variables needed by the Makefile.in.in installed by
1787
glib_DEFUN([GLIB_GNU_GETTEXT],
1788
[AC_REQUIRE([AC_PROG_CC])dnl
1789
AC_REQUIRE([AC_HEADER_STDC])dnl
1794
if test "$gt_cv_have_gettext" = "yes"; then
1795
if test "x$ALL_LINGUAS" = "x"; then
1798
AC_MSG_CHECKING(for catalogs to be installed)
1800
for presentlang in $ALL_LINGUAS; do
1802
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1803
desiredlanguages="$LINGUAS"
1805
desiredlanguages="$ALL_LINGUAS"
1807
for desiredlang in $desiredlanguages; do
1808
# Use the presentlang catalog if desiredlang is
1809
# a. equal to presentlang, or
1810
# b. a variant of presentlang (because in this case,
1811
# presentlang can be used as a fallback for messages
1812
# which are not translated in the desiredlang catalog).
1813
case "$desiredlang" in
1814
"$presentlang"*) useit=yes;;
1817
if test $useit = yes; then
1818
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1821
LINGUAS=$NEW_LINGUAS
1822
AC_MSG_RESULT($LINGUAS)
1825
dnl Construct list of names of catalog files to be constructed.
1826
if test -n "$LINGUAS"; then
1827
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1831
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1832
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1833
dnl Try to locate is.
1835
if test -n "$ac_aux_dir"; then
1836
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1838
if test -z "$MKINSTALLDIRS"; then
1839
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1841
AC_SUBST(MKINSTALLDIRS)
1843
dnl Generate list of files to be processed by xgettext which will
1844
dnl be included in po/Makefile.
1845
test -d po || mkdir po
1846
if test "x$srcdir" != "x."; then
1847
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1848
posrcprefix="$srcdir/"
1850
posrcprefix="../$srcdir/"
1856
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1857
< $srcdir/po/POTFILES.in > po/POTFILES
1860
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1861
# -------------------------------
1862
# Define VARIABLE to the location where catalog files will
1863
# be installed by po/Makefile.
1864
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1865
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1866
glib_save_prefix="$prefix"
1867
glib_save_exec_prefix="$exec_prefix"
1868
glib_save_datarootdir="$datarootdir"
1869
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1870
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1871
datarootdir=`eval echo "${datarootdir}"`
1872
if test "x$CATOBJEXT" = "x.mo" ; then
1873
localedir=`eval echo "${libdir}/locale"`
1875
localedir=`eval echo "${datadir}/locale"`
1877
prefix="$glib_save_prefix"
1878
exec_prefix="$glib_save_exec_prefix"
1879
datarootdir="$glib_save_datarootdir"
1880
AC_DEFINE_UNQUOTED($1, "$localedir",
1881
[Define the location where the catalogs will be installed])
1885
dnl Now the definitions that aclocal will find
1887
ifdef(glib_configure_ac,[],[
1888
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1889
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1892
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1894
# Create a temporary file with TEST-FILE as its contents and pass the
1895
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1896
# 0 and perform ACTION-IF-FAIL for any other exit status.
1897
AC_DEFUN([GLIB_RUN_PROG],
1898
[cat >conftest.foo <<_ACEOF
1901
if AC_RUN_LOG([$1 conftest.foo]); then
1902
m4_ifval([$3], [$3], [:])
1903
m4_ifvaln([$4], [else $4])dnl
1904
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1905
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1909
# nls.m4 serial 5 (gettext-0.18)
1910
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1912
dnl This file is free software; the Free Software Foundation
1913
dnl gives unlimited permission to copy and/or distribute it,
1914
dnl with or without modifications, as long as this notice is preserved.
1916
dnl This file can can be used in projects which are not available under
1917
dnl the GNU General Public License or the GNU Library General Public
1918
dnl License but which still want to provide support for the GNU gettext
1920
dnl Please note that the actual code of the GNU gettext library is covered
1921
dnl by the GNU Library General Public License, and the rest of the GNU
1922
dnl gettext package package is covered by the GNU General Public License.
1923
dnl They are *not* in the public domain.
1926
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1927
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1933
AC_MSG_CHECKING([whether NLS is requested])
1934
dnl Default is enabled NLS
1935
AC_ARG_ENABLE([nls],
1936
[ --disable-nls do not use Native Language Support],
1937
USE_NLS=$enableval, USE_NLS=yes)
1938
AC_MSG_RESULT([$USE_NLS])
1942
1994
m4_include([m4/as-compiler-flag.m4])
1943
1995
m4_include([m4/evo_krb5_support.m4])
1944
1996
m4_include([m4/evo_ldap_check.m4])