source: trunk/third/eog/aclocal.m4 @ 21327

Revision 21327, 33.7 KB checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21326, which included commits to RCS files with non-trunk default branches.
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13# Like AC_CONFIG_HEADER, but automatically create stamp file.
14
15AC_DEFUN([AM_CONFIG_HEADER],
16[AC_PREREQ([2.12])
17AC_CONFIG_HEADER([$1])
18dnl When config.status generates a header, we must update the stamp-h file.
19dnl This file resides in the same directory as the config header
20dnl that is generated.  We must strip everything past the first ":",
21dnl and everything past the last "/".
22AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
23ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
25<<am_indx=1
26for am_file in <<$1>>; do
27  case " <<$>>CONFIG_HEADERS " in
28  *" <<$>>am_file "*<<)>>
29    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
30    ;;
31  esac
32  am_indx=`expr "<<$>>am_indx" + 1`
33done<<>>dnl>>)
34changequote([,]))])
35
36# Do all the work for Automake.  This macro actually does too much --
37# some checks are only needed if your package does certain things.
38# But this isn't really a big deal.
39
40# serial 1
41
42dnl Usage:
43dnl AM_INIT_AUTOMAKE(package,version, [no-define])
44
45AC_DEFUN([AM_INIT_AUTOMAKE],
46[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
47AC_REQUIRE([AC_PROG_INSTALL])
48PACKAGE=[$1]
49AC_SUBST(PACKAGE)
50VERSION=[$2]
51AC_SUBST(VERSION)
52dnl test to see if srcdir already configured
53if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
54  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
55fi
56ifelse([$3],,
57AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
58AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
59AC_REQUIRE([AM_SANITY_CHECK])
60AC_REQUIRE([AC_ARG_PROGRAM])
61dnl FIXME This is truly gross.
62missing_dir=`cd $ac_aux_dir && pwd`
63AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
64AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
65AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
66AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
67AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
68AC_REQUIRE([AC_PROG_MAKE_SET])])
69
70# Copyright 2002  Free Software Foundation, Inc.
71
72# This program is free software; you can redistribute it and/or modify
73# it under the terms of the GNU General Public License as published by
74# the Free Software Foundation; either version 2, or (at your option)
75# any later version.
76
77# This program is distributed in the hope that it will be useful,
78# but WITHOUT ANY WARRANTY; without even the implied warranty of
79# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
80# GNU General Public License for more details.
81
82# You should have received a copy of the GNU General Public License
83# along with this program; if not, write to the Free Software
84# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
85
86# AM_AUTOMAKE_VERSION(VERSION)
87# ----------------------------
88# Automake X.Y traces this macro to ensure aclocal.m4 has been
89# generated from the m4 files accompanying Automake X.Y.
90AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
91
92# AM_SET_CURRENT_AUTOMAKE_VERSION
93# -------------------------------
94# Call AM_AUTOMAKE_VERSION so it can be traced.
95# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
96AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
97         [AM_AUTOMAKE_VERSION([1.4-p6])])
98
99#
100# Check to make sure that the build environment is sane.
101#
102
103AC_DEFUN([AM_SANITY_CHECK],
104[AC_MSG_CHECKING([whether build environment is sane])
105# Just in case
106sleep 1
107echo timestamp > conftestfile
108# Do `set' in a subshell so we don't clobber the current shell's
109# arguments.  Must try -L first in case configure is actually a
110# symlink; some systems play weird games with the mod time of symlinks
111# (eg FreeBSD returns the mod time of the symlink's containing
112# directory).
113if (
114   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
115   if test "[$]*" = "X"; then
116      # -L didn't work.
117      set X `ls -t $srcdir/configure conftestfile`
118   fi
119   if test "[$]*" != "X $srcdir/configure conftestfile" \
120      && test "[$]*" != "X conftestfile $srcdir/configure"; then
121
122      # If neither matched, then we have a broken ls.  This can happen
123      # if, for instance, CONFIG_SHELL is bash and it inherits a
124      # broken ls alias from the environment.  This has actually
125      # happened.  Such a system could not be considered "sane".
126      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
127alias in your environment])
128   fi
129
130   test "[$]2" = conftestfile
131   )
132then
133   # Ok.
134   :
135else
136   AC_MSG_ERROR([newly created file is older than distributed files!
137Check your system clock])
138fi
139rm -f conftest*
140AC_MSG_RESULT(yes)])
141
142dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
143dnl The program must properly implement --version.
144AC_DEFUN([AM_MISSING_PROG],
145[AC_MSG_CHECKING(for working $2)
146# Run test in a subshell; some versions of sh will print an error if
147# an executable is not found, even if stderr is redirected.
148# Redirect stdin to placate older versions of autoconf.  Sigh.
149if ($2 --version) < /dev/null > /dev/null 2>&1; then
150   $1=$2
151   AC_MSG_RESULT(found)
152else
153   $1="$3/missing $2"
154   AC_MSG_RESULT(missing)
155fi
156AC_SUBST($1)])
157
158# Add --enable-maintainer-mode option to configure.
159# From Jim Meyering
160
161# serial 1
162
163AC_DEFUN([AM_MAINTAINER_MODE],
164[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
165  dnl maintainer-mode is disabled by default
166  AC_ARG_ENABLE(maintainer-mode,
167[  --enable-maintainer-mode enable make rules and dependencies not useful
168                          (and sometimes confusing) to the casual installer],
169      USE_MAINTAINER_MODE=$enableval,
170      USE_MAINTAINER_MODE=no)
171  AC_MSG_RESULT($USE_MAINTAINER_MODE)
172  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
173  MAINT=$MAINTAINER_MODE_TRUE
174  AC_SUBST(MAINT)dnl
175]
176)
177
178# Define a conditional.
179
180AC_DEFUN([AM_CONDITIONAL],
181[AC_SUBST($1_TRUE)
182AC_SUBST($1_FALSE)
183if $2; then
184  $1_TRUE=
185  $1_FALSE='#'
186else
187  $1_TRUE='#'
188  $1_FALSE=
189fi])
190
191# isc-posix.m4 serial 2 (gettext-0.11.2)
192dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
193dnl This file is free software, distributed under the terms of the GNU
194dnl General Public License.  As a special exception to the GNU General
195dnl Public License, this file may be distributed as part of a program
196dnl that contains a configuration script generated by Autoconf, under
197dnl the same distribution terms as the rest of that program.
198
199# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
200
201# This test replaces the one in autoconf.
202# Currently this macro should have the same name as the autoconf macro
203# because gettext's gettext.m4 (distributed in the automake package)
204# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
205# give these diagnostics:
206#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
207#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
208
209undefine([AC_ISC_POSIX])
210
211AC_DEFUN([AC_ISC_POSIX],
212  [
213    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
214    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
215  ]
216)
217
218# Copyright (C) 1995-2002 Free Software Foundation, Inc.
219# Copyright (C) 2001-2003 Red Hat, Inc.
220#
221# This file is free software, distributed under the terms of the GNU
222# General Public License.  As a special exception to the GNU General
223# Public License, this file may be distributed as part of a program
224# that contains a configuration script generated by Autoconf, under
225# the same distribution terms as the rest of that program.
226#
227# This file can be copied and used freely without restrictions.  It can
228# be used in projects which are not available under the GNU Public License
229# but which still want to provide support for the GNU gettext functionality.
230#
231# Macro to add for using GNU gettext.
232# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
233#
234# Modified to never use included libintl.
235# Owen Taylor <otaylor@redhat.com>, 12/15/1998
236#
237# Major rework to remove unused code
238# Owen Taylor <otaylor@redhat.com>, 12/11/2002
239#
240# Added better handling of ALL_LINGUAS from GNU gettext version
241# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
242
243#
244# We need this here as well, since someone might use autoconf-2.5x
245# to configure GLib then an older version to configure a package
246# using AM_GLIB_GNU_GETTEXT
247AC_PREREQ(2.53)
248
249dnl
250dnl We go to great lengths to make sure that aclocal won't
251dnl try to pull in the installed version of these macros
252dnl when running aclocal in the glib directory.
253dnl
254m4_copy([AC_DEFUN],[glib_DEFUN])
255m4_copy([AC_REQUIRE],[glib_REQUIRE])
256dnl
257dnl At the end, if we're not within glib, we'll define the public
258dnl definitions in terms of our private definitions.
259dnl
260
261# GLIB_LC_MESSAGES
262#--------------------
263glib_DEFUN([GLIB_LC_MESSAGES],
264  [AC_CHECK_HEADERS([locale.h])
265    if test $ac_cv_header_locale_h = yes; then
266    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
267      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
268       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
269    if test $am_cv_val_LC_MESSAGES = yes; then
270      AC_DEFINE(HAVE_LC_MESSAGES, 1,
271        [Define if your <locale.h> file defines LC_MESSAGES.])
272    fi
273  fi])
274
275# GLIB_PATH_PROG_WITH_TEST
276#----------------------------
277dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
278dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
279glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
280[# Extract the first word of "$2", so it can be a program name with args.
281set dummy $2; ac_word=[$]2
282AC_MSG_CHECKING([for $ac_word])
283AC_CACHE_VAL(ac_cv_path_$1,
284[case "[$]$1" in
285  /*)
286  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
287  ;;
288  *)
289  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
290  for ac_dir in ifelse([$5], , $PATH, [$5]); do
291    test -z "$ac_dir" && ac_dir=.
292    if test -f $ac_dir/$ac_word; then
293      if [$3]; then
294        ac_cv_path_$1="$ac_dir/$ac_word"
295        break
296      fi
297    fi
298  done
299  IFS="$ac_save_ifs"
300dnl If no 4th arg is given, leave the cache variable unset,
301dnl so AC_PATH_PROGS will keep looking.
302ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
303])dnl
304  ;;
305esac])dnl
306$1="$ac_cv_path_$1"
307if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
308  AC_MSG_RESULT([$]$1)
309else
310  AC_MSG_RESULT(no)
311fi
312AC_SUBST($1)dnl
313])
314
315# GLIB_WITH_NLS
316#-----------------
317glib_DEFUN([GLIB_WITH_NLS],
318  dnl NLS is obligatory
319  [USE_NLS=yes
320    AC_SUBST(USE_NLS)
321
322    gt_cv_have_gettext=no
323
324    CATOBJEXT=NONE
325    XGETTEXT=:
326    INTLLIBS=
327
328    AC_CHECK_HEADER(libintl.h,
329     [gt_cv_func_dgettext_libintl="no"
330      libintl_extra_libs=""
331
332      #
333      # First check in libc
334      #
335      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
336        [AC_TRY_LINK([
337#include <libintl.h>
338],
339          [return (int) dgettext ("","")],
340          gt_cv_func_dgettext_libc=yes,
341          gt_cv_func_dgettext_libc=no)
342        ])
343 
344      if test "$gt_cv_func_dgettext_libc" = "yes" ; then
345        AC_CHECK_FUNCS(bind_textdomain_codeset)
346      fi
347
348      #
349      # If we don't have everything we want, check in libintl
350      #
351      if test "$gt_cv_func_dgettext_libc" != "yes" \
352         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
353       
354        AC_CHECK_LIB(intl, bindtextdomain,
355            [AC_CHECK_LIB(intl, dgettext,
356                          gt_cv_func_dgettext_libintl=yes)])
357
358        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
359          AC_MSG_CHECKING([if -liconv is needed to use gettext])
360          AC_MSG_RESULT([])
361          AC_CHECK_LIB(intl, dcgettext,
362                       [gt_cv_func_dgettext_libintl=yes
363                        libintl_extra_libs=-liconv],
364                        :,-liconv)
365        fi
366
367        #
368        # If we found libintl, then check in it for bind_textdomain_codeset();
369        # we'll prefer libc if neither have bind_textdomain_codeset(),
370        # and both have dgettext
371        #
372        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
373          glib_save_LIBS="$LIBS"
374          LIBS="$LIBS -lintl $libintl_extra_libs"
375          unset ac_cv_func_bind_textdomain_codeset
376          AC_CHECK_FUNCS(bind_textdomain_codeset)
377          LIBS="$glib_save_LIBS"
378
379          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
380            gt_cv_func_dgettext_libc=no
381          else
382            if test "$gt_cv_func_dgettext_libc" = "yes"; then
383              gt_cv_func_dgettext_libintl=no
384            fi
385          fi
386        fi
387      fi
388
389      if test "$gt_cv_func_dgettext_libc" = "yes" \
390        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
391        gt_cv_have_gettext=yes
392      fi
393 
394      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
395        INTLLIBS="-lintl $libintl_extra_libs"
396      fi
397 
398      if test "$gt_cv_have_gettext" = "yes"; then
399        AC_DEFINE(HAVE_GETTEXT,1,
400          [Define if the GNU gettext() function is already present or preinstalled.])
401        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
402          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
403        if test "$MSGFMT" != "no"; then
404          glib_save_LIBS="$LIBS"
405          LIBS="$LIBS $INTLLIBS"
406          AC_CHECK_FUNCS(dcgettext)
407          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
408          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
409            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
410          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
411                         return _nl_msg_cat_cntr],
412            [CATOBJEXT=.gmo
413             DATADIRNAME=share],
414            [case $host in
415            *-*-solaris*)
416            dnl On Solaris, if bind_textdomain_codeset is in libc,
417            dnl GNU format message catalog is always supported,
418            dnl since both are added to the libc all together.
419            dnl Hence, we'd like to go with DATADIRNAME=share and
420            dnl and CATOBJEXT=.gmo in this case.
421            AC_CHECK_FUNC(bind_textdomain_codeset,
422              [CATOBJEXT=.gmo
423               DATADIRNAME=share],
424              [CATOBJEXT=.mo
425               DATADIRNAME=lib])
426            ;;
427            *)
428            CATOBJEXT=.mo
429            DATADIRNAME=lib
430            ;;
431            esac])
432          LIBS="$glib_save_LIBS"
433          INSTOBJEXT=.mo
434        else
435          gt_cv_have_gettext=no
436        fi
437      fi
438    ])
439
440    if test "$gt_cv_have_gettext" = "yes" ; then
441      AC_DEFINE(ENABLE_NLS, 1,
442        [always defined to indicate that i18n is enabled])
443    fi
444
445    dnl Test whether we really found GNU xgettext.
446    if test "$XGETTEXT" != ":"; then
447      dnl If it is not GNU xgettext we define it as : so that the
448      dnl Makefiles still can work.
449      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
450        : ;
451      else
452        AC_MSG_RESULT(
453          [found xgettext program is not GNU xgettext; ignore it])
454        XGETTEXT=":"
455      fi
456    fi
457
458    # We need to process the po/ directory.
459    POSUB=po
460
461    AC_OUTPUT_COMMANDS(
462      [case "$CONFIG_FILES" in *po/Makefile.in*)
463        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
464      esac])
465
466    dnl These rules are solely for the distribution goal.  While doing this
467    dnl we only have to keep exactly one list of the available catalogs
468    dnl in configure.in.
469    for lang in $ALL_LINGUAS; do
470      GMOFILES="$GMOFILES $lang.gmo"
471      POFILES="$POFILES $lang.po"
472    done
473
474    dnl Make all variables we use known to autoconf.
475    AC_SUBST(CATALOGS)
476    AC_SUBST(CATOBJEXT)
477    AC_SUBST(DATADIRNAME)
478    AC_SUBST(GMOFILES)
479    AC_SUBST(INSTOBJEXT)
480    AC_SUBST(INTLLIBS)
481    AC_SUBST(PO_IN_DATADIR_TRUE)
482    AC_SUBST(PO_IN_DATADIR_FALSE)
483    AC_SUBST(POFILES)
484    AC_SUBST(POSUB)
485  ])
486
487# AM_GLIB_GNU_GETTEXT
488# -------------------
489# Do checks necessary for use of gettext. If a suitable implementation
490# of gettext is found in either in libintl or in the C library,
491# it will set INTLLIBS to the libraries needed for use of gettext
492# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
493# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
494# on various variables needed by the Makefile.in.in installed by
495# glib-gettextize.
496dnl
497glib_DEFUN([GLIB_GNU_GETTEXT],
498  [AC_REQUIRE([AC_PROG_CC])dnl
499   AC_REQUIRE([AC_HEADER_STDC])dnl
500   
501   GLIB_LC_MESSAGES
502   GLIB_WITH_NLS
503
504   if test "$gt_cv_have_gettext" = "yes"; then
505     if test "x$ALL_LINGUAS" = "x"; then
506       LINGUAS=
507     else
508       AC_MSG_CHECKING(for catalogs to be installed)
509       NEW_LINGUAS=
510       for presentlang in $ALL_LINGUAS; do
511         useit=no
512         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
513           desiredlanguages="$LINGUAS"
514         else
515           desiredlanguages="$ALL_LINGUAS"
516         fi
517         for desiredlang in $desiredlanguages; do
518           # Use the presentlang catalog if desiredlang is
519           #   a. equal to presentlang, or
520           #   b. a variant of presentlang (because in this case,
521           #      presentlang can be used as a fallback for messages
522           #      which are not translated in the desiredlang catalog).
523           case "$desiredlang" in
524             "$presentlang"*) useit=yes;;
525           esac
526         done
527         if test $useit = yes; then
528           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
529         fi
530       done
531       LINGUAS=$NEW_LINGUAS
532       AC_MSG_RESULT($LINGUAS)
533     fi
534
535     dnl Construct list of names of catalog files to be constructed.
536     if test -n "$LINGUAS"; then
537       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
538     fi
539   fi
540
541   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
542   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
543   dnl Try to locate is.
544   MKINSTALLDIRS=
545   if test -n "$ac_aux_dir"; then
546     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
547   fi
548   if test -z "$MKINSTALLDIRS"; then
549     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
550   fi
551   AC_SUBST(MKINSTALLDIRS)
552
553   dnl Generate list of files to be processed by xgettext which will
554   dnl be included in po/Makefile.
555   test -d po || mkdir po
556   if test "x$srcdir" != "x."; then
557     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
558       posrcprefix="$srcdir/"
559     else
560       posrcprefix="../$srcdir/"
561     fi
562   else
563     posrcprefix="../"
564   fi
565   rm -f po/POTFILES
566   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
567        < $srcdir/po/POTFILES.in > po/POTFILES
568  ])
569
570# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
571# -------------------------------
572# Define VARIABLE to the location where catalog files will
573# be installed by po/Makefile.
574glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
575[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
576glib_save_prefix="$prefix"
577glib_save_exec_prefix="$exec_prefix"
578test "x$prefix" = xNONE && prefix=$ac_default_prefix
579test "x$exec_prefix" = xNONE && exec_prefix=$prefix
580if test "x$CATOBJEXT" = "x.mo" ; then
581  localedir=`eval echo "${libdir}/locale"`
582else
583  localedir=`eval echo "${datadir}/locale"`
584fi
585prefix="$glib_save_prefix"
586exec_prefix="$glib_save_exec_prefix"
587AC_DEFINE_UNQUOTED($1, "$localedir",
588  [Define the location where the catalogs will be installed])
589])
590
591dnl
592dnl Now the definitions that aclocal will find
593dnl
594ifdef(glib_configure_in,[],[
595AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
596AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
597])dnl
598
599ll## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*-
600
601dnl AC_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
602# serial 1 AC_PROG_INTLTOOL
603AC_DEFUN([AC_PROG_INTLTOOL],
604[
605
606if test -n "$1"; then
607    AC_MSG_CHECKING(for intltool >= $1)
608
609    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
610    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }'  < ${ac_aux_dir}/intltool-update.in`
611    changequote({{,}})
612    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
613    changequote([,])
614
615    if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
616        AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
617    else
618        AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool $1 or later.])
619        exit 1
620    fi
621fi
622
623  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
624INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
625     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
626     INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
627      INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
628     INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
629   INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
630    INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
631INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
632       INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
633      INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
634      INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
635      INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
636    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
637  INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
638    INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
639
640AC_SUBST(INTLTOOL_DESKTOP_RULE)
641AC_SUBST(INTLTOOL_DIRECTORY_RULE)
642AC_SUBST(INTLTOOL_KEYS_RULE)
643AC_SUBST(INTLTOOL_PROP_RULE)
644AC_SUBST(INTLTOOL_OAF_RULE)
645AC_SUBST(INTLTOOL_PONG_RULE)
646AC_SUBST(INTLTOOL_SERVER_RULE)
647AC_SUBST(INTLTOOL_SHEET_RULE)
648AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
649AC_SUBST(INTLTOOL_UI_RULE)
650AC_SUBST(INTLTOOL_XAM_RULE)
651AC_SUBST(INTLTOOL_KBD_RULE)
652AC_SUBST(INTLTOOL_XML_RULE)
653AC_SUBST(INTLTOOL_CAVES_RULE)
654AC_SUBST(INTLTOOL_SCHEMAS_RULE)
655AC_SUBST(INTLTOOL_THEME_RULE)
656
657# Use the tools built into the package, not the ones that are installed.
658
659INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
660INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
661INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
662
663AC_SUBST(INTLTOOL_EXTRACT)
664AC_SUBST(INTLTOOL_MERGE)
665AC_SUBST(INTLTOOL_UPDATE)
666
667AC_PATH_PROG(INTLTOOL_PERL, perl)
668if test -z "$INTLTOOL_PERL"; then
669   AC_MSG_ERROR([perl not found; required for intltool])
670fi
671if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
672   AC_MSG_ERROR([perl 5.x required for intltool])
673fi
674if test "x$2" != "xno-xml"; then
675   AC_MSG_CHECKING([for XML::Parser])
676   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
677       AC_MSG_RESULT([ok])
678   else
679       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
680   fi
681fi
682
683# Remove file type tags (using []) from po/POTFILES.
684
685ifdef([AC_DIVERSION_ICMDS],[
686  AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
687      changequote(,)
688      mv -f po/POTFILES po/POTFILES.tmp
689      sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
690      rm -f po/POTFILES.tmp
691      changequote([,])
692  AC_DIVERT_POP()
693],[
694  ifdef([AC_CONFIG_COMMANDS_PRE],[
695    AC_CONFIG_COMMANDS_PRE([
696        changequote(,)
697        mv -f po/POTFILES po/POTFILES.tmp
698        sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
699        rm -f po/POTFILES.tmp
700        changequote([,])
701    ])
702  ])
703])
704
705# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
706
707AC_OUTPUT_COMMANDS([
708
709sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${ac_aux_dir}/intltool-extract.in > intltool-extract.out
710if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
711  rm -f intltool-extract.out
712else
713  mv -f intltool-extract.out intltool-extract
714fi
715chmod ugo+x intltool-extract
716chmod u+w intltool-extract
717
718sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" \
719    < ${ac_aux_dir}/intltool-merge.in > intltool-merge.out
720if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
721  rm -f intltool-merge.out
722else
723  mv -f intltool-merge.out intltool-merge
724fi
725chmod ugo+x intltool-merge
726chmod u+w intltool-merge
727
728sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${ac_aux_dir}/intltool-update.in > intltool-update.out
729if cmp -s intltool-update intltool-update.out 2>/dev/null; then
730  rm -f intltool-update.out
731else
732  mv -f intltool-update.out intltool-update
733fi
734chmod ugo+x intltool-update
735chmod u+w intltool-update
736
737], INTLTOOL_PERL=${INTLTOOL_PERL} ac_aux_dir=${ac_aux_dir})
738
739])
740
741dnl GNOME_COMPILE_WARNINGS
742dnl Turn on many useful compiler warnings
743dnl For now, only works on GCC
744AC_DEFUN([GNOME_COMPILE_WARNINGS],[
745    dnl ******************************
746    dnl More compiler warnings
747    dnl ******************************
748
749    if test -z "$1" ; then
750        default_compile_warnings=no
751    else
752        default_compile_warnings="$1"
753    fi
754
755    AC_ARG_ENABLE(compile-warnings,
756    [  --enable-compile-warnings=[no/minimum/yes/maximum/error] Turn on compiler warnings.], [enable_compile_warnings="$default_compile_warnings"], enable_compile_warnings=yes)
757
758    warnCFLAGS=
759    if test "x$GCC" != xyes; then
760        enable_compile_warnings=no
761    fi
762
763    warning_flags=
764    realsave_CFLAGS="$CFLAGS"
765
766    case "$enable_compile_warnings" in
767    no)
768        warning_flags=
769        ;;
770    minimum)
771        warning_flags="-Wall -Wunused"
772        ;;
773    yes)
774        warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
775        ;;
776    maximum|error)
777        warning_flags="-Wall -Wunused -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
778        CFLAGS="$warning_flags $CFLAGS"
779        for option in -Wsign-promo -Wno-sign-compare; do
780                SAVE_CFLAGS="$CFLAGS"
781                CFLAGS="$CFLAGS $option"
782                AC_MSG_CHECKING([whether gcc understands $option])
783                AC_TRY_COMPILE([], [],
784                        has_option=yes,
785                        has_option=no,)
786                CFLAGS="$SAVE_CFLAGS"
787                AC_MSG_RESULT($has_option)
788                if test $has_option = yes; then
789                  warning_flags="$warning_flags $option"
790                fi
791                unset has_option
792                unset SAVE_CFLAGS
793        done
794        unset option
795        if test "$enable_compile_warnings" = "error" ; then
796            warning_flags="$warning_flags -Werror"
797        fi
798        ;;
799    *)
800        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
801        ;;
802    esac
803    CFLAGS="$realsave_CFLAGS"
804    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
805    AC_MSG_RESULT($warning_flags)
806
807    AC_ARG_ENABLE(iso-c,
808    [  --enable-iso-c          Try to warn if code is not ISO C ],,
809    enable_iso_c=no)
810
811    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
812    complCFLAGS=
813    if test "x$enable_iso_c" != "xno"; then
814        if test "x$GCC" = "xyes"; then
815        case " $CFLAGS " in
816            *[\ \       ]-ansi[\ \      ]*) ;;
817            *) complCFLAGS="$complCFLAGS -ansi" ;;
818        esac
819        case " $CFLAGS " in
820            *[\ \       ]-pedantic[\ \  ]*) ;;
821            *) complCFLAGS="$complCFLAGS -pedantic" ;;
822        esac
823        fi
824    fi
825    AC_MSG_RESULT($complCFLAGS)
826
827    WARN_CFLAGS="$warning_flags $complCFLAGS"
828    AC_SUBST(WARN_CFLAGS)
829])
830
831dnl For C++, do basically the same thing.
832
833AC_DEFUN([GNOME_CXX_WARNINGS],[
834  AC_ARG_ENABLE(cxx-warnings,
835    [  --enable-cxx-warnings=[no/minimum/yes]   Turn on compiler warnings.],,enable_cxx_warnings=minimum)
836
837  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
838  warnCXXFLAGS=
839  if test "x$GCC" != xyes; then
840    enable_compile_warnings=no
841  fi
842  if test "x$enable_cxx_warnings" != "xno"; then
843    if test "x$GCC" = "xyes"; then
844      case " $CXXFLAGS " in
845      *[\ \     ]-Wall[\ \      ]*) ;;
846      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
847      esac
848
849      ## -W is not all that useful.  And it cannot be controlled
850      ## with individual -Wno-xxx flags, unlike -Wall
851      if test "x$enable_cxx_warnings" = "xyes"; then
852        warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual"
853      fi
854    fi
855  fi
856  AC_MSG_RESULT($warnCXXFLAGS)
857
858   AC_ARG_ENABLE(iso-cxx,
859     [  --enable-iso-cxx          Try to warn if code is not ISO C++ ],,
860     enable_iso_cxx=no)
861
862   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
863   complCXXFLAGS=
864   if test "x$enable_iso_cxx" != "xno"; then
865     if test "x$GCC" = "xyes"; then
866      case " $CXXFLAGS " in
867      *[\ \     ]-ansi[\ \      ]*) ;;
868      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
869      esac
870
871      case " $CXXFLAGS " in
872      *[\ \     ]-pedantic[\ \  ]*) ;;
873      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
874      esac
875     fi
876   fi
877  AC_MSG_RESULT($complCXXFLAGS)
878  if test "x$cxxflags_set" != "xyes"; then
879    CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
880    cxxflags_set=yes
881    AC_SUBST(cxxflags_set)
882  fi
883])
884
885
886dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
887dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
888dnl also defines GSTUFF_PKG_ERRORS on error
889AC_DEFUN(PKG_CHECK_MODULES, [
890  succeeded=no
891
892  if test -z "$PKG_CONFIG"; then
893    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
894  fi
895
896  if test "$PKG_CONFIG" = "no" ; then
897     echo "*** The pkg-config script could not be found. Make sure it is"
898     echo "*** in your path, or set the PKG_CONFIG environment variable"
899     echo "*** to the full path to pkg-config."
900     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
901  else
902     PKG_CONFIG_MIN_VERSION=0.9.0
903     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
904        AC_MSG_CHECKING(for $2)
905
906        if $PKG_CONFIG --exists "$2" ; then
907            AC_MSG_RESULT(yes)
908            succeeded=yes
909
910            AC_MSG_CHECKING($1_CFLAGS)
911            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
912            AC_MSG_RESULT($$1_CFLAGS)
913
914            AC_MSG_CHECKING($1_LIBS)
915            $1_LIBS=`$PKG_CONFIG --libs "$2"`
916            AC_MSG_RESULT($$1_LIBS)
917        else
918            $1_CFLAGS=""
919            $1_LIBS=""
920            ## If we have a custom action on failure, don't print errors, but
921            ## do set a variable so people can do so.
922            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
923            ifelse([$4], ,echo $$1_PKG_ERRORS,)
924        fi
925
926        AC_SUBST($1_CFLAGS)
927        AC_SUBST($1_LIBS)
928     else
929        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
930        echo "*** See http://www.freedesktop.org/software/pkgconfig"
931     fi
932  fi
933
934  if test $succeeded = yes; then
935     ifelse([$3], , :, [$3])
936  else
937     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
938  fi
939])
940
941
942
943dnl AM_GCONF_SOURCE_2
944dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
945dnl  (i.e. pass to gconftool-2
946dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
947dnl  you should install foo.schemas files
948dnl
949
950AC_DEFUN([AM_GCONF_SOURCE_2],
951[
952  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
953    GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
954  else
955    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
956  fi
957
958  AC_ARG_WITH(gconf-source,
959  [  --with-gconf-source=sourceaddress      Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
960
961  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
962  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
963
964  if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
965    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
966  fi
967
968  AC_ARG_WITH(gconf-schema-file-dir,
969  [  --with-gconf-schema-file-dir=dir        Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
970
971  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
972  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
973
974  AC_ARG_ENABLE(schemas-install,
975     [  --disable-schemas-install       Disable the schemas installation],
976     [case "${enableval}" in
977       yes) schemas_install=true ;;
978       no)  schemas_install=false ;;
979       *) AC_MSG_ERROR(bad value ${enableval} for --disable-schemas-install) ;;
980     esac],[schemas_install=true])
981     AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, test x$schemas_install = xtrue)
982])
983
Note: See TracBrowser for help on using the repository browser.