1# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
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.                            -*- Autoconf -*-
15
16# This macro actually does too much some checks are only needed if
17# your package does certain things.  But this isn't really a big deal.
18
19# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
20# Free Software Foundation, Inc.
21
22# This program is free software; you can redistribute it and/or modify
23# it under the terms of the GNU General Public License as published by
24# the Free Software Foundation; either version 2, or (at your option)
25# any later version.
26
27# This program is distributed in the hope that it will be useful,
28# but WITHOUT ANY WARRANTY; without even the implied warranty of
29# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30# GNU General Public License for more details.
31
32# You should have received a copy of the GNU General Public License
33# along with this program; if not, write to the Free Software
34# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35# 02111-1307, USA.
36
37# serial 8
38
39# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40# written in clear, in which case automake, when reading aclocal.m4,
41# will think it sees a *use*, and therefore will trigger all it's
42# C support machinery.  Also note that it means that autoscan, seeing
43# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
44
45
46AC_PREREQ([2.52])
47
48# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
49# the ones we care about.
50m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
51
52# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53# AM_INIT_AUTOMAKE([OPTIONS])
54# -----------------------------------------------
55# The call with PACKAGE and VERSION arguments is the old style
56# call (pre autoconf-2.50), which is being phased out.  PACKAGE
57# and VERSION should now be passed to AC_INIT and removed from
58# the call to AM_INIT_AUTOMAKE.
59# We support both call styles for the transition.  After
60# the next Automake release, Autoconf can make the AC_INIT
61# arguments mandatory, and then we can depend on a new Autoconf
62# release and drop the old call support.
63AC_DEFUN([AM_INIT_AUTOMAKE],
64[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65 AC_REQUIRE([AC_PROG_INSTALL])dnl
66# test to see if srcdir already configured
67if test "`cd $srcdir && pwd`" != "`pwd`" &&
68   test -f $srcdir/config.status; then
69  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
70fi
71
72# Define the identity of the package.
73dnl Distinguish between old-style and new-style calls.
74m4_ifval([$2],
75[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
76 AC_SUBST([PACKAGE], [$1])dnl
77 AC_SUBST([VERSION], [$2])],
78[_AM_SET_OPTIONS([$1])dnl
79 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
80 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
81
82_AM_IF_OPTION([no-define],,
83[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
84 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
85
86# Some tools Automake needs.
87AC_REQUIRE([AM_SANITY_CHECK])dnl
88AC_REQUIRE([AC_ARG_PROGRAM])dnl
89AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
90AM_MISSING_PROG(AUTOCONF, autoconf)
91AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
92AM_MISSING_PROG(AUTOHEADER, autoheader)
93AM_MISSING_PROG(MAKEINFO, makeinfo)
94AM_MISSING_PROG(AMTAR, tar)
95AM_PROG_INSTALL_SH
96AM_PROG_INSTALL_STRIP
97# We need awk for the "check" target.  The system "awk" is bad on
98# some platforms.
99AC_REQUIRE([AC_PROG_AWK])dnl
100AC_REQUIRE([AC_PROG_MAKE_SET])dnl
101
102_AM_IF_OPTION([no-dependencies],,
103[AC_PROVIDE_IFELSE([AC_PROG_][CC],
104                  [_AM_DEPENDENCIES(CC)],
105                  [define([AC_PROG_][CC],
106                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
107AC_PROVIDE_IFELSE([AC_PROG_][CXX],
108                  [_AM_DEPENDENCIES(CXX)],
109                  [define([AC_PROG_][CXX],
110                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111])
112])
113
114# Copyright 2002  Free Software Foundation, Inc.
115
116# This program is free software; you can redistribute it and/or modify
117# it under the terms of the GNU General Public License as published by
118# the Free Software Foundation; either version 2, or (at your option)
119# any later version.
120
121# This program is distributed in the hope that it will be useful,
122# but WITHOUT ANY WARRANTY; without even the implied warranty of
123# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
124# GNU General Public License for more details.
125
126# You should have received a copy of the GNU General Public License
127# along with this program; if not, write to the Free Software
128# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
129
130# AM_AUTOMAKE_VERSION(VERSION)
131# ----------------------------
132# Automake X.Y traces this macro to ensure aclocal.m4 has been
133# generated from the m4 files accompanying Automake X.Y.
134AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
135
136# AM_SET_CURRENT_AUTOMAKE_VERSION
137# -------------------------------
138# Call AM_AUTOMAKE_VERSION so it can be traced.
139# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
140AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
141	 [AM_AUTOMAKE_VERSION([1.6.3])])
142
143# Helper functions for option handling.                    -*- Autoconf -*-
144
145# Copyright 2001, 2002  Free Software Foundation, Inc.
146
147# This program is free software; you can redistribute it and/or modify
148# it under the terms of the GNU General Public License as published by
149# the Free Software Foundation; either version 2, or (at your option)
150# any later version.
151
152# This program is distributed in the hope that it will be useful,
153# but WITHOUT ANY WARRANTY; without even the implied warranty of
154# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
155# GNU General Public License for more details.
156
157# You should have received a copy of the GNU General Public License
158# along with this program; if not, write to the Free Software
159# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
160# 02111-1307, USA.
161
162# serial 2
163
164# _AM_MANGLE_OPTION(NAME)
165# -----------------------
166AC_DEFUN([_AM_MANGLE_OPTION],
167[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
168
169# _AM_SET_OPTION(NAME)
170# ------------------------------
171# Set option NAME.  Presently that only means defining a flag for this option.
172AC_DEFUN([_AM_SET_OPTION],
173[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
174
175# _AM_SET_OPTIONS(OPTIONS)
176# ----------------------------------
177# OPTIONS is a space-separated list of Automake options.
178AC_DEFUN([_AM_SET_OPTIONS],
179[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
180
181# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
182# -------------------------------------------
183# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
184AC_DEFUN([_AM_IF_OPTION],
185[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
186
187#
188# Check to make sure that the build environment is sane.
189#
190
191# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
192
193# This program is free software; you can redistribute it and/or modify
194# it under the terms of the GNU General Public License as published by
195# the Free Software Foundation; either version 2, or (at your option)
196# any later version.
197
198# This program is distributed in the hope that it will be useful,
199# but WITHOUT ANY WARRANTY; without even the implied warranty of
200# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
201# GNU General Public License for more details.
202
203# You should have received a copy of the GNU General Public License
204# along with this program; if not, write to the Free Software
205# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
206# 02111-1307, USA.
207
208# serial 3
209
210# AM_SANITY_CHECK
211# ---------------
212AC_DEFUN([AM_SANITY_CHECK],
213[AC_MSG_CHECKING([whether build environment is sane])
214# Just in case
215sleep 1
216echo timestamp > conftest.file
217# Do `set' in a subshell so we don't clobber the current shell's
218# arguments.  Must try -L first in case configure is actually a
219# symlink; some systems play weird games with the mod time of symlinks
220# (eg FreeBSD returns the mod time of the symlink's containing
221# directory).
222if (
223   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
224   if test "$[*]" = "X"; then
225      # -L didn't work.
226      set X `ls -t $srcdir/configure conftest.file`
227   fi
228   rm -f conftest.file
229   if test "$[*]" != "X $srcdir/configure conftest.file" \
230      && test "$[*]" != "X conftest.file $srcdir/configure"; then
231
232      # If neither matched, then we have a broken ls.  This can happen
233      # if, for instance, CONFIG_SHELL is bash and it inherits a
234      # broken ls alias from the environment.  This has actually
235      # happened.  Such a system could not be considered "sane".
236      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
237alias in your environment])
238   fi
239
240   test "$[2]" = conftest.file
241   )
242then
243   # Ok.
244   :
245else
246   AC_MSG_ERROR([newly created file is older than distributed files!
247Check your system clock])
248fi
249AC_MSG_RESULT(yes)])
250
251#  -*- Autoconf -*-
252
253
254# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
255
256# This program is free software; you can redistribute it and/or modify
257# it under the terms of the GNU General Public License as published by
258# the Free Software Foundation; either version 2, or (at your option)
259# any later version.
260
261# This program is distributed in the hope that it will be useful,
262# but WITHOUT ANY WARRANTY; without even the implied warranty of
263# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
264# GNU General Public License for more details.
265
266# You should have received a copy of the GNU General Public License
267# along with this program; if not, write to the Free Software
268# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
269# 02111-1307, USA.
270
271# serial 3
272
273# AM_MISSING_PROG(NAME, PROGRAM)
274# ------------------------------
275AC_DEFUN([AM_MISSING_PROG],
276[AC_REQUIRE([AM_MISSING_HAS_RUN])
277$1=${$1-"${am_missing_run}$2"}
278AC_SUBST($1)])
279
280
281# AM_MISSING_HAS_RUN
282# ------------------
283# Define MISSING if not defined so far and test if it supports --run.
284# If it does, set am_missing_run to use it, otherwise, to nothing.
285AC_DEFUN([AM_MISSING_HAS_RUN],
286[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
287test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
288# Use eval to expand $SHELL
289if eval "$MISSING --run true"; then
290  am_missing_run="$MISSING --run "
291else
292  am_missing_run=
293  AC_MSG_WARN([`missing' script is too old or missing])
294fi
295])
296
297# AM_AUX_DIR_EXPAND
298
299# Copyright 2001 Free Software Foundation, Inc.
300
301# This program is free software; you can redistribute it and/or modify
302# it under the terms of the GNU General Public License as published by
303# the Free Software Foundation; either version 2, or (at your option)
304# any later version.
305
306# This program is distributed in the hope that it will be useful,
307# but WITHOUT ANY WARRANTY; without even the implied warranty of
308# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
309# GNU General Public License for more details.
310
311# You should have received a copy of the GNU General Public License
312# along with this program; if not, write to the Free Software
313# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
314# 02111-1307, USA.
315
316# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
317# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
318# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
319#
320# Of course, Automake must honor this variable whenever it calls a
321# tool from the auxiliary directory.  The problem is that $srcdir (and
322# therefore $ac_aux_dir as well) can be either absolute or relative,
323# depending on how configure is run.  This is pretty annoying, since
324# it makes $ac_aux_dir quite unusable in subdirectories: in the top
325# source directory, any form will work fine, but in subdirectories a
326# relative path needs to be adjusted first.
327#
328# $ac_aux_dir/missing
329#    fails when called from a subdirectory if $ac_aux_dir is relative
330# $top_srcdir/$ac_aux_dir/missing
331#    fails if $ac_aux_dir is absolute,
332#    fails when called from a subdirectory in a VPATH build with
333#          a relative $ac_aux_dir
334#
335# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
336# are both prefixed by $srcdir.  In an in-source build this is usually
337# harmless because $srcdir is `.', but things will broke when you
338# start a VPATH build or use an absolute $srcdir.
339#
340# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
341# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
342#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
343# and then we would define $MISSING as
344#   MISSING="\${SHELL} $am_aux_dir/missing"
345# This will work as long as MISSING is not called from configure, because
346# unfortunately $(top_srcdir) has no meaning in configure.
347# However there are other variables, like CC, which are often used in
348# configure, and could therefore not use this "fixed" $ac_aux_dir.
349#
350# Another solution, used here, is to always expand $ac_aux_dir to an
351# absolute PATH.  The drawback is that using absolute paths prevent a
352# configured tree to be moved without reconfiguration.
353
354# Rely on autoconf to set up CDPATH properly.
355AC_PREREQ([2.50])
356
357AC_DEFUN([AM_AUX_DIR_EXPAND], [
358# expand $ac_aux_dir to an absolute path
359am_aux_dir=`cd $ac_aux_dir && pwd`
360])
361
362# AM_PROG_INSTALL_SH
363# ------------------
364# Define $install_sh.
365
366# Copyright 2001 Free Software Foundation, Inc.
367
368# This program is free software; you can redistribute it and/or modify
369# it under the terms of the GNU General Public License as published by
370# the Free Software Foundation; either version 2, or (at your option)
371# any later version.
372
373# This program is distributed in the hope that it will be useful,
374# but WITHOUT ANY WARRANTY; without even the implied warranty of
375# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
376# GNU General Public License for more details.
377
378# You should have received a copy of the GNU General Public License
379# along with this program; if not, write to the Free Software
380# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
381# 02111-1307, USA.
382
383AC_DEFUN([AM_PROG_INSTALL_SH],
384[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
385install_sh=${install_sh-"$am_aux_dir/install-sh"}
386AC_SUBST(install_sh)])
387
388# AM_PROG_INSTALL_STRIP
389
390# Copyright 2001 Free Software Foundation, Inc.
391
392# This program is free software; you can redistribute it and/or modify
393# it under the terms of the GNU General Public License as published by
394# the Free Software Foundation; either version 2, or (at your option)
395# any later version.
396
397# This program is distributed in the hope that it will be useful,
398# but WITHOUT ANY WARRANTY; without even the implied warranty of
399# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
400# GNU General Public License for more details.
401
402# You should have received a copy of the GNU General Public License
403# along with this program; if not, write to the Free Software
404# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
405# 02111-1307, USA.
406
407# One issue with vendor `install' (even GNU) is that you can't
408# specify the program used to strip binaries.  This is especially
409# annoying in cross-compiling environments, where the build's strip
410# is unlikely to handle the host's binaries.
411# Fortunately install-sh will honor a STRIPPROG variable, so we
412# always use install-sh in `make install-strip', and initialize
413# STRIPPROG with the value of the STRIP variable (set by the user).
414AC_DEFUN([AM_PROG_INSTALL_STRIP],
415[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
416# Installed binaries are usually stripped using `strip' when the user
417# run `make install-strip'.  However `strip' might not be the right
418# tool to use in cross-compilation environments, therefore Automake
419# will honor the `STRIP' environment variable to overrule this program.
420dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
421if test "$cross_compiling" != no; then
422  AC_CHECK_TOOL([STRIP], [strip], :)
423fi
424INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
425AC_SUBST([INSTALL_STRIP_PROGRAM])])
426
427# serial 4						-*- Autoconf -*-
428
429# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
430
431# This program is free software; you can redistribute it and/or modify
432# it under the terms of the GNU General Public License as published by
433# the Free Software Foundation; either version 2, or (at your option)
434# any later version.
435
436# This program is distributed in the hope that it will be useful,
437# but WITHOUT ANY WARRANTY; without even the implied warranty of
438# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
439# GNU General Public License for more details.
440
441# You should have received a copy of the GNU General Public License
442# along with this program; if not, write to the Free Software
443# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
444# 02111-1307, USA.
445
446
447# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
448# written in clear, in which case automake, when reading aclocal.m4,
449# will think it sees a *use*, and therefore will trigger all it's
450# C support machinery.  Also note that it means that autoscan, seeing
451# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
452
453
454
455# _AM_DEPENDENCIES(NAME)
456# ----------------------
457# See how the compiler implements dependency checking.
458# NAME is "CC", "CXX", "GCJ", or "OBJC".
459# We try a few techniques and use that to set a single cache variable.
460#
461# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
462# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
463# dependency, and given that the user is not expected to run this macro,
464# just rely on AC_PROG_CC.
465AC_DEFUN([_AM_DEPENDENCIES],
466[AC_REQUIRE([AM_SET_DEPDIR])dnl
467AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
468AC_REQUIRE([AM_MAKE_INCLUDE])dnl
469AC_REQUIRE([AM_DEP_TRACK])dnl
470
471ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
472       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
473       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
474       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
475                   [depcc="$$1"   am_compiler_list=])
476
477AC_CACHE_CHECK([dependency style of $depcc],
478               [am_cv_$1_dependencies_compiler_type],
479[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
480  # We make a subdir and do the tests there.  Otherwise we can end up
481  # making bogus files that we don't know about and never remove.  For
482  # instance it was reported that on HP-UX the gcc test will end up
483  # making a dummy file named `D' -- because `-MD' means `put the output
484  # in D'.
485  mkdir conftest.dir
486  # Copy depcomp to subdir because otherwise we won't find it if we're
487  # using a relative directory.
488  cp "$am_depcomp" conftest.dir
489  cd conftest.dir
490
491  am_cv_$1_dependencies_compiler_type=none
492  if test "$am_compiler_list" = ""; then
493     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
494  fi
495  for depmode in $am_compiler_list; do
496    # We need to recreate these files for each test, as the compiler may
497    # overwrite some of them when testing with obscure command lines.
498    # This happens at least with the AIX C compiler.
499    echo '#include "conftest.h"' > conftest.c
500    echo 'int i;' > conftest.h
501    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
502
503    case $depmode in
504    nosideeffect)
505      # after this tag, mechanisms are not by side-effect, so they'll
506      # only be used when explicitly requested
507      if test "x$enable_dependency_tracking" = xyes; then
508	continue
509      else
510	break
511      fi
512      ;;
513    none) break ;;
514    esac
515    # We check with `-c' and `-o' for the sake of the "dashmstdout"
516    # mode.  It turns out that the SunPro C++ compiler does not properly
517    # handle `-M -o', and we need to detect this.
518    if depmode=$depmode \
519       source=conftest.c object=conftest.o \
520       depfile=conftest.Po tmpdepfile=conftest.TPo \
521       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
522       grep conftest.h conftest.Po > /dev/null 2>&1 &&
523       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
524      am_cv_$1_dependencies_compiler_type=$depmode
525      break
526    fi
527  done
528
529  cd ..
530  rm -rf conftest.dir
531else
532  am_cv_$1_dependencies_compiler_type=none
533fi
534])
535AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
536])
537
538
539# AM_SET_DEPDIR
540# -------------
541# Choose a directory name for dependency files.
542# This macro is AC_REQUIREd in _AM_DEPENDENCIES
543AC_DEFUN([AM_SET_DEPDIR],
544[rm -f .deps 2>/dev/null
545mkdir .deps 2>/dev/null
546if test -d .deps; then
547  DEPDIR=.deps
548else
549  # MS-DOS does not allow filenames that begin with a dot.
550  DEPDIR=_deps
551fi
552rmdir .deps 2>/dev/null
553AC_SUBST([DEPDIR])
554])
555
556
557# AM_DEP_TRACK
558# ------------
559AC_DEFUN([AM_DEP_TRACK],
560[AC_ARG_ENABLE(dependency-tracking,
561[  --disable-dependency-tracking Speeds up one-time builds
562  --enable-dependency-tracking  Do not reject slow dependency extractors])
563if test "x$enable_dependency_tracking" != xno; then
564  am_depcomp="$ac_aux_dir/depcomp"
565  AMDEPBACKSLASH='\'
566fi
567AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
568AC_SUBST([AMDEPBACKSLASH])
569])
570
571# Generate code to set up dependency tracking.   -*- Autoconf -*-
572
573# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
574
575# This program is free software; you can redistribute it and/or modify
576# it under the terms of the GNU General Public License as published by
577# the Free Software Foundation; either version 2, or (at your option)
578# any later version.
579
580# This program is distributed in the hope that it will be useful,
581# but WITHOUT ANY WARRANTY; without even the implied warranty of
582# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
583# GNU General Public License for more details.
584
585# You should have received a copy of the GNU General Public License
586# along with this program; if not, write to the Free Software
587# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
588# 02111-1307, USA.
589
590#serial 2
591
592# _AM_OUTPUT_DEPENDENCY_COMMANDS
593# ------------------------------
594AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
595[for mf in $CONFIG_FILES; do
596  # Strip MF so we end up with the name of the file.
597  mf=`echo "$mf" | sed -e 's/:.*$//'`
598  # Check whether this is an Automake generated Makefile or not.
599  # We used to match only the files named `Makefile.in', but
600  # some people rename them; so instead we look at the file content.
601  # Grep'ing the first line is not enough: some people post-process
602  # each Makefile.in and add a new line on top of each file to say so.
603  # So let's grep whole file.
604  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
605    dirpart=`AS_DIRNAME("$mf")`
606  else
607    continue
608  fi
609  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
610  # Extract the definition of DEP_FILES from the Makefile without
611  # running `make'.
612  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
613  test -z "$DEPDIR" && continue
614  # When using ansi2knr, U may be empty or an underscore; expand it
615  U=`sed -n -e '/^U = / s///p' < "$mf"`
616  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
617  # We invoke sed twice because it is the simplest approach to
618  # changing $(DEPDIR) to its actual value in the expansion.
619  for file in `sed -n -e '
620    /^DEP_FILES = .*\\\\$/ {
621      s/^DEP_FILES = //
622      :loop
623	s/\\\\$//
624	p
625	n
626	/\\\\$/ b loop
627      p
628    }
629    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
630       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
631    # Make sure the directory exists.
632    test -f "$dirpart/$file" && continue
633    fdir=`AS_DIRNAME(["$file"])`
634    AS_MKDIR_P([$dirpart/$fdir])
635    # echo "creating $dirpart/$file"
636    echo '# dummy' > "$dirpart/$file"
637  done
638done
639])# _AM_OUTPUT_DEPENDENCY_COMMANDS
640
641
642# AM_OUTPUT_DEPENDENCY_COMMANDS
643# -----------------------------
644# This macro should only be invoked once -- use via AC_REQUIRE.
645#
646# This code is only required when automatic dependency tracking
647# is enabled.  FIXME.  This creates each `.P' file that we will
648# need in order to bootstrap the dependency handling code.
649AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
650[AC_CONFIG_COMMANDS([depfiles],
651     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
652     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
653])
654
655# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
656
657# This program is free software; you can redistribute it and/or modify
658# it under the terms of the GNU General Public License as published by
659# the Free Software Foundation; either version 2, or (at your option)
660# any later version.
661
662# This program is distributed in the hope that it will be useful,
663# but WITHOUT ANY WARRANTY; without even the implied warranty of
664# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
665# GNU General Public License for more details.
666
667# You should have received a copy of the GNU General Public License
668# along with this program; if not, write to the Free Software
669# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
670# 02111-1307, USA.
671
672# serial 2
673
674# AM_MAKE_INCLUDE()
675# -----------------
676# Check to see how make treats includes.
677AC_DEFUN([AM_MAKE_INCLUDE],
678[am_make=${MAKE-make}
679cat > confinc << 'END'
680doit:
681	@echo done
682END
683# If we don't find an include directive, just comment out the code.
684AC_MSG_CHECKING([for style of include used by $am_make])
685am__include="#"
686am__quote=
687_am_result=none
688# First try GNU make style include.
689echo "include confinc" > confmf
690# We grep out `Entering directory' and `Leaving directory'
691# messages which can occur if `w' ends up in MAKEFLAGS.
692# In particular we don't look at `^make:' because GNU make might
693# be invoked under some other name (usually "gmake"), in which
694# case it prints its new name instead of `make'.
695if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
696   am__include=include
697   am__quote=
698   _am_result=GNU
699fi
700# Now try BSD make style include.
701if test "$am__include" = "#"; then
702   echo '.include "confinc"' > confmf
703   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
704      am__include=.include
705      am__quote="\""
706      _am_result=BSD
707   fi
708fi
709AC_SUBST(am__include)
710AC_SUBST(am__quote)
711AC_MSG_RESULT($_am_result)
712rm -f confinc confmf
713])
714
715# AM_CONDITIONAL                                              -*- Autoconf -*-
716
717# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
718
719# This program is free software; you can redistribute it and/or modify
720# it under the terms of the GNU General Public License as published by
721# the Free Software Foundation; either version 2, or (at your option)
722# any later version.
723
724# This program is distributed in the hope that it will be useful,
725# but WITHOUT ANY WARRANTY; without even the implied warranty of
726# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
727# GNU General Public License for more details.
728
729# You should have received a copy of the GNU General Public License
730# along with this program; if not, write to the Free Software
731# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
732# 02111-1307, USA.
733
734# serial 5
735
736AC_PREREQ(2.52)
737
738# AM_CONDITIONAL(NAME, SHELL-CONDITION)
739# -------------------------------------
740# Define a conditional.
741AC_DEFUN([AM_CONDITIONAL],
742[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
743        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
744AC_SUBST([$1_TRUE])
745AC_SUBST([$1_FALSE])
746if $2; then
747  $1_TRUE=
748  $1_FALSE='#'
749else
750  $1_TRUE='#'
751  $1_FALSE=
752fi
753AC_CONFIG_COMMANDS_PRE(
754[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
755  AC_MSG_ERROR([conditional \"$1\" was never defined.
756Usually this means the macro was only invoked conditionally.])
757fi])])
758
759# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
760
761# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
762
763# This program is free software; you can redistribute it and/or modify
764# it under the terms of the GNU General Public License as published by
765# the Free Software Foundation; either version 2, or (at your option)
766# any later version.
767
768# This program is distributed in the hope that it will be useful,
769# but WITHOUT ANY WARRANTY; without even the implied warranty of
770# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
771# GNU General Public License for more details.
772
773# You should have received a copy of the GNU General Public License
774# along with this program; if not, write to the Free Software
775# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
776# 02111-1307, USA.
777
778AC_PREREQ([2.52])
779
780# serial 6
781
782# When config.status generates a header, we must update the stamp-h file.
783# This file resides in the same directory as the config header
784# that is generated.  We must strip everything past the first ":",
785# and everything past the last "/".
786
787# _AM_DIRNAME(PATH)
788# -----------------
789# Like AS_DIRNAME, only do it during macro expansion
790AC_DEFUN([_AM_DIRNAME],
791       [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
792	      m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
793		    m4_if(regexp([$1], [^/.*]), -1,
794			  [.],
795			  patsubst([$1], [^\(/\).*], [\1])),
796		    patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
797	      patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
798])# _AM_DIRNAME
799
800
801# The stamp files are numbered to have different names.
802# We could number them on a directory basis, but that's additional
803# complications, let's have a unique counter.
804m4_define([_AM_STAMP_Count], [0])
805
806
807# _AM_STAMP(HEADER)
808# -----------------
809# The name of the stamp file for HEADER.
810AC_DEFUN([_AM_STAMP],
811[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
812AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
813                               [:.*])))/stamp-h[]_AM_STAMP_Count])
814
815
816# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
817# ------------------------------------------------------------
818# We used to try to get a real timestamp in stamp-h.  But the fear is that
819# that will cause unnecessary cvs conflicts.
820AC_DEFUN([_AM_CONFIG_HEADER],
821[# Add the stamp file to the list of files AC keeps track of,
822# along with our hook.
823AC_CONFIG_HEADERS([$1],
824                  [# update the timestamp
825echo 'timestamp for $1' >"_AM_STAMP([$1])"
826$2],
827                  [$3])
828])# _AM_CONFIG_HEADER
829
830
831# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
832# --------------------------------------------------------------
833AC_DEFUN([AM_CONFIG_HEADER],
834[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
835])# AM_CONFIG_HEADER
836
837# Add --enable-maintainer-mode option to configure.
838# From Jim Meyering
839
840# Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
841
842# This program is free software; you can redistribute it and/or modify
843# it under the terms of the GNU General Public License as published by
844# the Free Software Foundation; either version 2, or (at your option)
845# any later version.
846
847# This program is distributed in the hope that it will be useful,
848# but WITHOUT ANY WARRANTY; without even the implied warranty of
849# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
850# GNU General Public License for more details.
851
852# You should have received a copy of the GNU General Public License
853# along with this program; if not, write to the Free Software
854# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
855# 02111-1307, USA.
856
857# serial 1
858
859AC_DEFUN([AM_MAINTAINER_MODE],
860[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
861  dnl maintainer-mode is disabled by default
862  AC_ARG_ENABLE(maintainer-mode,
863[  --enable-maintainer-mode enable make rules and dependencies not useful
864                          (and sometimes confusing) to the casual installer],
865      USE_MAINTAINER_MODE=$enableval,
866      USE_MAINTAINER_MODE=no)
867  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
868  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
869  MAINT=$MAINTAINER_MODE_TRUE
870  AC_SUBST(MAINT)dnl
871]
872)
873
874# objc.m4
875# Based on c.m4 from GNU Autoconf
876# The Objective C support, added by Landon Fuller <landonf@opendarwin.org>
877# on March 10th, 2004, is heavily based on Autoconf's existing C++ support.
878#
879#
880# This file is part of Autoconf.                       -*- Autoconf -*-
881# Programming languages support.
882# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
883#
884# This program is free software; you can redistribute it and/or modify
885# it under the terms of the GNU General Public License as published by
886# the Free Software Foundation; either version 2, or (at your option)
887# any later version.
888#
889# This program is distributed in the hope that it will be useful,
890# but WITHOUT ANY WARRANTY; without even the implied warranty of
891# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
892# GNU General Public License for more details.
893#
894# You should have received a copy of the GNU General Public License
895# along with this program; if not, write to the Free Software
896# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
897# 02111-1307, USA.
898#
899# As a special exception, the Free Software Foundation gives unlimited
900# permission to copy, distribute and modify the configure scripts that
901# are the output of Autoconf.  You need not follow the terms of the GNU
902# General Public License when using or distributing such scripts, even
903# though portions of the text of Autoconf appear in them.  The GNU
904# General Public License (GPL) does govern all other use of the material
905# that constitutes the Autoconf program.
906#
907# Certain portions of the Autoconf source text are designed to be copied
908# (in certain cases, depending on the input) into the output of
909# Autoconf.  We call these the "data" portions.  The rest of the Autoconf
910# source text consists of comments plus executable code that decides which
911# of the data portions to output in any given case.  We call these
912# comments and executable code the "non-data" portions.  Autoconf never
913# copies any of the non-data portions into its output.
914#
915# This special exception to the GPL applies to versions of Autoconf
916# released by the Free Software Foundation.  When you make and
917# distribute a modified version of Autoconf, you may extend this special
918# exception to the GPL to apply to your modified version as well, *unless*
919# your modified version has the potential to copy into its output some
920# of the text that was the non-data portion of the version that you started
921# with.  (In other words, unless your change moves or copies text from
922# the non-data portions to the data portions.)  If your modification has
923# such potential, you must delete any notice of this special exception
924# to the GPL from your modified version.
925#
926# Written by David MacKenzie, with help from
927# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
928# Roland McGrath, Noah Friedman, david d zuhn, and many others.
929#
930#
931#		    GNU GENERAL PUBLIC LICENSE
932#		       Version 2, June 1991
933#
934#  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
935#      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
936#  Everyone is permitted to copy and distribute verbatim copies
937#  of this license document, but changing it is not allowed.
938#
939# 			    Preamble
940#
941#  The licenses for most software are designed to take away your
942# freedom to share and change it.  By contrast, the GNU General Public
943# License is intended to guarantee your freedom to share and change free
944# software--to make sure the software is free for all its users.  This
945# General Public License applies to most of the Free Software
946# Foundation's software and to any other program whose authors commit to
947# using it.  (Some other Free Software Foundation software is covered by
948# the GNU Library General Public License instead.)  You can apply it to
949# your programs, too.
950#
951#  When we speak of free software, we are referring to freedom, not
952# price.  Our General Public Licenses are designed to make sure that you
953# have the freedom to distribute copies of free software (and charge for
954# this service if you wish), that you receive source code or can get it
955# if you want it, that you can change the software or use pieces of it
956# in new free programs; and that you know you can do these things.
957#
958#  To protect your rights, we need to make restrictions that forbid
959# anyone to deny you these rights or to ask you to surrender the rights.
960# These restrictions translate to certain responsibilities for you if you
961# distribute copies of the software, or if you modify it.
962#
963#  For example, if you distribute copies of such a program, whether
964# gratis or for a fee, you must give the recipients all the rights that
965# you have.  You must make sure that they, too, receive or can get the
966# source code.  And you must show them these terms so they know their
967# rights.
968#
969#  We protect your rights with two steps: (1) copyright the software, and
970# (2) offer you this license which gives you legal permission to copy,
971# distribute and/or modify the software.
972#
973#  Also, for each author's protection and ours, we want to make certain
974# that everyone understands that there is no warranty for this free
975# software.  If the software is modified by someone else and passed on, we
976# want its recipients to know that what they have is not the original, so
977# that any problems introduced by others will not reflect on the original
978# authors' reputations.
979#
980#  Finally, any free program is threatened constantly by software
981# patents.  We wish to avoid the danger that redistributors of a free
982# program will individually obtain patent licenses, in effect making the
983# program proprietary.  To prevent this, we have made it clear that any
984# patent must be licensed for everyone's free use or not licensed at all.
985#
986#  The precise terms and conditions for copying, distribution and
987# modification follow.
988#
989#		    GNU GENERAL PUBLIC LICENSE
990#  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
991#
992#  0. This License applies to any program or other work which contains
993# a notice placed by the copyright holder saying it may be distributed
994# under the terms of this General Public License.  The "Program", below,
995# refers to any such program or work, and a "work based on the Program"
996# means either the Program or any derivative work under copyright law:
997# that is to say, a work containing the Program or a portion of it,
998# either verbatim or with modifications and/or translated into another
999# language.  (Hereinafter, translation is included without limitation in
1000# the term "modification".)  Each licensee is addressed as "you".
1001#
1002# Activities other than copying, distribution and modification are not
1003# covered by this License; they are outside its scope.  The act of
1004# running the Program is not restricted, and the output from the Program
1005# is covered only if its contents constitute a work based on the
1006# Program (independent of having been made by running the Program).
1007# Whether that is true depends on what the Program does.
1008#
1009#  1. You may copy and distribute verbatim copies of the Program's
1010# source code as you receive it, in any medium, provided that you
1011# conspicuously and appropriately publish on each copy an appropriate
1012# copyright notice and disclaimer of warranty; keep intact all the
1013# notices that refer to this License and to the absence of any warranty;
1014# and give any other recipients of the Program a copy of this License
1015# along with the Program.
1016#
1017# You may charge a fee for the physical act of transferring a copy, and
1018# you may at your option offer warranty protection in exchange for a fee.
1019#
1020#  2. You may modify your copy or copies of the Program or any portion
1021# of it, thus forming a work based on the Program, and copy and
1022# distribute such modifications or work under the terms of Section 1
1023# above, provided that you also meet all of these conditions:
1024#
1025#    a) You must cause the modified files to carry prominent notices
1026#    stating that you changed the files and the date of any change.
1027#
1028#    b) You must cause any work that you distribute or publish, that in
1029#    whole or in part contains or is derived from the Program or any
1030#    part thereof, to be licensed as a whole at no charge to all third
1031#    parties under the terms of this License.
1032#
1033#    c) If the modified program normally reads commands interactively
1034#    when run, you must cause it, when started running for such
1035#    interactive use in the most ordinary way, to print or display an
1036#    announcement including an appropriate copyright notice and a
1037#    notice that there is no warranty (or else, saying that you provide
1038#    a warranty) and that users may redistribute the program under
1039#    these conditions, and telling the user how to view a copy of this
1040#    License.  (Exception: if the Program itself is interactive but
1041#    does not normally print such an announcement, your work based on
1042#    the Program is not required to print an announcement.)
1043#
1044# These requirements apply to the modified work as a whole.  If
1045# identifiable sections of that work are not derived from the Program,
1046# and can be reasonably considered independent and separate works in
1047# themselves, then this License, and its terms, do not apply to those
1048# sections when you distribute them as separate works.  But when you
1049# distribute the same sections as part of a whole which is a work based
1050# on the Program, the distribution of the whole must be on the terms of
1051# this License, whose permissions for other licensees extend to the
1052# entire whole, and thus to each and every part regardless of who wrote it.
1053#
1054# Thus, it is not the intent of this section to claim rights or contest
1055# your rights to work written entirely by you; rather, the intent is to
1056# exercise the right to control the distribution of derivative or
1057# collective works based on the Program.
1058#
1059# In addition, mere aggregation of another work not based on the Program
1060# with the Program (or with a work based on the Program) on a volume of
1061# a storage or distribution medium does not bring the other work under
1062# the scope of this License.
1063#
1064#  3. You may copy and distribute the Program (or a work based on it,
1065# under Section 2) in object code or executable form under the terms of
1066# Sections 1 and 2 above provided that you also do one of the following:
1067#
1068#    a) Accompany it with the complete corresponding machine-readable
1069#    source code, which must be distributed under the terms of Sections
1070#    1 and 2 above on a medium customarily used for software interchange; or,
1071#
1072#    b) Accompany it with a written offer, valid for at least three
1073#    years, to give any third party, for a charge no more than your
1074#    cost of physically performing source distribution, a complete
1075#    machine-readable copy of the corresponding source code, to be
1076#    distributed under the terms of Sections 1 and 2 above on a medium
1077#    customarily used for software interchange; or,
1078#
1079#    c) Accompany it with the information you received as to the offer
1080#    to distribute corresponding source code.  (This alternative is
1081#    allowed only for noncommercial distribution and only if you
1082#    received the program in object code or executable form with such
1083#    an offer, in accord with Subsection b above.)
1084#
1085# The source code for a work means the preferred form of the work for
1086# making modifications to it.  For an executable work, complete source
1087# code means all the source code for all modules it contains, plus any
1088# associated interface definition files, plus the scripts used to
1089# control compilation and installation of the executable.  However, as a
1090# special exception, the source code distributed need not include
1091# anything that is normally distributed (in either source or binary
1092# form) with the major components (compiler, kernel, and so on) of the
1093# operating system on which the executable runs, unless that component
1094# itself accompanies the executable.
1095#
1096# If distribution of executable or object code is made by offering
1097# access to copy from a designated place, then offering equivalent
1098# access to copy the source code from the same place counts as
1099# distribution of the source code, even though third parties are not
1100# compelled to copy the source along with the object code.
1101#
1102#  4. You may not copy, modify, sublicense, or distribute the Program
1103# except as expressly provided under this License.  Any attempt
1104# otherwise to copy, modify, sublicense or distribute the Program is
1105# void, and will automatically terminate your rights under this License.
1106# However, parties who have received copies, or rights, from you under
1107# this License will not have their licenses terminated so long as such
1108# parties remain in full compliance.
1109#
1110#  5. You are not required to accept this License, since you have not
1111# signed it.  However, nothing else grants you permission to modify or
1112# distribute the Program or its derivative works.  These actions are
1113# prohibited by law if you do not accept this License.  Therefore, by
1114# modifying or distributing the Program (or any work based on the
1115# Program), you indicate your acceptance of this License to do so, and
1116# all its terms and conditions for copying, distributing or modifying
1117# the Program or works based on it.
1118
1119#  6. Each time you redistribute the Program (or any work based on the
1120# Program), the recipient automatically receives a license from the
1121# original licensor to copy, distribute or modify the Program subject to
1122# these terms and conditions.  You may not impose any further
1123# restrictions on the recipients' exercise of the rights granted herein.
1124# You are not responsible for enforcing compliance by third parties to
1125# this License.
1126#
1127#  7. If, as a consequence of a court judgment or allegation of patent
1128# infringement or for any other reason (not limited to patent issues),
1129# conditions are imposed on you (whether by court order, agreement or
1130# otherwise) that contradict the conditions of this License, they do not
1131# excuse you from the conditions of this License.  If you cannot
1132# distribute so as to satisfy simultaneously your obligations under this
1133# License and any other pertinent obligations, then as a consequence you
1134# may not distribute the Program at all.  For example, if a patent
1135# license would not permit royalty-free redistribution of the Program by
1136# all those who receive copies directly or indirectly through you, then
1137# the only way you could satisfy both it and this License would be to
1138# refrain entirely from distribution of the Program.
1139#
1140# If any portion of this section is held invalid or unenforceable under
1141# any particular circumstance, the balance of the section is intended to
1142# apply and the section as a whole is intended to apply in other
1143# circumstances.
1144#
1145# It is not the purpose of this section to induce you to infringe any
1146# patents or other property right claims or to contest validity of any
1147# such claims; this section has the sole purpose of protecting the
1148# integrity of the free software distribution system, which is
1149# implemented by public license practices.  Many people have made
1150# generous contributions to the wide range of software distributed
1151# through that system in reliance on consistent application of that
1152# system; it is up to the author/donor to decide if he or she is willing
1153# to distribute software through any other system and a licensee cannot
1154# impose that choice.
1155#
1156# This section is intended to make thoroughly clear what is believed to
1157# be a consequence of the rest of this License.
1158#
1159#  8. If the distribution and/or use of the Program is restricted in
1160# certain countries either by patents or by copyrighted interfaces, the
1161# original copyright holder who places the Program under this License
1162# may add an explicit geographical distribution limitation excluding
1163# those countries, so that distribution is permitted only in or among
1164# countries not thus excluded.  In such case, this License incorporates
1165# the limitation as if written in the body of this License.
1166#
1167#  9. The Free Software Foundation may publish revised and/or new versions
1168# of the General Public License from time to time.  Such new versions will
1169# be similar in spirit to the present version, but may differ in detail to
1170# address new problems or concerns.
1171#
1172# Each version is given a distinguishing version number.  If the Program
1173# specifies a version number of this License which applies to it and "any
1174# later version", you have the option of following the terms and conditions
1175# either of that version or of any later version published by the Free
1176# Software Foundation.  If the Program does not specify a version number of
1177# this License, you may choose any version ever published by the Free Software
1178# Foundation.
1179#
1180#  10. If you wish to incorporate parts of the Program into other free
1181# programs whose distribution conditions are different, write to the author
1182# to ask for permission.  For software which is copyrighted by the Free
1183# Software Foundation, write to the Free Software Foundation; we sometimes
1184# make exceptions for this.  Our decision will be guided by the two goals
1185# of preserving the free status of all derivatives of our free software and
1186# of promoting the sharing and reuse of software generally.
1187#
1188#			    NO WARRANTY
1189#
1190#  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
1191# FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
1192# OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
1193# PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
1194# OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1195# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
1196# TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
1197# PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
1198# REPAIR OR CORRECTION.
1199#
1200#  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1201# WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
1202# REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
1203# INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
1204# OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
1205# TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
1206# YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
1207# PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
1208# POSSIBILITY OF SUCH DAMAGES.
1209#
1210#		     END OF TERMS AND CONDITIONS
1211#
1212#	    How to Apply These Terms to Your New Programs
1213#
1214#  If you develop a new program, and you want it to be of the greatest
1215# possible use to the public, the best way to achieve this is to make it
1216# free software which everyone can redistribute and change under these terms.
1217#
1218#  To do so, attach the following notices to the program.  It is safest
1219# to attach them to the start of each source file to most effectively
1220# convey the exclusion of warranty; and each file should have at least
1221# the "copyright" line and a pointer to where the full notice is found.
1222#
1223#    <one line to give the program's name and a brief idea of what it does.>
1224#    Copyright (C) <year>  <name of author>
1225#
1226#    This program is free software; you can redistribute it and/or modify
1227#    it under the terms of the GNU General Public License as published by
1228#    the Free Software Foundation; either version 2 of the License, or
1229#    (at your option) any later version.
1230#
1231#    This program is distributed in the hope that it will be useful,
1232#    but WITHOUT ANY WARRANTY; without even the implied warranty of
1233#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1234#    GNU General Public License for more details.
1235#
1236#    You should have received a copy of the GNU General Public License
1237#    along with this program; if not, write to the Free Software
1238#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1239#
1240#
1241# Also add information on how to contact you by electronic and paper mail.
1242#
1243# If the program is interactive, make it output a short notice like this
1244# when it starts in an interactive mode:
1245#
1246#    Gnomovision version 69, Copyright (C) year  name of author
1247#    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1248#    This is free software, and you are welcome to redistribute it
1249#    under certain conditions; type `show c' for details.
1250#
1251# The hypothetical commands `show w' and `show c' should show the appropriate
1252# parts of the General Public License.  Of course, the commands you use may
1253# be called something other than `show w' and `show c'; they could even be
1254# mouse-clicks or menu items--whatever suits your program.
1255#
1256# You should also get your employer (if you work as a programmer) or your
1257# school, if any, to sign a "copyright disclaimer" for the program, if
1258# necessary.  Here is a sample; alter the names:
1259#
1260#  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
1261#  `Gnomovision' (which makes passes at compilers) written by James Hacker.
1262#
1263#  <signature of Ty Coon>, 1 April 1989
1264#  Ty Coon, President of Vice
1265#
1266# This General Public License does not permit incorporating your program into
1267# proprietary programs.  If your program is a subroutine library, you may
1268# consider it more useful to permit linking proprietary applications with the
1269# library.  If this is what you want to do, use the GNU Library General
1270# Public License instead of this License.
1271#
1272
1273
1274
1275# ------------------------------ #
1276# 1d. The Objective C language.  #
1277# ------------------------------ #
1278
1279# AC_LANG(Objective C)
1280# --------------------
1281# OBJCFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1282m4_define([AC_LANG(Objective C)],
1283[ac_ext=m
1284ac_cpp='$OBJCPP $CPPFLAGS'
1285ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
1286ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
1287ac_compiler_gnu=$ac_cv_objc_compiler_gnu
1288])
1289
1290
1291# AC_LANG_OBJC
1292# -------------------------
1293AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)])
1294
1295
1296# _AC_LANG_ABBREV(Objective C)
1297# ----------------------------
1298m4_define([_AC_LANG_ABBREV(Objective C)], [objc])
1299
1300
1301# _AC_LANG_PREFIX(Objective C)
1302# ----------------------------
1303m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC])
1304
1305
1306
1307
1308
1309# ------------------------- #
1310# 2d. Objective C sources.  #
1311# ------------------------- #
1312
1313# AC_LANG_SOURCE(Objective C)(BODY)
1314# ---------------------------------
1315m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)])
1316
1317
1318# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY])
1319# ------------------------------------------------
1320m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)])
1321
1322
1323# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION)
1324# ---------------------------------------------
1325m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)])
1326
1327
1328# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION)
1329# --------------------------------------------
1330m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)])
1331
1332
1333# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION)
1334# -----------------------------------------------------------
1335m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)])
1336
1337
1338# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION)
1339# ---------------------------------------------------
1340m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)])
1341
1342
1343
1344
1345
1346# ------------------------------ #
1347# 3d. The Objective C compiler.  #
1348# ------------------------------ #
1349
1350
1351# AC_LANG_PREPROC(Objecitve C)
1352# ----------------------------
1353# Find the Objective C preprocessor.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
1354AC_DEFUN(
1355[AC_LANG_PREPROC(Objective C)],
1356[AC_REQUIRE([AC_PROG_OBJCPP])])
1357
1358
1359# AC_PROG_OBJCPP
1360# --------------
1361# Find a working Objective C preprocessor.
1362# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
1363# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_OBJC.
1364AC_DEFUN([AC_PROG_OBJCPP],
1365[AC_REQUIRE([AC_PROG_OBJC])dnl
1366AC_ARG_VAR([OBJCPP],   [Objective C preprocessor])dnl
1367_AC_ARG_VAR_CPPFLAGS()dnl
1368AC_LANG_PUSH(Objective C)dnl
1369AC_MSG_CHECKING([how to run the Objective C preprocessor])
1370if test -z "$OBJCPP"; then
1371  AC_CACHE_VAL(ac_cv_prog_OBJCPP,
1372  [dnl
1373    # Double quotes because OBJCPP needs to be expanded
1374    for OBJCPP in "$OBJC -E" "/lib/cpp"
1375    do
1376      _AC_PROG_PREPROC_WORKS_IFELSE([break])
1377    done
1378    ac_cv_prog_OBJCPP=$OBJCPP
1379  ])dnl
1380  OBJCPP=$ac_cv_prog_OBJCPP
1381else
1382  ac_cv_prog_OBJCPP=$OBJCPP
1383fi
1384AC_MSG_RESULT([$OBJCPP])
1385_AC_PROG_PREPROC_WORKS_IFELSE([],
1386	  [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])])
1387AC_SUBST(OBJCPP)dnl
1388AC_LANG_POP(Objective C)dnl
1389])# AC_PROG_OBJCPP
1390
1391
1392# AC_LANG_COMPILER(Objective C)
1393# -----------------------------
1394# Find the Objective C compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
1395AC_DEFUN(
1396[AC_LANG_COMPILER(Objective C)],
1397[AC_REQUIRE([AC_PROG_OBJC])])
1398
1399
1400# ac_cv_prog_objc
1401# ---------------
1402# We used to name the cache variable this way.
1403AU_DEFUN([ac_cv_prog_objc],
1404[ac_cv_objc_compiler_gnu])
1405
1406
1407# AC_PROG_OBJC([LIST-OF-COMPILERS])
1408# ---------------------------------
1409# LIST-OF-COMPILERS is a space separated list of Objective C compilers
1410# to search for (if not specified, a default list is used).  This just gives
1411# the user an opportunity to specify an alternative search list for the
1412# Objective C compiler.
1413# cc    Native compiler
1414# objc  David Stes' Portable Object Compiler
1415AN_MAKEVAR([OBJC],  [AC_PROG_OBJC])
1416AN_PROGRAM([gcc],   [AC_PROG_OBJC])
1417AN_PROGRAM([cc],    [AC_PROG_OBJC])
1418AC_DEFUN([AC_PROG_OBJC],
1419[AC_LANG_PUSH(Objective C)dnl
1420AC_ARG_VAR([OBJC],      [Objective C compiler command])dnl
1421AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl
1422_AC_ARG_VAR_LDFLAGS()dnl
1423_AC_ARG_VAR_CPPFLAGS()dnl
1424AC_CHECK_TOOLS(OBJC,
1425	       [$CCC m4_default([$1],
1426			  [gcc cc objc])],
1427	       gcc)
1428
1429# Provide some information about the compiler.
1430echo "$as_me:$LINENO:" \
1431     "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
1432ac_compiler=`set X $ac_compile; echo $[2]`
1433_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
1434_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
1435_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
1436
1437m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
1438m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
1439_AC_LANG_COMPILER_GNU
1440GOBJC=`test $ac_compiler_gnu = yes && echo yes`
1441dnl _AC_PROG_OBJC_G
1442_AC_PROG_OBJC_X
1443AC_LANG_POP(Objective C)dnl
1444])# AC_PROG_OBJC
1445
1446
1447# _AC_PROG_OBJC_G
1448# ---------------
1449# Check whether -g works, even if OBJCFLAGS is set, in case the package
1450# plays around with OBJCFLAGS (such as to build both debugging and
1451# normal versions of a library), tasteless as that idea is.
1452m4_define([_AC_PROG_OBJC_G],
1453[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
1454ac_save_OBJCFLAGS=$OBJCFLAGS
1455OBJCFLAGS="-g"
1456AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g,
1457	       [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1458				   [ac_cv_prog_objc_g=yes],
1459				   [ac_cv_prog_objc_g=no])])
1460if test "$ac_test_OBJCFLAGS" = set; then
1461  OBJCFLAGS=$ac_save_OBJCFLAGS
1462elif test $ac_cv_prog_objc_g = yes; then
1463  if test "$GOBJC" = yes; then
1464    OBJCFLAGS="-g -O2"
1465  else
1466    OBJCFLAGS="-g"
1467  fi
1468else
1469  if test "$GOBJC" = yes; then
1470    OBJCFLAGS="-O2"
1471  else
1472    OBJCFLAGS=
1473  fi
1474fi[]dnl
1475])# _AC_PROG_OBJC_G
1476
1477# _AC_PROG_OBJC_X
1478# ---------------
1479# Check whether -x objective-c works
1480m4_define([_AC_PROG_OBJC_X],
1481[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
1482ac_save_OBJCFLAGS=$OBJCFLAGS
1483OBJCFLAGS="$OBJCFLAGS -x objective-c"
1484AC_CACHE_CHECK(whether $OBJC accepts -x objective-c, ac_cv_prog_objc_x,
1485	       [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1486				   [ac_cv_prog_objc_x=yes],
1487				   [ac_cv_prog_objc_x=no])])
1488if test $ac_cv_prog_objc_x = yes; then
1489  OBJCFLAGS="$ac_save_OBJCFLAGS -x objective-c"
1490else
1491  OBJCFLAGS="$ac_save_OBJCFLAGS"
1492fi[]dnl
1493])# _AC_PROG_OBJC_X
1494
1495
1496
1497
1498
1499# -------------------------------- #
1500# 4b. C compiler characteristics.  #
1501# -------------------------------- #
1502
1503# libobjc and objc header tests shere?
1504
1505# Check for binary relocation support.
1506# Written by Hongli Lai
1507# http://autopackage.org/
1508
1509AC_DEFUN([AM_BINRELOC],
1510[
1511	AC_ARG_ENABLE(binreloc,
1512		[  --enable-binreloc       compile with binary relocation support
1513                          (default=enable when available)],
1514		enable_binreloc=$enableval,enable_binreloc=auto)
1515
1516	AC_ARG_ENABLE(binreloc-threads,
1517		[  --enable-binreloc-threads      compile binary relocation with threads support
1518	                         (default=yes)],
1519		enable_binreloc_threads=$enableval,enable_binreloc_threads=yes)
1520
1521	BINRELOC_CFLAGS=
1522	BINRELOC_LIBS=
1523	if test "x$enable_binreloc" = "xauto"; then
1524		AC_CHECK_FILE([/proc/self/maps])
1525		AC_CACHE_CHECK([whether everything is installed to the same prefix],
1526			       [br_cv_valid_prefixes], [
1527				if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
1528					"$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
1529					"$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
1530				then
1531					br_cv_valid_prefixes=yes
1532				else
1533					br_cv_valid_prefixes=no
1534				fi
1535				])
1536	fi
1537	AC_CACHE_CHECK([whether binary relocation support should be enabled],
1538		       [br_cv_binreloc],
1539		       [if test "x$enable_binreloc" = "xyes"; then
1540		       	       br_cv_binreloc=yes
1541		       elif test "x$enable_binreloc" = "xauto"; then
1542			       if test "x$br_cv_valid_prefixes" = "xyes" -a \
1543			       	       "x$ac_cv_file__proc_self_maps" = "xyes"; then
1544				       br_cv_binreloc=yes
1545			       else
1546				       br_cv_binreloc=no
1547			       fi
1548		       else
1549			       br_cv_binreloc=no
1550		       fi])
1551
1552	if test "x$br_cv_binreloc" = "xyes"; then
1553		BINRELOC_CFLAGS="-DENABLE_BINRELOC"
1554		AC_DEFINE(ENABLE_BINRELOC,,[Use binary relocation?])
1555		if test "x$enable_binreloc_threads" = "xyes"; then
1556			AC_CHECK_LIB([pthread], [pthread_getspecific])
1557		fi
1558
1559		AC_CACHE_CHECK([whether binary relocation should use threads],
1560			       [br_cv_binreloc_threads],
1561			       [if test "x$enable_binreloc_threads" = "xyes"; then
1562					if test "x$ac_cv_lib_pthread_pthread_getspecific" = "xyes"; then
1563						br_cv_binreloc_threads=yes
1564					else
1565						br_cv_binreloc_threads=no
1566					fi
1567			        else
1568					br_cv_binreloc_threads=no
1569				fi])
1570
1571		if test "x$br_cv_binreloc_threads" = "xyes"; then
1572			BINRELOC_LIBS="-lpthread"
1573			AC_DEFINE(BR_PTHREAD,1,[Include pthread support for binary relocation?])
1574		else
1575			BINRELOC_CFLAGS="$BINRELOC_CFLAGS -DBR_PTHREADS=0"
1576			AC_DEFINE(BR_PTHREAD,0,[Include pthread support for binary relocation?])
1577		fi
1578	fi
1579	AC_SUBST(BINRELOC_CFLAGS)
1580	AC_SUBST(BINRELOC_LIBS)
1581])
1582
1583# _ES_FRAMEWORK_PATH(FRAMEWORK-NAME, HEADER-FILE[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
1584# Check for the path to Framework FRAMEWORK-NAME by looking HEADER-FILE in it.
1585AC_DEFUN([_ES_FRAMEWORK_PATH],
1586[
1587    _es_frameworks_dirs="/System/Library/Frameworks /Library/Frameworks ~/Library/Frameworks"
1588    _es_framework_headers_dir="no"
1589    for _es_frameworks_dir in ${_es_frameworks_dirs} ; do
1590        _es_tmp_headers_dir="${_es_frameworks_dir}/[$1].framework/Headers"
1591        _es_framework_save_CFLAGS="${CFLAGS}"
1592        _es_framework_save_CXXFLAGS="${CXXFLAGS}"
1593        CFLAGS="${CFLAGS} -I${_es_tmp_headers_dir}"
1594        CXXFLAGS="${CXXFLAGS} -I${_es_tmp_headers_dir}"
1595        AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$2>], []),
1596            [_es_framework_headers_dir=${_es_tmp_headers_dir}], [])
1597        CFLAGS="${_es_framework_save_CFLAGS}"
1598        CXXFLAGS="${_es_framework_save_CXXFLAGS}"
1599        if test "x${_es_framework_headers_dir}" != "xno" ; then
1600            break
1601        fi
1602    done
1603
1604    if test "x${_es_lib_sdl_osx_headers_dir}" = "xno" ; then
1605        FRAMEWORK_HEADERS_DIR=""
1606        ifelse([$4], [], :, [$4])
1607    else
1608        FRAMEWORK_HEADERS_DIR="${_es_framework_headers_dir}"
1609        ifelse([$3], [], :, [$3])
1610    fi
1611])#_ES_FRAMEWORK_PATH
1612
1613# ES_LIB_SDL([MIN-VERSION[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
1614# -------------------------------------------------------------------
1615# Checks for SDL library.
1616# If found, defines SDL_CFLAGS and SDL_LIBS.
1617#
1618# Based on the original SDL's sdl.m4 file.
1619AC_DEFUN([ES_LIB_SDL],
1620[AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
1621AC_ARG_WITH([sdl-prefix],
1622            AS_HELP_STRING([--with-sdl-prefix],
1623                           [prefix where SDL is installed (optional)]),
1624            [_es_lib_sdl_prefix=$withval], [_es_lib_sdl_prefix=""])
1625AC_ARG_WITH([sdl-exec-prefix],
1626            AS_HELP_STRING([--with-sdl-exec-prefix],
1627                           [prefix where SDL binaries are installed (optional)]),
1628            [_es_lib_sdl_exec_prefix=$withval], [_es_lib_sdl_exec_prefix=""])
1629
1630_es_lib_sdl_found="no"
1631_es_lib_sdl_min_version=ifelse([$1], [], [0.11.0], [$1])
1632_es_lib_sdl_min_version_major=`echo ${_es_lib_sdl_min_version} | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1633_es_lib_sdl_min_version_minor=`echo ${_es_lib_sdl_min_version} | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1634_es_lib_sdl_min_version_micro=`echo ${_es_lib_sdl_min_version} | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1635
1636case "${host}" in
1637    *-apple-darwin*)
1638        _es_lib_sdl_osx=yes
1639        ;;
1640esac
1641# On Mac OS X, just try to use the SDL framework.
1642if test "x${_es_lib_sdl_osx}" = "xyes" ; then
1643    AC_MSG_CHECKING([for SDL, version >= ${_es_lib_sdl_min_version}])
1644    _ES_FRAMEWORK_PATH([SDL], [SDL.h],
1645                       [_es_lib_sdl_osx_headers_dir="${FRAMEWORK_HEADERS_DIR}"],
1646                       [_es_lib_sdl_osx_headers_dir="no"])
1647
1648    if test "x${_es_lib_sdl_osx_headers_dir}" = "xno" ; then
1649        SDL_CFLAGS=""
1650        SDL_LIBS=""
1651
1652        AC_MSG_RESULT([no])
1653        ifelse([$3], [], :, [$3])
1654    else
1655        SDL_CFLAGS="-I${_es_lib_sdl_osx_headers_dir}"
1656        SDL_LIBS="-framework SDL -framework Cocoa"
1657        _es_lib_sdl_found="yes"
1658    fi
1659else
1660# On others platforms use the sdl-config program.
1661    if test "x${_es_lib_sdl_exec_prefix}" != "x" ; then
1662        _es_lib_sdl_args="${_es_lib_sdl_args} --exec-prefix=${_es_lib_sdl_exec_prefix}"
1663        _es_lib_sdl_path="${_es_lib_sdl_exec_prefix}/bin:${_es_lib_sdl_path}"
1664    fi
1665
1666    if test "x${_es_lib_sdl_prefix}" != "x" ; then
1667        _es_lib_sdl_args="${_es_lib_sdl_args} --prefix=${_es_lib_sdl_prefix}"
1668        _es_lib_sdl_path="${_es_lib_sdl_prefix}/bin:${_es_lib_sdl_path}"
1669    fi
1670    AC_PATH_PROG([SDL_CONFIG], [sdl-config], [no], [${_es_lib_sdl_path}:${PATH}])
1671    AC_MSG_CHECKING([for SDL, version >= ${_es_lib_sdl_min_version}])
1672    if test "x${SDL_CONFIG}" != "xno" ; then
1673        SDL_CFLAGS=`${SDL_CONFIG} ${_es_lib_sdl_args} --cflags`
1674        SDL_LIBS=`${SDL_CONFIG} ${_es_lib_sdl_args} --libs`
1675        _es_lib_sdl_found="yes"
1676    else
1677        SDL_CFLAGS=""
1678        SDL_LIBS=""
1679
1680        AC_MSG_RESULT([no])
1681        ifelse([$3], [], :, [$3])
1682    fi
1683fi
1684
1685if test "x${_es_lib_sdl_found}" = "xyes" ; then
1686    _es_lib_sdl_save_CFLAGS="${CFLAGS}"
1687    _es_lib_sdl_save_CXXFLAGS="${CXXFLAGS}"
1688    _es_lib_sdl_save_LIBS="${LIBS}"
1689    CFLAGS="${CFLAGS} ${SDL_CFLAGS}"
1690    CXXFLAGS="${CXXFLAGS} ${SDL_CFLAGS}"
1691    LIBS="${LIBS} ${SDL_LIBS}"
1692    AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <SDL.h>
1693#include <SDL_version.h>
1694
1695
1696#if SDL_MAJOR_VERSION * 1000 + SDL_MINOR_VERSION * 100 + SDL_PATCHLEVEL < ${_es_lib_sdl_min_version_major} * 1000 + ${_es_lib_sdl_min_version_minor} * 100 + ${_es_lib_sdl_min_version_micro}
1697#error "SDL version not valid!"
1698#endif
1699
1700#ifdef main
1701#undef main
1702#endif
1703#if IS_WINCE_HOST
1704int SDL_main (int a, char **v) { return 0; }
1705#endif],
1706                                 []),
1707                   _es_lib_sdl_linked="yes", _es_lib_sdl_linked="no")
1708    CFLAGS="${_es_lib_sdl_save_CFLAGS}"
1709    CXXFLAGS="${_es_lib_sdl_save_CXXFLAGS}"
1710    LIBS="${_es_lib_sdl_save_LIBS}"
1711    if test "x${_es_lib_sdl_linked}" = "xyes" ; then
1712        AC_SUBST([SDL_CFLAGS])
1713        AC_SUBST([SDL_LIBS])
1714        AC_MSG_RESULT([yes])
1715        ifelse([$2], [], :, [$2])
1716    else
1717        AC_MSG_RESULT([no])
1718        ifelse([$3], [], :, [$3])
1719    fi
1720fi
1721])# ES_LIB_SDL
1722
1723# ES_LIB_SDL_SUBLIB(SUBLIBRARY-NAME, VARIABLE-SUFFIX[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
1724# ----------------------------------------------------------
1725# Checks for a sublibrary of SDL (usually called SDL_name).
1726# If found, defines SDL_[$VARIABLE-SUFFIX]_CFLAGS and SDL_[$VARIABLE_SUFFIX]_LIBS.
1727AC_DEFUN([ES_LIB_SDL_SUBLIB],
1728[AC_REQUIRE([ES_LIB_SDL])[]dnl
1729_es_lib_sdl_sublibrary_found="no"
1730
1731case "${host}" in
1732    *-apple-darwin*)
1733        _es_lib_sdl_sublibrary_osx="yes"
1734        ;;
1735    *-gp2x*)
1736        _es_lib_sdl_sublibrary_gp2x="yes"
1737        ;;
1738esac
1739# On Mac OS X, just try to use the SDL_sublibrary framework.
1740if test "x${_es_lib_sdl_sublibrary_osx}" = "xyes" ; then
1741    AC_MSG_CHECKING([for SDL_$1])
1742    _es_lib_sdl_sublibrary_save_CFLAGS="${CFLAGS}"
1743    _es_lib_sdl_sublibrary_save_CXXFLAGS="${CXXFLAGS}"
1744    CFLAGS="${CFLAGS} ${SDL_CFLAGS}"
1745    CXXFLAGS="${CXXFLAGS} ${SDL_CFLAGS}"
1746    _ES_FRAMEWORK_PATH([SDL_$1], [SDL_$1.h],
1747                       [_es_lib_sdl_sublibrary_osx_headers_dir="${FRAMEWORK_HEADERS_DIR}"],
1748                       [_es_lib_sdl_sublibrary_osx_headers_dir="no"])
1749    CFLAGS="${_es_lib_sdl_sublibrary_save_CFLAGS}"
1750    CXXFLAGS="${_es_lib_sdl_sublibrary_save_CXXFLAGS}"
1751
1752    if test "x${_es_lib_sdl_sublibrary_osx_headers_dir}" = "xno" ; then
1753        SDL_$2[]_CFLAGS=""
1754        SDL_$2[]_LIBS=""
1755
1756        AC_MSG_RESULT([no])
1757        ifelse([$4], [], :, [$4])
1758    else
1759        SDL_$2[]_CFLAGS="-I${_es_lib_sdl_sublibrary_osx_headers_dir}"
1760        SDL_$2[]_LIBS="-framework SDL_$1"
1761        _es_lib_sdl_sublibrary_found="yes"
1762    fi
1763# On others platforms try to compile the test program using SDL_CFLAGS
1764# and SDL_LIBS.
1765else
1766    # I seem to have problems in GP2X if I don't include them when linking.
1767    if test "x${_es_lib_sdl_sublibrary_gp2x}" = "xyes" ; then
1768        case $1 in
1769            image)
1770            _es_lib_sdl_sublibrary_extra_libs="-ljpeg -lpng -lz"
1771            ;;
1772            mixer)
1773            _es_lib_sdl_sublibrary_extra_libs="-lvorbisidec"
1774            ;;
1775            ttf)
1776            _es_lib_sdl_sublibrary_extra_libs="-lfreetype"
1777            ;;
1778        esac
1779    fi
1780    AC_MSG_CHECKING([for SDL_$1])
1781    _es_lib_sdl_sublibrary_save_CFLAGS="${CFLAGS}"
1782    _es_lib_sdl_sublibrary_save_CXXFLAGS="${CXXFLAGS}"
1783    CFLAGS="${CFLAGS} ${SDL_CFLAGS}"
1784    CXXFLAGS="${CXXFLAGS} ${SDL_CFLAGS}"
1785    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <SDL_$1.h>], []),
1786        [_es_lib_sdl_sublibrary_found="yes"], [_es_lib_sdl_sublibrary_found="no"])
1787    CFLAGS="${_es_lib_sdl_sublibrary_save_CFLAGS}"
1788    CXXFLAGS="${_es_lib_sdl_sublibrary_save_CXXFLAGS}"
1789
1790    if test "x${_es_lib_sdl_sublibrary_found}" = "xno" ; then
1791        SDL_$2[]_CFLAGS=""
1792        SDL_$2[]_LIBS=""
1793        AC_MSG_RESULT([no])
1794        ifelse([$4], [], :, [$4])
1795    else
1796        SDL_$2[]_CFLAGS=""
1797        SDL_$2[]_LIBS="-lSDL_$1 ${_es_lib_sdl_sublibrary_extra_libs}"
1798    fi
1799fi
1800
1801if test "x${_es_lib_sdl_sublibrary_found}" = "xyes" ; then
1802    _es_lib_sdl_sublibrary_save_CFLAGS="${CFLAGS}"
1803    _es_lib_sdl_sublibrary_save_CXXFLAGS="${CXXFLAGS}"
1804    _es_lib_sdl_sublibrary_save_LIBS="${LIBS}"
1805    CFLAGS="${CFLAGS} ${SDL_CFLAGS} ${SDL_$2[]_CFLAGS}"
1806    CXXFLAGS="${CXXFLAGS} ${SDL_CFLAGS} ${SDL_$2[]_CFLAGS}"
1807    LIBS="${LIBS} ${SDL_LIBS} ${SDL_$2[]_LIBS}"
1808    AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <SDL.h>
1809#include <SDL_$1.h>
1810
1811#ifdef main
1812#undef main
1813#endif
1814#if IS_WINCE_HOST
1815int SDL_main (int a, char **v) { return 0; }
1816#endif],
1817                                   []),
1818                   [_es_lib_sdl_sublibrary_linked="yes"],
1819                   [_es_lib_sdl_sublibrary_linked="no"])
1820    CFLAGS="${_es_lib_sdl_sublibrary_save_CFLAGS}"
1821    CXXFLAGS="${_es_lib_sdl_sublibrary_save_CXXFLAGS}"
1822    LIBS="${_es_lib_sdl_sublibrary_save_LIBS}"
1823
1824    if test "x${_es_lib_sdl_sublibrary_linked}" = "xyes" ; then
1825        AC_MSG_RESULT([yes])
1826        ifelse([$3], [], :, [$3])
1827    else
1828        AC_MSG_RESULT([no])
1829        ifelse([$4], [], :, [$4])
1830    fi
1831fi
1832])# ES_LIB_SDL_SUBLIBRARY
1833
1834