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'.])])
22
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
23
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
25
# This file is free software, distributed under the terms of the GNU
26
# General Public License. As a special exception to the GNU General
27
# Public License, this file may be distributed as part of a program
28
# that contains a configuration script generated by Autoconf, under
29
# the same distribution terms as the rest of that program.
31
# This file can be copied and used freely without restrictions. It can
32
# be used in projects which are not available under the GNU Public License
33
# but which still want to provide support for the GNU gettext functionality.
35
# Macro to add for using GNU gettext.
36
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
38
# Modified to never use included libintl.
39
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
41
# Major rework to remove unused code
42
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
44
# Added better handling of ALL_LINGUAS from GNU gettext version
45
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
47
# Modified to require ngettext
48
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
50
# We need this here as well, since someone might use autoconf-2.5x
51
# to configure GLib then an older version to configure a package
52
# using AM_GLIB_GNU_GETTEXT
56
dnl We go to great lengths to make sure that aclocal won't
57
dnl try to pull in the installed version of these macros
58
dnl when running aclocal in the glib directory.
60
m4_copy([AC_DEFUN],[glib_DEFUN])
61
m4_copy([AC_REQUIRE],[glib_REQUIRE])
63
dnl At the end, if we're not within glib, we'll define the public
64
dnl definitions in terms of our private definitions.
69
glib_DEFUN([GLIB_LC_MESSAGES],
70
[AC_CHECK_HEADERS([locale.h])
71
if test $ac_cv_header_locale_h = yes; then
72
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
73
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
74
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
75
if test $am_cv_val_LC_MESSAGES = yes; then
76
AC_DEFINE(HAVE_LC_MESSAGES, 1,
77
[Define if your <locale.h> file defines LC_MESSAGES.])
81
# GLIB_PATH_PROG_WITH_TEST
82
#----------------------------
83
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
84
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
85
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
86
[# Extract the first word of "$2", so it can be a program name with args.
87
set dummy $2; ac_word=[$]2
88
AC_MSG_CHECKING([for $ac_word])
89
AC_CACHE_VAL(ac_cv_path_$1,
92
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
95
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
96
for ac_dir in ifelse([$5], , $PATH, [$5]); do
97
test -z "$ac_dir" && ac_dir=.
98
if test -f $ac_dir/$ac_word; then
100
ac_cv_path_$1="$ac_dir/$ac_word"
106
dnl If no 4th arg is given, leave the cache variable unset,
107
dnl so AC_PATH_PROGS will keep looking.
108
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
113
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
123
glib_DEFUN([GLIB_WITH_NLS],
124
dnl NLS is obligatory
128
gt_cv_have_gettext=no
134
AC_CHECK_HEADER(libintl.h,
135
[gt_cv_func_dgettext_libintl="no"
136
libintl_extra_libs=""
139
# First check in libc
141
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
145
[return !ngettext ("","", 1)],
146
gt_cv_func_ngettext_libc=yes,
147
gt_cv_func_ngettext_libc=no)
150
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
151
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
155
[return !dgettext ("","")],
156
gt_cv_func_dgettext_libc=yes,
157
gt_cv_func_dgettext_libc=no)
161
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
162
AC_CHECK_FUNCS(bind_textdomain_codeset)
166
# If we don't have everything we want, check in libintl
168
if test "$gt_cv_func_dgettext_libc" != "yes" \
169
|| test "$gt_cv_func_ngettext_libc" != "yes" \
170
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
172
AC_CHECK_LIB(intl, bindtextdomain,
173
[AC_CHECK_LIB(intl, ngettext,
174
[AC_CHECK_LIB(intl, dgettext,
175
gt_cv_func_dgettext_libintl=yes)])])
177
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
178
AC_MSG_CHECKING([if -liconv is needed to use gettext])
180
AC_CHECK_LIB(intl, ngettext,
181
[AC_CHECK_LIB(intl, dcgettext,
182
[gt_cv_func_dgettext_libintl=yes
183
libintl_extra_libs=-liconv],
189
# If we found libintl, then check in it for bind_textdomain_codeset();
190
# we'll prefer libc if neither have bind_textdomain_codeset(),
191
# and both have dgettext and ngettext
193
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
194
glib_save_LIBS="$LIBS"
195
LIBS="$LIBS -lintl $libintl_extra_libs"
196
unset ac_cv_func_bind_textdomain_codeset
197
AC_CHECK_FUNCS(bind_textdomain_codeset)
198
LIBS="$glib_save_LIBS"
200
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
201
gt_cv_func_dgettext_libc=no
203
if test "$gt_cv_func_dgettext_libc" = "yes" \
204
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
205
gt_cv_func_dgettext_libintl=no
211
if test "$gt_cv_func_dgettext_libc" = "yes" \
212
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
213
gt_cv_have_gettext=yes
216
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
217
INTLLIBS="-lintl $libintl_extra_libs"
220
if test "$gt_cv_have_gettext" = "yes"; then
221
AC_DEFINE(HAVE_GETTEXT,1,
222
[Define if the GNU gettext() function is already present or preinstalled.])
223
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
224
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
225
if test "$MSGFMT" != "no"; then
226
glib_save_LIBS="$LIBS"
227
LIBS="$LIBS $INTLLIBS"
228
AC_CHECK_FUNCS(dcgettext)
230
AC_MSG_CHECKING([if msgfmt accepts -c])
231
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
234
"Content-Type: text/plain; charset=UTF-8\n"
235
"Project-Id-Version: test 1.0\n"
236
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
237
"Last-Translator: test <foo@bar.xx>\n"
238
"Language-Team: C <LL@li.org>\n"
239
"MIME-Version: 1.0\n"
240
"Content-Transfer-Encoding: 8bit\n"
241
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
242
AC_SUBST(MSGFMT_OPTS)
243
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
244
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
245
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
246
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
247
return _nl_msg_cat_cntr],
252
dnl On Solaris, if bind_textdomain_codeset is in libc,
253
dnl GNU format message catalog is always supported,
254
dnl since both are added to the libc all together.
255
dnl Hence, we'd like to go with DATADIRNAME=share and
256
dnl and CATOBJEXT=.gmo in this case.
257
AC_CHECK_FUNC(bind_textdomain_codeset,
268
LIBS="$glib_save_LIBS"
271
gt_cv_have_gettext=no
276
if test "$gt_cv_have_gettext" = "yes" ; then
277
AC_DEFINE(ENABLE_NLS, 1,
278
[always defined to indicate that i18n is enabled])
281
dnl Test whether we really found GNU xgettext.
282
if test "$XGETTEXT" != ":"; then
283
dnl If it is not GNU xgettext we define it as : so that the
284
dnl Makefiles still can work.
285
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
289
[found xgettext program is not GNU xgettext; ignore it])
294
# We need to process the po/ directory.
298
[case "$CONFIG_FILES" in *po/Makefile.in*)
299
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
302
dnl These rules are solely for the distribution goal. While doing this
303
dnl we only have to keep exactly one list of the available catalogs
305
for lang in $ALL_LINGUAS; do
306
GMOFILES="$GMOFILES $lang.gmo"
307
POFILES="$POFILES $lang.po"
310
dnl Make all variables we use known to autoconf.
313
AC_SUBST(DATADIRNAME)
317
AC_SUBST(PO_IN_DATADIR_TRUE)
318
AC_SUBST(PO_IN_DATADIR_FALSE)
323
# AM_GLIB_GNU_GETTEXT
324
# -------------------
325
# Do checks necessary for use of gettext. If a suitable implementation
326
# of gettext is found in either in libintl or in the C library,
327
# it will set INTLLIBS to the libraries needed for use of gettext
328
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
329
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
330
# on various variables needed by the Makefile.in.in installed by
333
glib_DEFUN([GLIB_GNU_GETTEXT],
334
[AC_REQUIRE([AC_PROG_CC])dnl
335
AC_REQUIRE([AC_HEADER_STDC])dnl
340
if test "$gt_cv_have_gettext" = "yes"; then
341
if test "x$ALL_LINGUAS" = "x"; then
344
AC_MSG_CHECKING(for catalogs to be installed)
346
for presentlang in $ALL_LINGUAS; do
348
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
349
desiredlanguages="$LINGUAS"
351
desiredlanguages="$ALL_LINGUAS"
353
for desiredlang in $desiredlanguages; do
354
# Use the presentlang catalog if desiredlang is
355
# a. equal to presentlang, or
356
# b. a variant of presentlang (because in this case,
357
# presentlang can be used as a fallback for messages
358
# which are not translated in the desiredlang catalog).
359
case "$desiredlang" in
360
"$presentlang"*) useit=yes;;
363
if test $useit = yes; then
364
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
368
AC_MSG_RESULT($LINGUAS)
371
dnl Construct list of names of catalog files to be constructed.
372
if test -n "$LINGUAS"; then
373
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
377
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
378
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
379
dnl Try to locate is.
381
if test -n "$ac_aux_dir"; then
382
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
384
if test -z "$MKINSTALLDIRS"; then
385
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
387
AC_SUBST(MKINSTALLDIRS)
389
dnl Generate list of files to be processed by xgettext which will
390
dnl be included in po/Makefile.
391
test -d po || mkdir po
392
if test "x$srcdir" != "x."; then
393
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
394
posrcprefix="$srcdir/"
396
posrcprefix="../$srcdir/"
402
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
403
< $srcdir/po/POTFILES.in > po/POTFILES
406
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
407
# -------------------------------
408
# Define VARIABLE to the location where catalog files will
409
# be installed by po/Makefile.
410
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
411
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
412
glib_save_prefix="$prefix"
413
glib_save_exec_prefix="$exec_prefix"
414
glib_save_datarootdir="$datarootdir"
415
test "x$prefix" = xNONE && prefix=$ac_default_prefix
416
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
417
datarootdir=`eval echo "${datarootdir}"`
418
if test "x$CATOBJEXT" = "x.mo" ; then
419
localedir=`eval echo "${libdir}/locale"`
421
localedir=`eval echo "${datadir}/locale"`
423
prefix="$glib_save_prefix"
424
exec_prefix="$glib_save_exec_prefix"
425
datarootdir="$glib_save_datarootdir"
426
AC_DEFINE_UNQUOTED($1, "$localedir",
427
[Define the location where the catalogs will be installed])
431
dnl Now the definitions that aclocal will find
433
ifdef(glib_configure_ac,[],[
434
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
435
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
438
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
440
# Create a temporary file with TEST-FILE as its contents and pass the
441
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
442
# 0 and perform ACTION-IF-FAIL for any other exit status.
443
AC_DEFUN([GLIB_RUN_PROG],
444
[cat >conftest.foo <<_ACEOF
447
if AC_RUN_LOG([$1 conftest.foo]); then
448
m4_ifval([$3], [$3], [:])
449
m4_ifvaln([$4], [else $4])dnl
450
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
451
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
458
dnl GNOME_COMMON_INIT
460
AC_DEFUN([GNOME_COMMON_INIT],
462
dnl this macro should come after AC_CONFIG_MACRO_DIR
463
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
465
dnl ensure that when the Automake generated makefile calls aclocal,
466
dnl it honours the $ACLOCAL_FLAGS environment variable
467
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
468
if test -n "$ac_macro_dir"; then
469
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
472
AC_SUBST([ACLOCAL_AMFLAGS])
475
AC_DEFUN([GNOME_DEBUG_CHECK],
477
AC_ARG_ENABLE([debug],
478
AC_HELP_STRING([--enable-debug],
479
[turn on debugging]),,
482
if test x$enable_debug = xyes ; then
483
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
484
[Enable additional debugging at the expense of performance and size])
488
dnl GNOME_MAINTAINER_MODE_DEFINES ()
489
dnl define DISABLE_DEPRECATED
491
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
493
AC_REQUIRE([AM_MAINTAINER_MODE])
495
DISABLE_DEPRECATED=""
496
if test $USE_MAINTAINER_MODE = yes; then
497
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
498
for DOMAIN in $DOMAINS; do
499
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
503
AC_SUBST(DISABLE_DEPRECATED)
506
dnl GNOME_COMPILE_WARNINGS
507
dnl Turn on many useful compiler warnings
508
dnl For now, only works on GCC
509
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
510
dnl ******************************
511
dnl More compiler warnings
512
dnl ******************************
514
AC_ARG_ENABLE(compile-warnings,
515
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
516
[Turn on compiler warnings]),,
517
[enable_compile_warnings="m4_default([$1],[yes])"])
520
if test "x$GCC" != xyes; then
521
enable_compile_warnings=no
525
realsave_CFLAGS="$CFLAGS"
527
case "$enable_compile_warnings" in
532
warning_flags="-Wall"
535
warning_flags="-Wall -Wmissing-prototypes"
538
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
539
CFLAGS="$warning_flags $CFLAGS"
540
for option in -Wno-sign-compare; do
541
SAVE_CFLAGS="$CFLAGS"
542
CFLAGS="$CFLAGS $option"
543
AC_MSG_CHECKING([whether gcc understands $option])
544
AC_TRY_COMPILE([], [],
547
CFLAGS="$SAVE_CFLAGS"
548
AC_MSG_RESULT($has_option)
549
if test $has_option = yes; then
550
warning_flags="$warning_flags $option"
556
if test "$enable_compile_warnings" = "error" ; then
557
warning_flags="$warning_flags -Werror"
561
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
564
CFLAGS="$realsave_CFLAGS"
565
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
566
AC_MSG_RESULT($warning_flags)
569
AC_HELP_STRING([--enable-iso-c],
570
[Try to warn if code is not ISO C ]),,
573
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
575
if test "x$enable_iso_c" != "xno"; then
576
if test "x$GCC" = "xyes"; then
578
*[\ \ ]-ansi[\ \ ]*) ;;
579
*) complCFLAGS="$complCFLAGS -ansi" ;;
582
*[\ \ ]-pedantic[\ \ ]*) ;;
583
*) complCFLAGS="$complCFLAGS -pedantic" ;;
587
AC_MSG_RESULT($complCFLAGS)
589
WARN_CFLAGS="$warning_flags $complCFLAGS"
590
AC_SUBST(WARN_CFLAGS)
593
dnl For C++, do basically the same thing.
595
AC_DEFUN([GNOME_CXX_WARNINGS],[
596
AC_ARG_ENABLE(cxx-warnings,
597
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
598
[Turn on compiler warnings.]),,
599
[enable_cxx_warnings="m4_default([$1],[minimum])"])
601
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
603
if test "x$GXX" != xyes; then
604
enable_cxx_warnings=no
606
if test "x$enable_cxx_warnings" != "xno"; then
607
if test "x$GXX" = "xyes"; then
608
case " $CXXFLAGS " in
609
*[\ \ ]-Wall[\ \ ]*) ;;
610
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
613
## -W is not all that useful. And it cannot be controlled
614
## with individual -Wno-xxx flags, unlike -Wall
615
if test "x$enable_cxx_warnings" = "xyes"; then
616
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
620
AC_MSG_RESULT($warnCXXFLAGS)
622
AC_ARG_ENABLE(iso-cxx,
623
AC_HELP_STRING([--enable-iso-cxx],
624
[Try to warn if code is not ISO C++ ]),,
627
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
629
if test "x$enable_iso_cxx" != "xno"; then
630
if test "x$GXX" = "xyes"; then
631
case " $CXXFLAGS " in
632
*[\ \ ]-ansi[\ \ ]*) ;;
633
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
636
case " $CXXFLAGS " in
637
*[\ \ ]-pedantic[\ \ ]*) ;;
638
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
642
AC_MSG_RESULT($complCXXFLAGS)
644
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
645
AC_SUBST(WARN_CXXFLAGS)
648
dnl -*- mode: autoconf -*-
649
dnl Copyright 2009 Johan Dahlin
651
dnl This file is free software; the author(s) gives unlimited
652
dnl permission to copy and/or distribute it, with or without
653
dnl modifications, as long as this notice is preserved.
658
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
660
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
661
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
662
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
664
dnl enable/disable introspection
665
m4_if([$2], [require],
667
enable_introspection=yes
669
AC_ARG_ENABLE(introspection,
670
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
671
[Enable introspection for this build]),,
672
[enable_introspection=auto])
675
AC_MSG_CHECKING([for gobject-introspection])
677
dnl presence/version checking
678
AS_CASE([$enable_introspection],
680
found_introspection="no (disabled, use --enable-introspection to enable)"
683
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
684
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
685
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
686
found_introspection=yes,
687
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
690
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
693
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
696
AC_MSG_RESULT([$found_introspection])
698
INTROSPECTION_SCANNER=
699
INTROSPECTION_COMPILER=
700
INTROSPECTION_GENERATE=
701
INTROSPECTION_GIRDIR=
702
INTROSPECTION_TYPELIBDIR=
703
if test "x$found_introspection" = "xyes"; then
704
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
705
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
706
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
707
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
708
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
709
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
710
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
711
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
713
AC_SUBST(INTROSPECTION_SCANNER)
714
AC_SUBST(INTROSPECTION_COMPILER)
715
AC_SUBST(INTROSPECTION_GENERATE)
716
AC_SUBST(INTROSPECTION_GIRDIR)
717
AC_SUBST(INTROSPECTION_TYPELIBDIR)
718
AC_SUBST(INTROSPECTION_CFLAGS)
719
AC_SUBST(INTROSPECTION_LIBS)
720
AC_SUBST(INTROSPECTION_MAKEFILE)
722
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
727
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
729
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
731
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
735
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
738
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
740
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
743
# nls.m4 serial 5 (gettext-0.18)
744
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
746
dnl This file is free software; the Free Software Foundation
747
dnl gives unlimited permission to copy and/or distribute it,
748
dnl with or without modifications, as long as this notice is preserved.
750
dnl This file can can be used in projects which are not available under
751
dnl the GNU General Public License or the GNU Library General Public
752
dnl License but which still want to provide support for the GNU gettext
754
dnl Please note that the actual code of the GNU gettext library is covered
755
dnl by the GNU Library General Public License, and the rest of the GNU
756
dnl gettext package package is covered by the GNU General Public License.
757
dnl They are *not* in the public domain.
760
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
761
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
767
AC_MSG_CHECKING([whether NLS is requested])
768
dnl Default is enabled NLS
770
[ --disable-nls do not use Native Language Support],
771
USE_NLS=$enableval, USE_NLS=yes)
772
AC_MSG_RESULT([$USE_NLS])
776
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
777
# serial 1 (pkg-config-0.24)
779
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
781
# This program is free software; you can redistribute it and/or modify
782
# it under the terms of the GNU General Public License as published by
783
# the Free Software Foundation; either version 2 of the License, or
784
# (at your option) any later version.
786
# This program is distributed in the hope that it will be useful, but
787
# WITHOUT ANY WARRANTY; without even the implied warranty of
788
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
789
# General Public License for more details.
791
# You should have received a copy of the GNU General Public License
792
# along with this program; if not, write to the Free Software
793
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
795
# As a special exception to the GNU General Public License, if you
796
# distribute this file as part of a program that contains a
797
# configuration script generated by Autoconf, you may include it under
798
# the same distribution terms that you use for the rest of that program.
800
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
801
# ----------------------------------
802
AC_DEFUN([PKG_PROG_PKG_CONFIG],
803
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
804
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
805
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
806
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
807
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
809
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
810
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
812
if test -n "$PKG_CONFIG"; then
813
_pkg_min_version=m4_default([$1], [0.9.0])
814
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
815
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
822
])# PKG_PROG_PKG_CONFIG
824
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
826
# Check to see whether a particular set of modules exists. Similar
827
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
829
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
830
# only at the first occurence in configure.ac, so if the first place
831
# it's called might be skipped (such as if it is within an "if", you
832
# have to call PKG_CHECK_EXISTS manually
833
# --------------------------------------------------------------
834
AC_DEFUN([PKG_CHECK_EXISTS],
835
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
836
if test -n "$PKG_CONFIG" && \
837
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
838
m4_default([$2], [:])
839
m4_ifvaln([$3], [else
843
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
844
# ---------------------------------------------
845
m4_define([_PKG_CONFIG],
846
[if test -n "$$1"; then
848
elif test -n "$PKG_CONFIG"; then
849
PKG_CHECK_EXISTS([$3],
850
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
857
# _PKG_SHORT_ERRORS_SUPPORTED
858
# -----------------------------
859
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
860
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
861
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
862
_pkg_short_errors_supported=yes
864
_pkg_short_errors_supported=no
866
])# _PKG_SHORT_ERRORS_SUPPORTED
869
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
870
# [ACTION-IF-NOT-FOUND])
873
# Note that if there is a possibility the first call to
874
# PKG_CHECK_MODULES might not happen, you should be sure to include an
875
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
878
# --------------------------------------------------------------
879
AC_DEFUN([PKG_CHECK_MODULES],
880
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
881
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
882
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
885
AC_MSG_CHECKING([for $1])
887
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
888
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
890
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
891
and $1[]_LIBS to avoid the need to call pkg-config.
892
See the pkg-config man page for more details.])
894
if test $pkg_failed = yes; then
896
_PKG_SHORT_ERRORS_SUPPORTED
897
if test $_pkg_short_errors_supported = yes; then
898
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
900
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
902
# Put the nasty error message in config.log where it belongs
903
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
905
m4_default([$4], [AC_MSG_ERROR(
906
[Package requirements ($2) were not met:
910
Consider adjusting the PKG_CONFIG_PATH environment variable if you
911
installed software in a non-standard prefix.
915
elif test $pkg_failed = untried; then
917
m4_default([$4], [AC_MSG_FAILURE(
918
[The pkg-config script could not be found or is too old. Make sure it
919
is in your PATH or set the PKG_CONFIG environment variable to the full
924
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
927
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
928
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
932
])# PKG_CHECK_MODULES
22
934
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
24
936
# This file is free software; the Free Software Foundation
1033
1945
AC_SUBST([am__untar])
1034
1946
]) # _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 -*-
1070
# serial 1 (pkg-config-0.24)
1072
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1074
# This program is free software; you can redistribute it and/or modify
1075
# it under the terms of the GNU General Public License as published by
1076
# the Free Software Foundation; either version 2 of the License, or
1077
# (at your option) any later version.
1079
# This program is distributed in the hope that it will be useful, but
1080
# WITHOUT ANY WARRANTY; without even the implied warranty of
1081
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1082
# General Public License for more details.
1084
# You should have received a copy of the GNU General Public License
1085
# along with this program; if not, write to the Free Software
1086
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1088
# As a special exception to the GNU General Public License, if you
1089
# distribute this file as part of a program that contains a
1090
# configuration script generated by Autoconf, you may include it under
1091
# the same distribution terms that you use for the rest of that program.
1093
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1094
# ----------------------------------
1095
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1096
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1097
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1098
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1099
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1100
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1102
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1103
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1105
if test -n "$PKG_CONFIG"; then
1106
_pkg_min_version=m4_default([$1], [0.9.0])
1107
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1108
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1109
AC_MSG_RESULT([yes])
1115
])# PKG_PROG_PKG_CONFIG
1117
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1119
# Check to see whether a particular set of modules exists. Similar
1120
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1122
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1123
# only at the first occurence in configure.ac, so if the first place
1124
# it's called might be skipped (such as if it is within an "if", you
1125
# have to call PKG_CHECK_EXISTS manually
1126
# --------------------------------------------------------------
1127
AC_DEFUN([PKG_CHECK_EXISTS],
1128
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1129
if test -n "$PKG_CONFIG" && \
1130
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1131
m4_default([$2], [:])
1132
m4_ifvaln([$3], [else
1136
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1137
# ---------------------------------------------
1138
m4_define([_PKG_CONFIG],
1139
[if test -n "$$1"; then
1141
elif test -n "$PKG_CONFIG"; then
1142
PKG_CHECK_EXISTS([$3],
1143
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1150
# _PKG_SHORT_ERRORS_SUPPORTED
1151
# -----------------------------
1152
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1153
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1154
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1155
_pkg_short_errors_supported=yes
1157
_pkg_short_errors_supported=no
1159
])# _PKG_SHORT_ERRORS_SUPPORTED
1162
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1163
# [ACTION-IF-NOT-FOUND])
1166
# Note that if there is a possibility the first call to
1167
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1168
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1171
# --------------------------------------------------------------
1172
AC_DEFUN([PKG_CHECK_MODULES],
1173
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1174
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1175
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1178
AC_MSG_CHECKING([for $1])
1180
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1181
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1183
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1184
and $1[]_LIBS to avoid the need to call pkg-config.
1185
See the pkg-config man page for more details.])
1187
if test $pkg_failed = yes; then
1189
_PKG_SHORT_ERRORS_SUPPORTED
1190
if test $_pkg_short_errors_supported = yes; then
1191
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1193
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1195
# Put the nasty error message in config.log where it belongs
1196
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1198
m4_default([$4], [AC_MSG_ERROR(
1199
[Package requirements ($2) were not met:
1203
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1204
installed software in a non-standard prefix.
1208
elif test $pkg_failed = untried; then
1210
m4_default([$4], [AC_MSG_FAILURE(
1211
[The pkg-config script could not be found or is too old. Make sure it
1212
is in your PATH or set the PKG_CONFIG environment variable to the full
1217
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
1220
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1221
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1222
AC_MSG_RESULT([yes])
1225
])# PKG_CHECK_MODULES
1227
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1228
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1230
# This file is free software, distributed under the terms of the GNU
1231
# General Public License. As a special exception to the GNU General
1232
# Public License, this file may be distributed as part of a program
1233
# that contains a configuration script generated by Autoconf, under
1234
# the same distribution terms as the rest of that program.
1236
# This file can be copied and used freely without restrictions. It can
1237
# be used in projects which are not available under the GNU Public License
1238
# but which still want to provide support for the GNU gettext functionality.
1240
# Macro to add for using GNU gettext.
1241
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1243
# Modified to never use included libintl.
1244
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1246
# Major rework to remove unused code
1247
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1249
# Added better handling of ALL_LINGUAS from GNU gettext version
1250
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1252
# Modified to require ngettext
1253
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1255
# We need this here as well, since someone might use autoconf-2.5x
1256
# to configure GLib then an older version to configure a package
1257
# using AM_GLIB_GNU_GETTEXT
1261
dnl We go to great lengths to make sure that aclocal won't
1262
dnl try to pull in the installed version of these macros
1263
dnl when running aclocal in the glib directory.
1265
m4_copy([AC_DEFUN],[glib_DEFUN])
1266
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1268
dnl At the end, if we're not within glib, we'll define the public
1269
dnl definitions in terms of our private definitions.
1273
#--------------------
1274
glib_DEFUN([GLIB_LC_MESSAGES],
1275
[AC_CHECK_HEADERS([locale.h])
1276
if test $ac_cv_header_locale_h = yes; then
1277
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1278
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1279
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1280
if test $am_cv_val_LC_MESSAGES = yes; then
1281
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1282
[Define if your <locale.h> file defines LC_MESSAGES.])
1286
# GLIB_PATH_PROG_WITH_TEST
1287
#----------------------------
1288
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1289
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1290
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1291
[# Extract the first word of "$2", so it can be a program name with args.
1292
set dummy $2; ac_word=[$]2
1293
AC_MSG_CHECKING([for $ac_word])
1294
AC_CACHE_VAL(ac_cv_path_$1,
1297
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1300
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1301
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1302
test -z "$ac_dir" && ac_dir=.
1303
if test -f $ac_dir/$ac_word; then
1305
ac_cv_path_$1="$ac_dir/$ac_word"
1311
dnl If no 4th arg is given, leave the cache variable unset,
1312
dnl so AC_PATH_PROGS will keep looking.
1313
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1318
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1319
AC_MSG_RESULT([$]$1)
1328
glib_DEFUN([GLIB_WITH_NLS],
1329
dnl NLS is obligatory
1333
gt_cv_have_gettext=no
1339
AC_CHECK_HEADER(libintl.h,
1340
[gt_cv_func_dgettext_libintl="no"
1341
libintl_extra_libs=""
1344
# First check in libc
1346
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1348
#include <libintl.h>
1350
[return !ngettext ("","", 1)],
1351
gt_cv_func_ngettext_libc=yes,
1352
gt_cv_func_ngettext_libc=no)
1355
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1356
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1358
#include <libintl.h>
1360
[return !dgettext ("","")],
1361
gt_cv_func_dgettext_libc=yes,
1362
gt_cv_func_dgettext_libc=no)
1366
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1367
AC_CHECK_FUNCS(bind_textdomain_codeset)
1371
# If we don't have everything we want, check in libintl
1373
if test "$gt_cv_func_dgettext_libc" != "yes" \
1374
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1375
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1377
AC_CHECK_LIB(intl, bindtextdomain,
1378
[AC_CHECK_LIB(intl, ngettext,
1379
[AC_CHECK_LIB(intl, dgettext,
1380
gt_cv_func_dgettext_libintl=yes)])])
1382
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1383
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1385
AC_CHECK_LIB(intl, ngettext,
1386
[AC_CHECK_LIB(intl, dcgettext,
1387
[gt_cv_func_dgettext_libintl=yes
1388
libintl_extra_libs=-liconv],
1394
# If we found libintl, then check in it for bind_textdomain_codeset();
1395
# we'll prefer libc if neither have bind_textdomain_codeset(),
1396
# and both have dgettext and ngettext
1398
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1399
glib_save_LIBS="$LIBS"
1400
LIBS="$LIBS -lintl $libintl_extra_libs"
1401
unset ac_cv_func_bind_textdomain_codeset
1402
AC_CHECK_FUNCS(bind_textdomain_codeset)
1403
LIBS="$glib_save_LIBS"
1405
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1406
gt_cv_func_dgettext_libc=no
1408
if test "$gt_cv_func_dgettext_libc" = "yes" \
1409
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1410
gt_cv_func_dgettext_libintl=no
1416
if test "$gt_cv_func_dgettext_libc" = "yes" \
1417
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1418
gt_cv_have_gettext=yes
1421
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1422
INTLLIBS="-lintl $libintl_extra_libs"
1425
if test "$gt_cv_have_gettext" = "yes"; then
1426
AC_DEFINE(HAVE_GETTEXT,1,
1427
[Define if the GNU gettext() function is already present or preinstalled.])
1428
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1429
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1430
if test "$MSGFMT" != "no"; then
1431
glib_save_LIBS="$LIBS"
1432
LIBS="$LIBS $INTLLIBS"
1433
AC_CHECK_FUNCS(dcgettext)
1435
AC_MSG_CHECKING([if msgfmt accepts -c])
1436
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1439
"Content-Type: text/plain; charset=UTF-8\n"
1440
"Project-Id-Version: test 1.0\n"
1441
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1442
"Last-Translator: test <foo@bar.xx>\n"
1443
"Language-Team: C <LL@li.org>\n"
1444
"MIME-Version: 1.0\n"
1445
"Content-Transfer-Encoding: 8bit\n"
1446
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1447
AC_SUBST(MSGFMT_OPTS)
1448
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1449
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1450
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1451
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1452
return _nl_msg_cat_cntr],
1457
dnl On Solaris, if bind_textdomain_codeset is in libc,
1458
dnl GNU format message catalog is always supported,
1459
dnl since both are added to the libc all together.
1460
dnl Hence, we'd like to go with DATADIRNAME=share and
1461
dnl and CATOBJEXT=.gmo in this case.
1462
AC_CHECK_FUNC(bind_textdomain_codeset,
1473
LIBS="$glib_save_LIBS"
1476
gt_cv_have_gettext=no
1481
if test "$gt_cv_have_gettext" = "yes" ; then
1482
AC_DEFINE(ENABLE_NLS, 1,
1483
[always defined to indicate that i18n is enabled])
1486
dnl Test whether we really found GNU xgettext.
1487
if test "$XGETTEXT" != ":"; then
1488
dnl If it is not GNU xgettext we define it as : so that the
1489
dnl Makefiles still can work.
1490
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1494
[found xgettext program is not GNU xgettext; ignore it])
1499
# We need to process the po/ directory.
1503
[case "$CONFIG_FILES" in *po/Makefile.in*)
1504
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1507
dnl These rules are solely for the distribution goal. While doing this
1508
dnl we only have to keep exactly one list of the available catalogs
1509
dnl in configure.ac.
1510
for lang in $ALL_LINGUAS; do
1511
GMOFILES="$GMOFILES $lang.gmo"
1512
POFILES="$POFILES $lang.po"
1515
dnl Make all variables we use known to autoconf.
1518
AC_SUBST(DATADIRNAME)
1520
AC_SUBST(INSTOBJEXT)
1522
AC_SUBST(PO_IN_DATADIR_TRUE)
1523
AC_SUBST(PO_IN_DATADIR_FALSE)
1528
# AM_GLIB_GNU_GETTEXT
1529
# -------------------
1530
# Do checks necessary for use of gettext. If a suitable implementation
1531
# of gettext is found in either in libintl or in the C library,
1532
# it will set INTLLIBS to the libraries needed for use of gettext
1533
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1534
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1535
# on various variables needed by the Makefile.in.in installed by
1538
glib_DEFUN([GLIB_GNU_GETTEXT],
1539
[AC_REQUIRE([AC_PROG_CC])dnl
1540
AC_REQUIRE([AC_HEADER_STDC])dnl
1545
if test "$gt_cv_have_gettext" = "yes"; then
1546
if test "x$ALL_LINGUAS" = "x"; then
1549
AC_MSG_CHECKING(for catalogs to be installed)
1551
for presentlang in $ALL_LINGUAS; do
1553
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1554
desiredlanguages="$LINGUAS"
1556
desiredlanguages="$ALL_LINGUAS"
1558
for desiredlang in $desiredlanguages; do
1559
# Use the presentlang catalog if desiredlang is
1560
# a. equal to presentlang, or
1561
# b. a variant of presentlang (because in this case,
1562
# presentlang can be used as a fallback for messages
1563
# which are not translated in the desiredlang catalog).
1564
case "$desiredlang" in
1565
"$presentlang"*) useit=yes;;
1568
if test $useit = yes; then
1569
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1572
LINGUAS=$NEW_LINGUAS
1573
AC_MSG_RESULT($LINGUAS)
1576
dnl Construct list of names of catalog files to be constructed.
1577
if test -n "$LINGUAS"; then
1578
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1582
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1583
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1584
dnl Try to locate is.
1586
if test -n "$ac_aux_dir"; then
1587
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1589
if test -z "$MKINSTALLDIRS"; then
1590
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1592
AC_SUBST(MKINSTALLDIRS)
1594
dnl Generate list of files to be processed by xgettext which will
1595
dnl be included in po/Makefile.
1596
test -d po || mkdir po
1597
if test "x$srcdir" != "x."; then
1598
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1599
posrcprefix="$srcdir/"
1601
posrcprefix="../$srcdir/"
1607
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1608
< $srcdir/po/POTFILES.in > po/POTFILES
1611
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1612
# -------------------------------
1613
# Define VARIABLE to the location where catalog files will
1614
# be installed by po/Makefile.
1615
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1616
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1617
glib_save_prefix="$prefix"
1618
glib_save_exec_prefix="$exec_prefix"
1619
glib_save_datarootdir="$datarootdir"
1620
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1621
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1622
datarootdir=`eval echo "${datarootdir}"`
1623
if test "x$CATOBJEXT" = "x.mo" ; then
1624
localedir=`eval echo "${libdir}/locale"`
1626
localedir=`eval echo "${datadir}/locale"`
1628
prefix="$glib_save_prefix"
1629
exec_prefix="$glib_save_exec_prefix"
1630
datarootdir="$glib_save_datarootdir"
1631
AC_DEFINE_UNQUOTED($1, "$localedir",
1632
[Define the location where the catalogs will be installed])
1636
dnl Now the definitions that aclocal will find
1638
ifdef(glib_configure_ac,[],[
1639
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1640
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1643
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1645
# Create a temporary file with TEST-FILE as its contents and pass the
1646
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1647
# 0 and perform ACTION-IF-FAIL for any other exit status.
1648
AC_DEFUN([GLIB_RUN_PROG],
1649
[cat >conftest.foo <<_ACEOF
1652
if AC_RUN_LOG([$1 conftest.foo]); then
1653
m4_ifval([$3], [$3], [:])
1654
m4_ifvaln([$4], [else $4])dnl
1655
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1656
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1665
dnl GNOME_COMMON_INIT
1667
AU_DEFUN([GNOME_COMMON_INIT],
1669
dnl this macro should come after AC_CONFIG_MACRO_DIR
1670
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
1672
dnl ensure that when the Automake generated makefile calls aclocal,
1673
dnl it honours the $ACLOCAL_FLAGS environment variable
1674
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
1675
if test -n "$ac_macro_dir"; then
1676
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
1679
AC_SUBST([ACLOCAL_AMFLAGS])
1681
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
1682
in your top-level Makefile.am, instead, where "m4" is the macro directory set
1683
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
1685
AC_DEFUN([GNOME_DEBUG_CHECK],
1687
AC_ARG_ENABLE([debug],
1688
AC_HELP_STRING([--enable-debug],
1689
[turn on debugging]),,
1692
if test x$enable_debug = xyes ; then
1693
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
1694
[Enable additional debugging at the expense of performance and size])
1698
dnl GNOME_MAINTAINER_MODE_DEFINES ()
1699
dnl define DISABLE_DEPRECATED
1701
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
1703
AC_REQUIRE([AM_MAINTAINER_MODE])
1705
DISABLE_DEPRECATED=""
1706
if test $USE_MAINTAINER_MODE = yes; then
1707
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
1708
for DOMAIN in $DOMAINS; do
1709
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
1713
AC_SUBST(DISABLE_DEPRECATED)
1716
dnl GNOME_COMPILE_WARNINGS
1717
dnl Turn on many useful compiler warnings
1718
dnl For now, only works on GCC
1719
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
1720
dnl ******************************
1721
dnl More compiler warnings
1722
dnl ******************************
1724
AC_ARG_ENABLE(compile-warnings,
1725
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
1726
[Turn on compiler warnings]),,
1727
[enable_compile_warnings="m4_default([$1],[yes])"])
1730
if test "x$GCC" != xyes; then
1731
enable_compile_warnings=no
1735
realsave_CFLAGS="$CFLAGS"
1737
case "$enable_compile_warnings" in
1742
warning_flags="-Wall"
1745
warning_flags="-Wall -Wmissing-prototypes"
1748
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
1749
CFLAGS="$warning_flags $CFLAGS"
1750
for option in -Wno-sign-compare; do
1751
SAVE_CFLAGS="$CFLAGS"
1752
CFLAGS="$CFLAGS $option"
1753
AC_MSG_CHECKING([whether gcc understands $option])
1754
AC_TRY_COMPILE([], [],
1757
CFLAGS="$SAVE_CFLAGS"
1758
AC_MSG_RESULT($has_option)
1759
if test $has_option = yes; then
1760
warning_flags="$warning_flags $option"
1766
if test "$enable_compile_warnings" = "error" ; then
1767
warning_flags="$warning_flags -Werror"
1771
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
1774
CFLAGS="$realsave_CFLAGS"
1775
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
1776
AC_MSG_RESULT($warning_flags)
1778
AC_ARG_ENABLE(iso-c,
1779
AC_HELP_STRING([--enable-iso-c],
1780
[Try to warn if code is not ISO C ]),,
1783
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
1785
if test "x$enable_iso_c" != "xno"; then
1786
if test "x$GCC" = "xyes"; then
1788
*[\ \ ]-ansi[\ \ ]*) ;;
1789
*) complCFLAGS="$complCFLAGS -ansi" ;;
1792
*[\ \ ]-pedantic[\ \ ]*) ;;
1793
*) complCFLAGS="$complCFLAGS -pedantic" ;;
1797
AC_MSG_RESULT($complCFLAGS)
1799
WARN_CFLAGS="$warning_flags $complCFLAGS"
1800
AC_SUBST(WARN_CFLAGS)
1803
dnl For C++, do basically the same thing.
1805
AC_DEFUN([GNOME_CXX_WARNINGS],[
1806
AC_ARG_ENABLE(cxx-warnings,
1807
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
1808
[Turn on compiler warnings.]),,
1809
[enable_cxx_warnings="m4_default([$1],[minimum])"])
1811
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1813
if test "x$GXX" != xyes; then
1814
enable_cxx_warnings=no
1816
if test "x$enable_cxx_warnings" != "xno"; then
1817
if test "x$GXX" = "xyes"; then
1818
case " $CXXFLAGS " in
1819
*[\ \ ]-Wall[\ \ ]*) ;;
1820
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
1823
## -W is not all that useful. And it cannot be controlled
1824
## with individual -Wno-xxx flags, unlike -Wall
1825
if test "x$enable_cxx_warnings" = "xyes"; then
1826
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
1830
AC_MSG_RESULT($warnCXXFLAGS)
1832
AC_ARG_ENABLE(iso-cxx,
1833
AC_HELP_STRING([--enable-iso-cxx],
1834
[Try to warn if code is not ISO C++ ]),,
1835
[enable_iso_cxx=no])
1837
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
1839
if test "x$enable_iso_cxx" != "xno"; then
1840
if test "x$GXX" = "xyes"; then
1841
case " $CXXFLAGS " in
1842
*[\ \ ]-ansi[\ \ ]*) ;;
1843
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
1846
case " $CXXFLAGS " in
1847
*[\ \ ]-pedantic[\ \ ]*) ;;
1848
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1852
AC_MSG_RESULT($complCXXFLAGS)
1854
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1855
AC_SUBST(WARN_CXXFLAGS)
1858
dnl -*- mode: autoconf -*-
1859
dnl Copyright 2009 Johan Dahlin
1861
dnl This file is free software; the author(s) gives unlimited
1862
dnl permission to copy and/or distribute it, with or without
1863
dnl modifications, as long as this notice is preserved.
1868
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
1870
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
1871
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
1872
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
1874
dnl enable/disable introspection
1875
m4_if([$2], [require],
1877
enable_introspection=yes
1879
AC_ARG_ENABLE(introspection,
1880
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
1881
[Enable introspection for this build]),,
1882
[enable_introspection=auto])
1885
AC_MSG_CHECKING([for gobject-introspection])
1887
dnl presence/version checking
1888
AS_CASE([$enable_introspection],
1890
found_introspection="no (disabled, use --enable-introspection to enable)"
1893
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
1894
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
1895
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
1896
found_introspection=yes,
1897
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
1900
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
1903
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
1906
AC_MSG_RESULT([$found_introspection])
1908
INTROSPECTION_SCANNER=
1909
INTROSPECTION_COMPILER=
1910
INTROSPECTION_GENERATE=
1911
INTROSPECTION_GIRDIR=
1912
INTROSPECTION_TYPELIBDIR=
1913
if test "x$found_introspection" = "xyes"; then
1914
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1915
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1916
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1917
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1918
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1919
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1920
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1921
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1923
AC_SUBST(INTROSPECTION_SCANNER)
1924
AC_SUBST(INTROSPECTION_COMPILER)
1925
AC_SUBST(INTROSPECTION_GENERATE)
1926
AC_SUBST(INTROSPECTION_GIRDIR)
1927
AC_SUBST(INTROSPECTION_TYPELIBDIR)
1928
AC_SUBST(INTROSPECTION_CFLAGS)
1929
AC_SUBST(INTROSPECTION_LIBS)
1930
AC_SUBST(INTROSPECTION_MAKEFILE)
1932
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1937
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
1939
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
1941
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
1945
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
1948
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
1950
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
1953
1948
m4_include([m4/gnome-doc-utils.m4])
1954
1949
m4_include([m4/gtk-doc.m4])
1955
1950
m4_include([m4/intltool.m4])