]> sourceware.org Git - newlib-cygwin.git/blame - newlib/acinclude.m4
2004-01-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
[newlib-cygwin.git] / newlib / acinclude.m4
CommitLineData
8a0efa53
CF
1dnl This provides configure definitions used by all the newlib
2dnl configure.in files.
3
4dnl Basic newlib configury. This calls basic introductory stuff,
5dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
6dnl configure.host. The only argument is the relative path to the top
7dnl newlib directory.
8
9AC_DEFUN(NEWLIB_CONFIGURE,
10[
11dnl Default to --enable-multilib
12AC_ARG_ENABLE(multilib,
13[ --enable-multilib build many library versions (default)],
14[case "${enableval}" in
15 yes) multilib=yes ;;
16 no) multilib=no ;;
17 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
18 esac], [multilib=yes])dnl
19
20dnl Support --enable-target-optspace
21AC_ARG_ENABLE(target-optspace,
22[ --enable-target-optspace optimize for space],
23[case "${enableval}" in
24 yes) target_optspace=yes ;;
25 no) target_optspace=no ;;
26 *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
27 esac], [target_optspace=])dnl
28
3ac6f3a7
JJ
29dnl Support --enable-malloc-debugging - currently only supported for Cygwin
30AC_ARG_ENABLE(malloc-debugging,
31[ --enable-malloc-debugging indicate malloc debugging requested],
32[case "${enableval}" in
33 yes) malloc_debugging=yes ;;
34 no) malloc_debugging=no ;;
35 *) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
36 esac], [malloc_debugging=])dnl
37
8a0efa53
CF
38dnl Support --enable-newlib-mb
39AC_ARG_ENABLE(newlib-mb,
40[ --enable-newlib-mb enable multibyte support],
41[case "${enableval}" in
42 yes) newlib_mb=yes ;;
43 no) newlib_mb=no ;;
44 *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
a8615092 45 esac], [newlib_mb=])dnl
8a0efa53 46
786ab12c
JJ
47dnl Support --enable-newlib-iconv
48AC_ARG_ENABLE(newlib-iconv,
49[ --enable-newlib-iconv enable iconv library support],
50[case "${enableval}" in
51 yes) newlib_iconv=yes ;;
52 no) newlib_iconv=no ;;
53 *) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv option) ;;
54 esac], [newlib_iconv=])dnl
55
56dnl Support --enable-newlib-builtin-converters
57AC_ARG_ENABLE(newlib-builtin-converters,
58[ --enable-newlib-builtin-converters enable specific comma-separated list of iconv converters to be built-in],
59[if test x${enableval} = x; then
60 AC_MSG_ERROR(bad value ${enableval} for newlib-builtin-converters option - use comma-separated list)
61 fi
62 builtin_converters=${enableval}
63 ], [builtin_converters=])dnl
64
0c048a9a
TF
65dnl Support --enable-newlib-multithread
66AC_ARG_ENABLE(newlib-multithread,
67[ --enable-newlib-multithread enable support for multiple threads],
68[case "${enableval}" in
69 yes) newlib_multithread=yes ;;
70 no) newlib_multithread=no ;;
71 *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
72 esac], [newlib_multithread=yes])dnl
73
90b65e2d
JJ
74dnl Support --enable-newlib-elix-level
75AC_ARG_ENABLE(newlib-elix-level,
76[ --enable-newlib-elix-level supply desired elix library level (1-4)],
77[case "${enableval}" in
78 0) newlib_elix_level=0 ;;
79 1) newlib_elix_level=1 ;;
80 2) newlib_elix_level=2 ;;
81 3) newlib_elix_level=3 ;;
82 4) newlib_elix_level=4 ;;
83 *) AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;;
84 esac], [newlib_elix_level=0])dnl
85
afecf2fa
JJ
86dnl Support --disable-newlib-io-float
87AC_ARG_ENABLE(newlib-io-float,
88[ --disable-newlib-io-float disable printf/scanf family float support],
89[case "${enableval}" in
90 yes) newlib_io_float=yes ;;
91 no) newlib_io_float=no ;;
92 *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
93 esac], [newlib_io_float=yes])dnl
94
313f1349
JJ
95dnl Support --disable-newlib-supplied-syscalls
96AC_ARG_ENABLE(newlib-supplied-syscalls,
97[ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
98[case "${enableval}" in
99 yes) newlib_may_supply_syscalls=yes ;;
100 no) newlib_may_supply_syscalls=no ;;
101 *) AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
102 esac], [newlib_may_supply_syscalls=yes])dnl
103
104AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes)
afecf2fa 105
8a0efa53
CF
106dnl We may get other options which we don't document:
107dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
108
109test -z "[$]{with_target_subdir}" && with_target_subdir=.
110
111if test "[$]{srcdir}" = "."; then
112 if test "[$]{with_target_subdir}" != "."; then
113 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
114 else
115 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
116 fi
117else
118 newlib_basedir="[$]{srcdir}/$1"
119fi
120AC_SUBST(newlib_basedir)
121
eaa75b70 122AC_CANONICAL_SYSTEM
8a0efa53 123
60b0838f 124AM_INIT_AUTOMAKE(newlib, 1.11.0)
8a0efa53
CF
125
126# FIXME: We temporarily define our own version of AC_PROG_CC. This is
127# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
128# are probably using a cross compiler, which will not be able to fully
129# link an executable. This should really be fixed in autoconf
130# itself.
131
132AC_DEFUN(LIB_AC_PROG_CC,
133[AC_BEFORE([$0], [AC_PROG_CPP])dnl
134AC_CHECK_PROG(CC, gcc, gcc)
135if test -z "$CC"; then
136 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
137 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
138fi
139
140AC_PROG_CC_GNU
141
142if test $ac_cv_prog_gcc = yes; then
143 GCC=yes
144dnl Check whether -g works, even if CFLAGS is set, in case the package
145dnl plays around with CFLAGS (such as to build both debugging and
146dnl normal versions of a library), tasteless as that idea is.
147 ac_test_CFLAGS="${CFLAGS+set}"
148 ac_save_CFLAGS="$CFLAGS"
149 CFLAGS=
150 AC_PROG_CC_G
151 if test "$ac_test_CFLAGS" = set; then
152 CFLAGS="$ac_save_CFLAGS"
153 elif test $ac_cv_prog_cc_g = yes; then
154 CFLAGS="-g -O2"
155 else
156 CFLAGS="-O2"
157 fi
158else
159 GCC=
160 test "${CFLAGS+set}" = set || CFLAGS="-g"
161fi
162])
163
164LIB_AC_PROG_CC
165
8a0efa53
CF
166AC_CHECK_TOOL(AS, as)
167AC_CHECK_TOOL(AR, ar)
168AC_CHECK_TOOL(RANLIB, ranlib, :)
169
170AC_PROG_INSTALL
171
172AM_MAINTAINER_MODE
173
174# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
175# at least currently, we never actually build a program, so we never
176# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
177# fails, because we are probably configuring with a cross compiler
178# which can't create executables. So we include AC_EXEEXT to keep
179# automake happy, but we don't execute it, since we don't care about
180# the result.
181if false; then
182 AC_EXEEXT
183fi
184
185. [$]{newlib_basedir}/configure.host
186
8a0efa53
CF
187newlib_cflags="[$]{newlib_cflags} -fno-builtin"
188
189NEWLIB_CFLAGS=${newlib_cflags}
190AC_SUBST(NEWLIB_CFLAGS)
191
2e1a7175
TF
192LDFLAGS=${ldflags}
193AC_SUBST(LDFLAGS)
194
90b65e2d
JJ
195AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0)
196AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1)
197AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2)
198AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3)
199AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4)
200
2e1a7175 201AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
0953fe64
TF
202
203# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
204# use oext, which is set in configure.host based on the target platform.
205OBJEXT=${oext}
206
207AC_SUBST(OBJEXT)
2e1a7175
TF
208AC_SUBST(oext)
209AC_SUBST(aext)
210
211AC_SUBST(libm_machine_dir)
8a0efa53
CF
212AC_SUBST(machine_dir)
213AC_SUBST(sys_dir)
214])
This page took 0.105381 seconds and 5 git commands to generate.