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
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
68
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
70
# This file is free software, distributed under the terms of the GNU
71
# General Public License. As a special exception to the GNU General
72
# Public License, this file may be distributed as part of a program
73
# that contains a configuration script generated by Autoconf, under
74
# the same distribution terms as the rest of that program.
76
# This file can be copied and used freely without restrictions. It can
77
# be used in projects which are not available under the GNU Public License
78
# but which still want to provide support for the GNU gettext functionality.
80
# Macro to add for using GNU gettext.
81
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
83
# Modified to never use included libintl.
84
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
86
# Major rework to remove unused code
87
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
89
# Added better handling of ALL_LINGUAS from GNU gettext version
90
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
92
# Modified to require ngettext
93
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
95
# We need this here as well, since someone might use autoconf-2.5x
96
# to configure GLib then an older version to configure a package
97
# using AM_GLIB_GNU_GETTEXT
101
dnl We go to great lengths to make sure that aclocal won't
102
dnl try to pull in the installed version of these macros
103
dnl when running aclocal in the glib directory.
105
m4_copy([AC_DEFUN],[glib_DEFUN])
106
m4_copy([AC_REQUIRE],[glib_REQUIRE])
108
dnl At the end, if we're not within glib, we'll define the public
109
dnl definitions in terms of our private definitions.
113
#--------------------
114
glib_DEFUN([GLIB_LC_MESSAGES],
115
[AC_CHECK_HEADERS([locale.h])
116
if test $ac_cv_header_locale_h = yes; then
117
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
118
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
119
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
120
if test $am_cv_val_LC_MESSAGES = yes; then
121
AC_DEFINE(HAVE_LC_MESSAGES, 1,
122
[Define if your <locale.h> file defines LC_MESSAGES.])
126
# GLIB_PATH_PROG_WITH_TEST
127
#----------------------------
128
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
129
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
130
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
131
[# Extract the first word of "$2", so it can be a program name with args.
132
set dummy $2; ac_word=[$]2
133
AC_MSG_CHECKING([for $ac_word])
134
AC_CACHE_VAL(ac_cv_path_$1,
137
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
140
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
141
for ac_dir in ifelse([$5], , $PATH, [$5]); do
142
test -z "$ac_dir" && ac_dir=.
143
if test -f $ac_dir/$ac_word; then
145
ac_cv_path_$1="$ac_dir/$ac_word"
151
dnl If no 4th arg is given, leave the cache variable unset,
152
dnl so AC_PATH_PROGS will keep looking.
153
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
158
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
168
glib_DEFUN([GLIB_WITH_NLS],
169
dnl NLS is obligatory
173
gt_cv_have_gettext=no
179
AC_CHECK_HEADER(libintl.h,
180
[gt_cv_func_dgettext_libintl="no"
181
libintl_extra_libs=""
184
# First check in libc
186
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
190
[return !ngettext ("","", 1)],
191
gt_cv_func_ngettext_libc=yes,
192
gt_cv_func_ngettext_libc=no)
195
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
196
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
200
[return !dgettext ("","")],
201
gt_cv_func_dgettext_libc=yes,
202
gt_cv_func_dgettext_libc=no)
206
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
207
AC_CHECK_FUNCS(bind_textdomain_codeset)
211
# If we don't have everything we want, check in libintl
213
if test "$gt_cv_func_dgettext_libc" != "yes" \
214
|| test "$gt_cv_func_ngettext_libc" != "yes" \
215
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
217
AC_CHECK_LIB(intl, bindtextdomain,
218
[AC_CHECK_LIB(intl, ngettext,
219
[AC_CHECK_LIB(intl, dgettext,
220
gt_cv_func_dgettext_libintl=yes)])])
222
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
223
AC_MSG_CHECKING([if -liconv is needed to use gettext])
225
AC_CHECK_LIB(intl, ngettext,
226
[AC_CHECK_LIB(intl, dcgettext,
227
[gt_cv_func_dgettext_libintl=yes
228
libintl_extra_libs=-liconv],
234
# If we found libintl, then check in it for bind_textdomain_codeset();
235
# we'll prefer libc if neither have bind_textdomain_codeset(),
236
# and both have dgettext and ngettext
238
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
239
glib_save_LIBS="$LIBS"
240
LIBS="$LIBS -lintl $libintl_extra_libs"
241
unset ac_cv_func_bind_textdomain_codeset
242
AC_CHECK_FUNCS(bind_textdomain_codeset)
243
LIBS="$glib_save_LIBS"
245
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
246
gt_cv_func_dgettext_libc=no
248
if test "$gt_cv_func_dgettext_libc" = "yes" \
249
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
250
gt_cv_func_dgettext_libintl=no
256
if test "$gt_cv_func_dgettext_libc" = "yes" \
257
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
258
gt_cv_have_gettext=yes
261
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
262
INTLLIBS="-lintl $libintl_extra_libs"
265
if test "$gt_cv_have_gettext" = "yes"; then
266
AC_DEFINE(HAVE_GETTEXT,1,
267
[Define if the GNU gettext() function is already present or preinstalled.])
268
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
269
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
270
if test "$MSGFMT" != "no"; then
271
glib_save_LIBS="$LIBS"
272
LIBS="$LIBS $INTLLIBS"
273
AC_CHECK_FUNCS(dcgettext)
275
AC_MSG_CHECKING([if msgfmt accepts -c])
276
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
279
"Content-Type: text/plain; charset=UTF-8\n"
280
"Project-Id-Version: test 1.0\n"
281
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
282
"Last-Translator: test <foo@bar.xx>\n"
283
"Language-Team: C <LL@li.org>\n"
284
"MIME-Version: 1.0\n"
285
"Content-Transfer-Encoding: 8bit\n"
286
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
287
AC_SUBST(MSGFMT_OPTS)
288
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
289
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
290
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
291
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
292
return _nl_msg_cat_cntr],
297
dnl On Solaris, if bind_textdomain_codeset is in libc,
298
dnl GNU format message catalog is always supported,
299
dnl since both are added to the libc all together.
300
dnl Hence, we'd like to go with DATADIRNAME=share and
301
dnl and CATOBJEXT=.gmo in this case.
302
AC_CHECK_FUNC(bind_textdomain_codeset,
313
LIBS="$glib_save_LIBS"
316
gt_cv_have_gettext=no
321
if test "$gt_cv_have_gettext" = "yes" ; then
322
AC_DEFINE(ENABLE_NLS, 1,
323
[always defined to indicate that i18n is enabled])
326
dnl Test whether we really found GNU xgettext.
327
if test "$XGETTEXT" != ":"; then
328
dnl If it is not GNU xgettext we define it as : so that the
329
dnl Makefiles still can work.
330
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
334
[found xgettext program is not GNU xgettext; ignore it])
339
# We need to process the po/ directory.
343
[case "$CONFIG_FILES" in *po/Makefile.in*)
344
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
347
dnl These rules are solely for the distribution goal. While doing this
348
dnl we only have to keep exactly one list of the available catalogs
350
for lang in $ALL_LINGUAS; do
351
GMOFILES="$GMOFILES $lang.gmo"
352
POFILES="$POFILES $lang.po"
355
dnl Make all variables we use known to autoconf.
358
AC_SUBST(DATADIRNAME)
362
AC_SUBST(PO_IN_DATADIR_TRUE)
363
AC_SUBST(PO_IN_DATADIR_FALSE)
368
# AM_GLIB_GNU_GETTEXT
369
# -------------------
370
# Do checks necessary for use of gettext. If a suitable implementation
371
# of gettext is found in either in libintl or in the C library,
372
# it will set INTLLIBS to the libraries needed for use of gettext
373
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
374
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
375
# on various variables needed by the Makefile.in.in installed by
378
glib_DEFUN([GLIB_GNU_GETTEXT],
379
[AC_REQUIRE([AC_PROG_CC])dnl
380
AC_REQUIRE([AC_HEADER_STDC])dnl
385
if test "$gt_cv_have_gettext" = "yes"; then
386
if test "x$ALL_LINGUAS" = "x"; then
389
AC_MSG_CHECKING(for catalogs to be installed)
391
for presentlang in $ALL_LINGUAS; do
393
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
394
desiredlanguages="$LINGUAS"
396
desiredlanguages="$ALL_LINGUAS"
398
for desiredlang in $desiredlanguages; do
399
# Use the presentlang catalog if desiredlang is
400
# a. equal to presentlang, or
401
# b. a variant of presentlang (because in this case,
402
# presentlang can be used as a fallback for messages
403
# which are not translated in the desiredlang catalog).
404
case "$desiredlang" in
405
"$presentlang"*) useit=yes;;
408
if test $useit = yes; then
409
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
413
AC_MSG_RESULT($LINGUAS)
416
dnl Construct list of names of catalog files to be constructed.
417
if test -n "$LINGUAS"; then
418
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
422
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
423
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
424
dnl Try to locate is.
426
if test -n "$ac_aux_dir"; then
427
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
429
if test -z "$MKINSTALLDIRS"; then
430
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
432
AC_SUBST(MKINSTALLDIRS)
434
dnl Generate list of files to be processed by xgettext which will
435
dnl be included in po/Makefile.
436
test -d po || mkdir po
437
if test "x$srcdir" != "x."; then
438
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
439
posrcprefix="$srcdir/"
441
posrcprefix="../$srcdir/"
447
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
448
< $srcdir/po/POTFILES.in > po/POTFILES
451
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
452
# -------------------------------
453
# Define VARIABLE to the location where catalog files will
454
# be installed by po/Makefile.
455
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
456
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
457
glib_save_prefix="$prefix"
458
glib_save_exec_prefix="$exec_prefix"
459
glib_save_datarootdir="$datarootdir"
460
test "x$prefix" = xNONE && prefix=$ac_default_prefix
461
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
462
datarootdir=`eval echo "${datarootdir}"`
463
if test "x$CATOBJEXT" = "x.mo" ; then
464
localedir=`eval echo "${libdir}/locale"`
466
localedir=`eval echo "${datadir}/locale"`
468
prefix="$glib_save_prefix"
469
exec_prefix="$glib_save_exec_prefix"
470
datarootdir="$glib_save_datarootdir"
471
AC_DEFINE_UNQUOTED($1, "$localedir",
472
[Define the location where the catalogs will be installed])
476
dnl Now the definitions that aclocal will find
478
ifdef(glib_configure_ac,[],[
479
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
480
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
483
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
485
# Create a temporary file with TEST-FILE as its contents and pass the
486
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
487
# 0 and perform ACTION-IF-FAIL for any other exit status.
488
AC_DEFUN([GLIB_RUN_PROG],
489
[cat >conftest.foo <<_ACEOF
492
if AC_RUN_LOG([$1 conftest.foo]); then
493
m4_ifval([$3], [$3], [:])
494
m4_ifvaln([$4], [else $4])dnl
495
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
496
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
503
dnl GNOME_COMMON_INIT
505
AC_DEFUN([GNOME_COMMON_INIT],
507
dnl this macro should come after AC_CONFIG_MACRO_DIR
508
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
510
dnl ensure that when the Automake generated makefile calls aclocal,
511
dnl it honours the $ACLOCAL_FLAGS environment variable
512
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
513
if test -n "$ac_macro_dir"; then
514
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
517
AC_SUBST([ACLOCAL_AMFLAGS])
520
AC_DEFUN([GNOME_DEBUG_CHECK],
522
AC_ARG_ENABLE([debug],
523
AC_HELP_STRING([--enable-debug],
524
[turn on debugging]),,
527
if test x$enable_debug = xyes ; then
528
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
529
[Enable additional debugging at the expense of performance and size])
533
dnl GNOME_MAINTAINER_MODE_DEFINES ()
534
dnl define DISABLE_DEPRECATED
536
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
538
AC_REQUIRE([AM_MAINTAINER_MODE])
540
DISABLE_DEPRECATED=""
541
if test $USE_MAINTAINER_MODE = yes; then
542
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
543
for DOMAIN in $DOMAINS; do
544
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
548
AC_SUBST(DISABLE_DEPRECATED)
551
dnl GNOME_COMPILE_WARNINGS
552
dnl Turn on many useful compiler warnings
553
dnl For now, only works on GCC
554
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
555
dnl ******************************
556
dnl More compiler warnings
557
dnl ******************************
559
AC_ARG_ENABLE(compile-warnings,
560
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
561
[Turn on compiler warnings]),,
562
[enable_compile_warnings="m4_default([$1],[yes])"])
565
if test "x$GCC" != xyes; then
566
enable_compile_warnings=no
570
realsave_CFLAGS="$CFLAGS"
572
case "$enable_compile_warnings" in
577
warning_flags="-Wall"
580
warning_flags="-Wall -Wmissing-prototypes"
583
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
584
CFLAGS="$warning_flags $CFLAGS"
585
for option in -Wno-sign-compare; do
586
SAVE_CFLAGS="$CFLAGS"
587
CFLAGS="$CFLAGS $option"
588
AC_MSG_CHECKING([whether gcc understands $option])
589
AC_TRY_COMPILE([], [],
592
CFLAGS="$SAVE_CFLAGS"
593
AC_MSG_RESULT($has_option)
594
if test $has_option = yes; then
595
warning_flags="$warning_flags $option"
601
if test "$enable_compile_warnings" = "error" ; then
602
warning_flags="$warning_flags -Werror"
606
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
609
CFLAGS="$realsave_CFLAGS"
610
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
611
AC_MSG_RESULT($warning_flags)
614
AC_HELP_STRING([--enable-iso-c],
615
[Try to warn if code is not ISO C ]),,
618
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
620
if test "x$enable_iso_c" != "xno"; then
621
if test "x$GCC" = "xyes"; then
623
*[\ \ ]-ansi[\ \ ]*) ;;
624
*) complCFLAGS="$complCFLAGS -ansi" ;;
627
*[\ \ ]-pedantic[\ \ ]*) ;;
628
*) complCFLAGS="$complCFLAGS -pedantic" ;;
632
AC_MSG_RESULT($complCFLAGS)
634
WARN_CFLAGS="$warning_flags $complCFLAGS"
635
AC_SUBST(WARN_CFLAGS)
638
dnl For C++, do basically the same thing.
640
AC_DEFUN([GNOME_CXX_WARNINGS],[
641
AC_ARG_ENABLE(cxx-warnings,
642
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
643
[Turn on compiler warnings.]),,
644
[enable_cxx_warnings="m4_default([$1],[minimum])"])
646
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
648
if test "x$GXX" != xyes; then
649
enable_cxx_warnings=no
651
if test "x$enable_cxx_warnings" != "xno"; then
652
if test "x$GXX" = "xyes"; then
653
case " $CXXFLAGS " in
654
*[\ \ ]-Wall[\ \ ]*) ;;
655
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
658
## -W is not all that useful. And it cannot be controlled
659
## with individual -Wno-xxx flags, unlike -Wall
660
if test "x$enable_cxx_warnings" = "xyes"; then
661
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
665
AC_MSG_RESULT($warnCXXFLAGS)
667
AC_ARG_ENABLE(iso-cxx,
668
AC_HELP_STRING([--enable-iso-cxx],
669
[Try to warn if code is not ISO C++ ]),,
672
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
674
if test "x$enable_iso_cxx" != "xno"; then
675
if test "x$GXX" = "xyes"; then
676
case " $CXXFLAGS " in
677
*[\ \ ]-ansi[\ \ ]*) ;;
678
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
681
case " $CXXFLAGS " in
682
*[\ \ ]-pedantic[\ \ ]*) ;;
683
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
687
AC_MSG_RESULT($complCXXFLAGS)
689
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
690
AC_SUBST(WARN_CXXFLAGS)
693
# nls.m4 serial 5 (gettext-0.18)
694
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
696
dnl This file is free software; the Free Software Foundation
697
dnl gives unlimited permission to copy and/or distribute it,
698
dnl with or without modifications, as long as this notice is preserved.
700
dnl This file can can be used in projects which are not available under
701
dnl the GNU General Public License or the GNU Library General Public
702
dnl License but which still want to provide support for the GNU gettext
704
dnl Please note that the actual code of the GNU gettext library is covered
705
dnl by the GNU Library General Public License, and the rest of the GNU
706
dnl gettext package package is covered by the GNU General Public License.
707
dnl They are *not* in the public domain.
710
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
711
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
717
AC_MSG_CHECKING([whether NLS is requested])
718
dnl Default is enabled NLS
720
[ --disable-nls do not use Native Language Support],
721
USE_NLS=$enableval, USE_NLS=yes)
722
AC_MSG_RESULT([$USE_NLS])
726
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
727
# serial 1 (pkg-config-0.24)
729
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
731
# This program is free software; you can redistribute it and/or modify
732
# it under the terms of the GNU General Public License as published by
733
# the Free Software Foundation; either version 2 of the License, or
734
# (at your option) any later version.
736
# This program is distributed in the hope that it will be useful, but
737
# WITHOUT ANY WARRANTY; without even the implied warranty of
738
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
739
# General Public License for more details.
741
# You should have received a copy of the GNU General Public License
742
# along with this program; if not, write to the Free Software
743
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
745
# As a special exception to the GNU General Public License, if you
746
# distribute this file as part of a program that contains a
747
# configuration script generated by Autoconf, you may include it under
748
# the same distribution terms that you use for the rest of that program.
750
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
751
# ----------------------------------
752
AC_DEFUN([PKG_PROG_PKG_CONFIG],
753
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
754
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
755
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
756
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
757
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
759
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
760
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
762
if test -n "$PKG_CONFIG"; then
763
_pkg_min_version=m4_default([$1], [0.9.0])
764
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
765
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
772
])# PKG_PROG_PKG_CONFIG
774
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
776
# Check to see whether a particular set of modules exists. Similar
777
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
779
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
780
# only at the first occurence in configure.ac, so if the first place
781
# it's called might be skipped (such as if it is within an "if", you
782
# have to call PKG_CHECK_EXISTS manually
783
# --------------------------------------------------------------
784
AC_DEFUN([PKG_CHECK_EXISTS],
785
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
786
if test -n "$PKG_CONFIG" && \
787
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
788
m4_default([$2], [:])
789
m4_ifvaln([$3], [else
793
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
794
# ---------------------------------------------
795
m4_define([_PKG_CONFIG],
796
[if test -n "$$1"; then
798
elif test -n "$PKG_CONFIG"; then
799
PKG_CHECK_EXISTS([$3],
800
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
807
# _PKG_SHORT_ERRORS_SUPPORTED
808
# -----------------------------
809
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
810
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
811
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
812
_pkg_short_errors_supported=yes
814
_pkg_short_errors_supported=no
816
])# _PKG_SHORT_ERRORS_SUPPORTED
819
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
820
# [ACTION-IF-NOT-FOUND])
823
# Note that if there is a possibility the first call to
824
# PKG_CHECK_MODULES might not happen, you should be sure to include an
825
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
828
# --------------------------------------------------------------
829
AC_DEFUN([PKG_CHECK_MODULES],
830
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
831
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
832
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
835
AC_MSG_CHECKING([for $1])
837
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
838
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
840
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
841
and $1[]_LIBS to avoid the need to call pkg-config.
842
See the pkg-config man page for more details.])
844
if test $pkg_failed = yes; then
846
_PKG_SHORT_ERRORS_SUPPORTED
847
if test $_pkg_short_errors_supported = yes; then
848
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
850
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
852
# Put the nasty error message in config.log where it belongs
853
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
855
m4_default([$4], [AC_MSG_ERROR(
856
[Package requirements ($2) were not met:
860
Consider adjusting the PKG_CONFIG_PATH environment variable if you
861
installed software in a non-standard prefix.
865
elif test $pkg_failed = untried; then
867
m4_default([$4], [AC_MSG_FAILURE(
868
[The pkg-config script could not be found or is too old. Make sure it
869
is in your PATH or set the PKG_CONFIG environment variable to the full
874
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
877
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
878
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
882
])# PKG_CHECK_MODULES
884
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
886
24
# This file is free software; the Free Software Foundation
1895
1033
AC_SUBST([am__untar])
1896
1034
]) # _AM_PROG_TAR
1036
# nls.m4 serial 5 (gettext-0.18)
1037
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1039
dnl This file is free software; the Free Software Foundation
1040
dnl gives unlimited permission to copy and/or distribute it,
1041
dnl with or without modifications, as long as this notice is preserved.
1043
dnl This file can can be used in projects which are not available under
1044
dnl the GNU General Public License or the GNU Library General Public
1045
dnl License but which still want to provide support for the GNU gettext
1047
dnl Please note that the actual code of the GNU gettext library is covered
1048
dnl by the GNU Library General Public License, and the rest of the GNU
1049
dnl gettext package package is covered by the GNU General Public License.
1050
dnl They are *not* in the public domain.
1053
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1054
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1060
AC_MSG_CHECKING([whether NLS is requested])
1061
dnl Default is enabled NLS
1062
AC_ARG_ENABLE([nls],
1063
[ --disable-nls do not use Native Language Support],
1064
USE_NLS=$enableval, USE_NLS=yes)
1065
AC_MSG_RESULT([$USE_NLS])
1069
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1071
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1073
# This program is free software; you can redistribute it and/or modify
1074
# it under the terms of the GNU General Public License as published by
1075
# the Free Software Foundation; either version 2 of the License, or
1076
# (at your option) any later version.
1078
# This program is distributed in the hope that it will be useful, but
1079
# WITHOUT ANY WARRANTY; without even the implied warranty of
1080
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1081
# General Public License for more details.
1083
# You should have received a copy of the GNU General Public License
1084
# along with this program; if not, write to the Free Software
1085
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1087
# As a special exception to the GNU General Public License, if you
1088
# distribute this file as part of a program that contains a
1089
# configuration script generated by Autoconf, you may include it under
1090
# the same distribution terms that you use for the rest of that program.
1092
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1093
# ----------------------------------
1094
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1095
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1096
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1097
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1098
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1099
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1101
if test -n "$PKG_CONFIG"; then
1102
_pkg_min_version=m4_default([$1], [0.9.0])
1103
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1104
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1105
AC_MSG_RESULT([yes])
1112
])# PKG_PROG_PKG_CONFIG
1114
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1116
# Check to see whether a particular set of modules exists. Similar
1117
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1120
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1121
# this or PKG_CHECK_MODULES is called, or make sure to call
1122
# PKG_CHECK_EXISTS manually
1123
# --------------------------------------------------------------
1124
AC_DEFUN([PKG_CHECK_EXISTS],
1125
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1126
if test -n "$PKG_CONFIG" && \
1127
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1128
m4_ifval([$2], [$2], [:])
1129
m4_ifvaln([$3], [else
1134
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1135
# ---------------------------------------------
1136
m4_define([_PKG_CONFIG],
1137
[if test -n "$$1"; then
1139
elif test -n "$PKG_CONFIG"; then
1140
PKG_CHECK_EXISTS([$3],
1141
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1148
# _PKG_SHORT_ERRORS_SUPPORTED
1149
# -----------------------------
1150
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1151
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1152
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1153
_pkg_short_errors_supported=yes
1155
_pkg_short_errors_supported=no
1157
])# _PKG_SHORT_ERRORS_SUPPORTED
1160
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1161
# [ACTION-IF-NOT-FOUND])
1164
# Note that if there is a possibility the first call to
1165
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1166
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1169
# --------------------------------------------------------------
1170
AC_DEFUN([PKG_CHECK_MODULES],
1171
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1172
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1173
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1176
AC_MSG_CHECKING([for $1])
1178
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1179
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1181
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1182
and $1[]_LIBS to avoid the need to call pkg-config.
1183
See the pkg-config man page for more details.])
1185
if test $pkg_failed = yes; then
1186
_PKG_SHORT_ERRORS_SUPPORTED
1187
if test $_pkg_short_errors_supported = yes; then
1188
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1190
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1192
# Put the nasty error message in config.log where it belongs
1193
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1195
ifelse([$4], , [AC_MSG_ERROR(dnl
1196
[Package requirements ($2) were not met:
1200
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1201
installed software in a non-standard prefix.
1205
[AC_MSG_RESULT([no])
1207
elif test $pkg_failed = untried; then
1208
ifelse([$4], , [AC_MSG_FAILURE(dnl
1209
[The pkg-config script could not be found or is too old. Make sure it
1210
is in your PATH or set the PKG_CONFIG environment variable to the full
1215
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1218
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1219
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1220
AC_MSG_RESULT([yes])
1221
ifelse([$3], , :, [$3])
1223
])# PKG_CHECK_MODULES
1225
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1226
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1228
# This file is free software, distributed under the terms of the GNU
1229
# General Public License. As a special exception to the GNU General
1230
# Public License, this file may be distributed as part of a program
1231
# that contains a configuration script generated by Autoconf, under
1232
# the same distribution terms as the rest of that program.
1234
# This file can be copied and used freely without restrictions. It can
1235
# be used in projects which are not available under the GNU Public License
1236
# but which still want to provide support for the GNU gettext functionality.
1238
# Macro to add for using GNU gettext.
1239
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1241
# Modified to never use included libintl.
1242
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1244
# Major rework to remove unused code
1245
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1247
# Added better handling of ALL_LINGUAS from GNU gettext version
1248
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1250
# Modified to require ngettext
1251
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1253
# We need this here as well, since someone might use autoconf-2.5x
1254
# to configure GLib then an older version to configure a package
1255
# using AM_GLIB_GNU_GETTEXT
1259
dnl We go to great lengths to make sure that aclocal won't
1260
dnl try to pull in the installed version of these macros
1261
dnl when running aclocal in the glib directory.
1263
m4_copy([AC_DEFUN],[glib_DEFUN])
1264
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1266
dnl At the end, if we're not within glib, we'll define the public
1267
dnl definitions in terms of our private definitions.
1271
#--------------------
1272
glib_DEFUN([GLIB_LC_MESSAGES],
1273
[AC_CHECK_HEADERS([locale.h])
1274
if test $ac_cv_header_locale_h = yes; then
1275
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1276
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1277
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1278
if test $am_cv_val_LC_MESSAGES = yes; then
1279
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1280
[Define if your <locale.h> file defines LC_MESSAGES.])
1284
# GLIB_PATH_PROG_WITH_TEST
1285
#----------------------------
1286
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1287
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1288
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1289
[# Extract the first word of "$2", so it can be a program name with args.
1290
set dummy $2; ac_word=[$]2
1291
AC_MSG_CHECKING([for $ac_word])
1292
AC_CACHE_VAL(ac_cv_path_$1,
1295
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1298
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1299
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1300
test -z "$ac_dir" && ac_dir=.
1301
if test -f $ac_dir/$ac_word; then
1303
ac_cv_path_$1="$ac_dir/$ac_word"
1309
dnl If no 4th arg is given, leave the cache variable unset,
1310
dnl so AC_PATH_PROGS will keep looking.
1311
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1316
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1317
AC_MSG_RESULT([$]$1)
1326
glib_DEFUN([GLIB_WITH_NLS],
1327
dnl NLS is obligatory
1331
gt_cv_have_gettext=no
1337
AC_CHECK_HEADER(libintl.h,
1338
[gt_cv_func_dgettext_libintl="no"
1339
libintl_extra_libs=""
1342
# First check in libc
1344
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1346
#include <libintl.h>
1348
[return !ngettext ("","", 1)],
1349
gt_cv_func_ngettext_libc=yes,
1350
gt_cv_func_ngettext_libc=no)
1353
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1354
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1356
#include <libintl.h>
1358
[return !dgettext ("","")],
1359
gt_cv_func_dgettext_libc=yes,
1360
gt_cv_func_dgettext_libc=no)
1364
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1365
AC_CHECK_FUNCS(bind_textdomain_codeset)
1369
# If we don't have everything we want, check in libintl
1371
if test "$gt_cv_func_dgettext_libc" != "yes" \
1372
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1373
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1375
AC_CHECK_LIB(intl, bindtextdomain,
1376
[AC_CHECK_LIB(intl, ngettext,
1377
[AC_CHECK_LIB(intl, dgettext,
1378
gt_cv_func_dgettext_libintl=yes)])])
1380
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1381
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1383
AC_CHECK_LIB(intl, ngettext,
1384
[AC_CHECK_LIB(intl, dcgettext,
1385
[gt_cv_func_dgettext_libintl=yes
1386
libintl_extra_libs=-liconv],
1392
# If we found libintl, then check in it for bind_textdomain_codeset();
1393
# we'll prefer libc if neither have bind_textdomain_codeset(),
1394
# and both have dgettext and ngettext
1396
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1397
glib_save_LIBS="$LIBS"
1398
LIBS="$LIBS -lintl $libintl_extra_libs"
1399
unset ac_cv_func_bind_textdomain_codeset
1400
AC_CHECK_FUNCS(bind_textdomain_codeset)
1401
LIBS="$glib_save_LIBS"
1403
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1404
gt_cv_func_dgettext_libc=no
1406
if test "$gt_cv_func_dgettext_libc" = "yes" \
1407
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1408
gt_cv_func_dgettext_libintl=no
1414
if test "$gt_cv_func_dgettext_libc" = "yes" \
1415
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1416
gt_cv_have_gettext=yes
1419
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1420
INTLLIBS="-lintl $libintl_extra_libs"
1423
if test "$gt_cv_have_gettext" = "yes"; then
1424
AC_DEFINE(HAVE_GETTEXT,1,
1425
[Define if the GNU gettext() function is already present or preinstalled.])
1426
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1427
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1428
if test "$MSGFMT" != "no"; then
1429
glib_save_LIBS="$LIBS"
1430
LIBS="$LIBS $INTLLIBS"
1431
AC_CHECK_FUNCS(dcgettext)
1433
AC_MSG_CHECKING([if msgfmt accepts -c])
1434
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1437
"Content-Type: text/plain; charset=UTF-8\n"
1438
"Project-Id-Version: test 1.0\n"
1439
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1440
"Last-Translator: test <foo@bar.xx>\n"
1441
"Language-Team: C <LL@li.org>\n"
1442
"MIME-Version: 1.0\n"
1443
"Content-Transfer-Encoding: 8bit\n"
1444
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1445
AC_SUBST(MSGFMT_OPTS)
1446
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1447
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1448
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1449
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1450
return _nl_msg_cat_cntr],
1455
dnl On Solaris, if bind_textdomain_codeset is in libc,
1456
dnl GNU format message catalog is always supported,
1457
dnl since both are added to the libc all together.
1458
dnl Hence, we'd like to go with DATADIRNAME=share and
1459
dnl and CATOBJEXT=.gmo in this case.
1460
AC_CHECK_FUNC(bind_textdomain_codeset,
1471
LIBS="$glib_save_LIBS"
1474
gt_cv_have_gettext=no
1479
if test "$gt_cv_have_gettext" = "yes" ; then
1480
AC_DEFINE(ENABLE_NLS, 1,
1481
[always defined to indicate that i18n is enabled])
1484
dnl Test whether we really found GNU xgettext.
1485
if test "$XGETTEXT" != ":"; then
1486
dnl If it is not GNU xgettext we define it as : so that the
1487
dnl Makefiles still can work.
1488
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1492
[found xgettext program is not GNU xgettext; ignore it])
1497
# We need to process the po/ directory.
1501
[case "$CONFIG_FILES" in *po/Makefile.in*)
1502
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1505
dnl These rules are solely for the distribution goal. While doing this
1506
dnl we only have to keep exactly one list of the available catalogs
1507
dnl in configure.ac.
1508
for lang in $ALL_LINGUAS; do
1509
GMOFILES="$GMOFILES $lang.gmo"
1510
POFILES="$POFILES $lang.po"
1513
dnl Make all variables we use known to autoconf.
1516
AC_SUBST(DATADIRNAME)
1518
AC_SUBST(INSTOBJEXT)
1520
AC_SUBST(PO_IN_DATADIR_TRUE)
1521
AC_SUBST(PO_IN_DATADIR_FALSE)
1526
# AM_GLIB_GNU_GETTEXT
1527
# -------------------
1528
# Do checks necessary for use of gettext. If a suitable implementation
1529
# of gettext is found in either in libintl or in the C library,
1530
# it will set INTLLIBS to the libraries needed for use of gettext
1531
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1532
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1533
# on various variables needed by the Makefile.in.in installed by
1536
glib_DEFUN([GLIB_GNU_GETTEXT],
1537
[AC_REQUIRE([AC_PROG_CC])dnl
1538
AC_REQUIRE([AC_HEADER_STDC])dnl
1543
if test "$gt_cv_have_gettext" = "yes"; then
1544
if test "x$ALL_LINGUAS" = "x"; then
1547
AC_MSG_CHECKING(for catalogs to be installed)
1549
for presentlang in $ALL_LINGUAS; do
1551
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1552
desiredlanguages="$LINGUAS"
1554
desiredlanguages="$ALL_LINGUAS"
1556
for desiredlang in $desiredlanguages; do
1557
# Use the presentlang catalog if desiredlang is
1558
# a. equal to presentlang, or
1559
# b. a variant of presentlang (because in this case,
1560
# presentlang can be used as a fallback for messages
1561
# which are not translated in the desiredlang catalog).
1562
case "$desiredlang" in
1563
"$presentlang"*) useit=yes;;
1566
if test $useit = yes; then
1567
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1570
LINGUAS=$NEW_LINGUAS
1571
AC_MSG_RESULT($LINGUAS)
1574
dnl Construct list of names of catalog files to be constructed.
1575
if test -n "$LINGUAS"; then
1576
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1580
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1581
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1582
dnl Try to locate is.
1584
if test -n "$ac_aux_dir"; then
1585
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1587
if test -z "$MKINSTALLDIRS"; then
1588
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1590
AC_SUBST(MKINSTALLDIRS)
1592
dnl Generate list of files to be processed by xgettext which will
1593
dnl be included in po/Makefile.
1594
test -d po || mkdir po
1595
if test "x$srcdir" != "x."; then
1596
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1597
posrcprefix="$srcdir/"
1599
posrcprefix="../$srcdir/"
1605
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1606
< $srcdir/po/POTFILES.in > po/POTFILES
1609
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1610
# -------------------------------
1611
# Define VARIABLE to the location where catalog files will
1612
# be installed by po/Makefile.
1613
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1614
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1615
glib_save_prefix="$prefix"
1616
glib_save_exec_prefix="$exec_prefix"
1617
glib_save_datarootdir="$datarootdir"
1618
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1619
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1620
datarootdir=`eval echo "${datarootdir}"`
1621
if test "x$CATOBJEXT" = "x.mo" ; then
1622
localedir=`eval echo "${libdir}/locale"`
1624
localedir=`eval echo "${datadir}/locale"`
1626
prefix="$glib_save_prefix"
1627
exec_prefix="$glib_save_exec_prefix"
1628
datarootdir="$glib_save_datarootdir"
1629
AC_DEFINE_UNQUOTED($1, "$localedir",
1630
[Define the location where the catalogs will be installed])
1634
dnl Now the definitions that aclocal will find
1636
ifdef(glib_configure_ac,[],[
1637
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1638
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1641
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1643
# Create a temporary file with TEST-FILE as its contents and pass the
1644
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1645
# 0 and perform ACTION-IF-FAIL for any other exit status.
1646
AC_DEFUN([GLIB_RUN_PROG],
1647
[cat >conftest.foo <<_ACEOF
1650
if AC_RUN_LOG([$1 conftest.foo]); then
1651
m4_ifval([$3], [$3], [:])
1652
m4_ifvaln([$4], [else $4])dnl
1653
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1654
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1663
dnl GNOME_COMMON_INIT
1665
AU_DEFUN([GNOME_COMMON_INIT],
1667
dnl this macro should come after AC_CONFIG_MACRO_DIR
1668
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
1670
dnl ensure that when the Automake generated makefile calls aclocal,
1671
dnl it honours the $ACLOCAL_FLAGS environment variable
1672
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
1673
if test -n "$ac_macro_dir"; then
1674
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
1677
AC_SUBST([ACLOCAL_AMFLAGS])
1679
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
1680
in your top-level Makefile.am, instead, where "m4" is the macro directory set
1681
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
1683
AC_DEFUN([GNOME_DEBUG_CHECK],
1685
AC_ARG_ENABLE([debug],
1686
AC_HELP_STRING([--enable-debug],
1687
[turn on debugging]),,
1690
if test x$enable_debug = xyes ; then
1691
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
1692
[Enable additional debugging at the expense of performance and size])
1696
dnl GNOME_MAINTAINER_MODE_DEFINES ()
1697
dnl define DISABLE_DEPRECATED
1699
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
1701
AC_REQUIRE([AM_MAINTAINER_MODE])
1703
DISABLE_DEPRECATED=""
1704
if test $USE_MAINTAINER_MODE = yes; then
1705
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
1706
for DOMAIN in $DOMAINS; do
1707
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
1711
AC_SUBST(DISABLE_DEPRECATED)
1714
dnl GNOME_COMPILE_WARNINGS
1715
dnl Turn on many useful compiler warnings
1716
dnl For now, only works on GCC
1717
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
1718
dnl ******************************
1719
dnl More compiler warnings
1720
dnl ******************************
1722
AC_ARG_ENABLE(compile-warnings,
1723
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
1724
[Turn on compiler warnings]),,
1725
[enable_compile_warnings="m4_default([$1],[yes])"])
1728
if test "x$GCC" != xyes; then
1729
enable_compile_warnings=no
1733
realsave_CFLAGS="$CFLAGS"
1735
case "$enable_compile_warnings" in
1740
warning_flags="-Wall"
1743
warning_flags="-Wall -Wmissing-prototypes"
1746
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
1747
CFLAGS="$warning_flags $CFLAGS"
1748
for option in -Wno-sign-compare; do
1749
SAVE_CFLAGS="$CFLAGS"
1750
CFLAGS="$CFLAGS $option"
1751
AC_MSG_CHECKING([whether gcc understands $option])
1752
AC_TRY_COMPILE([], [],
1755
CFLAGS="$SAVE_CFLAGS"
1756
AC_MSG_RESULT($has_option)
1757
if test $has_option = yes; then
1758
warning_flags="$warning_flags $option"
1764
if test "$enable_compile_warnings" = "error" ; then
1765
warning_flags="$warning_flags -Werror"
1769
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
1772
CFLAGS="$realsave_CFLAGS"
1773
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
1774
AC_MSG_RESULT($warning_flags)
1776
AC_ARG_ENABLE(iso-c,
1777
AC_HELP_STRING([--enable-iso-c],
1778
[Try to warn if code is not ISO C ]),,
1781
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
1783
if test "x$enable_iso_c" != "xno"; then
1784
if test "x$GCC" = "xyes"; then
1786
*[\ \ ]-ansi[\ \ ]*) ;;
1787
*) complCFLAGS="$complCFLAGS -ansi" ;;
1790
*[\ \ ]-pedantic[\ \ ]*) ;;
1791
*) complCFLAGS="$complCFLAGS -pedantic" ;;
1795
AC_MSG_RESULT($complCFLAGS)
1797
WARN_CFLAGS="$warning_flags $complCFLAGS"
1798
AC_SUBST(WARN_CFLAGS)
1801
dnl For C++, do basically the same thing.
1803
AC_DEFUN([GNOME_CXX_WARNINGS],[
1804
AC_ARG_ENABLE(cxx-warnings,
1805
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
1806
[Turn on compiler warnings.]),,
1807
[enable_cxx_warnings="m4_default([$1],[minimum])"])
1809
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1811
if test "x$GXX" != xyes; then
1812
enable_cxx_warnings=no
1814
if test "x$enable_cxx_warnings" != "xno"; then
1815
if test "x$GXX" = "xyes"; then
1816
case " $CXXFLAGS " in
1817
*[\ \ ]-Wall[\ \ ]*) ;;
1818
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
1821
## -W is not all that useful. And it cannot be controlled
1822
## with individual -Wno-xxx flags, unlike -Wall
1823
if test "x$enable_cxx_warnings" = "xyes"; then
1824
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
1828
AC_MSG_RESULT($warnCXXFLAGS)
1830
AC_ARG_ENABLE(iso-cxx,
1831
AC_HELP_STRING([--enable-iso-cxx],
1832
[Try to warn if code is not ISO C++ ]),,
1833
[enable_iso_cxx=no])
1835
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
1837
if test "x$enable_iso_cxx" != "xno"; then
1838
if test "x$GXX" = "xyes"; then
1839
case " $CXXFLAGS " in
1840
*[\ \ ]-ansi[\ \ ]*) ;;
1841
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
1844
case " $CXXFLAGS " in
1845
*[\ \ ]-pedantic[\ \ ]*) ;;
1846
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1850
AC_MSG_RESULT($complCXXFLAGS)
1852
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1853
AC_SUBST(WARN_CXXFLAGS)
1857
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
1858
dnl the schema should be compiled
1861
AC_DEFUN([GLIB_GSETTINGS],
1863
m4_pattern_allow([AM_V_GEN])
1864
AC_ARG_ENABLE(schemas-compile,
1865
AC_HELP_STRING([--disable-schemas-compile],
1866
[Disable regeneration of gschemas.compiled on install]),
1867
[case ${enableval} in
1868
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
1869
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
1870
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
1872
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
1873
PKG_PROG_PKG_CONFIG([0.16])
1874
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
1875
if test x$cross_compiling != xyes; then
1876
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
1878
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
1880
AC_SUBST(GLIB_COMPILE_SCHEMAS)
1881
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
1882
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
1884
ifelse([$1],,[:],[$1])
1888
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
1890
mostlyclean-am: clean-gsettings-schemas
1892
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
1894
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
1895
$(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
1897
all-am: $(gsettings_SCHEMAS:.xml=.valid)
1898
uninstall-am: uninstall-gsettings-schemas
1899
install-data-am: install-gsettings-schemas
1901
.SECONDARY: $(gsettings_SCHEMAS)
1903
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
1905
if test -n "$^"; then \
1906
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
1907
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
1908
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
1911
uninstall-gsettings-schemas:
1912
@$(NORMAL_UNINSTALL)
1913
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
1914
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
1915
test -n "$$files" || exit 0; \
1916
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
1917
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
1918
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
1920
clean-gsettings-schemas:
1921
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
1923
ifdef gsettings_ENUM_NAMESPACE
1924
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
1925
$(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
1928
_GSETTINGS_SUBST(GSETTINGS_RULES)
1931
dnl _GSETTINGS_SUBST(VARIABLE)
1932
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1933
AC_DEFUN([_GSETTINGS_SUBST],
1936
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1898
1940
m4_include([m4/epiphany.m4])
1899
1941
m4_include([m4/gnome-doc-utils.m4])
1900
1942
m4_include([m4/intltool.m4])