1 dnl This is the newlib/libc configure.in file.
2 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT([newlib],[NEWLIB_VERSION])
6 AC_CONFIG_SRCDIR([sys.tex])
8 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
9 AC_CONFIG_AUX_DIR(../..)
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
22 dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
23 dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
24 dnl line of the macro which fail because appropriate LDFLAGS are not set.
26 if test "${use_libtool}" = "yes"; then
31 AC_CONFIG_SUBDIRS(machine sys)
34 if test "x${have_crt0}" = "xyes"; then
39 dnl For each directory which we may or may not want, we define a name
40 dnl for the library and an automake conditional for whether we should
41 dnl build the library.
44 if test -n "${posix_dir}"; then
45 if test "${use_libtool}" = "yes"; then
46 LIBC_POSIX_LIB=${posix_dir}/lib${posix_dir}.${aext}
48 LIBC_POSIX_LIB=${posix_dir}/lib.${aext}
51 AC_SUBST(LIBC_POSIX_LIB)
52 AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x)
56 if test -n "${signal_dir}"; then
57 if test "${use_libtool}" = "yes"; then
58 LIBC_SIGNAL_LIB=${signal_dir}/lib${signal_dir}.${aext}
60 LIBC_SIGNAL_LIB=${signal_dir}/lib.${aext}
62 LIBC_SIGNAL_DEF=${signal_dir}/stmp-def
64 AC_SUBST(LIBC_SIGNAL_LIB)
65 AC_SUBST(LIBC_SIGNAL_DEF)
66 AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x)
70 if test -n "${stdio64_dir}"; then
71 if test "${use_libtool}" = "yes"; then
72 LIBC_STDIO64_LIB=${stdio64_dir}/lib${stdio64_dir}.${aext}
74 LIBC_STDIO64_LIB=${stdio64_dir}/lib.${aext}
76 LIBC_STDIO64_DEF=${stdio64_dir}/stmp-def
78 AC_SUBST(LIBC_STDIO64_LIB)
79 AC_SUBST(LIBC_STDIO64_DEF)
80 AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x)
83 if test -n "${syscall_dir}"; then
84 if test "${use_libtool}" = "yes"; then
85 LIBC_SYSCALL_LIB=${syscall_dir}/lib${syscall_dir}.${aext}
87 LIBC_SYSCALL_LIB=${syscall_dir}/lib.${aext}
90 AC_SUBST(LIBC_SYSCALL_LIB)
91 AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x)
94 if test -n "${unix_dir}"; then
95 if test "${use_libtool}" = "yes"; then
96 LIBC_UNIX_LIB=${unix_dir}/lib${unix_dir}.${aext}
98 LIBC_UNIX_LIB=${unix_dir}/lib.${aext}
101 AC_SUBST(LIBC_UNIX_LIB)
102 AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
108 AC_SUBST(LIBC_EXTRA_LIB)
109 AC_SUBST(LIBC_EXTRA_DEF)
112 dnl We always recur into sys and machine, and let them decide what to
113 dnl do. However, we do need to know whether they will produce a library.
116 if test -n "${sys_dir}"; then
117 if test "${use_libtool}" = "yes"; then
118 LIBC_SYS_LIB=sys/${sys_dir}/lib${sys_dir}.${aext}
120 LIBC_SYS_LIB=sys/lib.${aext}
123 AC_SUBST(LIBC_SYS_LIB)
126 dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
127 AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x)
129 if test -n "${machine_dir}"; then
130 if test "${use_libtool}" = "yes"; then
131 LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
133 LIBC_MACHINE_LIB=machine/lib.${aext}
136 AC_SUBST(LIBC_MACHINE_LIB)
137 AC_SUBST(machine_dir)
139 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])