]>
Commit | Line | Data |
---|---|---|
2efbc2a7 JJ |
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 | dnl This provides configure definitions used by all the newlib | |
14 | dnl configure.in files. | |
15 | ||
16 | dnl Basic newlib configury. This calls basic introductory stuff, | |
17 | dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs | |
18 | dnl configure.host. The only argument is the relative path to the top | |
19 | dnl newlib directory. | |
20 | ||
21 | AC_DEFUN(NEWLIB_CONFIGURE, | |
22 | [ | |
23 | dnl Default to --enable-multilib | |
24 | AC_ARG_ENABLE(multilib, | |
25 | [ --enable-multilib build many library versions (default)], | |
26 | [case "${enableval}" in | |
27 | yes) multilib=yes ;; | |
28 | no) multilib=no ;; | |
29 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; | |
30 | esac], [multilib=yes])dnl | |
31 | ||
32 | dnl Support --enable-target-optspace | |
33 | AC_ARG_ENABLE(target-optspace, | |
34 | [ --enable-target-optspace optimize for space], | |
35 | [case "${enableval}" in | |
36 | yes) target_optspace=yes ;; | |
37 | no) target_optspace=no ;; | |
38 | *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; | |
39 | esac], [target_optspace=])dnl | |
40 | ||
41 | dnl Support --enable-newlib-mb | |
42 | AC_ARG_ENABLE(newlib-mb, | |
43 | [ --enable-newlib-mb enable multibyte support], | |
44 | [case "${enableval}" in | |
45 | yes) newlib_mb=yes ;; | |
46 | no) newlib_mb=no ;; | |
47 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; | |
48 | esac], [newlib_mb=no])dnl | |
49 | ||
50 | dnl We may get other options which we don't document: | |
51 | dnl --with-target-subdir, --with-multisrctop, --with-multisubdir | |
52 | ||
53 | test -z "[$]{with_target_subdir}" && with_target_subdir=. | |
54 | ||
55 | if test "[$]{srcdir}" = "."; then | |
56 | if test "[$]{with_target_subdir}" != "."; then | |
57 | newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" | |
58 | else | |
59 | newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" | |
60 | fi | |
61 | else | |
62 | newlib_basedir="[$]{srcdir}/$1" | |
63 | fi | |
64 | AC_SUBST(newlib_basedir) | |
65 | ||
66 | AC_CANONICAL_HOST | |
67 | ||
68 | AM_INIT_AUTOMAKE(newlib, 1.8.2) | |
69 | ||
70 | # FIXME: We temporarily define our own version of AC_PROG_CC. This is | |
71 | # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We | |
72 | # are probably using a cross compiler, which will not be able to fully | |
73 | # link an executable. This should really be fixed in autoconf | |
74 | # itself. | |
75 | ||
76 | AC_DEFUN(LIB_AC_PROG_CC, | |
77 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
78 | AC_CHECK_PROG(CC, gcc, gcc) | |
79 | if test -z "$CC"; then | |
80 | AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) | |
81 | test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) | |
82 | fi | |
83 | ||
84 | AC_PROG_CC_GNU | |
85 | ||
86 | if test $ac_cv_prog_gcc = yes; then | |
87 | GCC=yes | |
88 | dnl Check whether -g works, even if CFLAGS is set, in case the package | |
89 | dnl plays around with CFLAGS (such as to build both debugging and | |
90 | dnl normal versions of a library), tasteless as that idea is. | |
91 | ac_test_CFLAGS="${CFLAGS+set}" | |
92 | ac_save_CFLAGS="$CFLAGS" | |
93 | CFLAGS= | |
94 | AC_PROG_CC_G | |
95 | if test "$ac_test_CFLAGS" = set; then | |
96 | CFLAGS="$ac_save_CFLAGS" | |
97 | elif test $ac_cv_prog_cc_g = yes; then | |
98 | CFLAGS="-g -O2" | |
99 | else | |
100 | CFLAGS="-O2" | |
101 | fi | |
102 | else | |
103 | GCC= | |
104 | test "${CFLAGS+set}" = set || CFLAGS="-g" | |
105 | fi | |
106 | ]) | |
107 | ||
108 | LIB_AC_PROG_CC | |
109 | ||
110 | # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't | |
111 | # run it explicitly here, it will be run implicitly before | |
112 | # NEWLIB_CONFIGURE, which doesn't work because that means that it will | |
113 | # be run before AC_CANONICAL_HOST. | |
114 | AC_CANONICAL_BUILD | |
115 | ||
116 | AC_CHECK_TOOL(AS, as) | |
117 | AC_CHECK_TOOL(AR, ar) | |
118 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
119 | ||
120 | AC_PROG_INSTALL | |
121 | ||
122 | AM_MAINTAINER_MODE | |
123 | ||
124 | # We need AC_EXEEXT to keep automake happy in cygnus mode. However, | |
125 | # at least currently, we never actually build a program, so we never | |
126 | # need to use $(EXEEXT). Moreover, the test for EXEEXT normally | |
127 | # fails, because we are probably configuring with a cross compiler | |
128 | # which can't create executables. So we include AC_EXEEXT to keep | |
129 | # automake happy, but we don't execute it, since we don't care about | |
130 | # the result. | |
131 | if false; then | |
132 | AC_EXEEXT | |
133 | fi | |
134 | ||
135 | . [$]{newlib_basedir}/configure.host | |
136 | ||
137 | case [$]{newlib_basedir} in | |
138 | /* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; | |
139 | *) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; | |
140 | esac | |
141 | ||
142 | newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" | |
143 | case "${host}" in | |
144 | *-*-cygwin*) | |
145 | newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" | |
146 | ;; | |
147 | esac | |
148 | ||
149 | newlib_cflags="[$]{newlib_cflags} -fno-builtin" | |
150 | ||
151 | NEWLIB_CFLAGS=${newlib_cflags} | |
152 | AC_SUBST(NEWLIB_CFLAGS) | |
153 | ||
154 | AC_SUBST(machine_dir) | |
155 | AC_SUBST(sys_dir) | |
156 | ]) | |
157 | ||
158 | # Do all the work for Automake. This macro actually does too much -- | |
159 | # some checks are only needed if your package does certain things. | |
160 | # But this isn't really a big deal. | |
161 | ||
162 | # serial 1 | |
163 | ||
164 | dnl Usage: | |
165 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
166 | ||
167 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
168 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
169 | PACKAGE=[$1] | |
170 | AC_SUBST(PACKAGE) | |
171 | VERSION=[$2] | |
172 | AC_SUBST(VERSION) | |
173 | dnl test to see if srcdir already configured | |
174 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
175 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
176 | fi | |
177 | ifelse([$3],, | |
178 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
179 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) | |
180 | AC_REQUIRE([AM_SANITY_CHECK]) | |
181 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
182 | dnl FIXME This is truly gross. | |
183 | missing_dir=`cd $ac_aux_dir && pwd` | |
184 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
185 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
186 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
187 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
188 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
189 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
190 | ||
191 | # | |
192 | # Check to make sure that the build environment is sane. | |
193 | # | |
194 | ||
195 | AC_DEFUN(AM_SANITY_CHECK, | |
196 | [AC_MSG_CHECKING([whether build environment is sane]) | |
197 | # Just in case | |
198 | sleep 1 | |
199 | echo timestamp > conftestfile | |
200 | # Do `set' in a subshell so we don't clobber the current shell's | |
201 | # arguments. Must try -L first in case configure is actually a | |
202 | # symlink; some systems play weird games with the mod time of symlinks | |
203 | # (eg FreeBSD returns the mod time of the symlink's containing | |
204 | # directory). | |
205 | if ( | |
206 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
207 | if test "[$]*" = "X"; then | |
208 | # -L didn't work. | |
209 | set X `ls -t $srcdir/configure conftestfile` | |
210 | fi | |
211 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
212 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
213 | ||
214 | # If neither matched, then we have a broken ls. This can happen | |
215 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
216 | # broken ls alias from the environment. This has actually | |
217 | # happened. Such a system could not be considered "sane". | |
218 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
219 | alias in your environment]) | |
220 | fi | |
221 | ||
222 | test "[$]2" = conftestfile | |
223 | ) | |
224 | then | |
225 | # Ok. | |
226 | : | |
227 | else | |
228 | AC_MSG_ERROR([newly created file is older than distributed files! | |
229 | Check your system clock]) | |
230 | fi | |
231 | rm -f conftest* | |
232 | AC_MSG_RESULT(yes)]) | |
233 | ||
234 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
235 | dnl The program must properly implement --version. | |
236 | AC_DEFUN(AM_MISSING_PROG, | |
237 | [AC_MSG_CHECKING(for working $2) | |
238 | # Run test in a subshell; some versions of sh will print an error if | |
239 | # an executable is not found, even if stderr is redirected. | |
240 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
241 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
242 | $1=$2 | |
243 | AC_MSG_RESULT(found) | |
244 | else | |
245 | $1="$3/missing $2" | |
246 | AC_MSG_RESULT(missing) | |
247 | fi | |
248 | AC_SUBST($1)]) | |
249 | ||
250 | # Add --enable-maintainer-mode option to configure. | |
251 | # From Jim Meyering | |
252 | ||
253 | # serial 1 | |
254 | ||
255 | AC_DEFUN(AM_MAINTAINER_MODE, | |
256 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
257 | dnl maintainer-mode is disabled by default | |
258 | AC_ARG_ENABLE(maintainer-mode, | |
259 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
260 | (and sometimes confusing) to the casual installer], | |
261 | USE_MAINTAINER_MODE=$enableval, | |
262 | USE_MAINTAINER_MODE=no) | |
263 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
264 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) | |
265 | MAINT=$MAINTAINER_MODE_TRUE | |
266 | AC_SUBST(MAINT)dnl | |
267 | ] | |
268 | ) | |
269 | ||
270 | # Define a conditional. | |
271 | ||
272 | AC_DEFUN(AM_CONDITIONAL, | |
273 | [AC_SUBST($1_TRUE) | |
274 | AC_SUBST($1_FALSE) | |
275 | if $2; then | |
276 | $1_TRUE= | |
277 | $1_FALSE='#' | |
278 | else | |
279 | $1_TRUE='#' | |
280 | $1_FALSE= | |
281 | fi]) | |
282 |