]>
Commit | Line | Data |
---|---|---|
8a0efa53 CF |
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.5) | |
5 | AC_INIT(sys.tex) | |
6 | ||
7 | dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. | |
8 | AC_CONFIG_AUX_DIR(../..) | |
9 | ||
037240a2 JJ |
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 | |
18 | ||
8a0efa53 CF |
19 | NEWLIB_CONFIGURE(..) |
20 | ||
2e1a7175 TF |
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. | |
24 | ||
25 | if test "${use_libtool}" = "yes"; then | |
26 | AC_LIBTOOL_WIN32_DLL | |
27 | AM_PROG_LIBTOOL | |
28 | fi | |
29 | ||
8a0efa53 CF |
30 | AC_CONFIG_SUBDIRS(machine sys) |
31 | ||
32 | CRT0= | |
33 | if test -n "${sys_dir}"; then | |
34 | CRT0=crt0.o | |
35 | fi | |
36 | AC_SUBST(CRT0) | |
37 | ||
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. | |
41 | ||
42 | LIBC_POSIX_LIB= | |
43 | if test -n "${posix_dir}"; then | |
2e1a7175 TF |
44 | if test "${use_libtool}" = "yes"; then |
45 | LIBC_POSIX_LIB=${posix_dir}/lib${posix_dir}.${aext} | |
46 | else | |
47 | LIBC_POSIX_LIB=${posix_dir}/lib.${aext} | |
48 | fi | |
8a0efa53 CF |
49 | fi |
50 | AC_SUBST(LIBC_POSIX_LIB) | |
51 | AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x) | |
52 | ||
53 | LIBC_SIGNAL_LIB= | |
54 | LIBC_SIGNAL_DEF= | |
55 | if test -n "${signal_dir}"; then | |
2e1a7175 TF |
56 | if test "${use_libtool}" = "yes"; then |
57 | LIBC_SIGNAL_LIB=${signal_dir}/lib${signal_dir}.${aext} | |
58 | else | |
59 | LIBC_SIGNAL_LIB=${signal_dir}/lib.${aext} | |
60 | fi | |
8a0efa53 CF |
61 | LIBC_SIGNAL_DEF=${signal_dir}/stmp-def |
62 | fi | |
63 | AC_SUBST(LIBC_SIGNAL_LIB) | |
64 | AC_SUBST(LIBC_SIGNAL_DEF) | |
65 | AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x) | |
66 | ||
dee51391 JJ |
67 | LIBC_STDIO64_LIB= |
68 | LIBC_STDIO64_DEF= | |
69 | if test -n "${stdio64_dir}"; then | |
70 | if test "${use_libtool}" = "yes"; then | |
71 | LIBC_STDIO64_LIB=${stdio64_dir}/lib${stdio64_dir}.${aext} | |
72 | else | |
73 | LIBC_STDIO64_LIB=${stdio64_dir}/lib.${aext} | |
74 | fi | |
75 | LIBC_STDIO64_DEF=${stdio64_dir}/stmp-def | |
76 | fi | |
77 | AC_SUBST(LIBC_STDIO64_LIB) | |
78 | AC_SUBST(LIBC_STDIO64_DEF) | |
79 | AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x) | |
80 | ||
8a0efa53 CF |
81 | LIBC_SYSCALL_LIB= |
82 | if test -n "${syscall_dir}"; then | |
2e1a7175 TF |
83 | if test "${use_libtool}" = "yes"; then |
84 | LIBC_SYSCALL_LIB=${syscall_dir}/lib${syscall_dir}.${aext} | |
85 | else | |
86 | LIBC_SYSCALL_LIB=${syscall_dir}/lib.${aext} | |
87 | fi | |
8a0efa53 CF |
88 | fi |
89 | AC_SUBST(LIBC_SYSCALL_LIB) | |
90 | AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x) | |
91 | ||
92 | LIBC_UNIX_LIB= | |
93 | if test -n "${unix_dir}"; then | |
2e1a7175 TF |
94 | if test "${use_libtool}" = "yes"; then |
95 | LIBC_UNIX_LIB=${unix_dir}/lib${unix_dir}.${aext} | |
96 | else | |
97 | LIBC_UNIX_LIB=${unix_dir}/lib.${aext} | |
98 | fi | |
8a0efa53 CF |
99 | fi |
100 | AC_SUBST(LIBC_UNIX_LIB) | |
101 | AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x) | |
102 | ||
09841445 TF |
103 | LIBC_EXTRA_LIB= |
104 | LIBC_EXTRA_DEF= | |
105 | extra_dir= | |
106 | ||
107 | AC_SUBST(LIBC_EXTRA_LIB) | |
108 | AC_SUBST(LIBC_EXTRA_DEF) | |
109 | AC_SUBST(extra_dir) | |
110 | ||
8a0efa53 CF |
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. | |
113 | ||
114 | LIBC_SYS_LIB= | |
115 | if test -n "${sys_dir}"; then | |
2e1a7175 TF |
116 | if test "${use_libtool}" = "yes"; then |
117 | LIBC_SYS_LIB=sys/${sys_dir}/lib${sys_dir}.${aext} | |
118 | else | |
119 | LIBC_SYS_LIB=sys/lib.${aext} | |
120 | fi | |
8a0efa53 CF |
121 | fi |
122 | AC_SUBST(LIBC_SYS_LIB) | |
2e1a7175 | 123 | AC_SUBST(sys_dir) |
8a0efa53 | 124 | |
786ab12c JJ |
125 | dnl iconv library will be compiled if --enable-newlib-iconv option is enabled |
126 | if test x${newlib_iconv} != x; then | |
127 | AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test 1 = 1) | |
128 | NEWLIB_CFLAGS="${NEWLIB_CFLAGS} -DENABLE_ICONV" | |
129 | fi; | |
130 | ||
131 | dnl Parse --enable-newlib-builtin-converters option argument | |
132 | if test "x${builtin_converters}" != "x"; then | |
133 | ||
134 | dnl Check that --enable-newlib-iconv was enabled | |
135 | if test x${newlib_iconv} = x; then | |
136 | AC_MSG_ERROR(--enable-newlib-builtin-converters option can't be used if iconv library is disabled - use --enable-newlib-iconv to enable it) | |
137 | fi | |
138 | ||
139 | dnl Normalize converter names and delete commas | |
140 | builtin_converters=`echo "${builtin_converters}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | |
141 | ||
142 | dnl Get the list of available converters excluding comments | |
143 | dnl Join line with previous if the first character is whitespace | |
144 | available_converters=`cat "${srcdir}/iconv/charset.aliases" | sed -e '/#/d' | sed -e 'N; s/\n //;'` | |
145 | ||
146 | dnl Check if required converters are supported | |
147 | dnl Convert aliases to "official" names | |
148 | builtin_converters1="${builtin_converters}" | |
149 | builtin_converters="" | |
150 | for converter in ${builtin_converters1}; do | |
151 | result=`echo "${available_converters}" | grep -e "\(^\| \)${converter}\( \|\$\)"` | |
152 | if test $? != "0"; then | |
153 | AC_MSG_ERROR(${converter} is not supported - see ${srcdir}/iconv/charset.aliases file for the list of available converters) | |
154 | fi | |
155 | converter1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'` | |
156 | builtin_converters="${builtin_converters} ${converter1}" | |
157 | done | |
158 | ||
159 | dnl Define appropriate -D options | |
160 | for converter in ${builtin_converters}; do | |
161 | opt=ICONV_CONVERTER_`echo "${converter}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` | |
162 | NEWLIB_ICONV_CFLAGS="${NEWLIB_ICONV_CFLAGS} -D${opt}" | |
163 | done | |
164 | ||
165 | else | |
166 | NEWLIB_ICONV_CFLAGS= | |
167 | fi; | |
168 | AC_SUBST(NEWLIB_ICONV_CFLAGS) | |
169 | ||
8a0efa53 | 170 | if test -n "${machine_dir}"; then |
2e1a7175 TF |
171 | if test "${use_libtool}" = "yes"; then |
172 | LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext} | |
173 | else | |
174 | LIBC_MACHINE_LIB=machine/lib.${aext} | |
175 | fi | |
8a0efa53 CF |
176 | fi |
177 | AC_SUBST(LIBC_MACHINE_LIB) | |
2e1a7175 | 178 | AC_SUBST(machine_dir) |
8a0efa53 | 179 | |
786ab12c | 180 | 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) |