OSDN Git Service

2002-09-10 Frank Ch. Eigler <fche@redhat.com>
[pf3gnuchains/gcc-fork.git] / fastjar / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
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.
7
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.
12
13
14 dnl Host type sizes probe.
15 dnl By Kaveh R. Ghazi.  One typo fixed since.
16 dnl
17 AC_DEFUN([gcc_AC_COMPILE_CHECK_SIZEOF],
18 [changequote(<<, >>)dnl
19 dnl The name to #define.
20 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
21 dnl The cache variable name.
22 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
23 changequote([, ])dnl
24 AC_MSG_CHECKING(size of $1)
25 AC_CACHE_VAL(AC_CV_NAME,
26 [for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence.
27   AC_TRY_COMPILE([#include "confdefs.h"
28 #include <sys/types.h>
29 $2
30 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
31   if test x$AC_CV_NAME != x ; then break; fi
32 done
33 ])
34 if test x$AC_CV_NAME = x ; then
35   AC_MSG_ERROR([cannot determine a size for $1])
36 fi
37 AC_MSG_RESULT($AC_CV_NAME)
38 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
39 undefine([AC_TYPE_NAME])dnl
40 undefine([AC_CV_NAME])dnl
41 ])
42
43 dnl Utility macro used by next two tests.
44 dnl AC_EXAMINE_OBJECT(C source code,
45 dnl     commands examining object file,
46 dnl     [commands to run if compile failed]):
47 dnl
48 dnl Compile the source code to an object file; then convert it into a
49 dnl printable representation.  All unprintable characters and
50 dnl asterisks (*) are replaced by dots (.).  All white space is
51 dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
52 dnl output, but runs of newlines are compressed to a single newline.
53 dnl Finally, line breaks are forcibly inserted so that no line is
54 dnl longer than 80 columns and the file ends with a newline.  The
55 dnl result of all this processing is in the file conftest.dmp, which
56 dnl may be examined by the commands in the second argument.
57 dnl
58 AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
59 [AC_LANG_SAVE
60 AC_LANG_C
61 dnl Next bit cribbed from AC_TRY_COMPILE.
62 cat > conftest.$ac_ext <<EOF
63 [#line __oline__ "configure"
64 #include "confdefs.h"
65 $1
66 ]EOF
67 if AC_TRY_EVAL(ac_compile); then
68   od -c conftest.o |
69     sed ['s/^[0-7]*[    ]*/ /
70           s/\*/./g
71           s/ \\n/*/g
72           s/ [0-9][0-9][0-9]/./g
73           s/  \\[^ ]/./g'] |
74     tr -d '
75  ' | tr -s '*' '
76 ' | fold | sed '$a\
77 ' > conftest.dmp
78   $2
79 ifelse($3, , , else
80   $3
81 )dnl
82 fi
83 rm -rf conftest*
84 AC_LANG_RESTORE])
85
86 dnl Host endianness probe.
87 dnl Differs from AC_C_BIGENDIAN in that it does not require
88 dnl running a program on the host.
89 dnl
90 AC_DEFUN([fastjar_AC_COMPILE_C_BIGENDIAN],
91 [AC_CACHE_CHECK(byte ordering, ac_cv_c_compile_endian,
92 [ac_cv_c_compile_endian=unknown
93 gcc_AC_EXAMINE_OBJECT([
94 #ifdef HAVE_LIMITS_H
95 # include <limits.h>
96 #endif
97 /* This structure must have no internal padding.  */
98   struct {
99     char prefix[sizeof "\nendian:" - 1];
100     short word;
101     char postfix[2];
102  } tester = {
103     "\nendian:",
104 #if SIZEOF_SHORT == 4
105     ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
106 #endif
107     ('A' << CHAR_BIT) | 'B',
108     'X', '\n'
109 };],
110  [if   grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
111     ac_cv_c_compile_endian=big-endian
112   elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
113     ac_cv_c_compile_endian=little-endian
114   fi])
115 ])
116 if test $ac_cv_c_compile_endian = unknown; then
117   AC_MSG_ERROR([*** unable to determine endianness])
118 elif test $ac_cv_c_compile_endian = big-endian; then
119   AC_DEFINE(WORDS_BIG_ENDIAN, 1,
120   [Define if the host machine stores words of multi-word integers in
121    big-endian order.])
122 fi
123 ])
124
125 dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
126 dnl of the usual 2.
127 AC_DEFUN(gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG,
128 [AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
129 [AC_TRY_COMPILE([
130 #include <sys/types.h>
131 #ifdef HAVE_SYS_STAT_H
132 # include <sys/stat.h>
133 #endif
134 #ifdef HAVE_UNISTD_H
135 # include <unistd.h>
136 #endif
137 #ifdef HAVE_DIRECT_H
138 # include <direct.h>
139 #endif], [mkdir ("foo", 0);],
140          gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
141 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
142    AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a
143 single argument.])
144 fi
145 ])
146
147 # Do all the work for Automake.  This macro actually does too much --
148 # some checks are only needed if your package does certain things.
149 # But this isn't really a big deal.
150
151 # serial 1
152
153 dnl Usage:
154 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
155
156 AC_DEFUN(AM_INIT_AUTOMAKE,
157 [AC_REQUIRE([AC_PROG_INSTALL])
158 PACKAGE=[$1]
159 AC_SUBST(PACKAGE)
160 VERSION=[$2]
161 AC_SUBST(VERSION)
162 dnl test to see if srcdir already configured
163 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
164   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
165 fi
166 ifelse([$3],,
167 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
168 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
169 AC_REQUIRE([AM_SANITY_CHECK])
170 AC_REQUIRE([AC_ARG_PROGRAM])
171 dnl FIXME This is truly gross.
172 missing_dir=`cd $ac_aux_dir && pwd`
173 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
174 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
175 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
176 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
177 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
178 AC_REQUIRE([AC_PROG_MAKE_SET])])
179
180 #
181 # Check to make sure that the build environment is sane.
182 #
183
184 AC_DEFUN(AM_SANITY_CHECK,
185 [AC_MSG_CHECKING([whether build environment is sane])
186 # Just in case
187 sleep 1
188 echo timestamp > conftestfile
189 # Do `set' in a subshell so we don't clobber the current shell's
190 # arguments.  Must try -L first in case configure is actually a
191 # symlink; some systems play weird games with the mod time of symlinks
192 # (eg FreeBSD returns the mod time of the symlink's containing
193 # directory).
194 if (
195    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
196    if test "[$]*" = "X"; then
197       # -L didn't work.
198       set X `ls -t $srcdir/configure conftestfile`
199    fi
200    if test "[$]*" != "X $srcdir/configure conftestfile" \
201       && test "[$]*" != "X conftestfile $srcdir/configure"; then
202
203       # If neither matched, then we have a broken ls.  This can happen
204       # if, for instance, CONFIG_SHELL is bash and it inherits a
205       # broken ls alias from the environment.  This has actually
206       # happened.  Such a system could not be considered "sane".
207       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
208 alias in your environment])
209    fi
210
211    test "[$]2" = conftestfile
212    )
213 then
214    # Ok.
215    :
216 else
217    AC_MSG_ERROR([newly created file is older than distributed files!
218 Check your system clock])
219 fi
220 rm -f conftest*
221 AC_MSG_RESULT(yes)])
222
223 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
224 dnl The program must properly implement --version.
225 AC_DEFUN(AM_MISSING_PROG,
226 [AC_MSG_CHECKING(for working $2)
227 # Run test in a subshell; some versions of sh will print an error if
228 # an executable is not found, even if stderr is redirected.
229 # Redirect stdin to placate older versions of autoconf.  Sigh.
230 if ($2 --version) < /dev/null > /dev/null 2>&1; then
231    $1=$2
232    AC_MSG_RESULT(found)
233 else
234    $1="$3/missing $2"
235    AC_MSG_RESULT(missing)
236 fi
237 AC_SUBST($1)])
238
239 # Like AC_CONFIG_HEADER, but automatically create stamp file.
240
241 AC_DEFUN(AM_CONFIG_HEADER,
242 [AC_PREREQ([2.12])
243 AC_CONFIG_HEADER([$1])
244 dnl When config.status generates a header, we must update the stamp-h file.
245 dnl This file resides in the same directory as the config header
246 dnl that is generated.  We must strip everything past the first ":",
247 dnl and everything past the last "/".
248 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
249 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
250 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
251 <<am_indx=1
252 for am_file in <<$1>>; do
253   case " <<$>>CONFIG_HEADERS " in
254   *" <<$>>am_file "*<<)>>
255     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
256     ;;
257   esac
258   am_indx=`expr "<<$>>am_indx" + 1`
259 done<<>>dnl>>)
260 changequote([,]))])
261
262 # Add --enable-maintainer-mode option to configure.
263 # From Jim Meyering
264
265 # serial 1
266
267 AC_DEFUN(AM_MAINTAINER_MODE,
268 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
269   dnl maintainer-mode is disabled by default
270   AC_ARG_ENABLE(maintainer-mode,
271 [  --enable-maintainer-mode enable make rules and dependencies not useful
272                           (and sometimes confusing) to the casual installer],
273       USE_MAINTAINER_MODE=$enableval,
274       USE_MAINTAINER_MODE=no)
275   AC_MSG_RESULT($USE_MAINTAINER_MODE)
276   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
277   MAINT=$MAINTAINER_MODE_TRUE
278   AC_SUBST(MAINT)dnl
279 ]
280 )
281
282 # Define a conditional.
283
284 AC_DEFUN(AM_CONDITIONAL,
285 [AC_SUBST($1_TRUE)
286 AC_SUBST($1_FALSE)
287 if $2; then
288   $1_TRUE=
289   $1_FALSE='#'
290 else
291   $1_TRUE='#'
292   $1_FALSE=
293 fi])
294