1 | dnl This is the newlib/libc configure.in file. |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_PREREQ(2.59) |
---|
5 | AC_INIT([newlib],[NEWLIB_VERSION]) |
---|
6 | AC_CONFIG_SRCDIR([sys.tex]) |
---|
7 | |
---|
8 | dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. |
---|
9 | AC_CONFIG_AUX_DIR(../..) |
---|
10 | |
---|
11 | dnl Support --enable-newlib-io-pos-args used by libc/stdio |
---|
12 | AC_ARG_ENABLE(newlib-io-pos-args, |
---|
13 | [ --enable-newlib-io-pos-args enable printf-family positional arg support], |
---|
14 | [case "${enableval}" in |
---|
15 | yes) newlib_io_pos_args=yes ;; |
---|
16 | no) newlib_io_pos_args=no ;; |
---|
17 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-pos-args option) ;; |
---|
18 | esac], [newlib_io_pos_args=no])dnl |
---|
19 | |
---|
20 | dnl Support --enable-newlib-nano-malloc used by libc/stdlib |
---|
21 | AC_ARG_ENABLE(newlib_nano_malloc, |
---|
22 | [ --enable-newlib-nano-malloc Use small-footprint nano-malloc implementation], |
---|
23 | [case "${enableval}" in |
---|
24 | yes) newlib_nano_malloc=yes ;; |
---|
25 | no) newlib_nano_malloc=no ;; |
---|
26 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-malloc) ;; |
---|
27 | esac],[newlib_nano_malloc=]) |
---|
28 | |
---|
29 | dnl Support --enable-newlib-nano-formatted-io used by libc/stdio |
---|
30 | AC_ARG_ENABLE(newlib_nano_formatted_io, |
---|
31 | [ --enable-newlib-nano-formatted-io Use small-footprint nano-formatted-IO implementation], |
---|
32 | [case "${enableval}" in |
---|
33 | yes) newlib_nano_formatted_io=yes ;; |
---|
34 | no) newlib_nano_formatted_io=no ;; |
---|
35 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-formatted-io) ;; |
---|
36 | esac],[newlib_nano_formatted_io=no]) |
---|
37 | AM_CONDITIONAL(NEWLIB_NANO_FORMATTED_IO, test x$newlib_nano_formatted_io = xyes) |
---|
38 | |
---|
39 | dnl Support --enable-retargetable-locking used by libc/sys |
---|
40 | AC_ARG_ENABLE(newlib-retargetable-locking, |
---|
41 | [ --enable-newlib-retargetable-locking Allow locking routines to be retargeted at link time], |
---|
42 | [case "${enableval}" in |
---|
43 | yes) newlib_retargetable_locking=yes ;; |
---|
44 | no) newlib_retargetable_lock=no ;; |
---|
45 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-retargetable-locking) ;; |
---|
46 | esac],[newlib_retargetable_locking=no]) |
---|
47 | AM_CONDITIONAL(NEWLIB_RETARGETABLE_LOCKING, test x$newlib_retargetable_locking = xyes) |
---|
48 | |
---|
49 | NEWLIB_CONFIGURE(..) |
---|
50 | |
---|
51 | AM_CONDITIONAL(NEWLIB_NANO_MALLOC, test x$newlib_nano_malloc = xyes) |
---|
52 | |
---|
53 | dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and |
---|
54 | dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first |
---|
55 | dnl line of the macro which fail because appropriate LDFLAGS are not set. |
---|
56 | _LT_DECL_SED |
---|
57 | _LT_PROG_ECHO_BACKSLASH |
---|
58 | if test "${use_libtool}" = "yes"; then |
---|
59 | AC_LIBTOOL_WIN32_DLL |
---|
60 | AM_PROG_LIBTOOL |
---|
61 | fi |
---|
62 | |
---|
63 | AC_CONFIG_SUBDIRS(machine sys) |
---|
64 | |
---|
65 | CRT0= |
---|
66 | if test "x${have_crt0}" = "xyes"; then |
---|
67 | CRT0=crt0.o |
---|
68 | fi |
---|
69 | AC_SUBST(CRT0) |
---|
70 | |
---|
71 | dnl For each directory which we may or may not want, we define a name |
---|
72 | dnl for the library and an automake conditional for whether we should |
---|
73 | dnl build the library. |
---|
74 | |
---|
75 | LIBC_SIGNAL_LIB= |
---|
76 | LIBC_SIGNAL_DEF= |
---|
77 | if test -n "${signal_dir}"; then |
---|
78 | if test "${use_libtool}" = "yes"; then |
---|
79 | LIBC_SIGNAL_LIB=${signal_dir}/lib${signal_dir}.${aext} |
---|
80 | else |
---|
81 | LIBC_SIGNAL_LIB=${signal_dir}/lib.${aext} |
---|
82 | fi |
---|
83 | LIBC_SIGNAL_DEF=${signal_dir}/stmp-def |
---|
84 | fi |
---|
85 | AC_SUBST(LIBC_SIGNAL_LIB) |
---|
86 | AC_SUBST(LIBC_SIGNAL_DEF) |
---|
87 | AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x) |
---|
88 | |
---|
89 | LIBC_STDIO_LIB= |
---|
90 | LIBC_STDIO_DEF= |
---|
91 | if test -n "${stdio_dir}"; then |
---|
92 | if test "${use_libtool}" = "yes"; then |
---|
93 | LIBC_STDIO_LIB=${stdio_dir}/lib${stdio_dir}.${aext} |
---|
94 | else |
---|
95 | LIBC_STDIO_LIB=${stdio_dir}/lib.${aext} |
---|
96 | fi |
---|
97 | LIBC_STDIO_DEF=${stdio_dir}/stmp-def |
---|
98 | fi |
---|
99 | AC_SUBST(LIBC_STDIO_LIB) |
---|
100 | AC_SUBST(LIBC_STDIO_DEF) |
---|
101 | AM_CONDITIONAL(HAVE_STDIO_DIR, test x${stdio_dir} != x) |
---|
102 | |
---|
103 | LIBC_STDIO64_LIB= |
---|
104 | LIBC_STDIO64_DEF= |
---|
105 | if test -n "${stdio64_dir}"; then |
---|
106 | if test "${use_libtool}" = "yes"; then |
---|
107 | LIBC_STDIO64_LIB=${stdio64_dir}/lib${stdio64_dir}.${aext} |
---|
108 | else |
---|
109 | LIBC_STDIO64_LIB=${stdio64_dir}/lib.${aext} |
---|
110 | fi |
---|
111 | LIBC_STDIO64_DEF=${stdio64_dir}/stmp-def |
---|
112 | fi |
---|
113 | AC_SUBST(LIBC_STDIO64_LIB) |
---|
114 | AC_SUBST(LIBC_STDIO64_DEF) |
---|
115 | AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x) |
---|
116 | |
---|
117 | LIBC_POSIX_LIB= |
---|
118 | LIBC_POSIX_DEF= |
---|
119 | if test -n "${posix_dir}"; then |
---|
120 | if test "${use_libtool}" = "yes"; then |
---|
121 | LIBC_POSIX_LIB=${posix_dir}/lib${posix_dir}.${aext} |
---|
122 | else |
---|
123 | LIBC_POSIX_LIB=${posix_dir}/lib.${aext} |
---|
124 | fi |
---|
125 | LIBC_POSIX_DEF=${posix_dir}/stmp-def |
---|
126 | fi |
---|
127 | AC_SUBST(LIBC_POSIX_LIB) |
---|
128 | AC_SUBST(LIBC_POSIX_DEF) |
---|
129 | AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x) |
---|
130 | |
---|
131 | LIBC_XDR_LIB= |
---|
132 | LIBC_XDR_DEF= |
---|
133 | if test -n "${xdr_dir}"; then |
---|
134 | if test "${use_libtool}" = "yes"; then |
---|
135 | LIBC_XDR_LIB=${xdr_dir}/lib${xdr_dir}.${aext} |
---|
136 | else |
---|
137 | LIBC_XDR_LIB=${xdr_dir}/lib.${aext} |
---|
138 | fi |
---|
139 | LIBC_XDR_DEF=${xdr_dir}/stmp-def |
---|
140 | fi |
---|
141 | AC_SUBST(LIBC_XDR_LIB) |
---|
142 | AC_SUBST(LIBC_XDR_DEF) |
---|
143 | AM_CONDITIONAL(HAVE_XDR_DIR, test x${xdr_dir} != x) |
---|
144 | |
---|
145 | LIBC_SYSCALL_LIB= |
---|
146 | if test -n "${syscall_dir}"; then |
---|
147 | if test "${use_libtool}" = "yes"; then |
---|
148 | LIBC_SYSCALL_LIB=${syscall_dir}/lib${syscall_dir}.${aext} |
---|
149 | else |
---|
150 | LIBC_SYSCALL_LIB=${syscall_dir}/lib.${aext} |
---|
151 | fi |
---|
152 | fi |
---|
153 | AC_SUBST(LIBC_SYSCALL_LIB) |
---|
154 | AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x) |
---|
155 | |
---|
156 | LIBC_UNIX_LIB= |
---|
157 | if test -n "${unix_dir}"; then |
---|
158 | if test "${use_libtool}" = "yes"; then |
---|
159 | LIBC_UNIX_LIB=${unix_dir}/lib${unix_dir}.${aext} |
---|
160 | else |
---|
161 | LIBC_UNIX_LIB=${unix_dir}/lib.${aext} |
---|
162 | fi |
---|
163 | fi |
---|
164 | AC_SUBST(LIBC_UNIX_LIB) |
---|
165 | AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x) |
---|
166 | |
---|
167 | LIBC_EXTRA_LIB= |
---|
168 | LIBC_EXTRA_DEF= |
---|
169 | extra_dir= |
---|
170 | |
---|
171 | AC_SUBST(LIBC_EXTRA_LIB) |
---|
172 | AC_SUBST(LIBC_EXTRA_DEF) |
---|
173 | AC_SUBST(extra_dir) |
---|
174 | |
---|
175 | dnl We always recur into sys and machine, and let them decide what to |
---|
176 | dnl do. However, we do need to know whether they will produce a library. |
---|
177 | |
---|
178 | LIBC_SYS_LIB= |
---|
179 | if test -n "${sys_dir}"; then |
---|
180 | if test "${use_libtool}" = "yes"; then |
---|
181 | LIBC_SYS_LIB=sys/${sys_dir}/lib${sys_dir}.${aext} |
---|
182 | else |
---|
183 | LIBC_SYS_LIB=sys/lib.${aext} |
---|
184 | fi |
---|
185 | fi |
---|
186 | AC_SUBST(LIBC_SYS_LIB) |
---|
187 | AC_SUBST(sys_dir) |
---|
188 | |
---|
189 | dnl Autoconf 2.59 doesn't support the AC_TYPE_LONG_DOUBLE macro. Instead of: |
---|
190 | dnl AC_TYPE_LONG_DOUBLE |
---|
191 | dnl AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes") |
---|
192 | dnl we specify our own long double test. |
---|
193 | AC_CACHE_CHECK([Checking long double support], [acnewlib_cv_type_long_double],[dnl |
---|
194 | cat > conftest.c <<EOF |
---|
195 | int main() { |
---|
196 | long double x = 0.0L; |
---|
197 | return 0; |
---|
198 | } |
---|
199 | EOF |
---|
200 | if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c conftest.c 1>&AS_MESSAGE_LOG_FD]) |
---|
201 | then |
---|
202 | acnewlib_cv_type_long_double=yes |
---|
203 | else |
---|
204 | acnewlib_cv_type_long_double=no |
---|
205 | fi |
---|
206 | rm -f conftest*]) |
---|
207 | AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes") |
---|
208 | |
---|
209 | dnl iconv library will be compiled if --enable-newlib-iconv option is enabled |
---|
210 | AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x) |
---|
211 | |
---|
212 | if test -n "${machine_dir}"; then |
---|
213 | if test "${use_libtool}" = "yes"; then |
---|
214 | LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext} |
---|
215 | else |
---|
216 | LIBC_MACHINE_LIB=machine/lib.${aext} |
---|
217 | fi |
---|
218 | fi |
---|
219 | AC_SUBST(LIBC_MACHINE_LIB) |
---|
220 | AC_SUBST(machine_dir) |
---|
221 | |
---|
222 | AC_CONFIG_FILES([Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile iconv/Makefile iconv/ces/Makefile iconv/ccs/Makefile iconv/ccs/binary/Makefile iconv/lib/Makefile ssp/Makefile xdr/Makefile]) |
---|
223 | AC_OUTPUT |
---|