Added SILC Thread Queue API
[crypto.git] / apps / silcer / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.5
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 # Do all the work for Automake.  This macro actually does too much --
15 # some checks are only needed if your package does certain things.
16 # But this isn't really a big deal.
17
18 # serial 5
19
20 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
21 # written in clear, in which case automake, when reading aclocal.m4,
22 # will think it sees a *use*, and therefore will trigger all it's
23 # C support machinery.  Also note that it means that autoscan, seeing
24 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
25
26
27 # We require 2.13 because we rely on SHELL being computed by configure.
28 AC_PREREQ([2.13])
29
30 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
31 # -----------------------------------------------------------
32 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
33 # The purpose of this macro is to provide the user with a means to
34 # check macros which are provided without letting her know how the
35 # information is coded.
36 # If this macro is not defined by Autoconf, define it here.
37 ifdef([AC_PROVIDE_IFELSE],
38       [],
39       [define([AC_PROVIDE_IFELSE],
40               [ifdef([AC_PROVIDE_$1],
41                      [$2], [$3])])])
42
43
44 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
45 # ----------------------------------------------
46 AC_DEFUN([AM_INIT_AUTOMAKE],
47 [AC_REQUIRE([AC_PROG_INSTALL])dnl
48 # test to see if srcdir already configured
49 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
50    test -f $srcdir/config.status; then
51   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
52 fi
53
54 # Define the identity of the package.
55 PACKAGE=$1
56 AC_SUBST(PACKAGE)dnl
57 VERSION=$2
58 AC_SUBST(VERSION)dnl
59 ifelse([$3],,
60 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
61 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
62
63 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
64 # the ones we care about.
65 ifdef([m4_pattern_allow],
66       [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
67
68 # Autoconf 2.50 always computes EXEEXT.  However we need to be
69 # compatible with 2.13, for now.  So we always define EXEEXT, but we
70 # don't compute it.
71 AC_SUBST(EXEEXT)
72 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
73 # requests that it be used.  This is a bit dumb.
74 : ${OBJEXT=o}
75 AC_SUBST(OBJEXT)
76
77 # Some tools Automake needs.
78 AC_REQUIRE([AM_SANITY_CHECK])dnl
79 AC_REQUIRE([AC_ARG_PROGRAM])dnl
80 AM_MISSING_PROG(ACLOCAL, aclocal)
81 AM_MISSING_PROG(AUTOCONF, autoconf)
82 AM_MISSING_PROG(AUTOMAKE, automake)
83 AM_MISSING_PROG(AUTOHEADER, autoheader)
84 AM_MISSING_PROG(MAKEINFO, makeinfo)
85 AM_MISSING_PROG(AMTAR, tar)
86 AM_PROG_INSTALL_SH
87 AM_PROG_INSTALL_STRIP
88 # We need awk for the "check" target.  The system "awk" is bad on
89 # some platforms.
90 AC_REQUIRE([AC_PROG_AWK])dnl
91 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
92 AC_REQUIRE([AM_DEP_TRACK])dnl
93 AC_REQUIRE([AM_SET_DEPDIR])dnl
94 AC_PROVIDE_IFELSE([AC_PROG_][CC],
95                   [_AM_DEPENDENCIES(CC)],
96                   [define([AC_PROG_][CC],
97                           defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
98 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
99                   [_AM_DEPENDENCIES(CXX)],
100                   [define([AC_PROG_][CXX],
101                           defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
102 ])
103
104 #
105 # Check to make sure that the build environment is sane.
106 #
107
108 # serial 3
109
110 # AM_SANITY_CHECK
111 # ---------------
112 AC_DEFUN([AM_SANITY_CHECK],
113 [AC_MSG_CHECKING([whether build environment is sane])
114 # Just in case
115 sleep 1
116 echo timestamp > conftest.file
117 # Do `set' in a subshell so we don't clobber the current shell's
118 # arguments.  Must try -L first in case configure is actually a
119 # symlink; some systems play weird games with the mod time of symlinks
120 # (eg FreeBSD returns the mod time of the symlink's containing
121 # directory).
122 if (
123    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
124    if test "$[*]" = "X"; then
125       # -L didn't work.
126       set X `ls -t $srcdir/configure conftest.file`
127    fi
128    rm -f conftest.file
129    if test "$[*]" != "X $srcdir/configure conftest.file" \
130       && test "$[*]" != "X conftest.file $srcdir/configure"; then
131
132       # If neither matched, then we have a broken ls.  This can happen
133       # if, for instance, CONFIG_SHELL is bash and it inherits a
134       # broken ls alias from the environment.  This has actually
135       # happened.  Such a system could not be considered "sane".
136       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
137 alias in your environment])
138    fi
139
140    test "$[2]" = conftest.file
141    )
142 then
143    # Ok.
144    :
145 else
146    AC_MSG_ERROR([newly created file is older than distributed files!
147 Check your system clock])
148 fi
149 AC_MSG_RESULT(yes)])
150
151
152 # serial 2
153
154 # AM_MISSING_PROG(NAME, PROGRAM)
155 # ------------------------------
156 AC_DEFUN([AM_MISSING_PROG],
157 [AC_REQUIRE([AM_MISSING_HAS_RUN])
158 $1=${$1-"${am_missing_run}$2"}
159 AC_SUBST($1)])
160
161
162 # AM_MISSING_HAS_RUN
163 # ------------------
164 # Define MISSING if not defined so far and test if it supports --run.
165 # If it does, set am_missing_run to use it, otherwise, to nothing.
166 AC_DEFUN([AM_MISSING_HAS_RUN],
167 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
168 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
169 # Use eval to expand $SHELL
170 if eval "$MISSING --run true"; then
171   am_missing_run="$MISSING --run "
172 else
173   am_missing_run=
174   am_backtick='`'
175   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
176 fi
177 ])
178
179 # AM_AUX_DIR_EXPAND
180
181 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
182 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
183 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
184 #
185 # Of course, Automake must honor this variable whenever it calls a
186 # tool from the auxiliary directory.  The problem is that $srcdir (and
187 # therefore $ac_aux_dir as well) can be either absolute or relative,
188 # depending on how configure is run.  This is pretty annoying, since
189 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
190 # source directory, any form will work fine, but in subdirectories a
191 # relative path needs to be adjusted first.
192 #
193 # $ac_aux_dir/missing
194 #    fails when called from a subdirectory if $ac_aux_dir is relative
195 # $top_srcdir/$ac_aux_dir/missing
196 #    fails if $ac_aux_dir is absolute,
197 #    fails when called from a subdirectory in a VPATH build with
198 #          a relative $ac_aux_dir
199 #
200 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
201 # are both prefixed by $srcdir.  In an in-source build this is usually
202 # harmless because $srcdir is `.', but things will broke when you
203 # start a VPATH build or use an absolute $srcdir.
204 #
205 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
206 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
207 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
208 # and then we would define $MISSING as
209 #   MISSING="\${SHELL} $am_aux_dir/missing"
210 # This will work as long as MISSING is not called from configure, because
211 # unfortunately $(top_srcdir) has no meaning in configure.
212 # However there are other variables, like CC, which are often used in
213 # configure, and could therefore not use this "fixed" $ac_aux_dir.
214 #
215 # Another solution, used here, is to always expand $ac_aux_dir to an
216 # absolute PATH.  The drawback is that using absolute paths prevent a
217 # configured tree to be moved without reconfiguration.
218
219 AC_DEFUN([AM_AUX_DIR_EXPAND], [
220 # expand $ac_aux_dir to an absolute path
221 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
222 ])
223
224 # AM_PROG_INSTALL_SH
225 # ------------------
226 # Define $install_sh.
227 AC_DEFUN([AM_PROG_INSTALL_SH],
228 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
229 install_sh=${install_sh-"$am_aux_dir/install-sh"}
230 AC_SUBST(install_sh)])
231
232 # One issue with vendor `install' (even GNU) is that you can't
233 # specify the program used to strip binaries.  This is especially
234 # annoying in cross-compiling environments, where the build's strip
235 # is unlikely to handle the host's binaries.
236 # Fortunately install-sh will honor a STRIPPROG variable, so we
237 # always use install-sh in `make install-strip', and initialize
238 # STRIPPROG with the value of the STRIP variable (set by the user).
239 AC_DEFUN([AM_PROG_INSTALL_STRIP],
240 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
241 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
242 AC_SUBST([INSTALL_STRIP_PROGRAM])])
243
244 # serial 4                                              -*- Autoconf -*-
245
246
247
248 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
249 # written in clear, in which case automake, when reading aclocal.m4,
250 # will think it sees a *use*, and therefore will trigger all it's
251 # C support machinery.  Also note that it means that autoscan, seeing
252 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
253
254
255
256 # _AM_DEPENDENCIES(NAME)
257 # ---------------------
258 # See how the compiler implements dependency checking.
259 # NAME is "CC", "CXX" or "OBJC".
260 # We try a few techniques and use that to set a single cache variable.
261 #
262 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
263 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
264 # dependency, and given that the user is not expected to run this macro,
265 # just rely on AC_PROG_CC.
266 AC_DEFUN([_AM_DEPENDENCIES],
267 [AC_REQUIRE([AM_SET_DEPDIR])dnl
268 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
269 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
270 AC_REQUIRE([AM_DEP_TRACK])dnl
271
272 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
273        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
274        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
275        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
276                    [depcc="$$1"   am_compiler_list=])
277
278 AC_CACHE_CHECK([dependency style of $depcc],
279                [am_cv_$1_dependencies_compiler_type],
280 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
281   # We make a subdir and do the tests there.  Otherwise we can end up
282   # making bogus files that we don't know about and never remove.  For
283   # instance it was reported that on HP-UX the gcc test will end up
284   # making a dummy file named `D' -- because `-MD' means `put the output
285   # in D'.
286   mkdir conftest.dir
287   # Copy depcomp to subdir because otherwise we won't find it if we're
288   # using a relative directory.
289   cp "$am_depcomp" conftest.dir
290   cd conftest.dir
291
292   am_cv_$1_dependencies_compiler_type=none
293   if test "$am_compiler_list" = ""; then
294      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
295   fi
296   for depmode in $am_compiler_list; do
297     # We need to recreate these files for each test, as the compiler may
298     # overwrite some of them when testing with obscure command lines.
299     # This happens at least with the AIX C compiler.
300     echo '#include "conftest.h"' > conftest.c
301     echo 'int i;' > conftest.h
302     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
303
304     case $depmode in
305     nosideeffect)
306       # after this tag, mechanisms are not by side-effect, so they'll
307       # only be used when explicitly requested
308       if test "x$enable_dependency_tracking" = xyes; then
309         continue
310       else
311         break
312       fi
313       ;;
314     none) break ;;
315     esac
316     # We check with `-c' and `-o' for the sake of the "dashmstdout"
317     # mode.  It turns out that the SunPro C++ compiler does not properly
318     # handle `-M -o', and we need to detect this.
319     if depmode=$depmode \
320        source=conftest.c object=conftest.o \
321        depfile=conftest.Po tmpdepfile=conftest.TPo \
322        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
323        grep conftest.h conftest.Po > /dev/null 2>&1 &&
324        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
325       am_cv_$1_dependencies_compiler_type=$depmode
326       break
327     fi
328   done
329
330   cd ..
331   rm -rf conftest.dir
332 else
333   am_cv_$1_dependencies_compiler_type=none
334 fi
335 ])
336 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
337 AC_SUBST([$1DEPMODE])
338 ])
339
340
341 # AM_SET_DEPDIR
342 # -------------
343 # Choose a directory name for dependency files.
344 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
345 AC_DEFUN([AM_SET_DEPDIR],
346 [rm -f .deps 2>/dev/null
347 mkdir .deps 2>/dev/null
348 if test -d .deps; then
349   DEPDIR=.deps
350 else
351   # MS-DOS does not allow filenames that begin with a dot.
352   DEPDIR=_deps
353 fi
354 rmdir .deps 2>/dev/null
355 AC_SUBST(DEPDIR)
356 ])
357
358
359 # AM_DEP_TRACK
360 # ------------
361 AC_DEFUN([AM_DEP_TRACK],
362 [AC_ARG_ENABLE(dependency-tracking,
363 [  --disable-dependency-tracking Speeds up one-time builds
364   --enable-dependency-tracking  Do not reject slow dependency extractors])
365 if test "x$enable_dependency_tracking" != xno; then
366   am_depcomp="$ac_aux_dir/depcomp"
367   AMDEPBACKSLASH='\'
368 fi
369 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
370 pushdef([subst], defn([AC_SUBST]))
371 subst(AMDEPBACKSLASH)
372 popdef([subst])
373 ])
374
375 # Generate code to set up dependency tracking.
376 # This macro should only be invoked once -- use via AC_REQUIRE.
377 # Usage:
378 # AM_OUTPUT_DEPENDENCY_COMMANDS
379
380 #
381 # This code is only required when automatic dependency tracking
382 # is enabled.  FIXME.  This creates each `.P' file that we will
383 # need in order to bootstrap the dependency handling code.
384 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
385 AC_OUTPUT_COMMANDS([
386 test x"$AMDEP_TRUE" != x"" ||
387 for mf in $CONFIG_FILES; do
388   case "$mf" in
389   Makefile) dirpart=.;;
390   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
391   *) continue;;
392   esac
393   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
394   # Extract the definition of DEP_FILES from the Makefile without
395   # running `make'.
396   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
397   test -z "$DEPDIR" && continue
398   # When using ansi2knr, U may be empty or an underscore; expand it
399   U=`sed -n -e '/^U = / s///p' < "$mf"`
400   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
401   # We invoke sed twice because it is the simplest approach to
402   # changing $(DEPDIR) to its actual value in the expansion.
403   for file in `sed -n -e '
404     /^DEP_FILES = .*\\\\$/ {
405       s/^DEP_FILES = //
406       :loop
407         s/\\\\$//
408         p
409         n
410         /\\\\$/ b loop
411       p
412     }
413     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
414        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
415     # Make sure the directory exists.
416     test -f "$dirpart/$file" && continue
417     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
418     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
419     # echo "creating $dirpart/$file"
420     echo '# dummy' > "$dirpart/$file"
421   done
422 done
423 ], [AMDEP_TRUE="$AMDEP_TRUE"
424 ac_aux_dir="$ac_aux_dir"])])
425
426 # AM_MAKE_INCLUDE()
427 # -----------------
428 # Check to see how make treats includes.
429 AC_DEFUN([AM_MAKE_INCLUDE],
430 [am_make=${MAKE-make}
431 cat > confinc << 'END'
432 doit:
433         @echo done
434 END
435 # If we don't find an include directive, just comment out the code.
436 AC_MSG_CHECKING([for style of include used by $am_make])
437 am__include='#'
438 am__quote=
439 _am_result=none
440 # First try GNU make style include.
441 echo "include confinc" > confmf
442 # We grep out `Entering directory' and `Leaving directory'
443 # messages which can occur if `w' ends up in MAKEFLAGS.
444 # In particular we don't look at `^make:' because GNU make might
445 # be invoked under some other name (usually "gmake"), in which
446 # case it prints its new name instead of `make'.
447 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
448    am__include=include
449    am__quote=
450    _am_result=GNU
451 fi
452 # Now try BSD make style include.
453 if test "$am__include" = "#"; then
454    echo '.include "confinc"' > confmf
455    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
456       am__include=.include
457       am__quote='"'
458       _am_result=BSD
459    fi
460 fi
461 AC_SUBST(am__include)
462 AC_SUBST(am__quote)
463 AC_MSG_RESULT($_am_result)
464 rm -f confinc confmf
465 ])
466
467 # serial 3
468
469 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
470 # -------------------------------------
471 # Define a conditional.
472 #
473 # FIXME: Once using 2.50, use this:
474 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
475 AC_DEFUN([AM_CONDITIONAL],
476 [ifelse([$1], [TRUE],
477         [errprint(__file__:__line__: [$0: invalid condition: $1
478 ])dnl
479 m4exit(1)])dnl
480 ifelse([$1], [FALSE],
481        [errprint(__file__:__line__: [$0: invalid condition: $1
482 ])dnl
483 m4exit(1)])dnl
484 AC_SUBST([$1_TRUE])
485 AC_SUBST([$1_FALSE])
486 if $2; then
487   $1_TRUE=
488   $1_FALSE='#'
489 else
490   $1_TRUE='#'
491   $1_FALSE=
492 fi])
493
494 # Like AC_CONFIG_HEADER, but automatically create stamp file.
495
496 # serial 3
497
498 # When config.status generates a header, we must update the stamp-h file.
499 # This file resides in the same directory as the config header
500 # that is generated.  We must strip everything past the first ":",
501 # and everything past the last "/".
502
503 AC_PREREQ([2.12])
504
505 AC_DEFUN([AM_CONFIG_HEADER],
506 [ifdef([AC_FOREACH],dnl
507          [dnl init our file count if it isn't already
508          m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
509          dnl prepare to store our destination file list for use in config.status
510          AC_FOREACH([_AM_File], [$1],
511                     [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
512                     m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
513                     dnl and add it to the list of files AC keeps track of, along
514                     dnl with our hook
515                     AC_CONFIG_HEADERS(_AM_File,
516 dnl COMMANDS, [, INIT-CMDS]
517 [# update the timestamp
518 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
519 ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
520                     m4_popdef([_AM_Dest])])],dnl
521 [AC_CONFIG_HEADER([$1])
522   AC_OUTPUT_COMMANDS(
523    ifelse(patsubst([$1], [[^ ]], []),
524           [],
525           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
526            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
527 [am_indx=1
528 for am_file in $1; do
529   case " \$CONFIG_HEADERS " in
530   *" \$am_file "*)
531     am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
532     if test -n "\$am_dir"; then
533       am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
534       for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
535         am_tmpdir=\$am_tmpdir\$am_subdir/
536         if test ! -d \$am_tmpdir; then
537           mkdir \$am_tmpdir
538         fi
539       done
540     fi
541     echo timestamp > "\$am_dir"stamp-h\$am_indx
542     ;;
543   esac
544   am_indx=\`expr \$am_indx + 1\`
545 done])
546 ])]) # AM_CONFIG_HEADER
547
548 # _AM_DIRNAME(PATH)
549 # -----------------
550 # Like AS_DIRNAME, only do it during macro expansion
551 AC_DEFUN([_AM_DIRNAME],
552        [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
553               m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
554                     m4_if(m4_regexp([$1], [^/.*]), -1,
555                           [.],
556                           m4_patsubst([$1], [^\(/\).*], [\1])),
557                     m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
558               m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
559 ]) # _AM_DIRNAME
560
561 # aclocal-include.m4
562
563 # This macro adds the name macrodir to the set of directories
564 # that `aclocal' searches for macros.  
565
566 # serial 1
567
568 dnl AM_ACLOCAL_INCLUDE(macrodir)
569 AC_DEFUN([AM_ACLOCAL_INCLUDE],
570 [
571         AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y)
572
573         test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
574
575         for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
576 ])
577
578
579 define([HACK_SUBST], defn([AC_SUBST]))
580
581 # serial 1 AC_PROG_XML_I18N_TOOLS
582 AC_DEFUN(AC_PROG_XML_I18N_TOOLS,
583 [
584
585 dnl This is a hack - we use the expansion of AC_SUBST instead of
586 dnl AC_SUBST itself to avoid automake putting 
587 dnl XML_I18N_MERGE_OAF_RULE = @XML_I18N_MERGE_OAF_RULE@
588 dnl in all the Makefile.in's, because that will blow up when substituted.
589 XML_I18N_MERGE_OAF_RULE='\%.oaf : \%.oaf.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
590         $(top_builddir)/xml-i18n-merge -o $(top_srcdir)/po $< [$]*.oaf'
591 HACK_SUBST(XML_I18N_MERGE_OAF_RULE)
592
593 XML_I18N_MERGE_SERVER_RULE='\%.server : \%.server.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
594         $(top_builddir)/xml-i18n-merge -o $(top_srcdir)/po $< [$]*.server'
595 HACK_SUBST(XML_I18N_MERGE_SERVER_RULE)
596
597 dnl same deal
598 XML_I18N_MERGE_KEYS_RULE='\%.keys : \%.keys.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
599         $(top_builddir)/xml-i18n-merge -k $(top_srcdir)/po $< [$]*.keys'
600 HACK_SUBST(XML_I18N_MERGE_KEYS_RULE)
601
602 dnl same deal
603 XML_I18N_MERGE_DESKTOP_RULE='\%.desktop : \%.desktop.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
604         $(top_builddir)/xml-i18n-merge -d $(top_srcdir)/po $< [$]*.desktop'
605 HACK_SUBST(XML_I18N_MERGE_DESKTOP_RULE)
606
607 dnl same deal
608 XML_I18N_MERGE_DIRECTORY_RULE='\%.directory : \%.directory.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
609         $(top_builddir)/xml-i18n-merge -d $(top_srcdir)/po $< [$]*.directory'
610 HACK_SUBST(XML_I18N_MERGE_DIRECTORY_RULE)
611
612 dnl same deal
613 XML_I18N_MERGE_SOUNDLIST_RULE='\%.soundlist : \%.soundlist.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
614         $(top_builddir)/xml-i18n-merge -d $(top_srcdir)/po $< [$]*.soundlist'
615 HACK_SUBST(XML_I18N_MERGE_SOUNDLIST_RULE)
616
617 dnl same deal
618 XML_I18N_MERGE_PONG_RULE='\%.pong : \%.pong.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
619         $(top_builddir)/xml-i18n-merge -x $(top_srcdir)/po $< [$]*.pong'
620 HACK_SUBST(XML_I18N_MERGE_PONG_RULE)
621
622 dnl same deal
623 XML_I18N_MERGE_XML_RULE='\%.xml : \%.xml.in $(top_builddir)/xml-i18n-merge $(top_srcdir)/po/*.po\
624         $(top_builddir)/xml-i18n-merge -x $(top_srcdir)/po $< [$]*.xml'
625 HACK_SUBST(XML_I18N_MERGE_XML_RULE)
626
627 # Always use our own xml-i18n-tools.
628 XML_I18N_EXTRACT='$(top_builddir)/xml-i18n-extract'
629 AC_SUBST(XML_I18N_EXTRACT)dnl
630
631 XML_I18N_MERGE='$(top_builddir)/xml-i18n-merge'
632 AC_SUBST(XML_I18N_MERGE)dnl
633
634 XML_I18N_UPDATE='$(top_builddir)/xml-i18n-update'
635 AC_SUBST(XML_I18N_UPDATE)dnl
636
637 AC_PATH_PROG(XML_I18N_TOOLS_PERL, perl)
638 if test -z "$XML_I18N_TOOLS_PERL"; then
639    AC_MSG_ERROR([perl not found; required for xml-i18n-tools])
640 fi
641 if test -z "`$XML_I18N_TOOLS_PERL -v | fgrep '5.' 2> /dev/null`"; then
642    AC_MSG_ERROR([perl 5.x required for xml-i18n-tools])
643 fi
644
645 dnl  manually sed perl in so people don't have to put the xml-i18n-tools scripts in their 
646 dnl  AC_OUTPUT
647 AC_OUTPUT_COMMANDS([
648 sed -e "s:@XML_I18N_TOOLS_PERL@:${XML_I18N_TOOLS_PERL}:;" < ${srcdir}/xml-i18n-extract.in > xml-i18n-extract;
649 chmod ugo+x xml-i18n-extract;
650 chmod u+w xml-i18n-extract;
651
652 sed -e "s:@XML_I18N_TOOLS_PERL@:${XML_I18N_TOOLS_PERL}:;" < ${srcdir}/xml-i18n-merge.in > xml-i18n-merge;
653 chmod ugo+x xml-i18n-merge;
654 chmod u+w xml-i18n-merge;
655
656 sed -e "s:@XML_I18N_TOOLS_PERL@:${XML_I18N_TOOLS_PERL}:;" < ${srcdir}/xml-i18n-update.in > xml-i18n-update;
657 chmod ugo+x xml-i18n-update;
658 chmod u+w xml-i18n-update;
659 ], XML_I18N_TOOLS_PERL=${XML_I18N_TOOLS_PERL})
660
661 # Redirect the config.log output again, so that the ltconfig log is not
662 # clobbered by the next message.
663 exec 5>>./config.log
664 ])
665
666 dnl old names
667 AC_DEFUN(AM_PROG_XML_I18N_TOOLS, [indir([AC_PROG_XML_I18N_TOOLS])])dnl
668
669 # gnome-common.m4
670
671 # This only for packages that are not in the GNOME CVS tree.
672
673 dnl GNOME_COMMON_INIT
674
675 AC_DEFUN([GNOME_COMMON_INIT],
676 [
677         GNOME_ACLOCAL_DIR="$GNOME_COMMON_MACROS_DIR"
678         AC_SUBST(GNOME_ACLOCAL_DIR)
679
680         ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
681 ])
682
683
684 dnl
685 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
686 dnl
687 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
688 dnl is not found. 
689 dnl
690
691 AC_DEFUN([GNOME_INIT_HOOK],[
692         AC_SUBST(GNOME_LIBS)
693         AC_SUBST(GNOMEUI_LIBS)
694         AC_SUBST(GNOMEGNORBA_LIBS)
695         AC_SUBST(GTKXMHTML_LIBS)
696         AC_SUBST(ZVT_LIBS)
697         AC_SUBST(GNOME_LIBDIR)
698         AC_SUBST(GNOME_INCLUDEDIR)
699
700         AC_ARG_WITH(gnome-includes,
701         [  --with-gnome-includes   Specify location of GNOME headers],[
702         CFLAGS="$CFLAGS -I$withval"
703         ])
704         
705         AC_ARG_WITH(gnome-libs,
706         [  --with-gnome-libs       Specify location of GNOME libs],[
707         LDFLAGS="$LDFLAGS -L$withval"
708         gnome_prefix=$withval
709         ])
710
711         AC_ARG_WITH(gnome,
712         [  --with-gnome            Specify prefix for GNOME files],
713                 if test x$withval = xyes; then
714                         want_gnome=yes
715                         dnl Note that an empty true branch is not
716                         dnl valid sh syntax.
717                         ifelse([$1], [], :, [$1])
718                 else
719                         if test "x$withval" = xno; then
720                                 want_gnome=no
721                         else
722                                 want_gnome=yes
723                                 LDFLAGS="$LDFLAGS -L$withval/lib"
724                                 CFLAGS="$CFLAGS -I$withval/include"
725                                 gnome_prefix=$withval/lib
726                         fi
727                 fi,
728                 want_gnome=yes)
729
730         if test "x$want_gnome" = xyes; then
731
732             AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
733             if test "$GNOME_CONFIG" = "no"; then
734               no_gnome_config="yes"
735             else
736               AC_MSG_CHECKING(if $GNOME_CONFIG works)
737               if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
738                 AC_MSG_RESULT(yes)
739                 GNOME_GNORBA_HOOK([],$2)
740                 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
741                 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
742                 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
743                 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
744                 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
745                 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
746                 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
747                 $1
748               else
749                 AC_MSG_RESULT(no)
750                 no_gnome_config="yes"
751               fi
752             fi
753
754             if test x$exec_prefix = xNONE; then
755                 if test x$prefix = xNONE; then
756                     gnome_prefix=$ac_default_prefix/lib
757                 else
758                     gnome_prefix=$prefix/lib
759                 fi
760             else
761                 gnome_prefix=`eval echo \`echo $libdir\``
762             fi
763         
764             if test "$no_gnome_config" = "yes"; then
765               AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
766               if test -f $gnome_prefix/gnomeConf.sh; then
767                 AC_MSG_RESULT(found)
768                 echo "loading gnome configuration from" \
769                      "$gnome_prefix/gnomeConf.sh"
770                 . $gnome_prefix/gnomeConf.sh
771                 $1
772               else
773                 AC_MSG_RESULT(not found)
774                 if test x$2 = xfail; then
775                   AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
776                 fi
777               fi
778             fi
779         fi
780
781         if test -n "$3"; then
782           n="$3"
783           for i in $n; do
784             AC_MSG_CHECKING(extra library \"$i\")
785             case $i in 
786               applets)
787                 AC_SUBST(GNOME_APPLETS_LIBS)
788                 GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
789                 AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
790               docklets)
791                 AC_SUBST(GNOME_DOCKLETS_LIBS)
792                 GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
793                 AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
794               capplet)
795                 AC_SUBST(GNOME_CAPPLET_LIBS)
796                 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
797                 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
798               *)
799                 AC_MSG_RESULT(unknown library)
800             esac
801           done
802         fi
803 ])
804
805 dnl
806 dnl GNOME_INIT ([additional-inits])
807 dnl
808
809 AC_DEFUN([GNOME_INIT],[
810         GNOME_INIT_HOOK([],fail,$1)
811 ])
812
813 dnl
814 dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
815 dnl
816 dnl if failflag is "failure" it aborts if gnorba is not found.
817 dnl
818
819 AC_DEFUN([GNOME_GNORBA_HOOK],[
820         GNOME_ORBIT_HOOK([],$2)
821         AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
822                 gnome_cv_gnorba_found=no
823                 if test x$gnome_cv_orbit_found = xyes; then
824                         GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
825                         GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
826                         if test -n "$GNORBA_LIBS"; then
827                                 gnome_cv_gnorba_found=yes
828                         fi
829                 fi
830         ])
831         AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
832         if test x$gnome_cv_orbit_found = xyes; then
833                 $1
834                 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
835                 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
836                 AC_SUBST(GNORBA_CFLAGS)
837                 AC_SUBST(GNORBA_LIBS)
838         else
839                 if test x$2 = xfailure; then
840                         AC_MSG_ERROR(gnorba library not installed or installation problem)
841                 fi
842         fi
843 ])
844
845 AC_DEFUN([GNOME_GNORBA_CHECK], [
846         GNOME_GNORBA_HOOK([],failure)
847 ])
848
849 dnl
850 dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
851 dnl
852 dnl if failflag is "failure" it aborts if orbit is not found.
853 dnl
854
855 AC_DEFUN([GNOME_ORBIT_HOOK],[
856         AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
857         AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
858         AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
859                 if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
860                         gnome_cv_orbit_found=no
861                 else
862                         gnome_cv_orbit_found=yes
863                 fi
864         ])
865         AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
866         if test x$gnome_cv_orbit_found = xyes; then
867                 $1
868                 ORBIT_CFLAGS=`orbit-config --cflags client server`
869                 ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
870                 AC_SUBST(ORBIT_CFLAGS)
871                 AC_SUBST(ORBIT_LIBS)
872         else
873                 if test x$2 = xfailure; then
874                         AC_MSG_ERROR(ORBit not installed or installation problem)
875                 fi
876         fi
877 ])
878
879 AC_DEFUN([GNOME_ORBIT_CHECK], [
880         GNOME_ORBIT_HOOK([],failure)
881 ])
882
883 #serial 1
884 # This test replaces the one in autoconf.
885 # Currently this macro should have the same name as the autoconf macro
886 # because gettext's gettext.m4 (distributed in the automake package)
887 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
888 # give these diagnostics:
889 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
890 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
891
892 undefine([AC_ISC_POSIX])
893
894 AC_DEFUN([AC_ISC_POSIX],
895   [
896     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
897     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
898   ]
899 )
900
901
902 # serial 1
903
904 # @defmac AC_PROG_CC_STDC
905 # @maindex PROG_CC_STDC
906 # @ovindex CC
907 # If the C compiler in not in ANSI C mode by default, try to add an option
908 # to output variable @code{CC} to make it so.  This macro tries various
909 # options that select ANSI C on some system or another.  It considers the
910 # compiler to be in ANSI C mode if it handles function prototypes correctly.
911 #
912 # If you use this macro, you should check after calling it whether the C
913 # compiler has been set to accept ANSI C; if not, the shell variable
914 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
915 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
916 # program @code{ansi2knr}, which comes with Ghostscript.
917 # @end defmac
918
919 AC_DEFUN([AM_PROG_CC_STDC],
920 [AC_REQUIRE([AC_PROG_CC])
921 AC_BEFORE([$0], [AC_C_INLINE])
922 AC_BEFORE([$0], [AC_C_CONST])
923 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
924 dnl a magic option to avoid problems with ANSI preprocessor commands
925 dnl like #elif.
926 dnl FIXME: can't do this because then AC_AIX won't work due to a
927 dnl circular dependency.
928 dnl AC_BEFORE([$0], [AC_PROG_CPP])
929 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
930 AC_CACHE_VAL(am_cv_prog_cc_stdc,
931 [am_cv_prog_cc_stdc=no
932 ac_save_CC="$CC"
933 # Don't try gcc -ansi; that turns off useful extensions and
934 # breaks some systems' header files.
935 # AIX                   -qlanglvl=ansi
936 # Ultrix and OSF/1      -std1
937 # HP-UX 10.20 and later -Ae
938 # HP-UX older versions  -Aa -D_HPUX_SOURCE
939 # SVR4                  -Xc -D__EXTENSIONS__
940 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
941 do
942   CC="$ac_save_CC $ac_arg"
943   AC_TRY_COMPILE(
944 [#include <stdarg.h>
945 #include <stdio.h>
946 #include <sys/types.h>
947 #include <sys/stat.h>
948 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
949 struct buf { int x; };
950 FILE * (*rcsopen) (struct buf *, struct stat *, int);
951 static char *e (p, i)
952      char **p;
953      int i;
954 {
955   return p[i];
956 }
957 static char *f (char * (*g) (char **, int), char **p, ...)
958 {
959   char *s;
960   va_list v;
961   va_start (v,p);
962   s = g (p, va_arg (v,int));
963   va_end (v);
964   return s;
965 }
966 int test (int i, double x);
967 struct s1 {int (*f) (int a);};
968 struct s2 {int (*f) (double a);};
969 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
970 int argc;
971 char **argv;
972 ], [
973 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
974 ],
975 [am_cv_prog_cc_stdc="$ac_arg"; break])
976 done
977 CC="$ac_save_CC"
978 ])
979 if test -z "$am_cv_prog_cc_stdc"; then
980   AC_MSG_RESULT([none needed])
981 else
982   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
983 fi
984 case "x$am_cv_prog_cc_stdc" in
985   x|xno) ;;
986   *) CC="$CC $am_cv_prog_cc_stdc" ;;
987 esac
988 ])
989
990 dnl GNOME_COMPILE_WARNINGS
991 dnl Turn on many useful compiler warnings
992 dnl For now, only works on GCC
993 AC_DEFUN([GNOME_COMPILE_WARNINGS],[
994   AC_ARG_ENABLE(compile-warnings, 
995     [  --enable-compile-warnings=[no/minimum/yes]       Turn on compiler warnings.],,enable_compile_warnings=minimum)
996
997   AC_MSG_CHECKING(what warning flags to pass to the C compiler)
998   warnCFLAGS=
999   if test "x$GCC" != xyes; then
1000     enable_compile_warnings=no
1001   fi
1002
1003   if test "x$enable_compile_warnings" != "xno"; then
1004     if test "x$GCC" = "xyes"; then
1005       case " $CFLAGS " in
1006       *[\ \     ]-Wall[\ \      ]*) ;;
1007       *) warnCFLAGS="-Wall -Wunused" ;;
1008       esac
1009
1010       ## -W is not all that useful.  And it cannot be controlled
1011       ## with individual -Wno-xxx flags, unlike -Wall
1012       if test "x$enable_compile_warnings" = "xyes"; then
1013         warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations"
1014       fi
1015     fi
1016   fi
1017   AC_MSG_RESULT($warnCFLAGS)
1018
1019   AC_ARG_ENABLE(iso-c,
1020     [  --enable-iso-c          Try to warn if code is not ISO C ],,
1021     enable_iso_c=no)
1022
1023   AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
1024   complCFLAGS=
1025   if test "x$enable_iso_c" != "xno"; then
1026     if test "x$GCC" = "xyes"; then
1027       case " $CFLAGS " in
1028       *[\ \     ]-ansi[\ \      ]*) ;;
1029       *) complCFLAGS="$complCFLAGS -ansi" ;;
1030       esac
1031
1032       case " $CFLAGS " in
1033       *[\ \     ]-pedantic[\ \  ]*) ;;
1034       *) complCFLAGS="$complCFLAGS -pedantic" ;;
1035       esac
1036     fi
1037   fi
1038   AC_MSG_RESULT($complCFLAGS)
1039   if test "x$cflags_set" != "xyes"; then
1040     CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
1041     cflags_set=yes
1042     AC_SUBST(cflags_set)
1043   fi
1044 ])
1045
1046 dnl For C++, do basically the same thing.
1047
1048 AC_DEFUN([GNOME_CXX_WARNINGS],[
1049   AC_ARG_ENABLE(cxx-warnings, 
1050     [  --enable-cxx-warnings=[no/minimum/yes]   Turn on compiler warnings.],,enable_cxx_warnings=minimum)
1051
1052   AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1053   warnCXXFLAGS=
1054   if test "x$GCC" != xyes; then
1055     enable_compile_warnings=no
1056   fi
1057   if test "x$enable_cxx_warnings" != "xno"; then
1058     if test "x$GCC" = "xyes"; then
1059       case " $CXXFLAGS " in
1060       *[\ \     ]-Wall[\ \      ]*) ;;
1061       *) warnCXXFLAGS="-Wall -Wno-unused" ;;
1062       esac
1063
1064       ## -W is not all that useful.  And it cannot be controlled
1065       ## with individual -Wno-xxx flags, unlike -Wall
1066       if test "x$enable_cxx_warnings" = "xyes"; then
1067         warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual"
1068       fi
1069     fi
1070   fi
1071   AC_MSG_RESULT($warnCXXFLAGS)
1072
1073    AC_ARG_ENABLE(iso-cxx,
1074      [  --enable-iso-cxx          Try to warn if code is not ISO C++ ],,
1075      enable_iso_cxx=no)
1076
1077    AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
1078    complCXXFLAGS=
1079    if test "x$enable_iso_cxx" != "xno"; then
1080      if test "x$GCC" = "xyes"; then
1081       case " $CXXFLAGS " in
1082       *[\ \     ]-ansi[\ \      ]*) ;;
1083       *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
1084       esac
1085
1086       case " $CXXFLAGS " in
1087       *[\ \     ]-pedantic[\ \  ]*) ;;
1088       *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1089       esac
1090      fi
1091    fi
1092   AC_MSG_RESULT($complCXXFLAGS)
1093   if test "x$cxxflags_set" != "xyes"; then
1094     CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1095     cxxflags_set=yes
1096     AC_SUBST(cxxflags_set)
1097   fi
1098 ])
1099
1100 dnl GNOME_X_CHECKS
1101 dnl
1102 dnl Basic X11 related checks for X11.  At the end, the following will be
1103 dnl defined/changed:
1104 dnl   GTK_{CFLAGS,LIBS}      From AM_PATH_GTK
1105 dnl   CPPFLAGS               Will include $X_CFLAGS
1106 dnl   GNOME_HAVE_SM          `true' or `false' depending on whether session
1107 dnl                          management is available.  It is available if
1108 dnl                          both -lSM and X11/SM/SMlib.h exist.  (Some
1109 dnl                          Solaris boxes have the library but not the header)
1110 dnl   XPM_LIBS               -lXpm if Xpm library is present, otherwise ""
1111 dnl
1112 dnl The following configure cache variables are defined (but not used):
1113 dnl   gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
1114 dnl
1115 AC_DEFUN([GNOME_X_CHECKS],
1116 [
1117         AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
1118         dnl Hope that GTK_CFLAGS have only -I and -D.  Otherwise, we could
1119         dnl   test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
1120         dnl
1121         dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
1122         dnl CPPFLAGS, not CFLAGS
1123         CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
1124
1125         saved_ldflags="$LDFLAGS"
1126         LDFLAGS="$LDFLAGS $GTK_LIBS"
1127
1128         gnome_cv_passdown_x_libs="$GTK_LIBS"
1129         gnome_cv_passdown_X_LIBS="$GTK_LIBS"
1130         gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
1131         gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
1132
1133         LDFLAGS="$saved_ldflags $GTK_LIBS"
1134
1135 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
1136         USE_DEVGTK=true
1137
1138 dnl     AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
1139 dnl     AC_EGREP_CPP(answer_affirmatively,
1140 dnl     [#include <gtk/gtkfeatures.h>
1141 dnl     #ifdef GTK_HAVE_FEATURES_1_1_0
1142 dnl        answer_affirmatively
1143 dnl     #endif
1144 dnl     ], dev_gtk=yes, dev_gtk=no)
1145 dnl     if test "$dev_gtk" = "yes"; then
1146 dnl        USE_DEVGTK=true
1147 dnl     fi
1148 dnl     AC_MSG_RESULT("$dev_gtk")
1149
1150         GNOME_HAVE_SM=true
1151         case "$GTK_LIBS" in
1152          *-lSM*)
1153             dnl Already found it.
1154             ;;
1155          *)
1156             dnl Assume that if we have -lSM then we also have -lICE.
1157             AC_CHECK_LIB(SM, SmcSaveYourselfDone,
1158                 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
1159                 $x_libs -lICE)
1160             ;;
1161         esac
1162
1163         if test "$GNOME_HAVE_SM" = true; then
1164            AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
1165         fi
1166
1167         if test "$GNOME_HAVE_SM" = true; then
1168            AC_DEFINE(HAVE_LIBSM)
1169         fi
1170
1171         XPM_LIBS=""
1172         AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
1173         AC_SUBST(XPM_LIBS)
1174
1175         AC_REQUIRE([GNOME_PTHREAD_CHECK])
1176         LDFLAGS="$saved_ldflags"
1177
1178         AC_PROVIDE([GNOME_X_CHECKS])
1179 ])
1180
1181 # Configure paths for GTK+
1182 # Owen Taylor     97-11-3
1183
1184 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1185 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
1186 dnl
1187 AC_DEFUN(AM_PATH_GTK,
1188 [dnl 
1189 dnl Get the cflags and libraries from the gtk-config script
1190 dnl
1191 AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
1192             gtk_config_prefix="$withval", gtk_config_prefix="")
1193 AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
1194             gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
1195 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
1196                     , enable_gtktest=yes)
1197
1198   for module in . $4
1199   do
1200       case "$module" in
1201          gthread) 
1202              gtk_config_args="$gtk_config_args gthread"
1203          ;;
1204       esac
1205   done
1206
1207   if test x$gtk_config_exec_prefix != x ; then
1208      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
1209      if test x${GTK_CONFIG+set} != xset ; then
1210         GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
1211      fi
1212   fi
1213   if test x$gtk_config_prefix != x ; then
1214      gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
1215      if test x${GTK_CONFIG+set} != xset ; then
1216         GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
1217      fi
1218   fi
1219
1220   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
1221   min_gtk_version=ifelse([$1], ,0.99.7,$1)
1222   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
1223   no_gtk=""
1224   if test "$GTK_CONFIG" = "no" ; then
1225     no_gtk=yes
1226   else
1227     GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
1228     GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
1229     gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
1230            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1231     gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
1232            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1233     gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
1234            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1235     if test "x$enable_gtktest" = "xyes" ; then
1236       ac_save_CFLAGS="$CFLAGS"
1237       ac_save_LIBS="$LIBS"
1238       CFLAGS="$CFLAGS $GTK_CFLAGS"
1239       LIBS="$GTK_LIBS $LIBS"
1240 dnl
1241 dnl Now check if the installed GTK is sufficiently new. (Also sanity
1242 dnl checks the results of gtk-config to some extent
1243 dnl
1244       rm -f conf.gtktest
1245       AC_TRY_RUN([
1246 #include <gtk/gtk.h>
1247 #include <stdio.h>
1248 #include <stdlib.h>
1249
1250 int 
1251 main ()
1252 {
1253   int major, minor, micro;
1254   char *tmp_version;
1255
1256   system ("touch conf.gtktest");
1257
1258   /* HP/UX 9 (%@#!) writes to sscanf strings */
1259   tmp_version = g_strdup("$min_gtk_version");
1260   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1261      printf("%s, bad version string\n", "$min_gtk_version");
1262      exit(1);
1263    }
1264
1265   if ((gtk_major_version != $gtk_config_major_version) ||
1266       (gtk_minor_version != $gtk_config_minor_version) ||
1267       (gtk_micro_version != $gtk_config_micro_version))
1268     {
1269       printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
1270              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
1271              gtk_major_version, gtk_minor_version, gtk_micro_version);
1272       printf ("*** was found! If gtk-config was correct, then it is best\n");
1273       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
1274       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1275       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1276       printf("*** required on your system.\n");
1277       printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
1278       printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
1279       printf("*** before re-running configure\n");
1280     } 
1281 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
1282   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
1283            (gtk_minor_version != GTK_MINOR_VERSION) ||
1284            (gtk_micro_version != GTK_MICRO_VERSION))
1285     {
1286       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
1287              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
1288       printf("*** library (version %d.%d.%d)\n",
1289              gtk_major_version, gtk_minor_version, gtk_micro_version);
1290     }
1291 #endif /* defined (GTK_MAJOR_VERSION) ... */
1292   else
1293     {
1294       if ((gtk_major_version > major) ||
1295         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1296         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
1297       {
1298         return 0;
1299        }
1300      else
1301       {
1302         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
1303                gtk_major_version, gtk_minor_version, gtk_micro_version);
1304         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
1305                major, minor, micro);
1306         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
1307         printf("***\n");
1308         printf("*** If you have already installed a sufficiently new version, this error\n");
1309         printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
1310         printf("*** being found. The easiest way to fix this is to remove the old version\n");
1311         printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
1312         printf("*** correct copy of gtk-config. (In this case, you will have to\n");
1313         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1314         printf("*** so that the correct libraries are found at run-time))\n");
1315       }
1316     }
1317   return 1;
1318 }
1319 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1320        CFLAGS="$ac_save_CFLAGS"
1321        LIBS="$ac_save_LIBS"
1322      fi
1323   fi
1324   if test "x$no_gtk" = x ; then
1325      AC_MSG_RESULT(yes)
1326      ifelse([$2], , :, [$2])     
1327   else
1328      AC_MSG_RESULT(no)
1329      if test "$GTK_CONFIG" = "no" ; then
1330        echo "*** The gtk-config script installed by GTK could not be found"
1331        echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
1332        echo "*** your path, or set the GTK_CONFIG environment variable to the"
1333        echo "*** full path to gtk-config."
1334      else
1335        if test -f conf.gtktest ; then
1336         :
1337        else
1338           echo "*** Could not run GTK test program, checking why..."
1339           CFLAGS="$CFLAGS $GTK_CFLAGS"
1340           LIBS="$LIBS $GTK_LIBS"
1341           AC_TRY_LINK([
1342 #include <gtk/gtk.h>
1343 #include <stdio.h>
1344 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1345         [ echo "*** The test program compiled, but did not run. This usually means"
1346           echo "*** that the run-time linker is not finding GTK or finding the wrong"
1347           echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
1348           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1349           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1350           echo "*** is required on your system"
1351           echo "***"
1352           echo "*** If you have an old version installed, it is best to remove it, although"
1353           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1354           echo "***"
1355           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1356           echo "*** came with the system with the command"
1357           echo "***"
1358           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
1359         [ echo "*** The test program failed to compile or link. See the file config.log for the"
1360           echo "*** exact error that occured. This usually means GTK was incorrectly installed"
1361           echo "*** or that you have moved GTK since it was installed. In the latter case, you"
1362           echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
1363           CFLAGS="$ac_save_CFLAGS"
1364           LIBS="$ac_save_LIBS"
1365        fi
1366      fi
1367      GTK_CFLAGS=""
1368      GTK_LIBS=""
1369      ifelse([$3], , :, [$3])
1370   fi
1371   AC_SUBST(GTK_CFLAGS)
1372   AC_SUBST(GTK_LIBS)
1373   rm -f conf.gtktest
1374 ])
1375
1376 dnl
1377 dnl And better, use gthreads instead...
1378 dnl
1379
1380 AC_DEFUN([GNOME_PTHREAD_CHECK],[
1381         PTHREAD_LIB=""
1382         AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1383                 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1384                     [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1385                         [AC_CHECK_FUNC(pthread_create)]
1386                     )]
1387                 )]
1388         )
1389         AC_SUBST(PTHREAD_LIB)
1390         AC_PROVIDE([GNOME_PTHREAD_CHECK])
1391 ])
1392
1393 # Macro to add for using GNU gettext.
1394 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1395 #
1396 # This file can be copied and used freely without restrictions.  It can
1397 # be used in projects which are not available under the GNU General Public
1398 # License but which still want to provide support for the GNU gettext
1399 # functionality.
1400 # Please note that the actual code of GNU gettext is covered by the GNU
1401 # General Public License and is *not* in the public domain.
1402
1403 # serial 10
1404
1405 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1406 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1407 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1408 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
1409 dnl    AM-DISABLE-SHARED). Otherwise, a static library
1410 dnl    $(top_builddir)/intl/libintl.a will be created.
1411 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1412 dnl    implementations (in libc or libintl) without the ngettext() function
1413 dnl    will be ignored.
1414 dnl LIBDIR is used to find the intl libraries.  If empty,
1415 dnl    the value `$(top_builddir)/intl/' is used.
1416 dnl
1417 dnl The result of the configuration is one of three cases:
1418 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1419 dnl    and used.
1420 dnl    Catalog format: GNU --> install in $(datadir)
1421 dnl    Catalog extension: .mo after installation, .gmo in source tree
1422 dnl 2) GNU gettext has been found in the system's C library.
1423 dnl    Catalog format: GNU --> install in $(datadir)
1424 dnl    Catalog extension: .mo after installation, .gmo in source tree
1425 dnl 3) No internationalization, always use English msgid.
1426 dnl    Catalog format: none
1427 dnl    Catalog extension: none
1428 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1429 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1430 dnl but we keep it in order not to force irrelevant filename changes on the
1431 dnl maintainers.
1432 dnl
1433 AC_DEFUN([AM_WITH_NLS],
1434   [AC_MSG_CHECKING([whether NLS is requested])
1435     dnl Default is enabled NLS
1436     AC_ARG_ENABLE(nls,
1437       [  --disable-nls           do not use Native Language Support],
1438       USE_NLS=$enableval, USE_NLS=yes)
1439     AC_MSG_RESULT($USE_NLS)
1440     AC_SUBST(USE_NLS)
1441
1442     BUILD_INCLUDED_LIBINTL=no
1443     USE_INCLUDED_LIBINTL=no
1444     INTLLIBS=
1445
1446     dnl If we use NLS figure out what method
1447     if test "$USE_NLS" = "yes"; then
1448       AC_DEFINE(ENABLE_NLS, 1,
1449         [Define to 1 if translation of program messages to the user's native language
1450    is requested.])
1451       AC_MSG_CHECKING([whether included gettext is requested])
1452       AC_ARG_WITH(included-gettext,
1453         [  --with-included-gettext use the GNU gettext library included here],
1454         nls_cv_force_use_gnu_gettext=$withval,
1455         nls_cv_force_use_gnu_gettext=no)
1456       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1457
1458       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1459       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1460         dnl User does not insist on using GNU NLS library.  Figure out what
1461         dnl to use.  If GNU gettext is available we use this.  Else we have
1462         dnl to fall back to GNU NLS library.
1463         CATOBJEXT=NONE
1464
1465         dnl Add a version number to the cache macros.
1466         define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1467         define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1468
1469         AC_CHECK_HEADER(libintl.h,
1470           [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1471             [AC_TRY_LINK([#include <libintl.h>
1472 extern int _nl_msg_cat_cntr;],
1473                [bindtextdomain ("", "");
1474 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1475                gt_cv_func_gnugettext_libc=yes,
1476                gt_cv_func_gnugettext_libc=no)])
1477
1478            if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1479              AC_CACHE_CHECK([for GNU gettext in libintl],
1480                gt_cv_func_gnugettext_libintl,
1481                [gt_save_LIBS="$LIBS"
1482                 LIBS="$LIBS -lintl $LIBICONV"
1483                 AC_TRY_LINK([#include <libintl.h>
1484 extern int _nl_msg_cat_cntr;],
1485                   [bindtextdomain ("", "");
1486 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1487                   gt_cv_func_gnugettext_libintl=yes,
1488                   gt_cv_func_gnugettext_libintl=no)
1489                 LIBS="$gt_save_LIBS"])
1490            fi
1491
1492            dnl If an already present or preinstalled GNU gettext() is found,
1493            dnl use it.  But if this macro is used in GNU gettext, and GNU
1494            dnl gettext is already preinstalled in libintl, we update this
1495            dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1496            if test "$gt_cv_func_gnugettext_libc" = "yes" \
1497               || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1498                    && test "$PACKAGE" != gettext; }; then
1499              AC_DEFINE(HAVE_GETTEXT, 1,
1500                [Define if the GNU gettext() function is already present or preinstalled.])
1501
1502              if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1503                dnl If iconv() is in a separate libiconv library, then anyone
1504                dnl linking with libintl{.a,.so} also needs to link with
1505                dnl libiconv.
1506                INTLLIBS="-lintl $LIBICONV"
1507              fi
1508
1509              gt_save_LIBS="$LIBS"
1510              LIBS="$LIBS $INTLLIBS"
1511              AC_CHECK_FUNCS(dcgettext)
1512              LIBS="$gt_save_LIBS"
1513
1514              dnl Search for GNU msgfmt in the PATH.
1515              AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1516                [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1517              AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1518
1519              dnl Search for GNU xgettext in the PATH.
1520              AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1521                [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1522
1523              CATOBJEXT=.gmo
1524            fi
1525         ])
1526
1527         if test "$CATOBJEXT" = "NONE"; then
1528           dnl GNU gettext is not found in the C library.
1529           dnl Fall back on GNU gettext library.
1530           nls_cv_use_gnu_gettext=yes
1531         fi
1532       fi
1533
1534       if test "$nls_cv_use_gnu_gettext" = "yes"; then
1535         dnl Mark actions used to generate GNU NLS library.
1536         INTLOBJS="\$(GETTOBJS)"
1537         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1538           [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1539         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1540         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1541           [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1542         AC_SUBST(MSGFMT)
1543         BUILD_INCLUDED_LIBINTL=yes
1544         USE_INCLUDED_LIBINTL=yes
1545         CATOBJEXT=.gmo
1546         INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1547         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1548       fi
1549
1550       dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1551       dnl Test whether we really found GNU msgfmt.
1552       if test "$GMSGFMT" != ":"; then
1553         dnl If it is no GNU msgfmt we define it as : so that the
1554         dnl Makefiles still can work.
1555         if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1556           : ;
1557         else
1558           AC_MSG_RESULT(
1559             [found msgfmt program is not GNU msgfmt; ignore it])
1560           GMSGFMT=":"
1561         fi
1562       fi
1563
1564       dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1565       dnl Test whether we really found GNU xgettext.
1566       if test "$XGETTEXT" != ":"; then
1567         dnl If it is no GNU xgettext we define it as : so that the
1568         dnl Makefiles still can work.
1569         if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1570           : ;
1571         else
1572           AC_MSG_RESULT(
1573             [found xgettext program is not GNU xgettext; ignore it])
1574           XGETTEXT=":"
1575         fi
1576       fi
1577
1578       dnl We need to process the po/ directory.
1579       POSUB=po
1580     fi
1581     AC_OUTPUT_COMMANDS(
1582      [for ac_file in $CONFIG_FILES; do
1583         # Support "outfile[:infile[:infile...]]"
1584         case "$ac_file" in
1585           *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1586         esac
1587         # PO directories have a Makefile.in generated from Makefile.in.in.
1588         case "$ac_file" in */Makefile.in)
1589           # Adjust a relative srcdir.
1590           ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1591           ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1592           ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1593           # In autoconf-2.13 it is called $ac_given_srcdir.
1594           # In autoconf-2.50 it is called $srcdir.
1595           test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1596           case "$ac_given_srcdir" in
1597             .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1598             /*) top_srcdir="$ac_given_srcdir" ;;
1599             *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1600           esac
1601           if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1602             rm -f "$ac_dir/POTFILES"
1603             test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1604             sed -e "/^#/d" -e "/^[      ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1605             test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1606             sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1607           fi
1608           ;;
1609         esac
1610       done])
1611
1612
1613     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1614     dnl to 'yes' because some of the testsuite requires it.
1615     if test "$PACKAGE" = gettext; then
1616       BUILD_INCLUDED_LIBINTL=yes
1617     fi
1618
1619     dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1620     dnl because plural.y uses bison specific features. It requires at least
1621     dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1622     dnl compile.
1623     dnl bison is only needed for the maintainer (who touches plural.y). But in
1624     dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1625     dnl the rule in general Makefile. Now, some people carelessly touch the
1626     dnl files or have a broken "make" program, hence the plural.c rule will
1627     dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1628     dnl present or too old.
1629     AC_CHECK_PROGS([INTLBISON], [bison])
1630     if test -z "$INTLBISON"; then
1631       ac_verc_fail=yes
1632     else
1633       dnl Found it, now check the version.
1634       AC_MSG_CHECKING([version of bison])
1635 changequote(<<,>>)dnl
1636       ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1637       case $ac_prog_version in
1638         '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1639         1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1640 changequote([,])dnl
1641            ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1642         *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1643       esac
1644       AC_MSG_RESULT([$ac_prog_version])
1645     fi
1646     if test $ac_verc_fail = yes; then
1647       INTLBISON=:
1648     fi
1649
1650     dnl These rules are solely for the distribution goal.  While doing this
1651     dnl we only have to keep exactly one list of the available catalogs
1652     dnl in configure.in.
1653     for lang in $ALL_LINGUAS; do
1654       GMOFILES="$GMOFILES $lang.gmo"
1655       POFILES="$POFILES $lang.po"
1656     done
1657
1658     dnl Make all variables we use known to autoconf.
1659     AC_SUBST(BUILD_INCLUDED_LIBINTL)
1660     AC_SUBST(USE_INCLUDED_LIBINTL)
1661     AC_SUBST(CATALOGS)
1662     AC_SUBST(CATOBJEXT)
1663     AC_SUBST(GMOFILES)
1664     AC_SUBST(INTLLIBS)
1665     AC_SUBST(INTLOBJS)
1666     AC_SUBST(POFILES)
1667     AC_SUBST(POSUB)
1668
1669     dnl For backward compatibility. Some configure.ins may be using this.
1670     nls_cv_header_intl=
1671     nls_cv_header_libgt=
1672
1673     dnl For backward compatibility. Some Makefiles may be using this.
1674     DATADIRNAME=share
1675     AC_SUBST(DATADIRNAME)
1676
1677     dnl For backward compatibility. Some Makefiles may be using this.
1678     INSTOBJEXT=.mo
1679     AC_SUBST(INSTOBJEXT)
1680
1681     dnl For backward compatibility. Some Makefiles may be using this.
1682     GENCAT=gencat
1683     AC_SUBST(GENCAT)
1684   ])
1685
1686 dnl Usage: Just like AM_WITH_NLS, which see.
1687 AC_DEFUN([AM_GNU_GETTEXT],
1688   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1689    AC_REQUIRE([AC_PROG_CC])dnl
1690    AC_REQUIRE([AC_CANONICAL_HOST])dnl
1691    AC_REQUIRE([AC_PROG_RANLIB])dnl
1692    AC_REQUIRE([AC_ISC_POSIX])dnl
1693    AC_REQUIRE([AC_HEADER_STDC])dnl
1694    AC_REQUIRE([AC_C_CONST])dnl
1695    AC_REQUIRE([AC_C_INLINE])dnl
1696    AC_REQUIRE([AC_TYPE_OFF_T])dnl
1697    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1698    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1699    AC_REQUIRE([AC_FUNC_MMAP])dnl
1700    AC_REQUIRE([jm_GLIBC21])dnl
1701
1702    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1703 stdlib.h string.h unistd.h sys/param.h])
1704    AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1705 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1706 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1707
1708    AM_ICONV
1709    AM_LANGINFO_CODESET
1710    AM_LC_MESSAGES
1711    AM_WITH_NLS([$1],[$2],[$3])
1712
1713    if test "x$CATOBJEXT" != "x"; then
1714      if test "x$ALL_LINGUAS" = "x"; then
1715        LINGUAS=
1716      else
1717        AC_MSG_CHECKING(for catalogs to be installed)
1718        NEW_LINGUAS=
1719        for presentlang in $ALL_LINGUAS; do
1720          useit=no
1721          for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1722            # Use the presentlang catalog if desiredlang is
1723            #   a. equal to presentlang, or
1724            #   b. a variant of presentlang (because in this case,
1725            #      presentlang can be used as a fallback for messages
1726            #      which are not translated in the desiredlang catalog).
1727            case "$desiredlang" in
1728              "$presentlang"*) useit=yes;;
1729            esac
1730          done
1731          if test $useit = yes; then
1732            NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1733          fi
1734        done
1735        LINGUAS=$NEW_LINGUAS
1736        AC_MSG_RESULT($LINGUAS)
1737      fi
1738
1739      dnl Construct list of names of catalog files to be constructed.
1740      if test -n "$LINGUAS"; then
1741        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1742      fi
1743    fi
1744
1745    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1746    dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1747    dnl Try to locate is.
1748    MKINSTALLDIRS=
1749    if test -n "$ac_aux_dir"; then
1750      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1751    fi
1752    if test -z "$MKINSTALLDIRS"; then
1753      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1754    fi
1755    AC_SUBST(MKINSTALLDIRS)
1756
1757    dnl Enable libtool support if the surrounding package wishes it.
1758    INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1759    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1760   ])
1761
1762 # Search path for a program which passes the given test.
1763 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1764 #
1765 # This file can be copied and used freely without restrictions.  It can
1766 # be used in projects which are not available under the GNU General Public
1767 # License but which still want to provide support for the GNU gettext
1768 # functionality.
1769 # Please note that the actual code of GNU gettext is covered by the GNU
1770 # General Public License and is *not* in the public domain.
1771
1772 # serial 2
1773
1774 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1775 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1776 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1777 [# Extract the first word of "$2", so it can be a program name with args.
1778 set dummy $2; ac_word=[$]2
1779 AC_MSG_CHECKING([for $ac_word])
1780 AC_CACHE_VAL(ac_cv_path_$1,
1781 [case "[$]$1" in
1782   /*)
1783   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1784   ;;
1785   *)
1786   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1787   for ac_dir in ifelse([$5], , $PATH, [$5]); do
1788     test -z "$ac_dir" && ac_dir=.
1789     if test -f $ac_dir/$ac_word; then
1790       if [$3]; then
1791         ac_cv_path_$1="$ac_dir/$ac_word"
1792         break
1793       fi
1794     fi
1795   done
1796   IFS="$ac_save_ifs"
1797 dnl If no 4th arg is given, leave the cache variable unset,
1798 dnl so AC_PATH_PROGS will keep looking.
1799 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1800 ])dnl
1801   ;;
1802 esac])dnl
1803 $1="$ac_cv_path_$1"
1804 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1805   AC_MSG_RESULT([$]$1)
1806 else
1807   AC_MSG_RESULT(no)
1808 fi
1809 AC_SUBST($1)dnl
1810 ])
1811
1812 #serial 2
1813
1814 # Test for the GNU C Library, version 2.1 or newer.
1815 # From Bruno Haible.
1816
1817 AC_DEFUN([jm_GLIBC21],
1818   [
1819     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1820       ac_cv_gnu_library_2_1,
1821       [AC_EGREP_CPP([Lucky GNU user],
1822         [
1823 #include <features.h>
1824 #ifdef __GNU_LIBRARY__
1825  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1826   Lucky GNU user
1827  #endif
1828 #endif
1829         ],
1830         ac_cv_gnu_library_2_1=yes,
1831         ac_cv_gnu_library_2_1=no)
1832       ]
1833     )
1834     AC_SUBST(GLIBC21)
1835     GLIBC21="$ac_cv_gnu_library_2_1"
1836   ]
1837 )
1838
1839 #serial AM2
1840
1841 dnl From Bruno Haible.
1842
1843 AC_DEFUN([AM_ICONV],
1844 [
1845   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1846   dnl those with the standalone portable GNU libiconv installed).
1847
1848   AC_ARG_WITH([libiconv-prefix],
1849 [  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
1850     for dir in `echo "$withval" | tr : ' '`; do
1851       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1852       if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1853     done
1854    ])
1855
1856   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1857     am_cv_func_iconv="no, consider installing GNU libiconv"
1858     am_cv_lib_iconv=no
1859     AC_TRY_LINK([#include <stdlib.h>
1860 #include <iconv.h>],
1861       [iconv_t cd = iconv_open("","");
1862        iconv(cd,NULL,NULL,NULL,NULL);
1863        iconv_close(cd);],
1864       am_cv_func_iconv=yes)
1865     if test "$am_cv_func_iconv" != yes; then
1866       am_save_LIBS="$LIBS"
1867       LIBS="$LIBS -liconv"
1868       AC_TRY_LINK([#include <stdlib.h>
1869 #include <iconv.h>],
1870         [iconv_t cd = iconv_open("","");
1871          iconv(cd,NULL,NULL,NULL,NULL);
1872          iconv_close(cd);],
1873         am_cv_lib_iconv=yes
1874         am_cv_func_iconv=yes)
1875       LIBS="$am_save_LIBS"
1876     fi
1877   ])
1878   if test "$am_cv_func_iconv" = yes; then
1879     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1880     AC_MSG_CHECKING([for iconv declaration])
1881     AC_CACHE_VAL(am_cv_proto_iconv, [
1882       AC_TRY_COMPILE([
1883 #include <stdlib.h>
1884 #include <iconv.h>
1885 extern
1886 #ifdef __cplusplus
1887 "C"
1888 #endif
1889 #if defined(__STDC__) || defined(__cplusplus)
1890 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1891 #else
1892 size_t iconv();
1893 #endif
1894 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1895       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
1896     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1897     AC_MSG_RESULT([$]{ac_t:-
1898          }[$]am_cv_proto_iconv)
1899     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1900       [Define as const if the declaration of iconv() needs const.])
1901   fi
1902   LIBICONV=
1903   if test "$am_cv_lib_iconv" = yes; then
1904     LIBICONV="-liconv"
1905   fi
1906   AC_SUBST(LIBICONV)
1907 ])
1908
1909 #serial AM1
1910
1911 dnl From Bruno Haible.
1912
1913 AC_DEFUN([AM_LANGINFO_CODESET],
1914 [
1915   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1916     [AC_TRY_LINK([#include <langinfo.h>],
1917       [char* cs = nl_langinfo(CODESET);],
1918       am_cv_langinfo_codeset=yes,
1919       am_cv_langinfo_codeset=no)
1920     ])
1921   if test $am_cv_langinfo_codeset = yes; then
1922     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1923       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1924   fi
1925 ])
1926
1927 # Check whether LC_MESSAGES is available in <locale.h>.
1928 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1929 #
1930 # This file can be copied and used freely without restrictions.  It can
1931 # be used in projects which are not available under the GNU General Public
1932 # License but which still want to provide support for the GNU gettext
1933 # functionality.
1934 # Please note that the actual code of GNU gettext is covered by the GNU
1935 # General Public License and is *not* in the public domain.
1936
1937 # serial 2
1938
1939 AC_DEFUN([AM_LC_MESSAGES],
1940   [if test $ac_cv_header_locale_h = yes; then
1941     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1942       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1943        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1944     if test $am_cv_val_LC_MESSAGES = yes; then
1945       AC_DEFINE(HAVE_LC_MESSAGES, 1,
1946         [Define if your <locale.h> file defines LC_MESSAGES.])
1947     fi
1948   fi])
1949