root/morphix/trunk/gtkxrandr/aclocal.m4

Revision 2, 21.7 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
16
17 # serial 1
18
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22 AC_DEFUN([AM_INIT_AUTOMAKE],
23 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
24 AC_REQUIRE([AC_PROG_INSTALL])
25 PACKAGE=[$1]
26 AC_SUBST(PACKAGE)
27 VERSION=[$2]
28 AC_SUBST(VERSION)
29 dnl test to see if srcdir already configured
30 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
31   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
32 fi
33 ifelse([$3],,
34 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
35 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
36 AC_REQUIRE([AM_SANITY_CHECK])
37 AC_REQUIRE([AC_ARG_PROGRAM])
38 dnl FIXME This is truly gross.
39 missing_dir=`cd $ac_aux_dir && pwd`
40 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
41 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
42 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
43 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
44 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
45 AC_REQUIRE([AC_PROG_MAKE_SET])])
46
47 # Copyright 2002  Free Software Foundation, Inc.
48
49 # This program is free software; you can redistribute it and/or modify
50 # it under the terms of the GNU General Public License as published by
51 # the Free Software Foundation; either version 2, or (at your option)
52 # any later version.
53
54 # This program is distributed in the hope that it will be useful,
55 # but WITHOUT ANY WARRANTY; without even the implied warranty of
56 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
57 # GNU General Public License for more details.
58
59 # You should have received a copy of the GNU General Public License
60 # along with this program; if not, write to the Free Software
61 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
62
63 # AM_AUTOMAKE_VERSION(VERSION)
64 # ----------------------------
65 # Automake X.Y traces this macro to ensure aclocal.m4 has been
66 # generated from the m4 files accompanying Automake X.Y.
67 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
68
69 # AM_SET_CURRENT_AUTOMAKE_VERSION
70 # -------------------------------
71 # Call AM_AUTOMAKE_VERSION so it can be traced.
72 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
73 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
74          [AM_AUTOMAKE_VERSION([1.4-p6])])
75
76 #
77 # Check to make sure that the build environment is sane.
78 #
79
80 AC_DEFUN([AM_SANITY_CHECK],
81 [AC_MSG_CHECKING([whether build environment is sane])
82 # Just in case
83 sleep 1
84 echo timestamp > conftestfile
85 # Do `set' in a subshell so we don't clobber the current shell's
86 # arguments.  Must try -L first in case configure is actually a
87 # symlink; some systems play weird games with the mod time of symlinks
88 # (eg FreeBSD returns the mod time of the symlink's containing
89 # directory).
90 if (
91    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
92    if test "[$]*" = "X"; then
93       # -L didn't work.
94       set X `ls -t $srcdir/configure conftestfile`
95    fi
96    if test "[$]*" != "X $srcdir/configure conftestfile" \
97       && test "[$]*" != "X conftestfile $srcdir/configure"; then
98
99       # If neither matched, then we have a broken ls.  This can happen
100       # if, for instance, CONFIG_SHELL is bash and it inherits a
101       # broken ls alias from the environment.  This has actually
102       # happened.  Such a system could not be considered "sane".
103       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
104 alias in your environment])
105    fi
106
107    test "[$]2" = conftestfile
108    )
109 then
110    # Ok.
111    :
112 else
113    AC_MSG_ERROR([newly created file is older than distributed files!
114 Check your system clock])
115 fi
116 rm -f conftest*
117 AC_MSG_RESULT(yes)])
118
119 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
120 dnl The program must properly implement --version.
121 AC_DEFUN([AM_MISSING_PROG],
122 [AC_MSG_CHECKING(for working $2)
123 # Run test in a subshell; some versions of sh will print an error if
124 # an executable is not found, even if stderr is redirected.
125 # Redirect stdin to placate older versions of autoconf.  Sigh.
126 if ($2 --version) < /dev/null > /dev/null 2>&1; then
127    $1=$2
128    AC_MSG_RESULT(found)
129 else
130    $1="$3/missing $2"
131    AC_MSG_RESULT(missing)
132 fi
133 AC_SUBST($1)])
134
135 # Like AC_CONFIG_HEADER, but automatically create stamp file.
136
137 AC_DEFUN([AM_CONFIG_HEADER],
138 [AC_PREREQ([2.12])
139 AC_CONFIG_HEADER([$1])
140 dnl When config.status generates a header, we must update the stamp-h file.
141 dnl This file resides in the same directory as the config header
142 dnl that is generated.  We must strip everything past the first ":",
143 dnl and everything past the last "/".
144 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
145 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
146 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
147 <<am_indx=1
148 for am_file in <<$1>>; do
149   case " <<$>>CONFIG_HEADERS " in
150   *" <<$>>am_file "*<<)>>
151     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
152     ;;
153   esac
154   am_indx=`expr "<<$>>am_indx" + 1`
155 done<<>>dnl>>)
156 changequote([,]))])
157
158 # Add --enable-maintainer-mode option to configure.
159 # From Jim Meyering
160
161 # serial 1
162
163 AC_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
180 AC_DEFUN([AM_CONDITIONAL],
181 [AC_SUBST($1_TRUE)
182 AC_SUBST($1_FALSE)
183 if $2; then
184   $1_TRUE=
185   $1_FALSE='#'
186 else
187   $1_TRUE='#'
188   $1_FALSE=
189 fi])
190
191 # isc-posix.m4 serial 2 (gettext-0.11.2)
192 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
193 dnl This file is free software, distributed under the terms of the GNU
194 dnl General Public License.  As a special exception to the GNU General
195 dnl Public License, this file may be distributed as part of a program
196 dnl that contains a configuration script generated by Autoconf, under
197 dnl 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
209 undefine([AC_ISC_POSIX])
210
211 AC_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
219 # serial 1
220
221 # @defmac AC_PROG_CC_STDC
222 # @maindex PROG_CC_STDC
223 # @ovindex CC
224 # If the C compiler in not in ANSI C mode by default, try to add an option
225 # to output variable @code{CC} to make it so.  This macro tries various
226 # options that select ANSI C on some system or another.  It considers the
227 # compiler to be in ANSI C mode if it handles function prototypes correctly.
228 #
229 # If you use this macro, you should check after calling it whether the C
230 # compiler has been set to accept ANSI C; if not, the shell variable
231 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
232 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
233 # program @code{ansi2knr}, which comes with Ghostscript.
234 # @end defmac
235
236 AC_DEFUN([AM_PROG_CC_STDC],
237 [AC_REQUIRE([AC_PROG_CC])
238 AC_BEFORE([$0], [AC_C_INLINE])
239 AC_BEFORE([$0], [AC_C_CONST])
240 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
241 dnl a magic option to avoid problems with ANSI preprocessor commands
242 dnl like #elif.
243 dnl FIXME: can't do this because then AC_AIX won't work due to a
244 dnl circular dependency.
245 dnl AC_BEFORE([$0], [AC_PROG_CPP])
246 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
247 AC_CACHE_VAL(am_cv_prog_cc_stdc,
248 [am_cv_prog_cc_stdc=no
249 ac_save_CC="$CC"
250 # Don't try gcc -ansi; that turns off useful extensions and
251 # breaks some systems' header files.
252 # AIX                   -qlanglvl=ansi
253 # Ultrix and OSF/1      -std1
254 # HP-UX                 -Aa -D_HPUX_SOURCE
255 # SVR4                  -Xc -D__EXTENSIONS__
256 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
257 do
258   CC="$ac_save_CC $ac_arg"
259   AC_TRY_COMPILE(
260 [#include <stdarg.h>
261 #include <stdio.h>
262 #include <sys/types.h>
263 #include <sys/stat.h>
264 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
265 struct buf { int x; };
266 FILE * (*rcsopen) (struct buf *, struct stat *, int);
267 static char *e (p, i)
268      char **p;
269      int i;
270 {
271   return p[i];
272 }
273 static char *f (char * (*g) (char **, int), char **p, ...)
274 {
275   char *s;
276   va_list v;
277   va_start (v,p);
278   s = g (p, va_arg (v,int));
279   va_end (v);
280   return s;
281 }
282 int test (int i, double x);
283 struct s1 {int (*f) (int a);};
284 struct s2 {int (*f) (double a);};
285 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
286 int argc;
287 char **argv;
288 ], [
289 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
290 ],
291 [am_cv_prog_cc_stdc="$ac_arg"; break])
292 done
293 CC="$ac_save_CC"
294 ])
295 if test -z "$am_cv_prog_cc_stdc"; then
296   AC_MSG_RESULT([none needed])
297 else
298   AC_MSG_RESULT($am_cv_prog_cc_stdc)
299 fi
300 case "x$am_cv_prog_cc_stdc" in
301   x|xno) ;;
302   *) CC="$CC $am_cv_prog_cc_stdc" ;;
303 esac
304 ])
305
306
307 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
308 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
309 dnl also defines GSTUFF_PKG_ERRORS on error
310 AC_DEFUN(PKG_CHECK_MODULES, [
311   succeeded=no
312
313   if test -z "$PKG_CONFIG"; then
314     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
315   fi
316
317   if test "$PKG_CONFIG" = "no" ; then
318      echo "*** The pkg-config script could not be found. Make sure it is"
319      echo "*** in your path, or set the PKG_CONFIG environment variable"
320      echo "*** to the full path to pkg-config."
321      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
322   else
323      PKG_CONFIG_MIN_VERSION=0.9.0
324      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
325         AC_MSG_CHECKING(for $2)
326
327         if $PKG_CONFIG --exists "$2" ; then
328             AC_MSG_RESULT(yes)
329             succeeded=yes
330
331             AC_MSG_CHECKING($1_CFLAGS)
332             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
333             AC_MSG_RESULT($$1_CFLAGS)
334
335             AC_MSG_CHECKING($1_LIBS)
336             $1_LIBS=`$PKG_CONFIG --libs "$2"`
337             AC_MSG_RESULT($$1_LIBS)
338         else
339             $1_CFLAGS=""
340             $1_LIBS=""
341             ## If we have a custom action on failure, don't print errors, but
342             ## do set a variable so people can do so.
343             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
344             ifelse([$4], ,echo $$1_PKG_ERRORS,)
345         fi
346
347         AC_SUBST($1_CFLAGS)
348         AC_SUBST($1_LIBS)
349      else
350         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
351         echo "*** See http://www.freedesktop.org/software/pkgconfig"
352      fi
353   fi
354
355   if test $succeeded = yes; then
356      ifelse([$3], , :, [$3])
357   else
358      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])
359   fi
360 ])
361
362
363
364 # Macro to add for using GNU gettext.
365 # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
366 #
367 # Modified to never use included libintl.
368 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
369 #
370 # Major rework to remove unused code
371 # Owen Taylor <otaylor@redhat.com>, 12/11/2002
372 #
373 # This file can be copied and used freely without restrictions.  It can
374 # be used in projects which are not available under the GNU Public License
375 # but which still want to provide support for the GNU gettext functionality.
376 #
377
378 #
379 # We need this here as well, since someone might use autoconf-2.5x
380 # to configure GLib then an older version to configure a package
381 # using AM_GLIB_GNU_GETTEXT
382 AC_PREREQ(2.53)
383
384 dnl
385 dnl We go to great lengths to make sure that aclocal won't
386 dnl try to pull in the installed version of these macros
387 dnl when running aclocal in the glib directory.
388 dnl
389 m4_copy([AC_DEFUN],[glib_DEFUN])
390 m4_copy([AC_REQUIRE],[glib_REQUIRE])
391 dnl
392 dnl At the end, if we're not within glib, we'll define the public
393 dnl definitions in terms of our private definitions.
394 dnl
395
396 # GLIB_LC_MESSAGES
397 #--------------------
398 glib_DEFUN([GLIB_LC_MESSAGES],
399   [AC_CHECK_HEADERS([locale.h])
400     if test $ac_cv_header_locale_h = yes; then
401     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
402       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
403        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
404     if test $am_cv_val_LC_MESSAGES = yes; then
405       AC_DEFINE(HAVE_LC_MESSAGES, 1,
406         [Define if your <locale.h> file defines LC_MESSAGES.])
407     fi
408   fi])
409
410 # GLIB_PATH_PROG_WITH_TEST
411 #----------------------------
412 dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
413 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
414 glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
415 [# Extract the first word of "$2", so it can be a program name with args.
416 set dummy $2; ac_word=[$]2
417 AC_MSG_CHECKING([for $ac_word])
418 AC_CACHE_VAL(ac_cv_path_$1,
419 [case "[$]$1" in
420   /*)
421   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
422   ;;
423   *)
424   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
425   for ac_dir in ifelse([$5], , $PATH, [$5]); do
426     test -z "$ac_dir" && ac_dir=.
427     if test -f $ac_dir/$ac_word; then
428       if [$3]; then
429         ac_cv_path_$1="$ac_dir/$ac_word"
430         break
431       fi
432     fi
433   done
434   IFS="$ac_save_ifs"
435 dnl If no 4th arg is given, leave the cache variable unset,
436 dnl so AC_PATH_PROGS will keep looking.
437 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
438 ])dnl
439   ;;
440 esac])dnl
441 $1="$ac_cv_path_$1"
442 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
443   AC_MSG_RESULT([$]$1)
444 else
445   AC_MSG_RESULT(no)
446 fi
447 AC_SUBST($1)dnl
448 ])
449
450 # GLIB_WITH_NLS
451 #-----------------
452 glib_DEFUN([GLIB_WITH_NLS],
453   dnl NLS is obligatory
454   [USE_NLS=yes
455     AC_SUBST(USE_NLS)
456
457     gt_cv_have_gettext=no
458
459     CATOBJEXT=NONE
460     XGETTEXT=:
461     INTLLIBS=
462
463     AC_CHECK_HEADER(libintl.h,
464      [gt_cv_func_dgettext_libintl="no"
465       libintl_extra_libs=""
466
467       #
468       # First check in libc
469       #
470       AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
471         [AC_TRY_LINK([
472 #include <libintl.h>
473 ],
474           [return (int) dgettext ("","")],
475           gt_cv_func_dgettext_libc=yes,
476           gt_cv_func_dgettext_libc=no)
477         ])
478  
479       if test "$gt_cv_func_dgettext_libc" = "yes" ; then
480         AC_CHECK_FUNCS(bind_textdomain_codeset)
481       fi
482
483       #
484       # If we don't have everything we want, check in libintl
485       #
486       if test "$gt_cv_func_dgettext_libc" != "yes" \
487          || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
488        
489         AC_CHECK_LIB(intl, bindtextdomain,
490             [AC_CHECK_LIB(intl, dgettext,
491                           gt_cv_func_dgettext_libintl=yes)])
492
493         if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
494           AC_MSG_CHECKING([if -liconv is needed to use gettext])
495           AC_MSG_RESULT([])
496           AC_CHECK_LIB(intl, dcgettext,
497                        [gt_cv_func_dgettext_libintl=yes
498                         libintl_extra_libs=-liconv],
499                         :,-liconv)
500         fi
501
502         #
503         # If we found libintl, then check in it for bind_textdomain_codeset();
504         # we'll prefer libc if neither have bind_textdomain_codeset(),
505         # and both have dgettext
506         #
507         if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
508           glib_save_LIBS="$LIBS"
509           LIBS="$LIBS -lintl $libintl_extra_libs"
510           unset ac_cv_func_bind_textdomain_codeset
511           AC_CHECK_FUNCS(bind_textdomain_codeset)
512           LIBS="$glib_save_LIBS"
513
514           if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
515             gt_cv_func_dgettext_libc=no
516           else
517             if test "$gt_cv_func_dgettext_libc" = "yes"; then
518               gt_cv_func_dgettext_libintl=no
519             fi
520           fi
521         fi
522       fi
523
524       if test "$gt_cv_func_dgettext_libc" = "yes" \
525         || test "$gt_cv_func_dgettext_libintl" = "yes"; then
526         gt_cv_have_gettext=yes
527       fi
528  
529       if test "$gt_cv_func_dgettext_libintl" = "yes"; then
530         INTLLIBS="-lintl $libintl_extra_libs"
531       fi
532  
533       if test "$gt_cv_have_gettext" = "yes"; then
534         AC_DEFINE(HAVE_GETTEXT,1,
535           [Define if the GNU gettext() function is already present or preinstalled.])
536         GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
537           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
538         if test "$MSGFMT" != "no"; then
539           AC_CHECK_FUNCS(dcgettext)
540           AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
541           GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
542             [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
543           AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
544                          return _nl_msg_cat_cntr],
545             [CATOBJEXT=.gmo
546              DATADIRNAME=share],
547             [CATOBJEXT=.mo
548              DATADIRNAME=lib])
549           INSTOBJEXT=.mo
550         else
551           gt_cv_have_gettext=no
552         fi
553       fi
554     ])
555
556     if test "$gt_cv_have_gettext" = "yes" ; then
557       AC_DEFINE(ENABLE_NLS, 1,
558         [always defined to indicate that i18n is enabled])
559     fi
560
561     dnl Test whether we really found GNU xgettext.
562     if test "$XGETTEXT" != ":"; then
563       dnl If it is not GNU xgettext we define it as : so that the
564       dnl Makefiles still can work.
565       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
566         : ;
567       else
568         AC_MSG_RESULT(
569           [found xgettext program is not GNU xgettext; ignore it])
570         XGETTEXT=":"
571       fi
572     fi
573
574     # We need to process the po/ directory.
575     POSUB=po
576
577     AC_OUTPUT_COMMANDS(
578       [case "$CONFIG_FILES" in *po/Makefile.in*)
579         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
580       esac])
581
582     dnl These rules are solely for the distribution goal.  While doing this
583     dnl we only have to keep exactly one list of the available catalogs
584     dnl in configure.in.
585     for lang in $ALL_LINGUAS; do
586       GMOFILES="$GMOFILES $lang.gmo"
587       POFILES="$POFILES $lang.po"
588     done
589
590     dnl Make all variables we use known to autoconf.
591     AC_SUBST(CATALOGS)
592     AC_SUBST(CATOBJEXT)
593     AC_SUBST(DATADIRNAME)
594     AC_SUBST(GMOFILES)
595     AC_SUBST(INSTOBJEXT)
596     AC_SUBST(INTLLIBS)
597     AC_SUBST(PO_IN_DATADIR_TRUE)
598     AC_SUBST(PO_IN_DATADIR_FALSE)
599     AC_SUBST(POFILES)
600     AC_SUBST(POSUB)
601   ])
602
603 # AM_GLIB_GNU_GETTEXT
604 # -------------------
605 # Do checks necessary for use of gettext. If a suitable implementation
606 # of gettext is found in either in libintl or in the C library,
607 # it will set INTLLIBS to the libraries needed for use of gettext
608 # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
609 # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
610 # on various variables needed by the Makefile.in.in installed by
611 # glib-gettextize.
612 dnl
613 glib_DEFUN(GLIB_GNU_GETTEXT,
614   [AC_REQUIRE([AC_PROG_CC])dnl
615    AC_REQUIRE([AC_HEADER_STDC])dnl
616   
617    GLIB_LC_MESSAGES
618    GLIB_WITH_NLS
619
620    if test "$gt_cv_have_gettext" = "yes"; then
621      if test "x$ALL_LINGUAS" = "x"; then
622        LINGUAS=
623      else
624        AC_MSG_CHECKING(for catalogs to be installed)
625        NEW_LINGUAS=
626        for lang in ${LINGUAS=$ALL_LINGUAS}; do
627          case "$ALL_LINGUAS" in
628           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
629          esac
630        done
631        LINGUAS=$NEW_LINGUAS
632        AC_MSG_RESULT($LINGUAS)
633      fi
634
635      dnl Construct list of names of catalog files to be constructed.
636      if test -n "$LINGUAS"; then
637        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
638      fi
639    fi
640
641    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
642    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
643    dnl Try to locate is.
644    MKINSTALLDIRS=
645    if test -n "$ac_aux_dir"; then
646      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
647    fi
648    if test -z "$MKINSTALLDIRS"; then
649      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
650    fi
651    AC_SUBST(MKINSTALLDIRS)
652
653    dnl Generate list of files to be processed by xgettext which will
654    dnl be included in po/Makefile.
655    test -d po || mkdir po
656    if test "x$srcdir" != "x."; then
657      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
658        posrcprefix="$srcdir/"
659      else
660        posrcprefix="../$srcdir/"
661      fi
662    else
663      posrcprefix="../"
664    fi
665    rm -f po/POTFILES
666    sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
667         < $srcdir/po/POTFILES.in > po/POTFILES
668   ])
669
670 # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
671 # -------------------------------
672 # Define VARIABLE to the location where catalog files will
673 # be installed by po/Makefile.
674 glib_DEFUN(GLIB_DEFINE_LOCALEDIR,
675 [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
676 glib_save_prefix="$prefix"
677 test "x$prefix" = xNONE && prefix=$ac_default_prefix
678 if test "x$CATOBJEXT" = "x.mo" ; then
679   localedir=`eval echo "${libdir}/locale"`
680 else
681   localedir=`eval echo "${datadir}/locale"`
682 fi
683 prefix="$glib_save_prefix"
684 AC_DEFINE_UNQUOTED($1, "$localedir",
685   [Define the location where the catalogs will be installed])
686 ])
687
688 dnl
689 dnl Now the definitions that aclocal will find
690 dnl
691 ifdef(glib_configure_in,[],[
692 AC_DEFUN(AM_GLIB_GNU_GETTEXT,[GLIB_GNU_GETTEXT($@)])
693 AC_DEFUN(AM_GLIB_DEFINE_LOCALEDIR,[GLIB_DEFINE_LOCALEDIR($@)])
694 ])dnl
695
Note: See TracBrowser for help on using the browser.