1 dnl This is the newlib configure.in file.
2 dnl Process this file with autoconf to produce a configure script.
6 AM_CONFIG_HEADER(newlib.h:newlib.hin)
8 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
11 dnl Support --enable-newlib-io-pos-args
12 dnl This option is actually read in libc/configure.in. It is repeated
13 dnl here so that it shows up in the help text.
14 AC_ARG_ENABLE(newlib-io-pos-args,
15 [ --enable-newlib-io-pos-args enable printf-family positional arg support],
16 [case "${enableval}" in
17 yes) newlib_io_pos_args=yes ;;
18 no) newlib_io_pos_args=no ;;
19 *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-pos-args option) ;;
20 esac], [newlib_io_pos_args=no])dnl
25 dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
26 dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
27 dnl line of the macro which fail because appropriate LDFLAGS are not set.
28 if test "${use_libtool}" = "yes"; then
34 configdirs="libc libm"
36 AC_ARG_ENABLE(newlib_hw_fp,
37 [ --enable-newlib-hw-fp Turn on hardware floating point math],
38 [case "${enableval}" in
39 yes) newlib_hw_fp=true ;;
40 no) newlib_hw_fp=false ;;
41 *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;;
42 esac],[newlib_hw_fp=false])
43 AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue)
45 if test -z "${with_multisubdir}"; then
46 configdirs="${configdirs} doc"
51 AM_CONDITIONAL(HAVE_DOC, test x$have_doc = xyes)
56 configdirs="${configdirs} iconvdata"
62 # These get added in the top-level configure.in, except in the case where
63 # newlib is being built natively.
64 LIBC_INCLUDE_GREP=`echo ${CC} | grep \/libc\/include`
65 if test -z "${LIBC_INCLUDE_GREP}"; then
66 CC_FOR_NEWLIB="${CC} -I$PWD/targ-include -I${newlib_basedir}/libc/include"
70 AC_SUBST(CC_FOR_NEWLIB)
72 AC_CONFIG_SUBDIRS(${configdirs})
76 if test -n "${sys_dir}"; then
85 if test -n "${crt1_dir}"; then
91 if test -n "${libm_machine_dir}"; then
92 LIBM_MACHINE_OBJECTLIST=libm/machine/${libm_machine_dir}/objectlist.awk.in
94 AC_SUBST(LIBM_MACHINE_OBJECTLIST)
96 if test -n "${machine_dir}"; then
97 MACHINE_OBJECTLIST=libc/machine/${machine_dir}/objectlist.awk.in
99 AC_SUBST(MACHINE_OBJECTLIST)
101 if test -n "${sys_dir}"; then
102 SYS_OBJECTLIST=libc/sys/${sys_dir}/objectlist.awk.in
104 AC_SUBST(SYS_OBJECTLIST)
106 if test "${have_sys_mach_dir}" = "yes"; then
107 SYS_MACH_OBJECTLIST=libc/sys/${sys_dir}/machine/${machine_dir}/objectlist.awk.in
109 AC_SUBST(SYS_MACH_OBJECTLIST)
111 if test -n "${posix_dir}"; then
112 POSIX_OBJECTLIST=libc/${posix_dir}/objectlist.awk.in
114 AC_SUBST(POSIX_OBJECTLIST)
116 if test -n "${signal_dir}"; then
117 SIGNAL_OBJECTLIST=libc/${signal_dir}/objectlist.awk.in
119 AC_SUBST(SIGNAL_OBJECTLIST)
121 if test -n "${syscall_dir}"; then
122 SYSCALL_OBJECTLIST=libc/${syscall_dir}/objectlist.awk.in
124 AC_SUBST(SYSCALL_OBJECTLIST)
126 if test -n "${unix_dir}"; then
127 UNIX_OBJECTLIST=libc/${unix_dir}/objectlist.awk.in
129 AC_SUBST(UNIX_OBJECTLIST)
131 if test -n "${stdio64_dir}"; then
132 STDIO64_OBJECTLIST=libc/${stdio64_dir}/objectlist.awk.in
134 AC_SUBST(STDIO64_OBJECTLIST)
136 # Put a plausible default for CC_FOR_BUILD in Makefile.
137 if test -z "$CC_FOR_BUILD"; then
140 AC_SUBST(CC_FOR_BUILD)
142 if test "${newlib_elix_level}" -gt "0"; then
143 AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
146 if test "${newlib_mb}" = "yes"; then
147 AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
150 AC_DEFINE_UNQUOTED(_NEWLIB_VERSION,"$VERSION")
152 if test "${multilib}" = "yes"; then
153 multilib_arg="--enable-multilib"
160 [if test -n "$CONFIG_FILES"; then
162 . ${newlib_basedir}/../config-ml.in
167 with_multisubdir=${with_multisubdir}
168 ac_configure_args="${multilib_arg} ${ac_configure_args}"
169 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
170 newlib_basedir=${newlib_basedir}