changed version name
[xscreensaver] / xscreensaver / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
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
14 dnl AC_PROG_INTLTOOL([MINIMUM-VERSION])
15 # serial 1 AC_PROG_INTLTOOL
16 AC_DEFUN(AC_PROG_INTLTOOL,
17 [
18
19 if test -n "$1"; then
20     AC_MSG_CHECKING(for intltool >= $1)
21
22     INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
23     INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }'  < intltool-update.in`
24     changequote({{,}})
25     INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < intltool-update.in`
26     changequote([,])
27
28     if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
29         AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
30     else
31         AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool $1 or later.])
32         exit 1
33     fi
34 fi
35
36   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'
37 INTLTOOL_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'
38      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'
39       INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -o -p'
40      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'
41    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'
42     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'
43 INTLTOOL_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'
44        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'
45       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'
46     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'
47
48 AC_SUBST(INTLTOOL_DESKTOP_RULE)
49 AC_SUBST(INTLTOOL_DIRECTORY_RULE)
50 AC_SUBST(INTLTOOL_KEYS_RULE)
51 AC_SUBST(INTLTOOL_OAF_RULE)
52 AC_SUBST(INTLTOOL_PONG_RULE)
53 AC_SUBST(INTLTOOL_SERVER_RULE)
54 AC_SUBST(INTLTOOL_SHEET_RULE)
55 AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
56 AC_SUBST(INTLTOOL_UI_RULE)
57 AC_SUBST(INTLTOOL_XML_RULE)
58 AC_SUBST(INTLTOOL_CAVES_RULE)
59
60 # Use the tools built into the package, not the ones that are installed.
61
62 INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
63 INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
64 INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
65
66 AC_SUBST(INTLTOOL_EXTRACT)
67 AC_SUBST(INTLTOOL_MERGE)
68 AC_SUBST(INTLTOOL_UPDATE)
69
70 AC_PATH_PROG(INTLTOOL_PERL, perl)
71 if test -z "$INTLTOOL_PERL"; then
72    AC_MSG_ERROR([perl not found; required for intltool])
73 fi
74 if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
75    AC_MSG_ERROR([perl 5.x required for intltool])
76 fi
77
78 # Remove file type tags (using []) from po/POTFILES.
79
80 ifdef([AC_DIVERSION_ICMDS],[
81   AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
82       changequote(,)
83       mv -f po/POTFILES po/POTFILES.tmp
84       sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
85       rm -f po/POTFILES.tmp
86       changequote([,])
87   AC_DIVERT_POP()
88 ],[
89   ifdef([AC_CONFIG_COMMANDS_PRE],[
90     AC_CONFIG_COMMANDS_PRE([
91         changequote(,)
92         mv -f po/POTFILES po/POTFILES.tmp
93         sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
94         rm -f po/POTFILES.tmp
95         changequote([,])
96     ])
97   ])
98 ])
99
100 # Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
101
102 AC_OUTPUT_COMMANDS([
103
104 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-extract.in > intltool-extract.out
105 if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
106   rm -f intltool-extract.out
107 else
108   mv -f intltool-extract.out intltool-extract
109 fi
110 chmod ugo+x intltool-extract
111 chmod u+w intltool-extract
112
113 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-merge.in > intltool-merge.out
114 if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
115   rm -f intltool-merge.out
116 else
117   mv -f intltool-merge.out intltool-merge
118 fi
119 chmod ugo+x intltool-merge
120 chmod u+w intltool-merge
121
122 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-update.in > intltool-update.out
123 if cmp -s intltool-update intltool-update.out 2>/dev/null; then
124   rm -f intltool-update.out
125 else
126   mv -f intltool-update.out intltool-update
127 fi
128 chmod ugo+x intltool-update
129 chmod u+w intltool-update
130
131 ], INTLTOOL_PERL=${INTLTOOL_PERL})
132
133 ])
134
135 # Macro to add for using GNU gettext.
136 # Ulrich Drepper <drepper@cygnus.com>, 1995.
137 #
138 # Modified to never use included libintl. 
139 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
140 #
141 #
142 # This file can be copied and used freely without restrictions.  It can
143 # be used in projects which are not available under the GNU Public License
144 # but which still want to provide support for the GNU gettext functionality.
145 # Please note that the actual code is *not* freely available.
146 #
147 #
148 # If you make changes to this file, you MUST update the copy in
149 # acinclude.m4. [ aclocal dies on duplicate macros, so if
150 # we run 'aclocal -I macros/' then we'll run into problems
151 # once we've installed glib-gettext.m4 :-( ]
152 #
153
154 # serial 5
155
156 AC_DEFUN(AM_GLIB_WITH_NLS,
157   dnl NLS is obligatory
158   [USE_NLS=yes
159     AC_SUBST(USE_NLS)
160
161     dnl Figure out what method
162     nls_cv_force_use_gnu_gettext="no"
163
164     nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
165     if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
166       dnl User does not insist on using GNU NLS library.  Figure out what
167       dnl to use.  If gettext or catgets are available (in this order) we
168       dnl use this.  Else we have to fall back to GNU NLS library.
169       dnl catgets is only used if permitted by option --with-catgets.
170       nls_cv_header_intl=
171       nls_cv_header_libgt=
172       CATOBJEXT=NONE
173
174       AC_CHECK_HEADER(libintl.h,
175         [AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
176           [AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
177             gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
178
179           if test "$gt_cv_func_dgettext_libc" != "yes"; then
180             AC_CHECK_LIB(intl, bindtextdomain,
181               [AC_CACHE_CHECK([for dgettext in libintl],
182                 gt_cv_func_dgettext_libintl,
183                 [AC_CHECK_LIB(intl, dgettext,
184                   gt_cv_func_dgettext_libintl=yes,
185                   gt_cv_func_dgettext_libintl=no)],
186                 gt_cv_func_dgettext_libintl=no)])
187           fi
188
189           if test "$gt_cv_func_dgettext_libintl" = "yes"; then
190             LIBS="$LIBS -lintl";
191           fi
192
193           if test "$gt_cv_func_dgettext_libc" = "yes" \
194             || test "$gt_cv_func_dgettext_libintl" = "yes"; then
195             AC_DEFINE(HAVE_GETTEXT,1,
196               [Define if the GNU gettext() function is already present or preinstalled.])
197             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
198               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
199             if test "$MSGFMT" != "no"; then
200               AC_CHECK_FUNCS(dcgettext)
201               AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
202               AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
203                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
204               AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
205                              return _nl_msg_cat_cntr],
206                 [CATOBJEXT=.gmo
207                  DATADIRNAME=share],
208                 [CATOBJEXT=.mo
209                  DATADIRNAME=lib])
210               INSTOBJEXT=.mo
211             fi
212           fi
213
214           # Added by Martin Baulig 12/15/98 for libc5 systems
215           if test "$gt_cv_func_dgettext_libc" != "yes" \
216             && test "$gt_cv_func_dgettext_libintl" = "yes"; then
217             INTLLIBS=-lintl
218             LIBS=`echo $LIBS | sed -e 's/-lintl//'`
219           fi
220       ])
221
222       if test "$CATOBJEXT" = "NONE"; then
223         dnl Neither gettext nor catgets in included in the C library.
224         dnl Fall back on GNU gettext library.
225         nls_cv_use_gnu_gettext=yes
226       fi
227     fi
228
229     if test "$nls_cv_use_gnu_gettext" != "yes"; then
230       AC_DEFINE(ENABLE_NLS, 1,
231         [always defined to indicate that i18n is enabled])
232     else
233       dnl Unset this variable since we use the non-zero value as a flag.
234       CATOBJEXT=
235     fi
236
237     dnl Test whether we really found GNU xgettext.
238     if test "$XGETTEXT" != ":"; then
239       dnl If it is no GNU xgettext we define it as : so that the
240       dnl Makefiles still can work.
241       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
242         : ;
243       else
244         AC_MSG_RESULT(
245           [found xgettext program is not GNU xgettext; ignore it])
246         XGETTEXT=":"
247       fi
248     fi
249
250     # We need to process the po/ directory.
251     POSUB=po
252
253     AC_OUTPUT_COMMANDS(
254       [case "$CONFIG_FILES" in *po/Makefile.in*)
255         rm -f po/stamp-it po/stamp-it.tmp
256         > po/stamp-it.tmp
257         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
258         mv po/stamp-it.tmp po/stamp-it
259       esac])
260
261     dnl These rules are solely for the distribution goal.  While doing this
262     dnl we only have to keep exactly one list of the available catalogs
263     dnl in configure.in.
264     for lang in $ALL_LINGUAS; do
265       GMOFILES="$GMOFILES $lang.gmo"
266       POFILES="$POFILES $lang.po"
267     done
268
269     dnl Make all variables we use known to autoconf.
270     AC_SUBST(CATALOGS)
271     AC_SUBST(CATOBJEXT)
272     AC_SUBST(DATADIRNAME)
273     AC_SUBST(GMOFILES)
274     AC_SUBST(INSTOBJEXT)
275     AC_SUBST(INTLDEPS)
276     AC_SUBST(INTLLIBS)
277     AC_SUBST(INTLOBJS)
278     AC_SUBST(POFILES)
279     AC_SUBST(POSUB)
280   ])
281
282 AC_DEFUN(AM_GLIB_GNU_GETTEXT,
283   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
284    AC_REQUIRE([AC_PROG_CC])dnl
285    AC_REQUIRE([AC_PROG_RANLIB])dnl
286    AC_REQUIRE([AC_HEADER_STDC])dnl
287    AC_REQUIRE([AC_C_CONST])dnl
288    AC_REQUIRE([AC_C_INLINE])dnl
289    AC_REQUIRE([AC_TYPE_OFF_T])dnl
290    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
291    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
292    AC_REQUIRE([AC_FUNC_MMAP])dnl
293
294    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
295 unistd.h sys/param.h])
296    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
297 strdup __argz_count __argz_stringify __argz_next])
298
299    AM_LC_MESSAGES
300    AM_GLIB_WITH_NLS
301
302    if test "x$CATOBJEXT" != "x"; then
303      if test "x$ALL_LINGUAS" = "x"; then
304        LINGUAS=
305      else
306        AC_MSG_CHECKING(for catalogs to be installed)
307        NEW_LINGUAS=
308        for lang in ${LINGUAS=$ALL_LINGUAS}; do
309          case "$ALL_LINGUAS" in
310           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
311          esac
312        done
313        LINGUAS=$NEW_LINGUAS
314        AC_MSG_RESULT($LINGUAS)
315      fi
316
317      dnl Construct list of names of catalog files to be constructed.
318      if test -n "$LINGUAS"; then
319        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
320      fi
321    fi
322
323    dnl Determine which catalog format we have (if any is needed)
324    dnl For now we know about two different formats:
325    dnl   Linux libc-5 and the normal X/Open format
326    test -d po || mkdir po
327    if test "$CATOBJEXT" = ".cat"; then
328      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
329
330      dnl Transform the SED scripts while copying because some dumb SEDs
331      dnl cannot handle comments.
332      sed -e '/^#/d' $srcdir/po/$msgformat-msg.sed > po/po2msg.sed
333    fi
334
335    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
336    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
337    dnl Try to locate is.
338    MKINSTALLDIRS=
339 #
340 # jwz: fuck this!  it puts hardcoded pathnames into the generated Makefiles!
341 #
342 #   if test -n "$ac_aux_dir"; then
343 #     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
344 #   fi
345    if test -z "$MKINSTALLDIRS"; then
346      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
347    fi
348
349    # jwz: you know what, screw it.  Let's just use the version that I
350    # already computed in configure.in, instead of this version that came
351    # with the i18n crud, ok?
352    MKINSTALLDIRS="$INSTALL_DIRS"
353
354
355    AC_SUBST(MKINSTALLDIRS)
356
357    dnl Generate list of files to be processed by xgettext which will
358    dnl be included in po/Makefile.
359    test -d po || mkdir po
360    if test "x$srcdir" != "x."; then
361      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
362        posrcprefix="$srcdir/"
363      else
364        posrcprefix="../$srcdir/"
365      fi
366    else
367      posrcprefix="../"
368    fi
369    rm -f po/POTFILES
370    sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
371         < $srcdir/po/POTFILES.in > po/POTFILES
372   ])
373
374
375 # Search path for a program which passes the given test.
376 # Ulrich Drepper <drepper@cygnus.com>, 1996.
377 #
378 # This file can be copied and used freely without restrictions.  It can
379 # be used in projects which are not available under the GNU Public License
380 # but which still want to provide support for the GNU gettext functionality.
381 # Please note that the actual code is *not* freely available.
382
383 # serial 1
384
385 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
386 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
387 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
388 [# Extract the first word of "$2", so it can be a program name with args.
389 set dummy $2; ac_word=[$]2
390 AC_MSG_CHECKING([for $ac_word])
391 AC_CACHE_VAL(ac_cv_path_$1,
392 [case "[$]$1" in
393   /*)
394   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
395   ;;
396   *)
397   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
398   for ac_dir in ifelse([$5], , $PATH, [$5]); do
399     test -z "$ac_dir" && ac_dir=.
400     if test -f $ac_dir/$ac_word; then
401       if [$3]; then
402         ac_cv_path_$1="$ac_dir/$ac_word"
403         break
404       fi
405     fi
406   done
407   IFS="$ac_save_ifs"
408 dnl If no 4th arg is given, leave the cache variable unset,
409 dnl so AC_PATH_PROGS will keep looking.
410 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
411 ])dnl
412   ;;
413 esac])dnl
414 $1="$ac_cv_path_$1"
415 if test -n "[$]$1"; then
416   AC_MSG_RESULT([$]$1)
417 else
418   AC_MSG_RESULT(no)
419 fi
420 AC_SUBST($1)dnl
421 ])
422
423 # Check whether LC_MESSAGES is available in <locale.h>.
424 # Ulrich Drepper <drepper@cygnus.com>, 1995.
425 #
426 # This file can be copied and used freely without restrictions.  It can
427 # be used in projects which are not available under the GNU Public License
428 # but which still want to provide support for the GNU gettext functionality.
429 # Please note that the actual code is *not* freely available.
430
431 # serial 2
432
433 AC_DEFUN([AM_LC_MESSAGES],
434   [if test $ac_cv_header_locale_h = yes; then
435     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
436       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
437        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
438     if test $am_cv_val_LC_MESSAGES = yes; then
439       AC_DEFINE(HAVE_LC_MESSAGES, 1,
440         [Define if your <locale.h> file defines LC_MESSAGES.])
441     fi
442   fi])
443