OSDN Git Service

2002-04-17 Jeff Johnston <jjohnstn@redhat.com>
[pf3gnuchains/sourceware.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
7 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 
8 AC_CONFIG_AUX_DIR(..)
9
10 NEWLIB_CONFIGURE(.)
11
12 dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
13 dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
14 dnl line of the macro which fail because appropriate LDFLAGS are not set.
15 if test "${use_libtool}" = "yes"; then
16 AC_LIBTOOL_WIN32_DLL
17 AM_PROG_LIBTOOL
18 AC_PROG_AWK
19 fi
20
21 configdirs="libc libm"
22
23 AC_ARG_ENABLE(newlib_hw_fp,
24 [  --enable-newlib-hw-fp    Turn on hardware floating point math],
25 [case "${enableval}" in
26    yes) newlib_hw_fp=true ;;
27    no)  newlib_hw_fp=false ;;
28    *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;;
29  esac],[newlib_hw_fp=false])
30 AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue)
31
32 if test -z "${with_multisubdir}"; then
33   configdirs="${configdirs} doc"
34   have_doc=yes
35 else
36   have_doc=
37 fi
38 AM_CONDITIONAL(HAVE_DOC, test x$have_doc = xyes)
39
40 AC_CONFIG_SUBDIRS(${configdirs})
41
42 CRT0=
43 CRT0_DIR=
44 if test -n "${sys_dir}"; then
45   CRT0=crt0.o
46   CRT0_DIR=libc/
47 fi
48 AC_SUBST(CRT0)
49 AC_SUBST(CRT0_DIR)
50
51 CRT1=${crt1}
52 CRT1_DIR=
53 if test -n "${crt1_dir}"; then
54   CRT1_DIR=${crt1_dir}/
55 fi
56 AC_SUBST(CRT1)
57 AC_SUBST(CRT1_DIR)
58
59 if test -n "${libm_machine_dir}"; then
60   LIBM_MACHINE_OBJECTLIST=libm/machine/${libm_machine_dir}/objectlist.awk.in
61 fi
62 AC_SUBST(LIBM_MACHINE_OBJECTLIST)
63
64 if test -n "${machine_dir}"; then
65   MACHINE_OBJECTLIST=libc/machine/${machine_dir}/objectlist.awk.in
66 fi
67 AC_SUBST(MACHINE_OBJECTLIST)
68
69 if test -n "${sys_dir}"; then
70   SYS_OBJECTLIST=libc/sys/${sys_dir}/objectlist.awk.in
71 fi
72 AC_SUBST(SYS_OBJECTLIST)
73
74 if test "${have_sys_mach_dir}" = "yes"; then
75   SYS_MACH_OBJECTLIST=libc/sys/${sys_dir}/machine/${machine_dir}/objectlist.awk.in
76 fi
77 AC_SUBST(SYS_MACH_OBJECTLIST)
78
79 if test -n "${posix_dir}"; then
80   POSIX_OBJECTLIST=libc/${posix_dir}/objectlist.awk.in
81 fi
82 AC_SUBST(POSIX_OBJECTLIST)
83
84 if test -n "${signal_dir}"; then
85   SIGNAL_OBJECTLIST=libc/${signal_dir}/objectlist.awk.in
86 fi
87 AC_SUBST(SIGNAL_OBJECTLIST)
88
89 if test -n "${syscall_dir}"; then
90   SYSCALL_OBJECTLIST=libc/${syscall_dir}/objectlist.awk.in
91 fi
92 AC_SUBST(SYSCALL_OBJECTLIST)
93
94 if test -n "${unix_dir}"; then
95   UNIX_OBJECTLIST=libc/${unix_dir}/objectlist.awk.in
96 fi
97 AC_SUBST(UNIX_OBJECTLIST)
98
99 # Put a plausible default for CC_FOR_BUILD in Makefile.
100 if test -z "$CC_FOR_BUILD"; then
101   if test "x$cross_compiling" = "xno"; then
102     CC_FOR_BUILD='$(CC)'
103   else
104     CC_FOR_BUILD=gcc
105   fi
106 fi
107 AC_SUBST(CC_FOR_BUILD)
108
109 if test "${multilib}" = "yes"; then
110   multilib_arg="--enable-multilib"
111 else
112   multilib_arg=
113 fi
114
115
116 AC_OUTPUT(Makefile,
117 [if test -n "$CONFIG_FILES"; then
118   . ${newlib_basedir}/../config-ml.in
119 fi],
120 srcdir=${srcdir}
121 host=${host}
122 target=${target}
123 with_multisubdir=${with_multisubdir}
124 ac_configure_args="${multilib_arg} ${ac_configure_args}"
125 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
126 newlib_basedir=${newlib_basedir}
127 CC="${CC}"
128 LDFLAGS="${LDFLAGS}"
129 )