]> git.ipfire.org Git - thirdparty/gcc.git/blame - fastjar/aclocal.m4
Merge basic-improvements-branch to trunk
[thirdparty/gcc.git] / fastjar / aclocal.m4
CommitLineData
4977bab6 1dnl aclocal.m4 generated automatically by aclocal 1.4-p5
bd8757b3 2
4977bab6 3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
bd8757b3
APB
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
4977bab6 13sinclude(../config/accross.m4)
9251acb4
TT
14
15dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
16dnl of the usual 2.
17AC_DEFUN(gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG,
18[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
19[AC_TRY_COMPILE([
20#include <sys/types.h>
21#ifdef HAVE_SYS_STAT_H
22# include <sys/stat.h>
23#endif
24#ifdef HAVE_UNISTD_H
25# include <unistd.h>
26#endif
27#ifdef HAVE_DIRECT_H
28# include <direct.h>
29#endif], [mkdir ("foo", 0);],
30 gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
31if test $gcc_cv_mkdir_takes_one_arg = yes ; then
32 AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a
33single argument.])
34fi
35])
36
bd8757b3
APB
37# Do all the work for Automake. This macro actually does too much --
38# some checks are only needed if your package does certain things.
39# But this isn't really a big deal.
40
41# serial 1
42
43dnl Usage:
44dnl AM_INIT_AUTOMAKE(package,version, [no-define])
45
4977bab6 46AC_DEFUN([AM_INIT_AUTOMAKE],
bd8757b3
APB
47[AC_REQUIRE([AC_PROG_INSTALL])
48PACKAGE=[$1]
49AC_SUBST(PACKAGE)
50VERSION=[$2]
51AC_SUBST(VERSION)
52dnl test to see if srcdir already configured
53if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
54 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
55fi
56ifelse([$3],,
57AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
58AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
59AC_REQUIRE([AM_SANITY_CHECK])
60AC_REQUIRE([AC_ARG_PROGRAM])
61dnl FIXME This is truly gross.
62missing_dir=`cd $ac_aux_dir && pwd`
63AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
64AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
65AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
66AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
67AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
68AC_REQUIRE([AC_PROG_MAKE_SET])])
69
70#
71# Check to make sure that the build environment is sane.
72#
73
4977bab6 74AC_DEFUN([AM_SANITY_CHECK],
bd8757b3
APB
75[AC_MSG_CHECKING([whether build environment is sane])
76# Just in case
77sleep 1
78echo timestamp > conftestfile
79# Do `set' in a subshell so we don't clobber the current shell's
80# arguments. Must try -L first in case configure is actually a
81# symlink; some systems play weird games with the mod time of symlinks
82# (eg FreeBSD returns the mod time of the symlink's containing
83# directory).
84if (
85 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
86 if test "[$]*" = "X"; then
87 # -L didn't work.
88 set X `ls -t $srcdir/configure conftestfile`
89 fi
90 if test "[$]*" != "X $srcdir/configure conftestfile" \
91 && test "[$]*" != "X conftestfile $srcdir/configure"; then
92
93 # If neither matched, then we have a broken ls. This can happen
94 # if, for instance, CONFIG_SHELL is bash and it inherits a
95 # broken ls alias from the environment. This has actually
96 # happened. Such a system could not be considered "sane".
97 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
98alias in your environment])
99 fi
100
101 test "[$]2" = conftestfile
102 )
103then
104 # Ok.
105 :
106else
107 AC_MSG_ERROR([newly created file is older than distributed files!
108Check your system clock])
109fi
110rm -f conftest*
111AC_MSG_RESULT(yes)])
112
113dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
114dnl The program must properly implement --version.
4977bab6 115AC_DEFUN([AM_MISSING_PROG],
bd8757b3
APB
116[AC_MSG_CHECKING(for working $2)
117# Run test in a subshell; some versions of sh will print an error if
118# an executable is not found, even if stderr is redirected.
119# Redirect stdin to placate older versions of autoconf. Sigh.
120if ($2 --version) < /dev/null > /dev/null 2>&1; then
121 $1=$2
122 AC_MSG_RESULT(found)
123else
124 $1="$3/missing $2"
125 AC_MSG_RESULT(missing)
126fi
127AC_SUBST($1)])
128
129# Like AC_CONFIG_HEADER, but automatically create stamp file.
130
4977bab6 131AC_DEFUN([AM_CONFIG_HEADER],
bd8757b3
APB
132[AC_PREREQ([2.12])
133AC_CONFIG_HEADER([$1])
134dnl When config.status generates a header, we must update the stamp-h file.
135dnl This file resides in the same directory as the config header
136dnl that is generated. We must strip everything past the first ":",
137dnl and everything past the last "/".
138AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
139ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
140<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
141<<am_indx=1
142for am_file in <<$1>>; do
143 case " <<$>>CONFIG_HEADERS " in
144 *" <<$>>am_file "*<<)>>
145 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
146 ;;
147 esac
148 am_indx=`expr "<<$>>am_indx" + 1`
149done<<>>dnl>>)
150changequote([,]))])
151
7a93476d
TT
152# Add --enable-maintainer-mode option to configure.
153# From Jim Meyering
154
155# serial 1
156
4977bab6 157AC_DEFUN([AM_MAINTAINER_MODE],
7a93476d
TT
158[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
159 dnl maintainer-mode is disabled by default
160 AC_ARG_ENABLE(maintainer-mode,
161[ --enable-maintainer-mode enable make rules and dependencies not useful
162 (and sometimes confusing) to the casual installer],
163 USE_MAINTAINER_MODE=$enableval,
164 USE_MAINTAINER_MODE=no)
165 AC_MSG_RESULT($USE_MAINTAINER_MODE)
166 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
167 MAINT=$MAINTAINER_MODE_TRUE
168 AC_SUBST(MAINT)dnl
169]
170)
171
172# Define a conditional.
173
4977bab6 174AC_DEFUN([AM_CONDITIONAL],
7a93476d
TT
175[AC_SUBST($1_TRUE)
176AC_SUBST($1_FALSE)
177if $2; then
178 $1_TRUE=
179 $1_FALSE='#'
180else
181 $1_TRUE='#'
182 $1_FALSE=
183fi])
184