1 dnl This is the newlib/libc configure.in file.
2 dnl Process this file with autoconf to produce a configure script.
7 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
8 AC_CONFIG_AUX_DIR(../..)
10 dnl Support --enable-newlib-io-pos-args used by libc/stdio
11 AC_ARG_ENABLE(newlib-io-pos-args,
12 [ --enable-newlib-io-pos-args enable printf-family positional arg support],
13 [case "${enableval}" in
14 yes) newlib_io_pos_args=yes ;;
15 no) newlib_io_pos_args=no ;;
16 *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-pos-args option) ;;
17 esac], [newlib_io_pos_args=no])dnl
21 dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
22 dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
23 dnl line of the macro which fail because appropriate LDFLAGS are not set.
25 if test "${use_libtool}" = "yes"; then
30 AC_CONFIG_SUBDIRS(machine sys)
33 if test -n "${sys_dir}"; then
38 dnl For each directory which we may or may not want, we define a name
39 dnl for the library and an automake conditional for whether we should
40 dnl build the library.
43 if test -n "${posix_dir}"; then
44 if test "${use_libtool}" = "yes"; then
45 LIBC_POSIX_LIB=${posix_dir}/lib${posix_dir}.${aext}
47 LIBC_POSIX_LIB=${posix_dir}/lib.${aext}
50 AC_SUBST(LIBC_POSIX_LIB)
51 AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x)
55 if test -n "${signal_dir}"; then
56 if test "${use_libtool}" = "yes"; then
57 LIBC_SIGNAL_LIB=${signal_dir}/lib${signal_dir}.${aext}
59 LIBC_SIGNAL_LIB=${signal_dir}/lib.${aext}
61 LIBC_SIGNAL_DEF=${signal_dir}/stmp-def
63 AC_SUBST(LIBC_SIGNAL_LIB)
64 AC_SUBST(LIBC_SIGNAL_DEF)
65 AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x)
69 if test -n "${stdio64_dir}"; then
70 if test "${use_libtool}" = "yes"; then
71 LIBC_STDIO64_LIB=${stdio64_dir}/lib${stdio64_dir}.${aext}
73 LIBC_STDIO64_LIB=${stdio64_dir}/lib.${aext}
75 LIBC_STDIO64_DEF=${stdio64_dir}/stmp-def
77 AC_SUBST(LIBC_STDIO64_LIB)
78 AC_SUBST(LIBC_STDIO64_DEF)
79 AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x)
82 if test -n "${syscall_dir}"; then
83 if test "${use_libtool}" = "yes"; then
84 LIBC_SYSCALL_LIB=${syscall_dir}/lib${syscall_dir}.${aext}
86 LIBC_SYSCALL_LIB=${syscall_dir}/lib.${aext}
89 AC_SUBST(LIBC_SYSCALL_LIB)
90 AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x)
93 if test -n "${unix_dir}"; then
94 if test "${use_libtool}" = "yes"; then
95 LIBC_UNIX_LIB=${unix_dir}/lib${unix_dir}.${aext}
97 LIBC_UNIX_LIB=${unix_dir}/lib.${aext}
100 AC_SUBST(LIBC_UNIX_LIB)
101 AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
107 AC_SUBST(LIBC_EXTRA_LIB)
108 AC_SUBST(LIBC_EXTRA_DEF)
111 dnl We always recur into sys and machine, and let them decide what to
112 dnl do. However, we do need to know whether they will produce a library.
115 if test -n "${sys_dir}"; then
116 if test "${use_libtool}" = "yes"; then
117 LIBC_SYS_LIB=sys/${sys_dir}/lib${sys_dir}.${aext}
119 LIBC_SYS_LIB=sys/lib.${aext}
122 AC_SUBST(LIBC_SYS_LIB)
125 dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
126 AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x)
128 if test -n "${machine_dir}"; then
129 if test "${use_libtool}" = "yes"; then
130 LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
132 LIBC_MACHINE_LIB=machine/lib.${aext}
135 AC_SUBST(LIBC_MACHINE_LIB)
136 AC_SUBST(machine_dir)
138 AC_OUTPUT(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)