source: trunk/libs/newlib/src/newlib/libc/configure.in @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 6.9 KB
Line 
1dnl This is the newlib/libc configure.in file.
2dnl Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT([newlib],[NEWLIB_VERSION])
6AC_CONFIG_SRCDIR([sys.tex])
7
8dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
9AC_CONFIG_AUX_DIR(../..)
10
11dnl Support --enable-newlib-io-pos-args used by libc/stdio
12AC_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
20dnl Support --enable-newlib-nano-malloc used by libc/stdlib
21AC_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
29dnl Support --enable-newlib-nano-formatted-io used by libc/stdio
30AC_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])
37AM_CONDITIONAL(NEWLIB_NANO_FORMATTED_IO, test x$newlib_nano_formatted_io = xyes)
38
39dnl Support --enable-retargetable-locking used by libc/sys
40AC_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])
47AM_CONDITIONAL(NEWLIB_RETARGETABLE_LOCKING, test x$newlib_retargetable_locking = xyes)
48
49NEWLIB_CONFIGURE(..)
50
51AM_CONDITIONAL(NEWLIB_NANO_MALLOC, test x$newlib_nano_malloc = xyes)
52
53dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
54dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
55dnl line of the macro which fail because appropriate LDFLAGS are not set.
56_LT_DECL_SED
57_LT_PROG_ECHO_BACKSLASH
58if test "${use_libtool}" = "yes"; then
59AC_LIBTOOL_WIN32_DLL
60AM_PROG_LIBTOOL
61fi
62
63AC_CONFIG_SUBDIRS(machine sys)
64
65CRT0=
66if test "x${have_crt0}" = "xyes"; then
67  CRT0=crt0.o
68fi
69AC_SUBST(CRT0)
70
71dnl For each directory which we may or may not want, we define a name
72dnl for the library and an automake conditional for whether we should
73dnl build the library.
74
75LIBC_SIGNAL_LIB=
76LIBC_SIGNAL_DEF=
77if 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
84fi
85AC_SUBST(LIBC_SIGNAL_LIB)
86AC_SUBST(LIBC_SIGNAL_DEF)
87AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x)
88
89LIBC_STDIO_LIB=
90LIBC_STDIO_DEF=
91if 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
98fi
99AC_SUBST(LIBC_STDIO_LIB)
100AC_SUBST(LIBC_STDIO_DEF)
101AM_CONDITIONAL(HAVE_STDIO_DIR, test x${stdio_dir} != x)
102
103LIBC_STDIO64_LIB=
104LIBC_STDIO64_DEF=
105if 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
112fi
113AC_SUBST(LIBC_STDIO64_LIB)
114AC_SUBST(LIBC_STDIO64_DEF)
115AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x)
116
117LIBC_POSIX_LIB=
118LIBC_POSIX_DEF=
119if 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
126fi
127AC_SUBST(LIBC_POSIX_LIB)
128AC_SUBST(LIBC_POSIX_DEF)
129AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x)
130
131LIBC_XDR_LIB=
132LIBC_XDR_DEF=
133if 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
140fi
141AC_SUBST(LIBC_XDR_LIB)
142AC_SUBST(LIBC_XDR_DEF)
143AM_CONDITIONAL(HAVE_XDR_DIR, test x${xdr_dir} != x)
144
145LIBC_SYSCALL_LIB=
146if 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
152fi
153AC_SUBST(LIBC_SYSCALL_LIB)
154AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x)
155
156LIBC_UNIX_LIB=
157if 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
163fi
164AC_SUBST(LIBC_UNIX_LIB)
165AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
166
167LIBC_EXTRA_LIB=
168LIBC_EXTRA_DEF=
169extra_dir=
170
171AC_SUBST(LIBC_EXTRA_LIB)
172AC_SUBST(LIBC_EXTRA_DEF)
173AC_SUBST(extra_dir)
174
175dnl We always recur into sys and machine, and let them decide what to
176dnl do.  However, we do need to know whether they will produce a library.
177
178LIBC_SYS_LIB=
179if 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
185fi
186AC_SUBST(LIBC_SYS_LIB)
187AC_SUBST(sys_dir)
188
189dnl Autoconf 2.59 doesn't support the AC_TYPE_LONG_DOUBLE macro. Instead of:
190dnl   AC_TYPE_LONG_DOUBLE
191dnl   AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes")
192dnl we specify our own long double test.
193AC_CACHE_CHECK([Checking long double support], [acnewlib_cv_type_long_double],[dnl
194cat > conftest.c <<EOF
195int main() {
196long double x = 0.0L;
197return 0;
198}
199EOF
200if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c conftest.c 1>&AS_MESSAGE_LOG_FD])
201then
202  acnewlib_cv_type_long_double=yes
203else
204  acnewlib_cv_type_long_double=no
205fi
206rm -f conftest*])
207AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes")
208
209dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
210AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x)
211
212if 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
218fi
219AC_SUBST(LIBC_MACHINE_LIB)
220AC_SUBST(machine_dir)
221
222AC_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])
223AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.