]> sourceware.org Git - newlib-cygwin.git/blame - newlib/libc/configure.in
2004-01-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
[newlib-cygwin.git] / newlib / libc / configure.in
CommitLineData
8a0efa53
CF
1dnl This is the newlib/libc configure.in file.
2dnl Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.5)
5AC_INIT(sys.tex)
6
7dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
8AC_CONFIG_AUX_DIR(../..)
9
037240a2
JJ
10dnl Support --enable-newlib-io-pos-args used by libc/stdio
11AC_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
19NEWLIB_CONFIGURE(..)
20
2e1a7175
TF
21dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
22dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
23dnl line of the macro which fail because appropriate LDFLAGS are not set.
24
25if test "${use_libtool}" = "yes"; then
26AC_LIBTOOL_WIN32_DLL
27AM_PROG_LIBTOOL
28fi
29
8a0efa53
CF
30AC_CONFIG_SUBDIRS(machine sys)
31
32CRT0=
33if test -n "${sys_dir}"; then
34 CRT0=crt0.o
35fi
36AC_SUBST(CRT0)
37
38dnl For each directory which we may or may not want, we define a name
39dnl for the library and an automake conditional for whether we should
40dnl build the library.
41
42LIBC_POSIX_LIB=
43if 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
49fi
50AC_SUBST(LIBC_POSIX_LIB)
51AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x)
52
53LIBC_SIGNAL_LIB=
54LIBC_SIGNAL_DEF=
55if 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
62fi
63AC_SUBST(LIBC_SIGNAL_LIB)
64AC_SUBST(LIBC_SIGNAL_DEF)
65AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x)
66
dee51391
JJ
67LIBC_STDIO64_LIB=
68LIBC_STDIO64_DEF=
69if 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
76fi
77AC_SUBST(LIBC_STDIO64_LIB)
78AC_SUBST(LIBC_STDIO64_DEF)
79AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x)
80
8a0efa53
CF
81LIBC_SYSCALL_LIB=
82if 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
88fi
89AC_SUBST(LIBC_SYSCALL_LIB)
90AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x)
91
92LIBC_UNIX_LIB=
93if 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
99fi
100AC_SUBST(LIBC_UNIX_LIB)
101AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
102
09841445
TF
103LIBC_EXTRA_LIB=
104LIBC_EXTRA_DEF=
105extra_dir=
106
107AC_SUBST(LIBC_EXTRA_LIB)
108AC_SUBST(LIBC_EXTRA_DEF)
109AC_SUBST(extra_dir)
110
8a0efa53
CF
111dnl We always recur into sys and machine, and let them decide what to
112dnl do. However, we do need to know whether they will produce a library.
113
114LIBC_SYS_LIB=
115if 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
121fi
122AC_SUBST(LIBC_SYS_LIB)
2e1a7175 123AC_SUBST(sys_dir)
8a0efa53 124
786ab12c
JJ
125dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
126if test x${newlib_iconv} != x; then
127 AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test 1 = 1)
128 NEWLIB_CFLAGS="${NEWLIB_CFLAGS} -DENABLE_ICONV"
129fi;
130
131dnl Parse --enable-newlib-builtin-converters option argument
132if 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
165else
166 NEWLIB_ICONV_CFLAGS=
167fi;
168AC_SUBST(NEWLIB_ICONV_CFLAGS)
169
8a0efa53 170if 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
176fi
177AC_SUBST(LIBC_MACHINE_LIB)
2e1a7175 178AC_SUBST(machine_dir)
8a0efa53 179
786ab12c 180AC_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)
This page took 0.115891 seconds and 5 git commands to generate.