1# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005  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# Configure paths for SDL
15# Sam Lantinga 9/21/99
16# stolen from Manish Singh
17# stolen back from Frank Belew
18# stolen from Manish Singh
19# Shamelessly stolen from Owen Taylor
20
21dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
22dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
23dnl
24AC_DEFUN([AM_PATH_SDL],
25[dnl
26dnl Get the cflags and libraries from the sdl-config script
27dnl
28AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
29            sdl_prefix="$withval", sdl_prefix="")
30AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
31            sdl_exec_prefix="$withval", sdl_exec_prefix="")
32AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
33		    , enable_sdltest=yes)
34
35  if test x$sdl_exec_prefix != x ; then
36    sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
37    if test x${SDL_CONFIG+set} != xset ; then
38      SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
39    fi
40  fi
41  if test x$sdl_prefix != x ; then
42    sdl_args="$sdl_args --prefix=$sdl_prefix"
43    if test x${SDL_CONFIG+set} != xset ; then
44      SDL_CONFIG=$sdl_prefix/bin/sdl-config
45    fi
46  fi
47
48  if test "x$prefix" != xNONE; then
49    PATH="$prefix/bin:$prefix/usr/bin:$PATH"
50  fi
51  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
52  min_sdl_version=ifelse([$1], ,0.11.0,$1)
53  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
54  no_sdl=""
55  if test "$SDL_CONFIG" = "no" ; then
56    no_sdl=yes
57  else
58    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
59    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
60
61    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
62           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
63    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
64           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
65    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
66           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
67    if test "x$enable_sdltest" = "xyes" ; then
68      ac_save_CFLAGS="$CFLAGS"
69      ac_save_CXXFLAGS="$CXXFLAGS"
70      ac_save_LIBS="$LIBS"
71      CFLAGS="$CFLAGS $SDL_CFLAGS"
72      CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
73      LIBS="$LIBS $SDL_LIBS"
74dnl
75dnl Now check if the installed SDL is sufficiently new. (Also sanity
76dnl checks the results of sdl-config to some extent
77dnl
78      rm -f conf.sdltest
79      AC_TRY_RUN([
80#include <stdio.h>
81#include <stdlib.h>
82#include <string.h>
83#include "SDL.h"
84
85char*
86my_strdup (char *str)
87{
88  char *new_str;
89
90  if (str)
91    {
92      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
93      strcpy (new_str, str);
94    }
95  else
96    new_str = NULL;
97
98  return new_str;
99}
100
101int main (int argc, char *argv[])
102{
103  int major, minor, micro;
104  char *tmp_version;
105
106  /* This hangs on some systems (?)
107  system ("touch conf.sdltest");
108  */
109  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
110
111  /* HP/UX 9 (%@#!) writes to sscanf strings */
112  tmp_version = my_strdup("$min_sdl_version");
113  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
114     printf("%s, bad version string\n", "$min_sdl_version");
115     exit(1);
116   }
117
118   if (($sdl_major_version > major) ||
119      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
120      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
121    {
122      return 0;
123    }
124  else
125    {
126      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
127      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
128      printf("*** best to upgrade to the required version.\n");
129      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
130      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
131      printf("*** config.cache before re-running configure\n");
132      return 1;
133    }
134}
135
136],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
137       CFLAGS="$ac_save_CFLAGS"
138       CXXFLAGS="$ac_save_CXXFLAGS"
139       LIBS="$ac_save_LIBS"
140     fi
141  fi
142  if test "x$no_sdl" = x ; then
143     AC_MSG_RESULT(yes)
144     ifelse([$2], , :, [$2])
145  else
146     AC_MSG_RESULT(no)
147     if test "$SDL_CONFIG" = "no" ; then
148       echo "*** The sdl-config script installed by SDL could not be found"
149       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
150       echo "*** your path, or set the SDL_CONFIG environment variable to the"
151       echo "*** full path to sdl-config."
152     else
153       if test -f conf.sdltest ; then
154        :
155       else
156          echo "*** Could not run SDL test program, checking why..."
157          CFLAGS="$CFLAGS $SDL_CFLAGS"
158          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
159          LIBS="$LIBS $SDL_LIBS"
160          AC_TRY_LINK([
161#include <stdio.h>
162#include "SDL.h"
163
164int main(int argc, char *argv[])
165{ return 0; }
166#undef  main
167#define main K_and_R_C_main
168],      [ return 0; ],
169        [ echo "*** The test program compiled, but did not run. This usually means"
170          echo "*** that the run-time linker is not finding SDL or finding the wrong"
171          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
172          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
173          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
174          echo "*** is required on your system"
175	  echo "***"
176          echo "*** If you have an old version installed, it is best to remove it, although"
177          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
178        [ echo "*** The test program failed to compile or link. See the file config.log for the"
179          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
180          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
181          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
182          CFLAGS="$ac_save_CFLAGS"
183          CXXFLAGS="$ac_save_CXXFLAGS"
184          LIBS="$ac_save_LIBS"
185       fi
186     fi
187     SDL_CFLAGS=""
188     SDL_LIBS=""
189     ifelse([$3], , :, [$3])
190  fi
191  AC_SUBST(SDL_CFLAGS)
192  AC_SUBST(SDL_LIBS)
193  rm -f conf.sdltest
194])
195
196# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
197#
198# This file is free software; the Free Software Foundation
199# gives unlimited permission to copy and/or distribute it,
200# with or without modifications, as long as this notice is preserved.
201
202# AM_AUTOMAKE_VERSION(VERSION)
203# ----------------------------
204# Automake X.Y traces this macro to ensure aclocal.m4 has been
205# generated from the m4 files accompanying Automake X.Y.
206AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
207
208# AM_SET_CURRENT_AUTOMAKE_VERSION
209# -------------------------------
210# Call AM_AUTOMAKE_VERSION so it can be traced.
211# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
212AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
213	 [AM_AUTOMAKE_VERSION([1.9.6])])
214
215# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
216
217# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
218#
219# This file is free software; the Free Software Foundation
220# gives unlimited permission to copy and/or distribute it,
221# with or without modifications, as long as this notice is preserved.
222
223# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
224# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
225# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
226#
227# Of course, Automake must honor this variable whenever it calls a
228# tool from the auxiliary directory.  The problem is that $srcdir (and
229# therefore $ac_aux_dir as well) can be either absolute or relative,
230# depending on how configure is run.  This is pretty annoying, since
231# it makes $ac_aux_dir quite unusable in subdirectories: in the top
232# source directory, any form will work fine, but in subdirectories a
233# relative path needs to be adjusted first.
234#
235# $ac_aux_dir/missing
236#    fails when called from a subdirectory if $ac_aux_dir is relative
237# $top_srcdir/$ac_aux_dir/missing
238#    fails if $ac_aux_dir is absolute,
239#    fails when called from a subdirectory in a VPATH build with
240#          a relative $ac_aux_dir
241#
242# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
243# are both prefixed by $srcdir.  In an in-source build this is usually
244# harmless because $srcdir is `.', but things will broke when you
245# start a VPATH build or use an absolute $srcdir.
246#
247# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
248# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
249#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
250# and then we would define $MISSING as
251#   MISSING="\${SHELL} $am_aux_dir/missing"
252# This will work as long as MISSING is not called from configure, because
253# unfortunately $(top_srcdir) has no meaning in configure.
254# However there are other variables, like CC, which are often used in
255# configure, and could therefore not use this "fixed" $ac_aux_dir.
256#
257# Another solution, used here, is to always expand $ac_aux_dir to an
258# absolute PATH.  The drawback is that using absolute paths prevent a
259# configured tree to be moved without reconfiguration.
260
261AC_DEFUN([AM_AUX_DIR_EXPAND],
262[dnl Rely on autoconf to set up CDPATH properly.
263AC_PREREQ([2.50])dnl
264# expand $ac_aux_dir to an absolute path
265am_aux_dir=`cd $ac_aux_dir && pwd`
266])
267
268# AM_CONDITIONAL                                            -*- Autoconf -*-
269
270# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
271# Free Software Foundation, Inc.
272#
273# This file is free software; the Free Software Foundation
274# gives unlimited permission to copy and/or distribute it,
275# with or without modifications, as long as this notice is preserved.
276
277# serial 7
278
279# AM_CONDITIONAL(NAME, SHELL-CONDITION)
280# -------------------------------------
281# Define a conditional.
282AC_DEFUN([AM_CONDITIONAL],
283[AC_PREREQ(2.52)dnl
284 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
285	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
286AC_SUBST([$1_TRUE])
287AC_SUBST([$1_FALSE])
288if $2; then
289  $1_TRUE=
290  $1_FALSE='#'
291else
292  $1_TRUE='#'
293  $1_FALSE=
294fi
295AC_CONFIG_COMMANDS_PRE(
296[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
297  AC_MSG_ERROR([[conditional "$1" was never defined.
298Usually this means the macro was only invoked conditionally.]])
299fi])])
300
301
302# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
303# Free Software Foundation, Inc.
304#
305# This file is free software; the Free Software Foundation
306# gives unlimited permission to copy and/or distribute it,
307# with or without modifications, as long as this notice is preserved.
308
309# serial 8
310
311# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
312# written in clear, in which case automake, when reading aclocal.m4,
313# will think it sees a *use*, and therefore will trigger all it's
314# C support machinery.  Also note that it means that autoscan, seeing
315# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
316
317
318# _AM_DEPENDENCIES(NAME)
319# ----------------------
320# See how the compiler implements dependency checking.
321# NAME is "CC", "CXX", "GCJ", or "OBJC".
322# We try a few techniques and use that to set a single cache variable.
323#
324# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
325# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
326# dependency, and given that the user is not expected to run this macro,
327# just rely on AC_PROG_CC.
328AC_DEFUN([_AM_DEPENDENCIES],
329[AC_REQUIRE([AM_SET_DEPDIR])dnl
330AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
331AC_REQUIRE([AM_MAKE_INCLUDE])dnl
332AC_REQUIRE([AM_DEP_TRACK])dnl
333
334ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
335       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
336       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
337       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
338                   [depcc="$$1"   am_compiler_list=])
339
340AC_CACHE_CHECK([dependency style of $depcc],
341               [am_cv_$1_dependencies_compiler_type],
342[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
343  # We make a subdir and do the tests there.  Otherwise we can end up
344  # making bogus files that we don't know about and never remove.  For
345  # instance it was reported that on HP-UX the gcc test will end up
346  # making a dummy file named `D' -- because `-MD' means `put the output
347  # in D'.
348  mkdir conftest.dir
349  # Copy depcomp to subdir because otherwise we won't find it if we're
350  # using a relative directory.
351  cp "$am_depcomp" conftest.dir
352  cd conftest.dir
353  # We will build objects and dependencies in a subdirectory because
354  # it helps to detect inapplicable dependency modes.  For instance
355  # both Tru64's cc and ICC support -MD to output dependencies as a
356  # side effect of compilation, but ICC will put the dependencies in
357  # the current directory while Tru64 will put them in the object
358  # directory.
359  mkdir sub
360
361  am_cv_$1_dependencies_compiler_type=none
362  if test "$am_compiler_list" = ""; then
363     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
364  fi
365  for depmode in $am_compiler_list; do
366    # Setup a source with many dependencies, because some compilers
367    # like to wrap large dependency lists on column 80 (with \), and
368    # we should not choose a depcomp mode which is confused by this.
369    #
370    # We need to recreate these files for each test, as the compiler may
371    # overwrite some of them when testing with obscure command lines.
372    # This happens at least with the AIX C compiler.
373    : > sub/conftest.c
374    for i in 1 2 3 4 5 6; do
375      echo '#include "conftst'$i'.h"' >> sub/conftest.c
376      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
377      # Solaris 8's {/usr,}/bin/sh.
378      touch sub/conftst$i.h
379    done
380    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
381
382    case $depmode in
383    nosideeffect)
384      # after this tag, mechanisms are not by side-effect, so they'll
385      # only be used when explicitly requested
386      if test "x$enable_dependency_tracking" = xyes; then
387	continue
388      else
389	break
390      fi
391      ;;
392    none) break ;;
393    esac
394    # We check with `-c' and `-o' for the sake of the "dashmstdout"
395    # mode.  It turns out that the SunPro C++ compiler does not properly
396    # handle `-M -o', and we need to detect this.
397    if depmode=$depmode \
398       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
399       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
400       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
401         >/dev/null 2>conftest.err &&
402       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
403       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
404       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
405      # icc doesn't choke on unknown options, it will just issue warnings
406      # or remarks (even with -Werror).  So we grep stderr for any message
407      # that says an option was ignored or not supported.
408      # When given -MP, icc 7.0 and 7.1 complain thusly:
409      #   icc: Command line warning: ignoring option '-M'; no argument required
410      # The diagnosis changed in icc 8.0:
411      #   icc: Command line remark: option '-MP' not supported
412      if (grep 'ignoring option' conftest.err ||
413          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
414        am_cv_$1_dependencies_compiler_type=$depmode
415        break
416      fi
417    fi
418  done
419
420  cd ..
421  rm -rf conftest.dir
422else
423  am_cv_$1_dependencies_compiler_type=none
424fi
425])
426AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
427AM_CONDITIONAL([am__fastdep$1], [
428  test "x$enable_dependency_tracking" != xno \
429  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
430])
431
432
433# AM_SET_DEPDIR
434# -------------
435# Choose a directory name for dependency files.
436# This macro is AC_REQUIREd in _AM_DEPENDENCIES
437AC_DEFUN([AM_SET_DEPDIR],
438[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
439AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
440])
441
442
443# AM_DEP_TRACK
444# ------------
445AC_DEFUN([AM_DEP_TRACK],
446[AC_ARG_ENABLE(dependency-tracking,
447[  --disable-dependency-tracking  speeds up one-time build
448  --enable-dependency-tracking   do not reject slow dependency extractors])
449if test "x$enable_dependency_tracking" != xno; then
450  am_depcomp="$ac_aux_dir/depcomp"
451  AMDEPBACKSLASH='\'
452fi
453AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
454AC_SUBST([AMDEPBACKSLASH])
455])
456
457# Generate code to set up dependency tracking.              -*- Autoconf -*-
458
459# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
460# Free Software Foundation, Inc.
461#
462# This file is free software; the Free Software Foundation
463# gives unlimited permission to copy and/or distribute it,
464# with or without modifications, as long as this notice is preserved.
465
466#serial 3
467
468# _AM_OUTPUT_DEPENDENCY_COMMANDS
469# ------------------------------
470AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
471[for mf in $CONFIG_FILES; do
472  # Strip MF so we end up with the name of the file.
473  mf=`echo "$mf" | sed -e 's/:.*$//'`
474  # Check whether this is an Automake generated Makefile or not.
475  # We used to match only the files named `Makefile.in', but
476  # some people rename them; so instead we look at the file content.
477  # Grep'ing the first line is not enough: some people post-process
478  # each Makefile.in and add a new line on top of each file to say so.
479  # So let's grep whole file.
480  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
481    dirpart=`AS_DIRNAME("$mf")`
482  else
483    continue
484  fi
485  # Extract the definition of DEPDIR, am__include, and am__quote
486  # from the Makefile without running `make'.
487  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
488  test -z "$DEPDIR" && continue
489  am__include=`sed -n 's/^am__include = //p' < "$mf"`
490  test -z "am__include" && continue
491  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
492  # When using ansi2knr, U may be empty or an underscore; expand it
493  U=`sed -n 's/^U = //p' < "$mf"`
494  # Find all dependency output files, they are included files with
495  # $(DEPDIR) in their names.  We invoke sed twice because it is the
496  # simplest approach to changing $(DEPDIR) to its actual value in the
497  # expansion.
498  for file in `sed -n "
499    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
500       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
501    # Make sure the directory exists.
502    test -f "$dirpart/$file" && continue
503    fdir=`AS_DIRNAME(["$file"])`
504    AS_MKDIR_P([$dirpart/$fdir])
505    # echo "creating $dirpart/$file"
506    echo '# dummy' > "$dirpart/$file"
507  done
508done
509])# _AM_OUTPUT_DEPENDENCY_COMMANDS
510
511
512# AM_OUTPUT_DEPENDENCY_COMMANDS
513# -----------------------------
514# This macro should only be invoked once -- use via AC_REQUIRE.
515#
516# This code is only required when automatic dependency tracking
517# is enabled.  FIXME.  This creates each `.P' file that we will
518# need in order to bootstrap the dependency handling code.
519AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
520[AC_CONFIG_COMMANDS([depfiles],
521     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
522     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
523])
524
525# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
526# Free Software Foundation, Inc.
527#
528# This file is free software; the Free Software Foundation
529# gives unlimited permission to copy and/or distribute it,
530# with or without modifications, as long as this notice is preserved.
531
532# serial 8
533
534# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
535AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
536
537# Do all the work for Automake.                             -*- Autoconf -*-
538
539# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
540# Free Software Foundation, Inc.
541#
542# This file is free software; the Free Software Foundation
543# gives unlimited permission to copy and/or distribute it,
544# with or without modifications, as long as this notice is preserved.
545
546# serial 12
547
548# This macro actually does too much.  Some checks are only needed if
549# your package does certain things.  But this isn't really a big deal.
550
551# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
552# AM_INIT_AUTOMAKE([OPTIONS])
553# -----------------------------------------------
554# The call with PACKAGE and VERSION arguments is the old style
555# call (pre autoconf-2.50), which is being phased out.  PACKAGE
556# and VERSION should now be passed to AC_INIT and removed from
557# the call to AM_INIT_AUTOMAKE.
558# We support both call styles for the transition.  After
559# the next Automake release, Autoconf can make the AC_INIT
560# arguments mandatory, and then we can depend on a new Autoconf
561# release and drop the old call support.
562AC_DEFUN([AM_INIT_AUTOMAKE],
563[AC_PREREQ([2.58])dnl
564dnl Autoconf wants to disallow AM_ names.  We explicitly allow
565dnl the ones we care about.
566m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
567AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
568AC_REQUIRE([AC_PROG_INSTALL])dnl
569# test to see if srcdir already configured
570if test "`cd $srcdir && pwd`" != "`pwd`" &&
571   test -f $srcdir/config.status; then
572  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
573fi
574
575# test whether we have cygpath
576if test -z "$CYGPATH_W"; then
577  if (cygpath --version) >/dev/null 2>/dev/null; then
578    CYGPATH_W='cygpath -w'
579  else
580    CYGPATH_W=echo
581  fi
582fi
583AC_SUBST([CYGPATH_W])
584
585# Define the identity of the package.
586dnl Distinguish between old-style and new-style calls.
587m4_ifval([$2],
588[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
589 AC_SUBST([PACKAGE], [$1])dnl
590 AC_SUBST([VERSION], [$2])],
591[_AM_SET_OPTIONS([$1])dnl
592 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
593 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
594
595_AM_IF_OPTION([no-define],,
596[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
597 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
598
599# Some tools Automake needs.
600AC_REQUIRE([AM_SANITY_CHECK])dnl
601AC_REQUIRE([AC_ARG_PROGRAM])dnl
602AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
603AM_MISSING_PROG(AUTOCONF, autoconf)
604AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
605AM_MISSING_PROG(AUTOHEADER, autoheader)
606AM_MISSING_PROG(MAKEINFO, makeinfo)
607AM_PROG_INSTALL_SH
608AM_PROG_INSTALL_STRIP
609AC_REQUIRE([AM_PROG_MKDIR_P])dnl
610# We need awk for the "check" target.  The system "awk" is bad on
611# some platforms.
612AC_REQUIRE([AC_PROG_AWK])dnl
613AC_REQUIRE([AC_PROG_MAKE_SET])dnl
614AC_REQUIRE([AM_SET_LEADING_DOT])dnl
615_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
616              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
617	      		     [_AM_PROG_TAR([v7])])])
618_AM_IF_OPTION([no-dependencies],,
619[AC_PROVIDE_IFELSE([AC_PROG_CC],
620                  [_AM_DEPENDENCIES(CC)],
621                  [define([AC_PROG_CC],
622                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
623AC_PROVIDE_IFELSE([AC_PROG_CXX],
624                  [_AM_DEPENDENCIES(CXX)],
625                  [define([AC_PROG_CXX],
626                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
627])
628])
629
630
631# When config.status generates a header, we must update the stamp-h file.
632# This file resides in the same directory as the config header
633# that is generated.  The stamp files are numbered to have different names.
634
635# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
636# loop where config.status creates the headers, so we can generate
637# our stamp files there.
638AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
639[# Compute $1's index in $config_headers.
640_am_stamp_count=1
641for _am_header in $config_headers :; do
642  case $_am_header in
643    $1 | $1:* )
644      break ;;
645    * )
646      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
647  esac
648done
649echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
650
651# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
652#
653# This file is free software; the Free Software Foundation
654# gives unlimited permission to copy and/or distribute it,
655# with or without modifications, as long as this notice is preserved.
656
657# AM_PROG_INSTALL_SH
658# ------------------
659# Define $install_sh.
660AC_DEFUN([AM_PROG_INSTALL_SH],
661[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
662install_sh=${install_sh-"$am_aux_dir/install-sh"}
663AC_SUBST(install_sh)])
664
665# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
666#
667# This file is free software; the Free Software Foundation
668# gives unlimited permission to copy and/or distribute it,
669# with or without modifications, as long as this notice is preserved.
670
671# serial 2
672
673# Check whether the underlying file-system supports filenames
674# with a leading dot.  For instance MS-DOS doesn't.
675AC_DEFUN([AM_SET_LEADING_DOT],
676[rm -rf .tst 2>/dev/null
677mkdir .tst 2>/dev/null
678if test -d .tst; then
679  am__leading_dot=.
680else
681  am__leading_dot=_
682fi
683rmdir .tst 2>/dev/null
684AC_SUBST([am__leading_dot])])
685
686# Check to see how 'make' treats includes.	            -*- Autoconf -*-
687
688# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
689#
690# This file is free software; the Free Software Foundation
691# gives unlimited permission to copy and/or distribute it,
692# with or without modifications, as long as this notice is preserved.
693
694# serial 3
695
696# AM_MAKE_INCLUDE()
697# -----------------
698# Check to see how make treats includes.
699AC_DEFUN([AM_MAKE_INCLUDE],
700[am_make=${MAKE-make}
701cat > confinc << 'END'
702am__doit:
703	@echo done
704.PHONY: am__doit
705END
706# If we don't find an include directive, just comment out the code.
707AC_MSG_CHECKING([for style of include used by $am_make])
708am__include="#"
709am__quote=
710_am_result=none
711# First try GNU make style include.
712echo "include confinc" > confmf
713# We grep out `Entering directory' and `Leaving directory'
714# messages which can occur if `w' ends up in MAKEFLAGS.
715# In particular we don't look at `^make:' because GNU make might
716# be invoked under some other name (usually "gmake"), in which
717# case it prints its new name instead of `make'.
718if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
719   am__include=include
720   am__quote=
721   _am_result=GNU
722fi
723# Now try BSD make style include.
724if test "$am__include" = "#"; then
725   echo '.include "confinc"' > confmf
726   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
727      am__include=.include
728      am__quote="\""
729      _am_result=BSD
730   fi
731fi
732AC_SUBST([am__include])
733AC_SUBST([am__quote])
734AC_MSG_RESULT([$_am_result])
735rm -f confinc confmf
736])
737
738# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
739
740# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
741# Free Software Foundation, Inc.
742#
743# This file is free software; the Free Software Foundation
744# gives unlimited permission to copy and/or distribute it,
745# with or without modifications, as long as this notice is preserved.
746
747# serial 4
748
749# AM_MISSING_PROG(NAME, PROGRAM)
750# ------------------------------
751AC_DEFUN([AM_MISSING_PROG],
752[AC_REQUIRE([AM_MISSING_HAS_RUN])
753$1=${$1-"${am_missing_run}$2"}
754AC_SUBST($1)])
755
756
757# AM_MISSING_HAS_RUN
758# ------------------
759# Define MISSING if not defined so far and test if it supports --run.
760# If it does, set am_missing_run to use it, otherwise, to nothing.
761AC_DEFUN([AM_MISSING_HAS_RUN],
762[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
763test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
764# Use eval to expand $SHELL
765if eval "$MISSING --run true"; then
766  am_missing_run="$MISSING --run "
767else
768  am_missing_run=
769  AC_MSG_WARN([`missing' script is too old or missing])
770fi
771])
772
773# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
774#
775# This file is free software; the Free Software Foundation
776# gives unlimited permission to copy and/or distribute it,
777# with or without modifications, as long as this notice is preserved.
778
779# AM_PROG_MKDIR_P
780# ---------------
781# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
782#
783# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
784# created by `make install' are always world readable, even if the
785# installer happens to have an overly restrictive umask (e.g. 077).
786# This was a mistake.  There are at least two reasons why we must not
787# use `-m 0755':
788#   - it causes special bits like SGID to be ignored,
789#   - it may be too restrictive (some setups expect 775 directories).
790#
791# Do not use -m 0755 and let people choose whatever they expect by
792# setting umask.
793#
794# We cannot accept any implementation of `mkdir' that recognizes `-p'.
795# Some implementations (such as Solaris 8's) are not thread-safe: if a
796# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
797# concurrently, both version can detect that a/ is missing, but only
798# one can create it and the other will error out.  Consequently we
799# restrict ourselves to GNU make (using the --version option ensures
800# this.)
801AC_DEFUN([AM_PROG_MKDIR_P],
802[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
803  # We used to keeping the `.' as first argument, in order to
804  # allow $(mkdir_p) to be used without argument.  As in
805  #   $(mkdir_p) $(somedir)
806  # where $(somedir) is conditionally defined.  However this is wrong
807  # for two reasons:
808  #  1. if the package is installed by a user who cannot write `.'
809  #     make install will fail,
810  #  2. the above comment should most certainly read
811  #     $(mkdir_p) $(DESTDIR)$(somedir)
812  #     so it does not work when $(somedir) is undefined and
813  #     $(DESTDIR) is not.
814  #  To support the latter case, we have to write
815  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
816  #  so the `.' trick is pointless.
817  mkdir_p='mkdir -p --'
818else
819  # On NextStep and OpenStep, the `mkdir' command does not
820  # recognize any option.  It will interpret all options as
821  # directories to create, and then abort because `.' already
822  # exists.
823  for d in ./-p ./--version;
824  do
825    test -d $d && rmdir $d
826  done
827  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
828  if test -f "$ac_aux_dir/mkinstalldirs"; then
829    mkdir_p='$(mkinstalldirs)'
830  else
831    mkdir_p='$(install_sh) -d'
832  fi
833fi
834AC_SUBST([mkdir_p])])
835
836# Helper functions for option handling.                     -*- Autoconf -*-
837
838# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
839#
840# This file is free software; the Free Software Foundation
841# gives unlimited permission to copy and/or distribute it,
842# with or without modifications, as long as this notice is preserved.
843
844# serial 3
845
846# _AM_MANGLE_OPTION(NAME)
847# -----------------------
848AC_DEFUN([_AM_MANGLE_OPTION],
849[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
850
851# _AM_SET_OPTION(NAME)
852# ------------------------------
853# Set option NAME.  Presently that only means defining a flag for this option.
854AC_DEFUN([_AM_SET_OPTION],
855[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
856
857# _AM_SET_OPTIONS(OPTIONS)
858# ----------------------------------
859# OPTIONS is a space-separated list of Automake options.
860AC_DEFUN([_AM_SET_OPTIONS],
861[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
862
863# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
864# -------------------------------------------
865# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
866AC_DEFUN([_AM_IF_OPTION],
867[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
868
869# Check to make sure that the build environment is sane.    -*- Autoconf -*-
870
871# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
872# Free Software Foundation, Inc.
873#
874# This file is free software; the Free Software Foundation
875# gives unlimited permission to copy and/or distribute it,
876# with or without modifications, as long as this notice is preserved.
877
878# serial 4
879
880# AM_SANITY_CHECK
881# ---------------
882AC_DEFUN([AM_SANITY_CHECK],
883[AC_MSG_CHECKING([whether build environment is sane])
884# Just in case
885sleep 1
886echo timestamp > conftest.file
887# Do `set' in a subshell so we don't clobber the current shell's
888# arguments.  Must try -L first in case configure is actually a
889# symlink; some systems play weird games with the mod time of symlinks
890# (eg FreeBSD returns the mod time of the symlink's containing
891# directory).
892if (
893   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
894   if test "$[*]" = "X"; then
895      # -L didn't work.
896      set X `ls -t $srcdir/configure conftest.file`
897   fi
898   rm -f conftest.file
899   if test "$[*]" != "X $srcdir/configure conftest.file" \
900      && test "$[*]" != "X conftest.file $srcdir/configure"; then
901
902      # If neither matched, then we have a broken ls.  This can happen
903      # if, for instance, CONFIG_SHELL is bash and it inherits a
904      # broken ls alias from the environment.  This has actually
905      # happened.  Such a system could not be considered "sane".
906      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
907alias in your environment])
908   fi
909
910   test "$[2]" = conftest.file
911   )
912then
913   # Ok.
914   :
915else
916   AC_MSG_ERROR([newly created file is older than distributed files!
917Check your system clock])
918fi
919AC_MSG_RESULT(yes)])
920
921# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
922#
923# This file is free software; the Free Software Foundation
924# gives unlimited permission to copy and/or distribute it,
925# with or without modifications, as long as this notice is preserved.
926
927# AM_PROG_INSTALL_STRIP
928# ---------------------
929# One issue with vendor `install' (even GNU) is that you can't
930# specify the program used to strip binaries.  This is especially
931# annoying in cross-compiling environments, where the build's strip
932# is unlikely to handle the host's binaries.
933# Fortunately install-sh will honor a STRIPPROG variable, so we
934# always use install-sh in `make install-strip', and initialize
935# STRIPPROG with the value of the STRIP variable (set by the user).
936AC_DEFUN([AM_PROG_INSTALL_STRIP],
937[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
938# Installed binaries are usually stripped using `strip' when the user
939# run `make install-strip'.  However `strip' might not be the right
940# tool to use in cross-compilation environments, therefore Automake
941# will honor the `STRIP' environment variable to overrule this program.
942dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
943if test "$cross_compiling" != no; then
944  AC_CHECK_TOOL([STRIP], [strip], :)
945fi
946INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
947AC_SUBST([INSTALL_STRIP_PROGRAM])])
948
949# Check how to create a tarball.                            -*- Autoconf -*-
950
951# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
952#
953# This file is free software; the Free Software Foundation
954# gives unlimited permission to copy and/or distribute it,
955# with or without modifications, as long as this notice is preserved.
956
957# serial 2
958
959# _AM_PROG_TAR(FORMAT)
960# --------------------
961# Check how to create a tarball in format FORMAT.
962# FORMAT should be one of `v7', `ustar', or `pax'.
963#
964# Substitute a variable $(am__tar) that is a command
965# writing to stdout a FORMAT-tarball containing the directory
966# $tardir.
967#     tardir=directory && $(am__tar) > result.tar
968#
969# Substitute a variable $(am__untar) that extract such
970# a tarball read from stdin.
971#     $(am__untar) < result.tar
972AC_DEFUN([_AM_PROG_TAR],
973[# Always define AMTAR for backward compatibility.
974AM_MISSING_PROG([AMTAR], [tar])
975m4_if([$1], [v7],
976     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
977     [m4_case([$1], [ustar],, [pax],,
978              [m4_fatal([Unknown tar format])])
979AC_MSG_CHECKING([how to create a $1 tar archive])
980# Loop over all known methods to create a tar archive until one works.
981_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
982_am_tools=${am_cv_prog_tar_$1-$_am_tools}
983# Do not fold the above two line into one, because Tru64 sh and
984# Solaris sh will not grok spaces in the rhs of `-'.
985for _am_tool in $_am_tools
986do
987  case $_am_tool in
988  gnutar)
989    for _am_tar in tar gnutar gtar;
990    do
991      AM_RUN_LOG([$_am_tar --version]) && break
992    done
993    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
994    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
995    am__untar="$_am_tar -xf -"
996    ;;
997  plaintar)
998    # Must skip GNU tar: if it does not support --format= it doesn't create
999    # ustar tarball either.
1000    (tar --version) >/dev/null 2>&1 && continue
1001    am__tar='tar chf - "$$tardir"'
1002    am__tar_='tar chf - "$tardir"'
1003    am__untar='tar xf -'
1004    ;;
1005  pax)
1006    am__tar='pax -L -x $1 -w "$$tardir"'
1007    am__tar_='pax -L -x $1 -w "$tardir"'
1008    am__untar='pax -r'
1009    ;;
1010  cpio)
1011    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1012    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1013    am__untar='cpio -i -H $1 -d'
1014    ;;
1015  none)
1016    am__tar=false
1017    am__tar_=false
1018    am__untar=false
1019    ;;
1020  esac
1021
1022  # If the value was cached, stop now.  We just wanted to have am__tar
1023  # and am__untar set.
1024  test -n "${am_cv_prog_tar_$1}" && break
1025
1026  # tar/untar a dummy directory, and stop if the command works
1027  rm -rf conftest.dir
1028  mkdir conftest.dir
1029  echo GrepMe > conftest.dir/file
1030  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1031  rm -rf conftest.dir
1032  if test -s conftest.tar; then
1033    AM_RUN_LOG([$am__untar <conftest.tar])
1034    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1035  fi
1036done
1037rm -rf conftest.dir
1038
1039AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1040AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1041AC_SUBST([am__tar])
1042AC_SUBST([am__untar])
1043]) # _AM_PROG_TAR
1044
1045m4_include([m4/codeset.m4])
1046m4_include([m4/gettext.m4])
1047m4_include([m4/glibc21.m4])
1048m4_include([m4/iconv.m4])
1049m4_include([m4/intdiv0.m4])
1050m4_include([m4/intmax.m4])
1051m4_include([m4/inttypes-pri.m4])
1052m4_include([m4/inttypes.m4])
1053m4_include([m4/inttypes_h.m4])
1054m4_include([m4/isc-posix.m4])
1055m4_include([m4/lcmessage.m4])
1056m4_include([m4/lib-ld.m4])
1057m4_include([m4/lib-link.m4])
1058m4_include([m4/lib-prefix.m4])
1059m4_include([m4/longdouble.m4])
1060m4_include([m4/longlong.m4])
1061m4_include([m4/nls.m4])
1062m4_include([m4/po.m4])
1063m4_include([m4/printf-posix.m4])
1064m4_include([m4/progtest.m4])
1065m4_include([m4/signed.m4])
1066m4_include([m4/size_max.m4])
1067m4_include([m4/stdint_h.m4])
1068m4_include([m4/uintmax_t.m4])
1069m4_include([m4/ulonglong.m4])
1070m4_include([m4/wchar_t.m4])
1071m4_include([m4/wint_t.m4])
1072m4_include([m4/xsize.m4])
1073