19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
23
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
24
dnl (i.e. pass to gconftool-2
25
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
26
dnl you should install foo.schemas files
29
AC_DEFUN([AM_GCONF_SOURCE_2],
31
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
32
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
34
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
37
AC_ARG_WITH([gconf-source],
38
AC_HELP_STRING([--with-gconf-source=sourceaddress],
39
[Config database for installing schema files.]),
40
[GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
42
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
43
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
45
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
46
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
49
AC_ARG_WITH([gconf-schema-file-dir],
50
AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
51
[Directory for installing schema files.]),
52
[GCONF_SCHEMA_FILE_DIR="$withval"],)
54
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
55
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
57
AC_ARG_ENABLE(schemas-install,
58
AC_HELP_STRING([--disable-schemas-install],
59
[Disable the schemas installation]),
62
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
64
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
67
# Configure paths for GLIB
68
# Owen Taylor 1997-2001
70
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
71
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
72
dnl gthread, or gio is specified in MODULES, pass to pkg-config
74
AC_DEFUN([AM_PATH_GLIB_2_0],
76
dnl Get the cflags and libraries from pkg-config
78
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
79
, enable_glibtest=yes)
81
pkg_config_args=glib-2.0
86
pkg_config_args="$pkg_config_args gmodule-2.0"
89
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
92
pkg_config_args="$pkg_config_args gobject-2.0"
95
pkg_config_args="$pkg_config_args gthread-2.0"
98
pkg_config_args="$pkg_config_args $module-2.0"
103
PKG_PROG_PKG_CONFIG([0.16])
107
if test "x$PKG_CONFIG" = x ; then
112
min_glib_version=ifelse([$1], ,2.0.0,$1)
113
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
115
if test x$PKG_CONFIG != xno ; then
116
## don't try to run the test against uninstalled libtool libs
117
if $PKG_CONFIG --uninstalled $pkg_config_args; then
118
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
122
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
129
if test x"$no_glib" = x ; then
130
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
131
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
132
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
134
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
135
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
136
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
137
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
138
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
139
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
140
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
141
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
142
if test "x$enable_glibtest" = "xyes" ; then
143
ac_save_CFLAGS="$CFLAGS"
145
CFLAGS="$CFLAGS $GLIB_CFLAGS"
146
LIBS="$GLIB_LIBS $LIBS"
148
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
149
dnl checks the results of pkg-config to some extent)
160
int major, minor, micro;
164
ignored = system ("touch conf.glibtest");
166
/* HP/UX 9 (%@#!) writes to sscanf strings */
167
tmp_version = g_strdup("$min_glib_version");
168
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
169
printf("%s, bad version string\n", "$min_glib_version");
173
if ((glib_major_version != $glib_config_major_version) ||
174
(glib_minor_version != $glib_config_minor_version) ||
175
(glib_micro_version != $glib_config_micro_version))
177
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
178
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
179
glib_major_version, glib_minor_version, glib_micro_version);
180
printf ("*** was found! If pkg-config was correct, then it is best\n");
181
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
182
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
183
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
184
printf("*** required on your system.\n");
185
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
186
printf("*** to point to the correct configuration files\n");
188
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
189
(glib_minor_version != GLIB_MINOR_VERSION) ||
190
(glib_micro_version != GLIB_MICRO_VERSION))
192
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
193
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
194
printf("*** library (version %d.%d.%d)\n",
195
glib_major_version, glib_minor_version, glib_micro_version);
199
if ((glib_major_version > major) ||
200
((glib_major_version == major) && (glib_minor_version > minor)) ||
201
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
207
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
208
glib_major_version, glib_minor_version, glib_micro_version);
209
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
210
major, minor, micro);
211
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
213
printf("*** If you have already installed a sufficiently new version, this error\n");
214
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
215
printf("*** being found. The easiest way to fix this is to remove the old version\n");
216
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
217
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
218
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
219
printf("*** so that the correct libraries are found at run-time))\n");
224
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
225
CFLAGS="$ac_save_CFLAGS"
229
if test "x$no_glib" = x ; then
230
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
231
ifelse([$2], , :, [$2])
234
if test "$PKG_CONFIG" = "no" ; then
235
echo "*** A new enough version of pkg-config was not found."
236
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
238
if test -f conf.glibtest ; then
241
echo "*** Could not run GLIB test program, checking why..."
242
ac_save_CFLAGS="$CFLAGS"
244
CFLAGS="$CFLAGS $GLIB_CFLAGS"
245
LIBS="$LIBS $GLIB_LIBS"
249
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
250
[ echo "*** The test program compiled, but did not run. This usually means"
251
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
252
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
253
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
254
echo "*** to the installed location Also, make sure you have run ldconfig if that"
255
echo "*** is required on your system"
257
echo "*** If you have an old version installed, it is best to remove it, although"
258
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
259
[ echo "*** The test program failed to compile or link. See the file config.log for the"
260
echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
261
CFLAGS="$ac_save_CFLAGS"
270
ifelse([$3], , :, [$3])
272
AC_SUBST(GLIB_CFLAGS)
274
AC_SUBST(GLIB_GENMARSHAL)
275
AC_SUBST(GOBJECT_QUERY)
276
AC_SUBST(GLIB_MKENUMS)
280
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
281
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
283
# This file is free software, distributed under the terms of the GNU
284
# General Public License. As a special exception to the GNU General
285
# Public License, this file may be distributed as part of a program
286
# that contains a configuration script generated by Autoconf, under
287
# the same distribution terms as the rest of that program.
289
# This file can be copied and used freely without restrictions. It can
290
# be used in projects which are not available under the GNU Public License
291
# but which still want to provide support for the GNU gettext functionality.
293
# Macro to add for using GNU gettext.
294
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
296
# Modified to never use included libintl.
297
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
299
# Major rework to remove unused code
300
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
302
# Added better handling of ALL_LINGUAS from GNU gettext version
303
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
305
# Modified to require ngettext
306
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
308
# We need this here as well, since someone might use autoconf-2.5x
309
# to configure GLib then an older version to configure a package
310
# using AM_GLIB_GNU_GETTEXT
314
dnl We go to great lengths to make sure that aclocal won't
315
dnl try to pull in the installed version of these macros
316
dnl when running aclocal in the glib directory.
318
m4_copy([AC_DEFUN],[glib_DEFUN])
319
m4_copy([AC_REQUIRE],[glib_REQUIRE])
321
dnl At the end, if we're not within glib, we'll define the public
322
dnl definitions in terms of our private definitions.
326
#--------------------
327
glib_DEFUN([GLIB_LC_MESSAGES],
328
[AC_CHECK_HEADERS([locale.h])
329
if test $ac_cv_header_locale_h = yes; then
330
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
331
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
332
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
333
if test $am_cv_val_LC_MESSAGES = yes; then
334
AC_DEFINE(HAVE_LC_MESSAGES, 1,
335
[Define if your <locale.h> file defines LC_MESSAGES.])
339
# GLIB_PATH_PROG_WITH_TEST
340
#----------------------------
341
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
342
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
343
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
344
[# Extract the first word of "$2", so it can be a program name with args.
345
set dummy $2; ac_word=[$]2
346
AC_MSG_CHECKING([for $ac_word])
347
AC_CACHE_VAL(ac_cv_path_$1,
350
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
353
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
354
for ac_dir in ifelse([$5], , $PATH, [$5]); do
355
test -z "$ac_dir" && ac_dir=.
356
if test -f $ac_dir/$ac_word; then
358
ac_cv_path_$1="$ac_dir/$ac_word"
364
dnl If no 4th arg is given, leave the cache variable unset,
365
dnl so AC_PATH_PROGS will keep looking.
366
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
371
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
381
glib_DEFUN([GLIB_WITH_NLS],
382
dnl NLS is obligatory
386
gt_cv_have_gettext=no
392
AC_CHECK_HEADER(libintl.h,
393
[gt_cv_func_dgettext_libintl="no"
394
libintl_extra_libs=""
397
# First check in libc
399
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
403
[return !ngettext ("","", 1)],
404
gt_cv_func_ngettext_libc=yes,
405
gt_cv_func_ngettext_libc=no)
408
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
409
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
413
[return !dgettext ("","")],
414
gt_cv_func_dgettext_libc=yes,
415
gt_cv_func_dgettext_libc=no)
419
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
420
AC_CHECK_FUNCS(bind_textdomain_codeset)
424
# If we don't have everything we want, check in libintl
426
if test "$gt_cv_func_dgettext_libc" != "yes" \
427
|| test "$gt_cv_func_ngettext_libc" != "yes" \
428
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
430
AC_CHECK_LIB(intl, bindtextdomain,
431
[AC_CHECK_LIB(intl, ngettext,
432
[AC_CHECK_LIB(intl, dgettext,
433
gt_cv_func_dgettext_libintl=yes)])])
435
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
436
AC_MSG_CHECKING([if -liconv is needed to use gettext])
438
AC_CHECK_LIB(intl, ngettext,
439
[AC_CHECK_LIB(intl, dcgettext,
440
[gt_cv_func_dgettext_libintl=yes
441
libintl_extra_libs=-liconv],
447
# If we found libintl, then check in it for bind_textdomain_codeset();
448
# we'll prefer libc if neither have bind_textdomain_codeset(),
449
# and both have dgettext and ngettext
451
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
452
glib_save_LIBS="$LIBS"
453
LIBS="$LIBS -lintl $libintl_extra_libs"
454
unset ac_cv_func_bind_textdomain_codeset
455
AC_CHECK_FUNCS(bind_textdomain_codeset)
456
LIBS="$glib_save_LIBS"
458
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
459
gt_cv_func_dgettext_libc=no
461
if test "$gt_cv_func_dgettext_libc" = "yes" \
462
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
463
gt_cv_func_dgettext_libintl=no
469
if test "$gt_cv_func_dgettext_libc" = "yes" \
470
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
471
gt_cv_have_gettext=yes
474
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
475
INTLLIBS="-lintl $libintl_extra_libs"
478
if test "$gt_cv_have_gettext" = "yes"; then
479
AC_DEFINE(HAVE_GETTEXT,1,
480
[Define if the GNU gettext() function is already present or preinstalled.])
481
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
482
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
483
if test "$MSGFMT" != "no"; then
484
glib_save_LIBS="$LIBS"
485
LIBS="$LIBS $INTLLIBS"
486
AC_CHECK_FUNCS(dcgettext)
488
AC_MSG_CHECKING([if msgfmt accepts -c])
489
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
492
"Content-Type: text/plain; charset=UTF-8\n"
493
"Project-Id-Version: test 1.0\n"
494
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
495
"Last-Translator: test <foo@bar.xx>\n"
496
"Language-Team: C <LL@li.org>\n"
497
"MIME-Version: 1.0\n"
498
"Content-Transfer-Encoding: 8bit\n"
499
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
500
AC_SUBST(MSGFMT_OPTS)
501
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
502
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
503
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
504
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
505
return _nl_msg_cat_cntr],
510
dnl On Solaris, if bind_textdomain_codeset is in libc,
511
dnl GNU format message catalog is always supported,
512
dnl since both are added to the libc all together.
513
dnl Hence, we'd like to go with DATADIRNAME=share and
514
dnl and CATOBJEXT=.gmo in this case.
515
AC_CHECK_FUNC(bind_textdomain_codeset,
526
LIBS="$glib_save_LIBS"
529
gt_cv_have_gettext=no
534
if test "$gt_cv_have_gettext" = "yes" ; then
535
AC_DEFINE(ENABLE_NLS, 1,
536
[always defined to indicate that i18n is enabled])
539
dnl Test whether we really found GNU xgettext.
540
if test "$XGETTEXT" != ":"; then
541
dnl If it is not GNU xgettext we define it as : so that the
542
dnl Makefiles still can work.
543
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
547
[found xgettext program is not GNU xgettext; ignore it])
552
# We need to process the po/ directory.
556
[case "$CONFIG_FILES" in *po/Makefile.in*)
557
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
560
dnl These rules are solely for the distribution goal. While doing this
561
dnl we only have to keep exactly one list of the available catalogs
563
for lang in $ALL_LINGUAS; do
564
GMOFILES="$GMOFILES $lang.gmo"
565
POFILES="$POFILES $lang.po"
568
dnl Make all variables we use known to autoconf.
571
AC_SUBST(DATADIRNAME)
575
AC_SUBST(PO_IN_DATADIR_TRUE)
576
AC_SUBST(PO_IN_DATADIR_FALSE)
581
# AM_GLIB_GNU_GETTEXT
582
# -------------------
583
# Do checks necessary for use of gettext. If a suitable implementation
584
# of gettext is found in either in libintl or in the C library,
585
# it will set INTLLIBS to the libraries needed for use of gettext
586
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
587
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
588
# on various variables needed by the Makefile.in.in installed by
591
glib_DEFUN([GLIB_GNU_GETTEXT],
592
[AC_REQUIRE([AC_PROG_CC])dnl
593
AC_REQUIRE([AC_HEADER_STDC])dnl
598
if test "$gt_cv_have_gettext" = "yes"; then
599
if test "x$ALL_LINGUAS" = "x"; then
602
AC_MSG_CHECKING(for catalogs to be installed)
604
for presentlang in $ALL_LINGUAS; do
606
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
607
desiredlanguages="$LINGUAS"
609
desiredlanguages="$ALL_LINGUAS"
611
for desiredlang in $desiredlanguages; do
612
# Use the presentlang catalog if desiredlang is
613
# a. equal to presentlang, or
614
# b. a variant of presentlang (because in this case,
615
# presentlang can be used as a fallback for messages
616
# which are not translated in the desiredlang catalog).
617
case "$desiredlang" in
618
"$presentlang"*) useit=yes;;
621
if test $useit = yes; then
622
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
626
AC_MSG_RESULT($LINGUAS)
629
dnl Construct list of names of catalog files to be constructed.
630
if test -n "$LINGUAS"; then
631
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
635
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
636
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
637
dnl Try to locate is.
639
if test -n "$ac_aux_dir"; then
640
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
642
if test -z "$MKINSTALLDIRS"; then
643
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
645
AC_SUBST(MKINSTALLDIRS)
647
dnl Generate list of files to be processed by xgettext which will
648
dnl be included in po/Makefile.
649
test -d po || mkdir po
650
if test "x$srcdir" != "x."; then
651
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
652
posrcprefix="$srcdir/"
654
posrcprefix="../$srcdir/"
660
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
661
< $srcdir/po/POTFILES.in > po/POTFILES
664
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
665
# -------------------------------
666
# Define VARIABLE to the location where catalog files will
667
# be installed by po/Makefile.
668
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
669
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
670
glib_save_prefix="$prefix"
671
glib_save_exec_prefix="$exec_prefix"
672
glib_save_datarootdir="$datarootdir"
673
test "x$prefix" = xNONE && prefix=$ac_default_prefix
674
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
675
datarootdir=`eval echo "${datarootdir}"`
676
if test "x$CATOBJEXT" = "x.mo" ; then
677
localedir=`eval echo "${libdir}/locale"`
679
localedir=`eval echo "${datadir}/locale"`
681
prefix="$glib_save_prefix"
682
exec_prefix="$glib_save_exec_prefix"
683
datarootdir="$glib_save_datarootdir"
684
AC_DEFINE_UNQUOTED($1, "$localedir",
685
[Define the location where the catalogs will be installed])
689
dnl Now the definitions that aclocal will find
691
ifdef(glib_configure_in,[],[
692
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
693
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
696
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
698
# Create a temporary file with TEST-FILE as its contents and pass the
699
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
700
# 0 and perform ACTION-IF-FAIL for any other exit status.
701
AC_DEFUN([GLIB_RUN_PROG],
702
[cat >conftest.foo <<_ACEOF
705
if AC_RUN_LOG([$1 conftest.foo]); then
706
m4_ifval([$3], [$3], [:])
707
m4_ifvaln([$4], [else $4])dnl
708
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
709
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
716
dnl GNOME_COMMON_INIT
718
AC_DEFUN([GNOME_COMMON_INIT],
720
dnl this macro should come after AC_CONFIG_MACRO_DIR
721
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
723
dnl ensure that when the Automake generated makefile calls aclocal,
724
dnl it honours the $ACLOCAL_FLAGS environment variable
725
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
726
if test -n "$ac_macro_dir"; then
727
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
730
AC_SUBST([ACLOCAL_AMFLAGS])
733
AC_DEFUN([GNOME_DEBUG_CHECK],
735
AC_ARG_ENABLE([debug],
736
AC_HELP_STRING([--enable-debug],
737
[turn on debugging]),,
740
if test x$enable_debug = xyes ; then
741
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
742
[Enable additional debugging at the expense of performance and size])
746
dnl GNOME_MAINTAINER_MODE_DEFINES ()
747
dnl define DISABLE_DEPRECATED
749
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
751
AC_REQUIRE([AM_MAINTAINER_MODE])
753
DISABLE_DEPRECATED=""
754
if test $USE_MAINTAINER_MODE = yes; then
755
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
756
for DOMAIN in $DOMAINS; do
757
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
761
AC_SUBST(DISABLE_DEPRECATED)
764
dnl GNOME_COMPILE_WARNINGS
765
dnl Turn on many useful compiler warnings
766
dnl For now, only works on GCC
767
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
768
dnl ******************************
769
dnl More compiler warnings
770
dnl ******************************
772
AC_ARG_ENABLE(compile-warnings,
773
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
774
[Turn on compiler warnings]),,
775
[enable_compile_warnings="m4_default([$1],[yes])"])
778
if test "x$GCC" != xyes; then
779
enable_compile_warnings=no
783
realsave_CFLAGS="$CFLAGS"
785
case "$enable_compile_warnings" in
790
warning_flags="-Wall"
793
warning_flags="-Wall -Wmissing-prototypes"
796
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
797
CFLAGS="$warning_flags $CFLAGS"
798
for option in -Wno-sign-compare; do
799
SAVE_CFLAGS="$CFLAGS"
800
CFLAGS="$CFLAGS $option"
801
AC_MSG_CHECKING([whether gcc understands $option])
802
AC_TRY_COMPILE([], [],
805
CFLAGS="$SAVE_CFLAGS"
806
AC_MSG_RESULT($has_option)
807
if test $has_option = yes; then
808
warning_flags="$warning_flags $option"
814
if test "$enable_compile_warnings" = "error" ; then
815
warning_flags="$warning_flags -Werror"
819
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
822
CFLAGS="$realsave_CFLAGS"
823
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
824
AC_MSG_RESULT($warning_flags)
827
AC_HELP_STRING([--enable-iso-c],
828
[Try to warn if code is not ISO C ]),,
831
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
833
if test "x$enable_iso_c" != "xno"; then
834
if test "x$GCC" = "xyes"; then
836
*[\ \ ]-ansi[\ \ ]*) ;;
837
*) complCFLAGS="$complCFLAGS -ansi" ;;
840
*[\ \ ]-pedantic[\ \ ]*) ;;
841
*) complCFLAGS="$complCFLAGS -pedantic" ;;
845
AC_MSG_RESULT($complCFLAGS)
847
WARN_CFLAGS="$warning_flags $complCFLAGS"
848
AC_SUBST(WARN_CFLAGS)
851
dnl For C++, do basically the same thing.
853
AC_DEFUN([GNOME_CXX_WARNINGS],[
854
AC_ARG_ENABLE(cxx-warnings,
855
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
856
[Turn on compiler warnings.]),,
857
[enable_cxx_warnings="m4_default([$1],[minimum])"])
859
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
861
if test "x$GXX" != xyes; then
862
enable_cxx_warnings=no
864
if test "x$enable_cxx_warnings" != "xno"; then
865
if test "x$GXX" = "xyes"; then
866
case " $CXXFLAGS " in
867
*[\ \ ]-Wall[\ \ ]*) ;;
868
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
871
## -W is not all that useful. And it cannot be controlled
872
## with individual -Wno-xxx flags, unlike -Wall
873
if test "x$enable_cxx_warnings" = "xyes"; then
874
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
878
AC_MSG_RESULT($warnCXXFLAGS)
880
AC_ARG_ENABLE(iso-cxx,
881
AC_HELP_STRING([--enable-iso-cxx],
882
[Try to warn if code is not ISO C++ ]),,
885
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
887
if test "x$enable_iso_cxx" != "xno"; then
888
if test "x$GXX" = "xyes"; then
889
case " $CXXFLAGS " in
890
*[\ \ ]-ansi[\ \ ]*) ;;
891
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
894
case " $CXXFLAGS " in
895
*[\ \ ]-pedantic[\ \ ]*) ;;
896
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
900
AC_MSG_RESULT($complCXXFLAGS)
902
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
903
AC_SUBST(WARN_CXXFLAGS)
906
22
# nls.m4 serial 3 (gettext-0.15)
907
23
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
908
24
dnl This file is free software; the Free Software Foundation
2326
1442
AC_SUBST([am__untar])
2327
1443
]) # _AM_PROG_TAR
1445
dnl AM_GCONF_SOURCE_2
1446
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
1447
dnl (i.e. pass to gconftool-2
1448
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
1449
dnl you should install foo.schemas files
1452
AC_DEFUN([AM_GCONF_SOURCE_2],
1454
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
1455
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
1457
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
1460
AC_ARG_WITH([gconf-source],
1461
AC_HELP_STRING([--with-gconf-source=sourceaddress],
1462
[Config database for installing schema files.]),
1463
[GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
1465
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
1466
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
1468
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
1469
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
1472
AC_ARG_WITH([gconf-schema-file-dir],
1473
AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
1474
[Directory for installing schema files.]),
1475
[GCONF_SCHEMA_FILE_DIR="$withval"],)
1477
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
1478
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
1480
AC_ARG_ENABLE(schemas-install,
1481
AC_HELP_STRING([--disable-schemas-install],
1482
[Disable the schemas installation]),
1483
[case ${enableval} in
1485
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
1487
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
1490
# Configure paths for GLIB
1491
# Owen Taylor 1997-2001
1493
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1494
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
1495
dnl gthread, or gio is specified in MODULES, pass to pkg-config
1497
AC_DEFUN([AM_PATH_GLIB_2_0],
1499
dnl Get the cflags and libraries from pkg-config
1501
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
1502
, enable_glibtest=yes)
1504
pkg_config_args=glib-2.0
1509
pkg_config_args="$pkg_config_args gmodule-2.0"
1512
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
1515
pkg_config_args="$pkg_config_args gobject-2.0"
1518
pkg_config_args="$pkg_config_args gthread-2.0"
1521
pkg_config_args="$pkg_config_args $module-2.0"
1526
PKG_PROG_PKG_CONFIG([0.16])
1530
if test "x$PKG_CONFIG" = x ; then
1535
min_glib_version=ifelse([$1], ,2.0.0,$1)
1536
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
1538
if test x$PKG_CONFIG != xno ; then
1539
## don't try to run the test against uninstalled libtool libs
1540
if $PKG_CONFIG --uninstalled $pkg_config_args; then
1541
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
1545
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
1552
if test x"$no_glib" = x ; then
1553
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
1554
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
1555
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
1557
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
1558
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
1559
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
1560
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1561
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
1562
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1563
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
1564
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1565
if test "x$enable_glibtest" = "xyes" ; then
1566
ac_save_CFLAGS="$CFLAGS"
1567
ac_save_LIBS="$LIBS"
1568
CFLAGS="$CFLAGS $GLIB_CFLAGS"
1569
LIBS="$GLIB_LIBS $LIBS"
1571
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
1572
dnl checks the results of pkg-config to some extent)
1583
int major, minor, micro;
1586
fclose (fopen ("conf.glibtest", "w"));
1588
/* HP/UX 9 (%@#!) writes to sscanf strings */
1589
tmp_version = g_strdup("$min_glib_version");
1590
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1591
printf("%s, bad version string\n", "$min_glib_version");
1595
if ((glib_major_version != $glib_config_major_version) ||
1596
(glib_minor_version != $glib_config_minor_version) ||
1597
(glib_micro_version != $glib_config_micro_version))
1599
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
1600
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
1601
glib_major_version, glib_minor_version, glib_micro_version);
1602
printf ("*** was found! If pkg-config was correct, then it is best\n");
1603
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
1604
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1605
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1606
printf("*** required on your system.\n");
1607
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
1608
printf("*** to point to the correct configuration files\n");
1610
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
1611
(glib_minor_version != GLIB_MINOR_VERSION) ||
1612
(glib_micro_version != GLIB_MICRO_VERSION))
1614
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
1615
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
1616
printf("*** library (version %d.%d.%d)\n",
1617
glib_major_version, glib_minor_version, glib_micro_version);
1621
if ((glib_major_version > major) ||
1622
((glib_major_version == major) && (glib_minor_version > minor)) ||
1623
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
1629
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
1630
glib_major_version, glib_minor_version, glib_micro_version);
1631
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
1632
major, minor, micro);
1633
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
1635
printf("*** If you have already installed a sufficiently new version, this error\n");
1636
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
1637
printf("*** being found. The easiest way to fix this is to remove the old version\n");
1638
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
1639
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
1640
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1641
printf("*** so that the correct libraries are found at run-time))\n");
1646
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1647
CFLAGS="$ac_save_CFLAGS"
1648
LIBS="$ac_save_LIBS"
1651
if test "x$no_glib" = x ; then
1652
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
1653
ifelse([$2], , :, [$2])
1656
if test "$PKG_CONFIG" = "no" ; then
1657
echo "*** A new enough version of pkg-config was not found."
1658
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
1660
if test -f conf.glibtest ; then
1663
echo "*** Could not run GLIB test program, checking why..."
1664
ac_save_CFLAGS="$CFLAGS"
1665
ac_save_LIBS="$LIBS"
1666
CFLAGS="$CFLAGS $GLIB_CFLAGS"
1667
LIBS="$LIBS $GLIB_LIBS"
1671
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
1672
[ echo "*** The test program compiled, but did not run. This usually means"
1673
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
1674
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
1675
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1676
echo "*** to the installed location Also, make sure you have run ldconfig if that"
1677
echo "*** is required on your system"
1679
echo "*** If you have an old version installed, it is best to remove it, although"
1680
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1681
[ echo "*** The test program failed to compile or link. See the file config.log for the"
1682
echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
1683
CFLAGS="$ac_save_CFLAGS"
1684
LIBS="$ac_save_LIBS"
1692
ifelse([$3], , :, [$3])
1694
AC_SUBST(GLIB_CFLAGS)
1696
AC_SUBST(GLIB_GENMARSHAL)
1697
AC_SUBST(GOBJECT_QUERY)
1698
AC_SUBST(GLIB_MKENUMS)
1702
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1703
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1705
# This file is free software, distributed under the terms of the GNU
1706
# General Public License. As a special exception to the GNU General
1707
# Public License, this file may be distributed as part of a program
1708
# that contains a configuration script generated by Autoconf, under
1709
# the same distribution terms as the rest of that program.
1711
# This file can be copied and used freely without restrictions. It can
1712
# be used in projects which are not available under the GNU Public License
1713
# but which still want to provide support for the GNU gettext functionality.
1715
# Macro to add for using GNU gettext.
1716
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1718
# Modified to never use included libintl.
1719
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1721
# Major rework to remove unused code
1722
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1724
# Added better handling of ALL_LINGUAS from GNU gettext version
1725
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1727
# Modified to require ngettext
1728
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1730
# We need this here as well, since someone might use autoconf-2.5x
1731
# to configure GLib then an older version to configure a package
1732
# using AM_GLIB_GNU_GETTEXT
1736
dnl We go to great lengths to make sure that aclocal won't
1737
dnl try to pull in the installed version of these macros
1738
dnl when running aclocal in the glib directory.
1740
m4_copy([AC_DEFUN],[glib_DEFUN])
1741
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1743
dnl At the end, if we're not within glib, we'll define the public
1744
dnl definitions in terms of our private definitions.
1748
#--------------------
1749
glib_DEFUN([GLIB_LC_MESSAGES],
1750
[AC_CHECK_HEADERS([locale.h])
1751
if test $ac_cv_header_locale_h = yes; then
1752
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1753
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1754
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1755
if test $am_cv_val_LC_MESSAGES = yes; then
1756
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1757
[Define if your <locale.h> file defines LC_MESSAGES.])
1761
# GLIB_PATH_PROG_WITH_TEST
1762
#----------------------------
1763
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1764
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1765
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1766
[# Extract the first word of "$2", so it can be a program name with args.
1767
set dummy $2; ac_word=[$]2
1768
AC_MSG_CHECKING([for $ac_word])
1769
AC_CACHE_VAL(ac_cv_path_$1,
1772
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1775
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1776
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1777
test -z "$ac_dir" && ac_dir=.
1778
if test -f $ac_dir/$ac_word; then
1780
ac_cv_path_$1="$ac_dir/$ac_word"
1786
dnl If no 4th arg is given, leave the cache variable unset,
1787
dnl so AC_PATH_PROGS will keep looking.
1788
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1793
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1794
AC_MSG_RESULT([$]$1)
1803
glib_DEFUN([GLIB_WITH_NLS],
1804
dnl NLS is obligatory
1808
gt_cv_have_gettext=no
1814
AC_CHECK_HEADER(libintl.h,
1815
[gt_cv_func_dgettext_libintl="no"
1816
libintl_extra_libs=""
1819
# First check in libc
1821
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1823
#include <libintl.h>
1825
[return !ngettext ("","", 1)],
1826
gt_cv_func_ngettext_libc=yes,
1827
gt_cv_func_ngettext_libc=no)
1830
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1831
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1833
#include <libintl.h>
1835
[return !dgettext ("","")],
1836
gt_cv_func_dgettext_libc=yes,
1837
gt_cv_func_dgettext_libc=no)
1841
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1842
AC_CHECK_FUNCS(bind_textdomain_codeset)
1846
# If we don't have everything we want, check in libintl
1848
if test "$gt_cv_func_dgettext_libc" != "yes" \
1849
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1850
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1852
AC_CHECK_LIB(intl, bindtextdomain,
1853
[AC_CHECK_LIB(intl, ngettext,
1854
[AC_CHECK_LIB(intl, dgettext,
1855
gt_cv_func_dgettext_libintl=yes)])])
1857
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1858
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1860
AC_CHECK_LIB(intl, ngettext,
1861
[AC_CHECK_LIB(intl, dcgettext,
1862
[gt_cv_func_dgettext_libintl=yes
1863
libintl_extra_libs=-liconv],
1869
# If we found libintl, then check in it for bind_textdomain_codeset();
1870
# we'll prefer libc if neither have bind_textdomain_codeset(),
1871
# and both have dgettext and ngettext
1873
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1874
glib_save_LIBS="$LIBS"
1875
LIBS="$LIBS -lintl $libintl_extra_libs"
1876
unset ac_cv_func_bind_textdomain_codeset
1877
AC_CHECK_FUNCS(bind_textdomain_codeset)
1878
LIBS="$glib_save_LIBS"
1880
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1881
gt_cv_func_dgettext_libc=no
1883
if test "$gt_cv_func_dgettext_libc" = "yes" \
1884
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1885
gt_cv_func_dgettext_libintl=no
1891
if test "$gt_cv_func_dgettext_libc" = "yes" \
1892
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1893
gt_cv_have_gettext=yes
1896
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1897
INTLLIBS="-lintl $libintl_extra_libs"
1900
if test "$gt_cv_have_gettext" = "yes"; then
1901
AC_DEFINE(HAVE_GETTEXT,1,
1902
[Define if the GNU gettext() function is already present or preinstalled.])
1903
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1904
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1905
if test "$MSGFMT" != "no"; then
1906
glib_save_LIBS="$LIBS"
1907
LIBS="$LIBS $INTLLIBS"
1908
AC_CHECK_FUNCS(dcgettext)
1910
AC_MSG_CHECKING([if msgfmt accepts -c])
1911
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1914
"Content-Type: text/plain; charset=UTF-8\n"
1915
"Project-Id-Version: test 1.0\n"
1916
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1917
"Last-Translator: test <foo@bar.xx>\n"
1918
"Language-Team: C <LL@li.org>\n"
1919
"MIME-Version: 1.0\n"
1920
"Content-Transfer-Encoding: 8bit\n"
1921
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1922
AC_SUBST(MSGFMT_OPTS)
1923
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1924
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1925
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1926
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1927
return _nl_msg_cat_cntr],
1932
dnl On Solaris, if bind_textdomain_codeset is in libc,
1933
dnl GNU format message catalog is always supported,
1934
dnl since both are added to the libc all together.
1935
dnl Hence, we'd like to go with DATADIRNAME=share and
1936
dnl and CATOBJEXT=.gmo in this case.
1937
AC_CHECK_FUNC(bind_textdomain_codeset,
1948
LIBS="$glib_save_LIBS"
1951
gt_cv_have_gettext=no
1956
if test "$gt_cv_have_gettext" = "yes" ; then
1957
AC_DEFINE(ENABLE_NLS, 1,
1958
[always defined to indicate that i18n is enabled])
1961
dnl Test whether we really found GNU xgettext.
1962
if test "$XGETTEXT" != ":"; then
1963
dnl If it is not GNU xgettext we define it as : so that the
1964
dnl Makefiles still can work.
1965
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1969
[found xgettext program is not GNU xgettext; ignore it])
1974
# We need to process the po/ directory.
1978
[case "$CONFIG_FILES" in *po/Makefile.in*)
1979
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1982
dnl These rules are solely for the distribution goal. While doing this
1983
dnl we only have to keep exactly one list of the available catalogs
1984
dnl in configure.in.
1985
for lang in $ALL_LINGUAS; do
1986
GMOFILES="$GMOFILES $lang.gmo"
1987
POFILES="$POFILES $lang.po"
1990
dnl Make all variables we use known to autoconf.
1993
AC_SUBST(DATADIRNAME)
1995
AC_SUBST(INSTOBJEXT)
1997
AC_SUBST(PO_IN_DATADIR_TRUE)
1998
AC_SUBST(PO_IN_DATADIR_FALSE)
2003
# AM_GLIB_GNU_GETTEXT
2004
# -------------------
2005
# Do checks necessary for use of gettext. If a suitable implementation
2006
# of gettext is found in either in libintl or in the C library,
2007
# it will set INTLLIBS to the libraries needed for use of gettext
2008
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
2009
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
2010
# on various variables needed by the Makefile.in.in installed by
2013
glib_DEFUN([GLIB_GNU_GETTEXT],
2014
[AC_REQUIRE([AC_PROG_CC])dnl
2015
AC_REQUIRE([AC_HEADER_STDC])dnl
2020
if test "$gt_cv_have_gettext" = "yes"; then
2021
if test "x$ALL_LINGUAS" = "x"; then
2024
AC_MSG_CHECKING(for catalogs to be installed)
2026
for presentlang in $ALL_LINGUAS; do
2028
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
2029
desiredlanguages="$LINGUAS"
2031
desiredlanguages="$ALL_LINGUAS"
2033
for desiredlang in $desiredlanguages; do
2034
# Use the presentlang catalog if desiredlang is
2035
# a. equal to presentlang, or
2036
# b. a variant of presentlang (because in this case,
2037
# presentlang can be used as a fallback for messages
2038
# which are not translated in the desiredlang catalog).
2039
case "$desiredlang" in
2040
"$presentlang"*) useit=yes;;
2043
if test $useit = yes; then
2044
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
2047
LINGUAS=$NEW_LINGUAS
2048
AC_MSG_RESULT($LINGUAS)
2051
dnl Construct list of names of catalog files to be constructed.
2052
if test -n "$LINGUAS"; then
2053
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2057
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2058
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
2059
dnl Try to locate is.
2061
if test -n "$ac_aux_dir"; then
2062
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
2064
if test -z "$MKINSTALLDIRS"; then
2065
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2067
AC_SUBST(MKINSTALLDIRS)
2069
dnl Generate list of files to be processed by xgettext which will
2070
dnl be included in po/Makefile.
2071
test -d po || mkdir po
2072
if test "x$srcdir" != "x."; then
2073
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
2074
posrcprefix="$srcdir/"
2076
posrcprefix="../$srcdir/"
2082
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
2083
< $srcdir/po/POTFILES.in > po/POTFILES
2086
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
2087
# -------------------------------
2088
# Define VARIABLE to the location where catalog files will
2089
# be installed by po/Makefile.
2090
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
2091
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
2092
glib_save_prefix="$prefix"
2093
glib_save_exec_prefix="$exec_prefix"
2094
glib_save_datarootdir="$datarootdir"
2095
test "x$prefix" = xNONE && prefix=$ac_default_prefix
2096
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
2097
datarootdir=`eval echo "${datarootdir}"`
2098
if test "x$CATOBJEXT" = "x.mo" ; then
2099
localedir=`eval echo "${libdir}/locale"`
2101
localedir=`eval echo "${datadir}/locale"`
2103
prefix="$glib_save_prefix"
2104
exec_prefix="$glib_save_exec_prefix"
2105
datarootdir="$glib_save_datarootdir"
2106
AC_DEFINE_UNQUOTED($1, "$localedir",
2107
[Define the location where the catalogs will be installed])
2111
dnl Now the definitions that aclocal will find
2113
ifdef(glib_configure_in,[],[
2114
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
2115
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
2118
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
2120
# Create a temporary file with TEST-FILE as its contents and pass the
2121
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
2122
# 0 and perform ACTION-IF-FAIL for any other exit status.
2123
AC_DEFUN([GLIB_RUN_PROG],
2124
[cat >conftest.foo <<_ACEOF
2127
if AC_RUN_LOG([$1 conftest.foo]); then
2128
m4_ifval([$3], [$3], [:])
2129
m4_ifvaln([$4], [else $4])dnl
2130
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
2131
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
2138
dnl GNOME_COMMON_INIT
2140
AC_DEFUN([GNOME_COMMON_INIT],
2142
dnl this macro should come after AC_CONFIG_MACRO_DIR
2143
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
2145
dnl ensure that when the Automake generated makefile calls aclocal,
2146
dnl it honours the $ACLOCAL_FLAGS environment variable
2147
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
2148
if test -n "$ac_macro_dir"; then
2149
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
2152
AC_SUBST([ACLOCAL_AMFLAGS])
2155
AC_DEFUN([GNOME_DEBUG_CHECK],
2157
AC_ARG_ENABLE([debug],
2158
AC_HELP_STRING([--enable-debug],
2159
[turn on debugging]),,
2162
if test x$enable_debug = xyes ; then
2163
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
2164
[Enable additional debugging at the expense of performance and size])
2168
dnl GNOME_MAINTAINER_MODE_DEFINES ()
2169
dnl define DISABLE_DEPRECATED
2171
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
2173
AC_REQUIRE([AM_MAINTAINER_MODE])
2175
DISABLE_DEPRECATED=""
2176
if test $USE_MAINTAINER_MODE = yes; then
2177
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
2178
for DOMAIN in $DOMAINS; do
2179
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
2183
AC_SUBST(DISABLE_DEPRECATED)
2186
dnl GNOME_COMPILE_WARNINGS
2187
dnl Turn on many useful compiler warnings
2188
dnl For now, only works on GCC
2189
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
2190
dnl ******************************
2191
dnl More compiler warnings
2192
dnl ******************************
2194
AC_ARG_ENABLE(compile-warnings,
2195
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
2196
[Turn on compiler warnings]),,
2197
[enable_compile_warnings="m4_default([$1],[yes])"])
2200
if test "x$GCC" != xyes; then
2201
enable_compile_warnings=no
2205
realsave_CFLAGS="$CFLAGS"
2207
case "$enable_compile_warnings" in
2212
warning_flags="-Wall"
2215
warning_flags="-Wall -Wmissing-prototypes"
2218
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
2219
CFLAGS="$warning_flags $CFLAGS"
2220
for option in -Wno-sign-compare; do
2221
SAVE_CFLAGS="$CFLAGS"
2222
CFLAGS="$CFLAGS $option"
2223
AC_MSG_CHECKING([whether gcc understands $option])
2224
AC_TRY_COMPILE([], [],
2227
CFLAGS="$SAVE_CFLAGS"
2228
AC_MSG_RESULT($has_option)
2229
if test $has_option = yes; then
2230
warning_flags="$warning_flags $option"
2236
if test "$enable_compile_warnings" = "error" ; then
2237
warning_flags="$warning_flags -Werror"
2241
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
2244
CFLAGS="$realsave_CFLAGS"
2245
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
2246
AC_MSG_RESULT($warning_flags)
2248
AC_ARG_ENABLE(iso-c,
2249
AC_HELP_STRING([--enable-iso-c],
2250
[Try to warn if code is not ISO C ]),,
2253
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
2255
if test "x$enable_iso_c" != "xno"; then
2256
if test "x$GCC" = "xyes"; then
2258
*[\ \ ]-ansi[\ \ ]*) ;;
2259
*) complCFLAGS="$complCFLAGS -ansi" ;;
2262
*[\ \ ]-pedantic[\ \ ]*) ;;
2263
*) complCFLAGS="$complCFLAGS -pedantic" ;;
2267
AC_MSG_RESULT($complCFLAGS)
2269
WARN_CFLAGS="$warning_flags $complCFLAGS"
2270
AC_SUBST(WARN_CFLAGS)
2273
dnl For C++, do basically the same thing.
2275
AC_DEFUN([GNOME_CXX_WARNINGS],[
2276
AC_ARG_ENABLE(cxx-warnings,
2277
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
2278
[Turn on compiler warnings.]),,
2279
[enable_cxx_warnings="m4_default([$1],[minimum])"])
2281
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
2283
if test "x$GXX" != xyes; then
2284
enable_cxx_warnings=no
2286
if test "x$enable_cxx_warnings" != "xno"; then
2287
if test "x$GXX" = "xyes"; then
2288
case " $CXXFLAGS " in
2289
*[\ \ ]-Wall[\ \ ]*) ;;
2290
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
2293
## -W is not all that useful. And it cannot be controlled
2294
## with individual -Wno-xxx flags, unlike -Wall
2295
if test "x$enable_cxx_warnings" = "xyes"; then
2296
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
2300
AC_MSG_RESULT($warnCXXFLAGS)
2302
AC_ARG_ENABLE(iso-cxx,
2303
AC_HELP_STRING([--enable-iso-cxx],
2304
[Try to warn if code is not ISO C++ ]),,
2305
[enable_iso_cxx=no])
2307
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
2309
if test "x$enable_iso_cxx" != "xno"; then
2310
if test "x$GXX" = "xyes"; then
2311
case " $CXXFLAGS " in
2312
*[\ \ ]-ansi[\ \ ]*) ;;
2313
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
2316
case " $CXXFLAGS " in
2317
*[\ \ ]-pedantic[\ \ ]*) ;;
2318
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
2322
AC_MSG_RESULT($complCXXFLAGS)
2324
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
2325
AC_SUBST(WARN_CXXFLAGS)
2329
2328
m4_include([m4/gtk-doc.m4])
2330
2329
m4_include([m4/intltool.m4])
2331
2330
m4_include([m4/libtool.m4])