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

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