* Clean.tcl: Add -r to rm, so it gets rid of CVS directories.
[dejagnu.git] / aclocal.m4
blob4884dc2ed32f524d2233d1877a1040d857454e11
1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 AC_DEFUN(DJ_AC_PATH_TCLSH, [
14 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../
15 ../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../..
16 /../../../../../.."
17 no_itcl=true
18 AC_MSG_CHECKING(for the tclsh program)
19 AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory where tcl header
20 s are], with_tclinclude=${withval})
21 AC_CACHE_VAL(ac_cv_path_tclsh,[
22 dnl first check to see if --with-itclinclude was specified
23 if test x"${with_tclinclude}" != x ; then
24   if test -f ${with_tclinclude}/tclsh ; then
25     ac_cv_path_tclsh=`(cd ${with_tclinclude}; pwd)`
26   elif test -f ${with_tclinclude}/src/tclsh ; then
27     ac_cv_path_tclsh=`(cd ${with_tclinclude}/src; pwd)`
28   else
29     AC_MSG_ERROR([${with_tclinclude} directory doesn't contain tclsh])
30   fi
34 dnl next check in private source directory
35 dnl since ls returns lowest version numbers first, reverse its output
36 if test x"${ac_cv_path_tclsh}" = x ; then
37     dnl find the top level Itcl source directory
38     for i in $dirlist; do
39         if test -n "`ls -dr $srcdir/$i/tcl* 2>/dev/null`" ; then
40             tclpath=$srcdir/$i
41             break
42         fi
43     done
45     dnl find the exact Itcl source dir. We do it this way, cause there
46     dnl might be multiple version of Itcl, and we want the most recent one.
47     for i in `ls -dr $tclpath/tcl* 2>/dev/null ` ; do
48         if test -f $i/src/tclsh ; then
49           ac_cv_path_tclsh=`(cd $i/src; pwd)`/tclsh
50           break
51         fi
52     done
55 dnl see if one is installed
56 if test x"${ac_cv_path_tclsh}" = x ; then
57    AC_MSG_RESULT(none)
58    AC_PATH_PROG(tclsh, tclsh)
59 else
60    AC_MSG_RESULT(${ac_cv_path_tclsh})
62 TCLSH="${ac_cv_path_tclsh}"
63 AC_SUBST(TCLSH)
67 AC_DEFUN(DJ_AC_PATH_DOCBOOK, [
68 dirlist=".. ../../ ../../.. ../../../.. ../../../../.. ../../../../../.. ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
69 AC_MSG_CHECKING(for docbook tools)
70 AC_ARG_WITH(oskith, [  --with-docbook       directory where the db2 sgml tools are], with_docbook=${withval})
71 AC_CACHE_VAL(ac_cv_c_docbook,[
72 dnl first check to see if --with-docbook was specified
73 if test x"${with_docbook}" != x ; then
74   if test -f ${with_docbook}/db2html ; then
75     ac_cv_c_docbook=`(cd ${with_docbook}; pwd)`
76   else
77     AC_MSG_ERROR([${with_docbook} directory doesn't contain SGML tools])
78   fi
81 if test x"${ac_cv_c_docbook}" = x ; then
82     for i in $ac_default_prefix/bin /usr/local/bin $OSKITHDIR/../bin /usr/bin /bin /opt /home; do
83         dnl See is we have an SGML tool in that directory.
84         if test -f $i/db2html ; then
85             ac_cv_c_docbook=$i
86             break
87         fi
88     done
91 if test x"${ac_cv_c_docbook}" = x ; then
92     AC_MSG_RESULT(none)
93 else
94     DOCBOOK="${ac_cv_c_docbook}"
95     AC_MSG_RESULT(${ac_cv_c_docbook})
98 AC_SUBST(DOCBOOK)
101 # Do all the work for Automake.  This macro actually does too much --
102 # some checks are only needed if your package does certain things.
103 # But this isn't really a big deal.
105 # serial 1
107 dnl Usage:
108 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
110 AC_DEFUN(AM_INIT_AUTOMAKE,
111 [AC_REQUIRE([AC_PROG_INSTALL])
112 PACKAGE=[$1]
113 AC_SUBST(PACKAGE)
114 VERSION=[$2]
115 AC_SUBST(VERSION)
116 dnl test to see if srcdir already configured
117 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
118   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
120 ifelse([$3],,
121 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
122 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
123 AC_REQUIRE([AM_SANITY_CHECK])
124 AC_REQUIRE([AC_ARG_PROGRAM])
125 dnl FIXME This is truly gross.
126 missing_dir=`cd $ac_aux_dir && pwd`
127 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
128 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
129 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
130 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
131 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
132 AC_REQUIRE([AC_PROG_MAKE_SET])])
135 # Check to make sure that the build environment is sane.
138 AC_DEFUN(AM_SANITY_CHECK,
139 [AC_MSG_CHECKING([whether build environment is sane])
140 # Just in case
141 sleep 1
142 echo timestamp > conftestfile
143 # Do `set' in a subshell so we don't clobber the current shell's
144 # arguments.  Must try -L first in case configure is actually a
145 # symlink; some systems play weird games with the mod time of symlinks
146 # (eg FreeBSD returns the mod time of the symlink's containing
147 # directory).
148 if (
149    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
150    if test "[$]*" = "X"; then
151       # -L didn't work.
152       set X `ls -t $srcdir/configure conftestfile`
153    fi
154    if test "[$]*" != "X $srcdir/configure conftestfile" \
155       && test "[$]*" != "X conftestfile $srcdir/configure"; then
157       # If neither matched, then we have a broken ls.  This can happen
158       # if, for instance, CONFIG_SHELL is bash and it inherits a
159       # broken ls alias from the environment.  This has actually
160       # happened.  Such a system could not be considered "sane".
161       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
162 alias in your environment])
163    fi
165    test "[$]2" = conftestfile
166    )
167 then
168    # Ok.
169    :
170 else
171    AC_MSG_ERROR([newly created file is older than distributed files!
172 Check your system clock])
174 rm -f conftest*
175 AC_MSG_RESULT(yes)])
177 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
178 dnl The program must properly implement --version.
179 AC_DEFUN(AM_MISSING_PROG,
180 [AC_MSG_CHECKING(for working $2)
181 # Run test in a subshell; some versions of sh will print an error if
182 # an executable is not found, even if stderr is redirected.
183 # Redirect stdin to placate older versions of autoconf.  Sigh.
184 if ($2 --version) < /dev/null > /dev/null 2>&1; then
185    $1=$2
186    AC_MSG_RESULT(found)
187 else
188    $1="$3/missing $2"
189    AC_MSG_RESULT(missing)
191 AC_SUBST($1)])
193 # Add --enable-maintainer-mode option to configure.
194 # From Jim Meyering
196 # serial 1
198 AC_DEFUN(AM_MAINTAINER_MODE,
199 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
200   dnl maintainer-mode is disabled by default
201   AC_ARG_ENABLE(maintainer-mode,
202 [  --enable-maintainer-mode enable make rules and dependencies not useful
203                           (and sometimes confusing) to the casual installer],
204       USE_MAINTAINER_MODE=$enableval,
205       USE_MAINTAINER_MODE=no)
206   AC_MSG_RESULT($USE_MAINTAINER_MODE)
207   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
208   MAINT=$MAINTAINER_MODE_TRUE
209   AC_SUBST(MAINT)dnl
213 # Define a conditional.
215 AC_DEFUN(AM_CONDITIONAL,
216 [AC_SUBST($1_TRUE)
217 AC_SUBST($1_FALSE)
218 if $2; then
219   $1_TRUE=
220   $1_FALSE='#'
221 else
222   $1_TRUE='#'
223   $1_FALSE=
224 fi])