1# aclocal.m4t generated automatically by aclocal 1.5
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14AC_DEFUN(ACX_FLAG,
15[
16	AC_LANG_CASE(C, cur_lang=C;, C++, cur_lang=C++;)dnl undocumented !
17	dnl if test x$ac_ext = xcc; then
18	if test x$cur_lang = xC++; then
19		AC_CACHE_CHECK(whether the C++ compiler supports $1, ac_cv_flag_cc_$2,
20			OLDCXXFLAGS="$CXXFLAGS"
21			CXXFLAGS="$CXXFLAGS $1"
22			[AC_TRY_LINK([],[int i=0],
23				ac_cv_flag_cc_$2=yes
24				$3,
25				ac_cv_flag_cc_$2=no
26				CXXFLAGS="$OLDCXXFLAGS"
27				$4
28			)]
29		)
30	else
31		AC_CACHE_CHECK(whether the C compiler supports $1, ac_cv_flag_c_$2,
32			OLDCFLAGS="$CFLAGS"
33			CFLAGS="$CFLAGS $1"
34			[AC_TRY_LINK([],[int i=0],
35				ac_cv_flag_c_$2=yes
36				$3,
37				ac_cv_flag_c_$2=no
38				CFLAGS="$OLDCFLAGS"
39				$4
40			)]
41		)
42	fi
43])
44
45AC_DEFUN(ACX_M_PI,
46[
47	AC_CACHE_CHECK(for M_PI, ac_cv_m_pi,
48		[AC_TRY_COMPILE([
49			#include <math.h>],[
50				double d = M_PI
51			],ac_cv_m_pi=yes,ac_cv_m_pi=no
52		)]
53	)
54	if test $ac_cv_m_pi = no; then
55		AC_DEFINE(M_PI, 3.14159265358979323846, [Define to the value of pi if you don't already have it])
56	fi
57])
58
59AC_DEFUN(ACX_NAMESPACE,
60[
61	AC_LANG_PUSH(C++)
62	AC_CACHE_CHECK(whether the C++ compiler needs std::, ac_cv_needstd,
63		[AC_TRY_COMPILE([#include <string>],
64			[string s],
65			ac_cv_needstd=no,
66			ac_cv_needstd=yes
67		)]
68	)
69	if test $ac_cv_needstd = no; then
70		AC_DEFINE(NO_NAMESPACE,, [Define if your compiler doesn't support namespaces])
71	fi
72	AC_LANG_POP(C++)
73])
74
75AC_DEFUN(ACX_FL_PIXMAP,
76[
77	AC_MSG_CHECKING([[whether Fl_Pixmap needs const char*const*]])
78	AC_TRY_COMPILE([
79		#include <FL/Enumerations.H>
80		#include <FL/Fl_Pixmap.H>],[
81		char *const abuf[] = { "a", "b" };
82		Fl_Pixmap pix(abuf)
83	],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(yes)]
84	[AC_DEFINE_UNQUOTED(XPMCONST, const, [Define to const if your compiler complains about the constness of Fl_Pixmap])])
85])
86
87AC_DEFUN(ACX_FIND_FILE,
88[
89	AC_CACHE_CHECK(for $1, ac_cv_path_$4,
90		for i in $$3 $2;
91		do
92			if test -r "$i/$1"; then
93				$3=$i
94				ac_cv_path_$4=$i
95				break
96			fi
97		done
98		if test "$$3" = ""; then ac_cv_path_$4=no; fi
99	)
100])
101
102dnl parameters:
103dnl 1: header file, 2: name of lib, 3: function in lib,
104dnl 4: action if found, 5: action if not found
105AC_DEFUN(ACX_CHECK_LIB,
106[
107	success=no
108	AC_CHECK_HEADER($1,[AC_CHECK_LIB($2,$3,success=yes)])
109	if test x$success = xyes; then
110		LIBS="-l$2 $LIBS"
111		$4
112	else
113		:
114		$5
115	fi
116])
117
118AC_DEFUN(ACX_X_OR_WIN,
119[
120	AC_REQUIRE([AC_CANONICAL_HOST])dnl
121	case "$host_os" in
122		*cygwin* ) x_or_win=win;;
123		 *mingw* ) x_or_win=win;;
124		       * ) x_or_win=neither;
125	esac
126
127	if [test x$x_or_win = xwin]; then
128		CFLAGS="-mwindows $CFLAGS"
129		CXXFLAGS="-mwindows $CXXFLAGS"
130		LDFLAGS="-mwindows $LDFLAGS"
131		LIBS="-lgdi32 -luser32 -lglu32 -lmsvcrt -lwsock32 $LIBS"
132	else
133		AC_PATH_XTRA
134		if [test a$no_x = a]; then
135			x_or_win=x
136			dnl there's no direct reference to X11 in the code, so no CFLAGS required
137			LDFLAGS="$X_LIBS $LDFLAGS"
138			LIBS="-lX11 $X_EXTRA_LIBS $X_PRE_LIBS $LIBS"
139		fi
140	fi
141])
142
143# Add a variable $2 (e.g. "-L...") to $1, if it's not already contained
144AC_DEFUN(ACX_ADD_BEFORE,
145[
146	contained=no
147	for addvar in $$1; do
148		if test x$addvar = x$$2; then
149			contained=yes
150		fi
151	done
152	if test x$contained = xno; then
153		$1="$$2 $$1"
154	fi
155])
156
157# Add a variable $2 (e.g. "-L...") to $1, if it's not already contained
158AC_DEFUN(ACX_ADD_AFTER,
159[
160	contained=no
161	for addvar in $$1; do
162		if test x$addvar = x$$2; then
163			contained=yes
164		fi
165	done
166	if test x$contained = xno; then
167		$1="$$1 $$2"
168	fi
169])
170
171# $1: required api-version (1.1),
172# $2: action (--use-images --use-gl)
173# $3: action if success, $4: action if failure
174AC_DEFUN(ACX_FLTK_CONFIG,
175[
176	AC_PATH_PROG(FLTK,fltk-config)
177	if test a$FLTK != a; then
178
179		# look for fluid
180		if test x$FLUID = x; then
181			FLUID=`$FLTK --exec-prefix`/bin/fluid$EXEEXT
182		fi
183		AC_SUBST(FLUID)
184
185		# check api-version
186		if test x$1 != x; then
187			FLTK_API_VERSION=`$FLTK --api-version`
188			if test x$1 != x$FLTK_API_VERSION; then
189				AC_MSG_WARN([FLTK: api version $1 required, but $FLTK_API_VERSION found.])
190			fi
191		fi
192
193		# add requested flags to LDFLAGS
194		FLTK_LDFLAGS=`$FLTK $2 --ldflags`
195		FLTK_LDFLAGS_REVERSE=""
196		for acx_var in $FLTK_LDFLAGS; do
197			FLTK_LDFLAGS_REVERSE="$acx_var $FLTK_LDFLAGS_REVERSE"
198		done
199		for acx_var in $FLTK_LDFLAGS_REVERSE; do
200			case "$acx_var" in
201				-l*) ACX_ADD_BEFORE(LIBS,acx_var);;
202				*) ACX_ADD_BEFORE(LDFLAGS,acx_var);;
203			esac
204		done
205
206		# add requested flags to CPPFLAGS or CXXFLAGS
207		FLTK_INCLUDE=`$FLTK $2 --cxxflags`
208		for acx_var in $FLTK_INCLUDE; do
209			case "$acx_var" in
210				-I*) ACX_ADD_AFTER(CPPFLAGS,acx_var);;
211				*) ACX_ADD_AFTER(CXXFLAGS,acx_var);;
212			esac
213		done
214		$3
215	else
216		:
217		$4
218	fi
219])
220
221AC_DEFUN(ACX_FLTK,
222[
223	AC_REQUIRE([ACX_X_OR_WIN])dnl
224#$EXEEXT instead!!!
225	if test a$x_or_win = ax; then
226		AC_PATH_PROG(FLUID,fluid,,$PATH:/usr/local/bin:/usr/bin)
227	elif test x$x_or_win = xwin; then
228		AC_PATH_PROG(FLUID,fluid.exe,,$PATH)
229	fi
230	AC_SUBST(FLUID)
231
232	AC_LANG_PUSH(C++)
233	ACX_CHECK_LIB(FL/Fl.H,fltk,fl_window,fltk=yes,fltk=no)
234	AC_LANG_POP(C++)
235])
236
237# Like AC_CONFIG_HEADER, but automatically create stamp file.
238
239# serial 3
240
241# When config.status generates a header, we must update the stamp-h file.
242# This file resides in the same directory as the config header
243# that is generated.  We must strip everything past the first ":",
244# and everything past the last "/".
245
246AC_PREREQ([2.12])
247
248AC_DEFUN([AM_CONFIG_HEADER],
249[ifdef([AC_FOREACH],dnl
250	 [dnl init our file count if it isn't already
251	 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
252	 dnl prepare to store our destination file list for use in config.status
253	 AC_FOREACH([_AM_File], [$1],
254		    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
255		    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
256		    dnl and add it to the list of files AC keeps track of, along
257		    dnl with our hook
258		    AC_CONFIG_HEADERS(_AM_File,
259dnl COMMANDS, [, INIT-CMDS]
260[# update the timestamp
261echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
262][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
263		    m4_popdef([_AM_Dest])])],dnl
264[AC_CONFIG_HEADER([$1])
265  AC_OUTPUT_COMMANDS(
266   ifelse(patsubst([$1], [[^ ]], []),
267	  [],
268	  [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
269	   patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
270[am_indx=1
271for am_file in $1; do
272  case " \$CONFIG_HEADERS " in
273  *" \$am_file "*)
274    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
275    if test -n "\$am_dir"; then
276      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
277      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
278        am_tmpdir=\$am_tmpdir\$am_subdir/
279        if test ! -d \$am_tmpdir; then
280          mkdir \$am_tmpdir
281        fi
282      done
283    fi
284    echo timestamp > "\$am_dir"stamp-h\$am_indx
285    ;;
286  esac
287  am_indx=\`expr \$am_indx + 1\`
288done])
289])]) # AM_CONFIG_HEADER
290
291# _AM_DIRNAME(PATH)
292# -----------------
293# Like AS_DIRNAME, only do it during macro expansion
294AC_DEFUN([_AM_DIRNAME],
295       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
296	      m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
297		    m4_if(m4_regexp([$1], [^/.*]), -1,
298			  [.],
299			  m4_patsubst([$1], [^\(/\).*], [\1])),
300		    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
301	      m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
302]) # _AM_DIRNAME
303
304# Do all the work for Automake.  This macro actually does too much --
305# some checks are only needed if your package does certain things.
306# But this isn't really a big deal.
307
308# serial 5
309
310# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
311# written in clear, in which case automake, when reading aclocal.m4,
312# will think it sees a *use*, and therefore will trigger all it's
313# C support machinery.  Also note that it means that autoscan, seeing
314# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
315
316
317# We require 2.13 because we rely on SHELL being computed by configure.
318AC_PREREQ([2.13])
319
320# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
321# -----------------------------------------------------------
322# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
323# The purpose of this macro is to provide the user with a means to
324# check macros which are provided without letting her know how the
325# information is coded.
326# If this macro is not defined by Autoconf, define it here.
327ifdef([AC_PROVIDE_IFELSE],
328      [],
329      [define([AC_PROVIDE_IFELSE],
330              [ifdef([AC_PROVIDE_$1],
331                     [$2], [$3])])])
332
333
334# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
335# ----------------------------------------------
336AC_DEFUN([AM_INIT_AUTOMAKE],
337[AC_REQUIRE([AC_PROG_INSTALL])dnl
338# test to see if srcdir already configured
339if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
340   test -f $srcdir/config.status; then
341  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
342fi
343
344# Define the identity of the package.
345PACKAGE=$1
346AC_SUBST(PACKAGE)dnl
347VERSION=$2
348AC_SUBST(VERSION)dnl
349ifelse([$3],,
350[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
351AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
352
353# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
354# the ones we care about.
355ifdef([m4_pattern_allow],
356      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
357
358# Autoconf 2.50 always computes EXEEXT.  However we need to be
359# compatible with 2.13, for now.  So we always define EXEEXT, but we
360# don't compute it.
361AC_SUBST(EXEEXT)
362# Similar for OBJEXT -- only we only use OBJEXT if the user actually
363# requests that it be used.  This is a bit dumb.
364: ${OBJEXT=o}
365AC_SUBST(OBJEXT)
366
367# Some tools Automake needs.
368AC_REQUIRE([AM_SANITY_CHECK])dnl
369AC_REQUIRE([AC_ARG_PROGRAM])dnl
370AM_MISSING_PROG(ACLOCAL, aclocal)
371AM_MISSING_PROG(AUTOCONF, autoconf)
372AM_MISSING_PROG(AUTOMAKE, automake)
373AM_MISSING_PROG(AUTOHEADER, autoheader)
374AM_MISSING_PROG(MAKEINFO, makeinfo)
375AM_MISSING_PROG(AMTAR, tar)
376AM_PROG_INSTALL_SH
377AM_PROG_INSTALL_STRIP
378# We need awk for the "check" target.  The system "awk" is bad on
379# some platforms.
380AC_REQUIRE([AC_PROG_AWK])dnl
381AC_REQUIRE([AC_PROG_MAKE_SET])dnl
382AC_REQUIRE([AM_DEP_TRACK])dnl
383AC_REQUIRE([AM_SET_DEPDIR])dnl
384AC_PROVIDE_IFELSE([AC_PROG_][CC],
385                  [_AM_DEPENDENCIES(CC)],
386                  [define([AC_PROG_][CC],
387                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
388AC_PROVIDE_IFELSE([AC_PROG_][CXX],
389                  [_AM_DEPENDENCIES(CXX)],
390                  [define([AC_PROG_][CXX],
391                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
392])
393
394#
395# Check to make sure that the build environment is sane.
396#
397
398# serial 3
399
400# AM_SANITY_CHECK
401# ---------------
402AC_DEFUN([AM_SANITY_CHECK],
403[AC_MSG_CHECKING([whether build environment is sane])
404# Just in case
405sleep 1
406echo timestamp > conftest.file
407# Do `set' in a subshell so we don't clobber the current shell's
408# arguments.  Must try -L first in case configure is actually a
409# symlink; some systems play weird games with the mod time of symlinks
410# (eg FreeBSD returns the mod time of the symlink's containing
411# directory).
412if (
413   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
414   if test "$[*]" = "X"; then
415      # -L didn't work.
416      set X `ls -t $srcdir/configure conftest.file`
417   fi
418   rm -f conftest.file
419   if test "$[*]" != "X $srcdir/configure conftest.file" \
420      && test "$[*]" != "X conftest.file $srcdir/configure"; then
421
422      # If neither matched, then we have a broken ls.  This can happen
423      # if, for instance, CONFIG_SHELL is bash and it inherits a
424      # broken ls alias from the environment.  This has actually
425      # happened.  Such a system could not be considered "sane".
426      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
427alias in your environment])
428   fi
429
430   test "$[2]" = conftest.file
431   )
432then
433   # Ok.
434   :
435else
436   AC_MSG_ERROR([newly created file is older than distributed files!
437Check your system clock])
438fi
439AC_MSG_RESULT(yes)])
440
441
442# serial 2
443
444# AM_MISSING_PROG(NAME, PROGRAM)
445# ------------------------------
446AC_DEFUN([AM_MISSING_PROG],
447[AC_REQUIRE([AM_MISSING_HAS_RUN])
448$1=${$1-"${am_missing_run}$2"}
449AC_SUBST($1)])
450
451
452# AM_MISSING_HAS_RUN
453# ------------------
454# Define MISSING if not defined so far and test if it supports --run.
455# If it does, set am_missing_run to use it, otherwise, to nothing.
456AC_DEFUN([AM_MISSING_HAS_RUN],
457[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
458test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
459# Use eval to expand $SHELL
460if eval "$MISSING --run true"; then
461  am_missing_run="$MISSING --run "
462else
463  am_missing_run=
464  am_backtick='`'
465  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
466fi
467])
468
469# AM_AUX_DIR_EXPAND
470
471# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
472# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
473# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
474#
475# Of course, Automake must honor this variable whenever it calls a
476# tool from the auxiliary directory.  The problem is that $srcdir (and
477# therefore $ac_aux_dir as well) can be either absolute or relative,
478# depending on how configure is run.  This is pretty annoying, since
479# it makes $ac_aux_dir quite unusable in subdirectories: in the top
480# source directory, any form will work fine, but in subdirectories a
481# relative path needs to be adjusted first.
482#
483# $ac_aux_dir/missing
484#    fails when called from a subdirectory if $ac_aux_dir is relative
485# $top_srcdir/$ac_aux_dir/missing
486#    fails if $ac_aux_dir is absolute,
487#    fails when called from a subdirectory in a VPATH build with
488#          a relative $ac_aux_dir
489#
490# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
491# are both prefixed by $srcdir.  In an in-source build this is usually
492# harmless because $srcdir is `.', but things will broke when you
493# start a VPATH build or use an absolute $srcdir.
494#
495# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
496# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
497#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
498# and then we would define $MISSING as
499#   MISSING="\${SHELL} $am_aux_dir/missing"
500# This will work as long as MISSING is not called from configure, because
501# unfortunately $(top_srcdir) has no meaning in configure.
502# However there are other variables, like CC, which are often used in
503# configure, and could therefore not use this "fixed" $ac_aux_dir.
504#
505# Another solution, used here, is to always expand $ac_aux_dir to an
506# absolute PATH.  The drawback is that using absolute paths prevent a
507# configured tree to be moved without reconfiguration.
508
509AC_DEFUN([AM_AUX_DIR_EXPAND], [
510# expand $ac_aux_dir to an absolute path
511am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
512])
513
514# AM_PROG_INSTALL_SH
515# ------------------
516# Define $install_sh.
517AC_DEFUN([AM_PROG_INSTALL_SH],
518[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
519install_sh=${install_sh-"$am_aux_dir/install-sh"}
520AC_SUBST(install_sh)])
521
522# One issue with vendor `install' (even GNU) is that you can't
523# specify the program used to strip binaries.  This is especially
524# annoying in cross-compiling environments, where the build's strip
525# is unlikely to handle the host's binaries.
526# Fortunately install-sh will honor a STRIPPROG variable, so we
527# always use install-sh in `make install-strip', and initialize
528# STRIPPROG with the value of the STRIP variable (set by the user).
529AC_DEFUN([AM_PROG_INSTALL_STRIP],
530[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
531INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
532AC_SUBST([INSTALL_STRIP_PROGRAM])])
533
534# serial 4						-*- Autoconf -*-
535
536
537
538# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
539# written in clear, in which case automake, when reading aclocal.m4,
540# will think it sees a *use*, and therefore will trigger all it's
541# C support machinery.  Also note that it means that autoscan, seeing
542# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
543
544
545
546# _AM_DEPENDENCIES(NAME)
547# ---------------------
548# See how the compiler implements dependency checking.
549# NAME is "CC", "CXX" or "OBJC".
550# We try a few techniques and use that to set a single cache variable.
551#
552# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
553# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
554# dependency, and given that the user is not expected to run this macro,
555# just rely on AC_PROG_CC.
556AC_DEFUN([_AM_DEPENDENCIES],
557[AC_REQUIRE([AM_SET_DEPDIR])dnl
558AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
559AC_REQUIRE([AM_MAKE_INCLUDE])dnl
560AC_REQUIRE([AM_DEP_TRACK])dnl
561
562ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
563       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
564       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
565       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
566                   [depcc="$$1"   am_compiler_list=])
567
568AC_CACHE_CHECK([dependency style of $depcc],
569               [am_cv_$1_dependencies_compiler_type],
570[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
571  # We make a subdir and do the tests there.  Otherwise we can end up
572  # making bogus files that we don't know about and never remove.  For
573  # instance it was reported that on HP-UX the gcc test will end up
574  # making a dummy file named `D' -- because `-MD' means `put the output
575  # in D'.
576  mkdir conftest.dir
577  # Copy depcomp to subdir because otherwise we won't find it if we're
578  # using a relative directory.
579  cp "$am_depcomp" conftest.dir
580  cd conftest.dir
581
582  am_cv_$1_dependencies_compiler_type=none
583  if test "$am_compiler_list" = ""; then
584     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
585  fi
586  for depmode in $am_compiler_list; do
587    # We need to recreate these files for each test, as the compiler may
588    # overwrite some of them when testing with obscure command lines.
589    # This happens at least with the AIX C compiler.
590    echo '#include "conftest.h"' > conftest.c
591    echo 'int i;' > conftest.h
592    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
593
594    case $depmode in
595    nosideeffect)
596      # after this tag, mechanisms are not by side-effect, so they'll
597      # only be used when explicitly requested
598      if test "x$enable_dependency_tracking" = xyes; then
599	continue
600      else
601	break
602      fi
603      ;;
604    none) break ;;
605    esac
606    # We check with `-c' and `-o' for the sake of the "dashmstdout"
607    # mode.  It turns out that the SunPro C++ compiler does not properly
608    # handle `-M -o', and we need to detect this.
609    if depmode=$depmode \
610       source=conftest.c object=conftest.o \
611       depfile=conftest.Po tmpdepfile=conftest.TPo \
612       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
613       grep conftest.h conftest.Po > /dev/null 2>&1 &&
614       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
615      am_cv_$1_dependencies_compiler_type=$depmode
616      break
617    fi
618  done
619
620  cd ..
621  rm -rf conftest.dir
622else
623  am_cv_$1_dependencies_compiler_type=none
624fi
625])
626$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
627AC_SUBST([$1DEPMODE])
628])
629
630
631# AM_SET_DEPDIR
632# -------------
633# Choose a directory name for dependency files.
634# This macro is AC_REQUIREd in _AM_DEPENDENCIES
635AC_DEFUN([AM_SET_DEPDIR],
636[rm -f .deps 2>/dev/null
637mkdir .deps 2>/dev/null
638if test -d .deps; then
639  DEPDIR=.deps
640else
641  # MS-DOS does not allow filenames that begin with a dot.
642  DEPDIR=_deps
643fi
644rmdir .deps 2>/dev/null
645AC_SUBST(DEPDIR)
646])
647
648
649# AM_DEP_TRACK
650# ------------
651AC_DEFUN([AM_DEP_TRACK],
652[AC_ARG_ENABLE(dependency-tracking,
653[  --disable-dependency-tracking Speeds up one-time builds
654  --enable-dependency-tracking  Do not reject slow dependency extractors])
655if test "x$enable_dependency_tracking" != xno; then
656  am_depcomp="$ac_aux_dir/depcomp"
657  AMDEPBACKSLASH='\'
658fi
659AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
660pushdef([subst], defn([AC_SUBST]))
661subst(AMDEPBACKSLASH)
662popdef([subst])
663])
664
665# Generate code to set up dependency tracking.
666# This macro should only be invoked once -- use via AC_REQUIRE.
667# Usage:
668# AM_OUTPUT_DEPENDENCY_COMMANDS
669
670#
671# This code is only required when automatic dependency tracking
672# is enabled.  FIXME.  This creates each `.P' file that we will
673# need in order to bootstrap the dependency handling code.
674AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
675AC_OUTPUT_COMMANDS([
676test x"$AMDEP_TRUE" != x"" ||
677for mf in $CONFIG_FILES; do
678  case "$mf" in
679  Makefile) dirpart=.;;
680  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
681  *) continue;;
682  esac
683  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
684  # Extract the definition of DEP_FILES from the Makefile without
685  # running `make'.
686  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687  test -z "$DEPDIR" && continue
688  # When using ansi2knr, U may be empty or an underscore; expand it
689  U=`sed -n -e '/^U = / s///p' < "$mf"`
690  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691  # We invoke sed twice because it is the simplest approach to
692  # changing $(DEPDIR) to its actual value in the expansion.
693  for file in `sed -n -e '
694    /^DEP_FILES = .*\\\\$/ {
695      s/^DEP_FILES = //
696      :loop
697	s/\\\\$//
698	p
699	n
700	/\\\\$/ b loop
701      p
702    }
703    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705    # Make sure the directory exists.
706    test -f "$dirpart/$file" && continue
707    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
708    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
709    # echo "creating $dirpart/$file"
710    echo '# dummy' > "$dirpart/$file"
711  done
712done
713], [AMDEP_TRUE="$AMDEP_TRUE"
714ac_aux_dir="$ac_aux_dir"])])
715
716# AM_MAKE_INCLUDE()
717# -----------------
718# Check to see how make treats includes.
719AC_DEFUN([AM_MAKE_INCLUDE],
720[am_make=${MAKE-make}
721cat > confinc << 'END'
722doit:
723	@echo done
724END
725# If we don't find an include directive, just comment out the code.
726AC_MSG_CHECKING([for style of include used by $am_make])
727am__include='#'
728am__quote=
729_am_result=none
730# First try GNU make style include.
731echo "include confinc" > confmf
732# We grep out `Entering directory' and `Leaving directory'
733# messages which can occur if `w' ends up in MAKEFLAGS.
734# In particular we don't look at `^make:' because GNU make might
735# be invoked under some other name (usually "gmake"), in which
736# case it prints its new name instead of `make'.
737if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
738   am__include=include
739   am__quote=
740   _am_result=GNU
741fi
742# Now try BSD make style include.
743if test "$am__include" = "#"; then
744   echo '.include "confinc"' > confmf
745   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
746      am__include=.include
747      am__quote='"'
748      _am_result=BSD
749   fi
750fi
751AC_SUBST(am__include)
752AC_SUBST(am__quote)
753AC_MSG_RESULT($_am_result)
754rm -f confinc confmf
755])
756
757# serial 3
758
759# AM_CONDITIONAL(NAME, SHELL-CONDITION)
760# -------------------------------------
761# Define a conditional.
762#
763# FIXME: Once using 2.50, use this:
764# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
765AC_DEFUN([AM_CONDITIONAL],
766[ifelse([$1], [TRUE],
767        [errprint(__file__:__line__: [$0: invalid condition: $1
768])dnl
769m4exit(1)])dnl
770ifelse([$1], [FALSE],
771       [errprint(__file__:__line__: [$0: invalid condition: $1
772])dnl
773m4exit(1)])dnl
774AC_SUBST([$1_TRUE])
775AC_SUBST([$1_FALSE])
776if $2; then
777  $1_TRUE=
778  $1_FALSE='#'
779else
780  $1_TRUE='#'
781  $1_FALSE=
782fi])
783
784