Debian Codegraph @

aclocal.m4

raw
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
21 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
22 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
23 dnl
24 AC_DEFUN([AM_PATH_SDL],
25 [dnl
26 dnl Get the cflags and libraries from the sdl-config script
27 dnl
28 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
29 sdl_prefix="$withval", sdl_prefix="")
30 AC_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="")
32 AC_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"
74 dnl
75 dnl Now check if the installed SDL is sufficiently new. (Also sanity
76 dnl checks the results of sdl-config to some extent
77 dnl
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
85 char*
86 my_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
101 int 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
164 int 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.
206 AC_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.
212 AC_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
261 AC_DEFUN([AM_AUX_DIR_EXPAND],
262 [dnl Rely on autoconf to set up CDPATH properly.
263 AC_PREREQ([2.50])dnl
264 # expand $ac_aux_dir to an absolute path
265 am_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.
282 AC_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
286 AC_SUBST([$1_TRUE])
287 AC_SUBST([$1_FALSE])
288 if $2; then
289 $1_TRUE=
290 $1_FALSE='#'
291 else
292 $1_TRUE='#'
293 $1_FALSE=
294 fi
295 AC_CONFIG_COMMANDS_PRE(
296 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
297 AC_MSG_ERROR([[conditional "$1" was never defined.
298 Usually this means the macro was only invoked conditionally.]])
299 fi])])
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.
328 AC_DEFUN([_AM_DEPENDENCIES],
329 [AC_REQUIRE([AM_SET_DEPDIR])dnl
330 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
331 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
332 AC_REQUIRE([AM_DEP_TRACK])dnl
333
334 ifelse([$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
340 AC_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
422 else
423 am_cv_$1_dependencies_compiler_type=none
424 fi
425 ])
426 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
427 AM_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
437 AC_DEFUN([AM_SET_DEPDIR],
438 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
439 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
440 ])
441
442
443 # AM_DEP_TRACK
444 # ------------
445 AC_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])
449 if test "x$enable_dependency_tracking" != xno; then
450 am_depcomp="$ac_aux_dir/depcomp"
451 AMDEPBACKSLASH='\'
452 fi
453 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
454 AC_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 # ------------------------------
470 AC_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
508 done
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.
519 AC_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 # Do all the work for Automake. -*- Autoconf -*-
526
527 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
528 # Free Software Foundation, Inc.
529 #
530 # This file is free software; the Free Software Foundation
531 # gives unlimited permission to copy and/or distribute it,
532 # with or without modifications, as long as this notice is preserved.
533
534 # serial 12
535
536 # This macro actually does too much. Some checks are only needed if
537 # your package does certain things. But this isn't really a big deal.
538
539 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
540 # AM_INIT_AUTOMAKE([OPTIONS])
541 # -----------------------------------------------
542 # The call with PACKAGE and VERSION arguments is the old style
543 # call (pre autoconf-2.50), which is being phased out. PACKAGE
544 # and VERSION should now be passed to AC_INIT and removed from
545 # the call to AM_INIT_AUTOMAKE.
546 # We support both call styles for the transition. After
547 # the next Automake release, Autoconf can make the AC_INIT
548 # arguments mandatory, and then we can depend on a new Autoconf
549 # release and drop the old call support.
550 AC_DEFUN([AM_INIT_AUTOMAKE],
551 [AC_PREREQ([2.58])dnl
552 dnl Autoconf wants to disallow AM_ names. We explicitly allow
553 dnl the ones we care about.
554 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
555 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
556 AC_REQUIRE([AC_PROG_INSTALL])dnl
557 # test to see if srcdir already configured
558 if test "`cd $srcdir && pwd`" != "`pwd`" &&
559 test -f $srcdir/config.status; then
560 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
561 fi
562
563 # test whether we have cygpath
564 if test -z "$CYGPATH_W"; then
565 if (cygpath --version) >/dev/null 2>/dev/null; then
566 CYGPATH_W='cygpath -w'
567 else
568 CYGPATH_W=echo
569 fi
570 fi
571 AC_SUBST([CYGPATH_W])
572
573 # Define the identity of the package.
574 dnl Distinguish between old-style and new-style calls.
575 m4_ifval([$2],
576 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
577 AC_SUBST([PACKAGE], [$1])dnl
578 AC_SUBST([VERSION], [$2])],
579 [_AM_SET_OPTIONS([$1])dnl
580 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
581 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
582
583 _AM_IF_OPTION([no-define],,
584 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
585 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
586
587 # Some tools Automake needs.
588 AC_REQUIRE([AM_SANITY_CHECK])dnl
589 AC_REQUIRE([AC_ARG_PROGRAM])dnl
590 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
591 AM_MISSING_PROG(AUTOCONF, autoconf)
592 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
593 AM_MISSING_PROG(AUTOHEADER, autoheader)
594 AM_MISSING_PROG(MAKEINFO, makeinfo)
595 AM_PROG_INSTALL_SH
596 AM_PROG_INSTALL_STRIP
597 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
598 # We need awk for the "check" target. The system "awk" is bad on
599 # some platforms.
600 AC_REQUIRE([AC_PROG_AWK])dnl
601 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
602 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
603 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
604 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
605 [_AM_PROG_TAR([v7])])])
606 _AM_IF_OPTION([no-dependencies],,
607 [AC_PROVIDE_IFELSE([AC_PROG_CC],
608 [_AM_DEPENDENCIES(CC)],
609 [define([AC_PROG_CC],
610 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
611 AC_PROVIDE_IFELSE([AC_PROG_CXX],
612 [_AM_DEPENDENCIES(CXX)],
613 [define([AC_PROG_CXX],
614 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
615 ])
616 ])
617
618
619 # When config.status generates a header, we must update the stamp-h file.
620 # This file resides in the same directory as the config header
621 # that is generated. The stamp files are numbered to have different names.
622
623 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
624 # loop where config.status creates the headers, so we can generate
625 # our stamp files there.
626 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
627 [# Compute $1's index in $config_headers.
628 _am_stamp_count=1
629 for _am_header in $config_headers :; do
630 case $_am_header in
631 $1 | $1:* )
632 break ;;
633 * )
634 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
635 esac
636 done
637 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
638
639 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
640 #
641 # This file is free software; the Free Software Foundation
642 # gives unlimited permission to copy and/or distribute it,
643 # with or without modifications, as long as this notice is preserved.
644
645 # AM_PROG_INSTALL_SH
646 # ------------------
647 # Define $install_sh.
648 AC_DEFUN([AM_PROG_INSTALL_SH],
649 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
650 install_sh=${install_sh-"$am_aux_dir/install-sh"}
651 AC_SUBST(install_sh)])
652
653 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
654 #
655 # This file is free software; the Free Software Foundation
656 # gives unlimited permission to copy and/or distribute it,
657 # with or without modifications, as long as this notice is preserved.
658
659 # serial 2
660
661 # Check whether the underlying file-system supports filenames
662 # with a leading dot. For instance MS-DOS doesn't.
663 AC_DEFUN([AM_SET_LEADING_DOT],
664 [rm -rf .tst 2>/dev/null
665 mkdir .tst 2>/dev/null
666 if test -d .tst; then
667 am__leading_dot=.
668 else
669 am__leading_dot=_
670 fi
671 rmdir .tst 2>/dev/null
672 AC_SUBST([am__leading_dot])])
673
674 # Check to see how 'make' treats includes. -*- Autoconf -*-
675
676 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
677 #
678 # This file is free software; the Free Software Foundation
679 # gives unlimited permission to copy and/or distribute it,
680 # with or without modifications, as long as this notice is preserved.
681
682 # serial 3
683
684 # AM_MAKE_INCLUDE()
685 # -----------------
686 # Check to see how make treats includes.
687 AC_DEFUN([AM_MAKE_INCLUDE],
688 [am_make=${MAKE-make}
689 cat > confinc << 'END'
690 am__doit:
691 @echo done
692 .PHONY: am__doit
693 END
694 # If we don't find an include directive, just comment out the code.
695 AC_MSG_CHECKING([for style of include used by $am_make])
696 am__include="#"
697 am__quote=
698 _am_result=none
699 # First try GNU make style include.
700 echo "include confinc" > confmf
701 # We grep out `Entering directory' and `Leaving directory'
702 # messages which can occur if `w' ends up in MAKEFLAGS.
703 # In particular we don't look at `^make:' because GNU make might
704 # be invoked under some other name (usually "gmake"), in which
705 # case it prints its new name instead of `make'.
706 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
707 am__include=include
708 am__quote=
709 _am_result=GNU
710 fi
711 # Now try BSD make style include.
712 if test "$am__include" = "#"; then
713 echo '.include "confinc"' > confmf
714 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
715 am__include=.include
716 am__quote="\""
717 _am_result=BSD
718 fi
719 fi
720 AC_SUBST([am__include])
721 AC_SUBST([am__quote])
722 AC_MSG_RESULT([$_am_result])
723 rm -f confinc confmf
724 ])
725
726 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
727
728 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
729 # Free Software Foundation, Inc.
730 #
731 # This file is free software; the Free Software Foundation
732 # gives unlimited permission to copy and/or distribute it,
733 # with or without modifications, as long as this notice is preserved.
734
735 # serial 4
736
737 # AM_MISSING_PROG(NAME, PROGRAM)
738 # ------------------------------
739 AC_DEFUN([AM_MISSING_PROG],
740 [AC_REQUIRE([AM_MISSING_HAS_RUN])
741 $1=${$1-"${am_missing_run}$2"}
742 AC_SUBST($1)])
743
744
745 # AM_MISSING_HAS_RUN
746 # ------------------
747 # Define MISSING if not defined so far and test if it supports --run.
748 # If it does, set am_missing_run to use it, otherwise, to nothing.
749 AC_DEFUN([AM_MISSING_HAS_RUN],
750 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
751 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
752 # Use eval to expand $SHELL
753 if eval "$MISSING --run true"; then
754 am_missing_run="$MISSING --run "
755 else
756 am_missing_run=
757 AC_MSG_WARN([`missing' script is too old or missing])
758 fi
759 ])
760
761 # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
762 #
763 # This file is free software; the Free Software Foundation
764 # gives unlimited permission to copy and/or distribute it,
765 # with or without modifications, as long as this notice is preserved.
766
767 # AM_PROG_MKDIR_P
768 # ---------------
769 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
770 #
771 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
772 # created by `make install' are always world readable, even if the
773 # installer happens to have an overly restrictive umask (e.g. 077).
774 # This was a mistake. There are at least two reasons why we must not
775 # use `-m 0755':
776 # - it causes special bits like SGID to be ignored,
777 # - it may be too restrictive (some setups expect 775 directories).
778 #
779 # Do not use -m 0755 and let people choose whatever they expect by
780 # setting umask.
781 #
782 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
783 # Some implementations (such as Solaris 8's) are not thread-safe: if a
784 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
785 # concurrently, both version can detect that a/ is missing, but only
786 # one can create it and the other will error out. Consequently we
787 # restrict ourselves to GNU make (using the --version option ensures
788 # this.)
789 AC_DEFUN([AM_PROG_MKDIR_P],
790 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
791 # We used to keeping the `.' as first argument, in order to
792 # allow $(mkdir_p) to be used without argument. As in
793 # $(mkdir_p) $(somedir)
794 # where $(somedir) is conditionally defined. However this is wrong
795 # for two reasons:
796 # 1. if the package is installed by a user who cannot write `.'
797 # make install will fail,
798 # 2. the above comment should most certainly read
799 # $(mkdir_p) $(DESTDIR)$(somedir)
800 # so it does not work when $(somedir) is undefined and
801 # $(DESTDIR) is not.
802 # To support the latter case, we have to write
803 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
804 # so the `.' trick is pointless.
805 mkdir_p='mkdir -p --'
806 else
807 # On NextStep and OpenStep, the `mkdir' command does not
808 # recognize any option. It will interpret all options as
809 # directories to create, and then abort because `.' already
810 # exists.
811 for d in ./-p ./--version;
812 do
813 test -d $d && rmdir $d
814 done
815 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
816 if test -f "$ac_aux_dir/mkinstalldirs"; then
817 mkdir_p='$(mkinstalldirs)'
818 else
819 mkdir_p='$(install_sh) -d'
820 fi
821 fi
822 AC_SUBST([mkdir_p])])
823
824 # Helper functions for option handling. -*- Autoconf -*-
825
826 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
827 #
828 # This file is free software; the Free Software Foundation
829 # gives unlimited permission to copy and/or distribute it,
830 # with or without modifications, as long as this notice is preserved.
831
832 # serial 3
833
834 # _AM_MANGLE_OPTION(NAME)
835 # -----------------------
836 AC_DEFUN([_AM_MANGLE_OPTION],
837 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
838
839 # _AM_SET_OPTION(NAME)
840 # ------------------------------
841 # Set option NAME. Presently that only means defining a flag for this option.
842 AC_DEFUN([_AM_SET_OPTION],
843 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
844
845 # _AM_SET_OPTIONS(OPTIONS)
846 # ----------------------------------
847 # OPTIONS is a space-separated list of Automake options.
848 AC_DEFUN([_AM_SET_OPTIONS],
849 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
850
851 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
852 # -------------------------------------------
853 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
854 AC_DEFUN([_AM_IF_OPTION],
855 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
856
857 # Check to make sure that the build environment is sane. -*- Autoconf -*-
858
859 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
860 # Free Software Foundation, Inc.
861 #
862 # This file is free software; the Free Software Foundation
863 # gives unlimited permission to copy and/or distribute it,
864 # with or without modifications, as long as this notice is preserved.
865
866 # serial 4
867
868 # AM_SANITY_CHECK
869 # ---------------
870 AC_DEFUN([AM_SANITY_CHECK],
871 [AC_MSG_CHECKING([whether build environment is sane])
872 # Just in case
873 sleep 1
874 echo timestamp > conftest.file
875 # Do `set' in a subshell so we don't clobber the current shell's
876 # arguments. Must try -L first in case configure is actually a
877 # symlink; some systems play weird games with the mod time of symlinks
878 # (eg FreeBSD returns the mod time of the symlink's containing
879 # directory).
880 if (
881 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
882 if test "$[*]" = "X"; then
883 # -L didn't work.
884 set X `ls -t $srcdir/configure conftest.file`
885 fi
886 rm -f conftest.file
887 if test "$[*]" != "X $srcdir/configure conftest.file" \
888 && test "$[*]" != "X conftest.file $srcdir/configure"; then
889
890 # If neither matched, then we have a broken ls. This can happen
891 # if, for instance, CONFIG_SHELL is bash and it inherits a
892 # broken ls alias from the environment. This has actually
893 # happened. Such a system could not be considered "sane".
894 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
895 alias in your environment])
896 fi
897
898 test "$[2]" = conftest.file
899 )
900 then
901 # Ok.
902 :
903 else
904 AC_MSG_ERROR([newly created file is older than distributed files!
905 Check your system clock])
906 fi
907 AC_MSG_RESULT(yes)])
908
909 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
910 #
911 # This file is free software; the Free Software Foundation
912 # gives unlimited permission to copy and/or distribute it,
913 # with or without modifications, as long as this notice is preserved.
914
915 # AM_PROG_INSTALL_STRIP
916 # ---------------------
917 # One issue with vendor `install' (even GNU) is that you can't
918 # specify the program used to strip binaries. This is especially
919 # annoying in cross-compiling environments, where the build's strip
920 # is unlikely to handle the host's binaries.
921 # Fortunately install-sh will honor a STRIPPROG variable, so we
922 # always use install-sh in `make install-strip', and initialize
923 # STRIPPROG with the value of the STRIP variable (set by the user).
924 AC_DEFUN([AM_PROG_INSTALL_STRIP],
925 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
926 # Installed binaries are usually stripped using `strip' when the user
927 # run `make install-strip'. However `strip' might not be the right
928 # tool to use in cross-compilation environments, therefore Automake
929 # will honor the `STRIP' environment variable to overrule this program.
930 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
931 if test "$cross_compiling" != no; then
932 AC_CHECK_TOOL([STRIP], [strip], :)
933 fi
934 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
935 AC_SUBST([INSTALL_STRIP_PROGRAM])])
936
937 # Check how to create a tarball. -*- Autoconf -*-
938
939 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
940 #
941 # This file is free software; the Free Software Foundation
942 # gives unlimited permission to copy and/or distribute it,
943 # with or without modifications, as long as this notice is preserved.
944
945 # serial 2
946
947 # _AM_PROG_TAR(FORMAT)
948 # --------------------
949 # Check how to create a tarball in format FORMAT.
950 # FORMAT should be one of `v7', `ustar', or `pax'.
951 #
952 # Substitute a variable $(am__tar) that is a command
953 # writing to stdout a FORMAT-tarball containing the directory
954 # $tardir.
955 # tardir=directory && $(am__tar) > result.tar
956 #
957 # Substitute a variable $(am__untar) that extract such
958 # a tarball read from stdin.
959 # $(am__untar) < result.tar
960 AC_DEFUN([_AM_PROG_TAR],
961 [# Always define AMTAR for backward compatibility.
962 AM_MISSING_PROG([AMTAR], [tar])
963 m4_if([$1], [v7],
964 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
965 [m4_case([$1], [ustar],, [pax],,
966 [m4_fatal([Unknown tar format])])
967 AC_MSG_CHECKING([how to create a $1 tar archive])
968 # Loop over all known methods to create a tar archive until one works.
969 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
970 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
971 # Do not fold the above two line into one, because Tru64 sh and
972 # Solaris sh will not grok spaces in the rhs of `-'.
973 for _am_tool in $_am_tools
974 do
975 case $_am_tool in
976 gnutar)
977 for _am_tar in tar gnutar gtar;
978 do
979 AM_RUN_LOG([$_am_tar --version]) && break
980 done
981 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
982 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
983 am__untar="$_am_tar -xf -"
984 ;;
985 plaintar)
986 # Must skip GNU tar: if it does not support --format= it doesn't create
987 # ustar tarball either.
988 (tar --version) >/dev/null 2>&1 && continue
989 am__tar='tar chf - "$$tardir"'
990 am__tar_='tar chf - "$tardir"'
991 am__untar='tar xf -'
992 ;;
993 pax)
994 am__tar='pax -L -x $1 -w "$$tardir"'
995 am__tar_='pax -L -x $1 -w "$tardir"'
996 am__untar='pax -r'
997 ;;
998 cpio)
999 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1000 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1001 am__untar='cpio -i -H $1 -d'
1002 ;;
1003 none)
1004 am__tar=false
1005 am__tar_=false
1006 am__untar=false
1007 ;;
1008 esac
1009
1010 # If the value was cached, stop now. We just wanted to have am__tar
1011 # and am__untar set.
1012 test -n "${am_cv_prog_tar_$1}" && break
1013
1014 # tar/untar a dummy directory, and stop if the command works
1015 rm -rf conftest.dir
1016 mkdir conftest.dir
1017 echo GrepMe > conftest.dir/file
1018 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1019 rm -rf conftest.dir
1020 if test -s conftest.tar; then
1021 AM_RUN_LOG([$am__untar <conftest.tar])
1022 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1023 fi
1024 done
1025 rm -rf conftest.dir
1026
1027 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1028 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1029 AC_SUBST([am__tar])
1030 AC_SUBST([am__untar])
1031 ]) # _AM_PROG_TAR
1032