OSDN Git Service

2006-07-31 Jeff Johnston <jjohnstn@redhat.com>
[pf3gnuchains/pf3gnuchains4x.git] / newlib / libc / configure.in
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.59)
5 AC_INIT([newlib],[NEWLIB_VERSION])
6 AC_CONFIG_SRCDIR([sys.tex])
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 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
19
20 NEWLIB_CONFIGURE(..)
21
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.
25
26 if test "${use_libtool}" = "yes"; then
27 AC_LIBTOOL_WIN32_DLL
28 AM_PROG_LIBTOOL
29 fi
30
31 AC_CONFIG_SUBDIRS(machine sys)
32
33 CRT0=
34 if test "x${have_crt0}" = "xyes"; then
35   CRT0=crt0.o
36 fi
37 AC_SUBST(CRT0)
38
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.
42
43 LIBC_POSIX_LIB=
44 if test -n "${posix_dir}"; then
45   if test "${use_libtool}" = "yes"; then
46     LIBC_POSIX_LIB=${posix_dir}/lib${posix_dir}.${aext}
47   else
48     LIBC_POSIX_LIB=${posix_dir}/lib.${aext}
49   fi
50 fi
51 AC_SUBST(LIBC_POSIX_LIB)
52 AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x)
53
54 LIBC_SIGNAL_LIB=
55 LIBC_SIGNAL_DEF=
56 if test -n "${signal_dir}"; then
57   if test "${use_libtool}" = "yes"; then
58     LIBC_SIGNAL_LIB=${signal_dir}/lib${signal_dir}.${aext}
59   else
60     LIBC_SIGNAL_LIB=${signal_dir}/lib.${aext}
61   fi
62   LIBC_SIGNAL_DEF=${signal_dir}/stmp-def
63 fi
64 AC_SUBST(LIBC_SIGNAL_LIB)
65 AC_SUBST(LIBC_SIGNAL_DEF)
66 AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x)
67
68 LIBC_STDIO64_LIB=
69 LIBC_STDIO64_DEF=
70 if test -n "${stdio64_dir}"; then
71   if test "${use_libtool}" = "yes"; then
72     LIBC_STDIO64_LIB=${stdio64_dir}/lib${stdio64_dir}.${aext}
73   else
74     LIBC_STDIO64_LIB=${stdio64_dir}/lib.${aext}
75   fi
76   LIBC_STDIO64_DEF=${stdio64_dir}/stmp-def
77 fi
78 AC_SUBST(LIBC_STDIO64_LIB)
79 AC_SUBST(LIBC_STDIO64_DEF)
80 AM_CONDITIONAL(HAVE_STDIO64_DIR, test x${stdio64_dir} != x)
81
82 LIBC_SYSCALL_LIB=
83 if test -n "${syscall_dir}"; then
84   if test "${use_libtool}" = "yes"; then
85     LIBC_SYSCALL_LIB=${syscall_dir}/lib${syscall_dir}.${aext}
86   else
87     LIBC_SYSCALL_LIB=${syscall_dir}/lib.${aext}
88   fi
89 fi
90 AC_SUBST(LIBC_SYSCALL_LIB)
91 AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x)
92
93 LIBC_UNIX_LIB=
94 if test -n "${unix_dir}"; then
95   if test "${use_libtool}" = "yes"; then
96     LIBC_UNIX_LIB=${unix_dir}/lib${unix_dir}.${aext}
97   else
98     LIBC_UNIX_LIB=${unix_dir}/lib.${aext}
99   fi
100 fi
101 AC_SUBST(LIBC_UNIX_LIB)
102 AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
103
104 LIBC_EXTRA_LIB=
105 LIBC_EXTRA_DEF=
106 extra_dir=
107
108 AC_SUBST(LIBC_EXTRA_LIB)
109 AC_SUBST(LIBC_EXTRA_DEF)
110 AC_SUBST(extra_dir)
111
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.
114
115 LIBC_SYS_LIB=
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}
119   else
120     LIBC_SYS_LIB=sys/lib.${aext}
121   fi
122 fi
123 AC_SUBST(LIBC_SYS_LIB)
124 AC_SUBST(sys_dir)
125
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)
128
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}
132   else
133     LIBC_MACHINE_LIB=machine/lib.${aext}
134   fi
135 fi
136 AC_SUBST(LIBC_MACHINE_LIB)
137 AC_SUBST(machine_dir)
138
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])
140 AC_OUTPUT