OSDN Git Service

2003-05-28 Jeff Johnston <jjohnstn@redhat.com>
[pf3gnuchains/pf3gnuchains3x.git] / newlib / configure.in
1 dnl This is the newlib configure.in file.
2 dnl Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.5)
5 AC_INIT(libc)
6 AM_CONFIG_HEADER(newlib.h:newlib.hin)
7
8 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 
9 AC_CONFIG_AUX_DIR(..)
10
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
21
22
23 NEWLIB_CONFIGURE(.)
24
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
29 AC_LIBTOOL_WIN32_DLL
30 AM_PROG_LIBTOOL
31 AC_PROG_AWK
32 fi
33
34 configdirs="libc libm"
35
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)
44
45 if test -z "${with_multisubdir}"; then
46   configdirs="${configdirs} doc"
47   have_doc=yes
48 else
49   have_doc=
50 fi
51 AM_CONDITIONAL(HAVE_DOC, test x$have_doc = xyes)
52
53 EXTRA_DIRS=
54 case $host in
55   i[3456]86-pc-linux-*)
56         configdirs="${configdirs} iconvdata"
57         EXTRA_DIRS=iconvdata
58         ;;
59 esac
60 AC_SUBST(EXTRA_DIRS)
61
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"
67 else
68   CC_FOR_NEWLIB="${CC}"
69 fi
70 AC_SUBST(CC_FOR_NEWLIB)
71
72 AC_CONFIG_SUBDIRS(${configdirs})
73
74 CRT0=
75 CRT0_DIR=
76 if test -n "${sys_dir}"; then
77   CRT0=crt0.o
78   CRT0_DIR=libc/
79 fi
80 AC_SUBST(CRT0)
81 AC_SUBST(CRT0_DIR)
82
83 CRT1=${crt1}
84 CRT1_DIR=
85 if test -n "${crt1_dir}"; then
86   CRT1_DIR=${crt1_dir}/
87 fi
88 AC_SUBST(CRT1)
89 AC_SUBST(CRT1_DIR)
90
91 if test -n "${libm_machine_dir}"; then
92   LIBM_MACHINE_OBJECTLIST=libm/machine/${libm_machine_dir}/objectlist.awk.in
93 fi
94 AC_SUBST(LIBM_MACHINE_OBJECTLIST)
95
96 if test -n "${machine_dir}"; then
97   MACHINE_OBJECTLIST=libc/machine/${machine_dir}/objectlist.awk.in
98 fi
99 AC_SUBST(MACHINE_OBJECTLIST)
100
101 if test -n "${sys_dir}"; then
102   SYS_OBJECTLIST=libc/sys/${sys_dir}/objectlist.awk.in
103 fi
104 AC_SUBST(SYS_OBJECTLIST)
105
106 if test "${have_sys_mach_dir}" = "yes"; then
107   SYS_MACH_OBJECTLIST=libc/sys/${sys_dir}/machine/${machine_dir}/objectlist.awk.in
108 fi
109 AC_SUBST(SYS_MACH_OBJECTLIST)
110
111 if test -n "${posix_dir}"; then
112   POSIX_OBJECTLIST=libc/${posix_dir}/objectlist.awk.in
113 fi
114 AC_SUBST(POSIX_OBJECTLIST)
115
116 if test -n "${signal_dir}"; then
117   SIGNAL_OBJECTLIST=libc/${signal_dir}/objectlist.awk.in
118 fi
119 AC_SUBST(SIGNAL_OBJECTLIST)
120
121 if test -n "${syscall_dir}"; then
122   SYSCALL_OBJECTLIST=libc/${syscall_dir}/objectlist.awk.in
123 fi
124 AC_SUBST(SYSCALL_OBJECTLIST)
125
126 if test -n "${unix_dir}"; then
127   UNIX_OBJECTLIST=libc/${unix_dir}/objectlist.awk.in
128 fi
129 AC_SUBST(UNIX_OBJECTLIST)
130
131 if test -n "${stdio64_dir}"; then
132   STDIO64_OBJECTLIST=libc/${stdio64_dir}/objectlist.awk.in
133 fi
134 AC_SUBST(STDIO64_OBJECTLIST)
135
136 # Put a plausible default for CC_FOR_BUILD in Makefile.
137 if test -z "$CC_FOR_BUILD"; then
138   CC_FOR_BUILD=gcc
139 fi
140 AC_SUBST(CC_FOR_BUILD)
141
142 if test "${newlib_elix_level}" -gt "0"; then
143 AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level})
144 fi
145
146 if test "${newlib_mb}" = "yes"; then
147 AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8)
148 fi
149
150 AC_DEFINE_UNQUOTED(_NEWLIB_VERSION,"$VERSION")
151
152 if test "${multilib}" = "yes"; then
153   multilib_arg="--enable-multilib"
154 else
155   multilib_arg=
156 fi
157
158
159 AC_OUTPUT(Makefile,
160 [if test -n "$CONFIG_FILES"; then
161   unset ac_file
162   . ${newlib_basedir}/../config-ml.in
163 fi],
164 srcdir=${srcdir}
165 host=${host}
166 target=${target}
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}
171 CC="${CC}"
172 LDFLAGS="${LDFLAGS}"
173 )