OSDN Git Service

2004-09-15 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.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
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
19 NEWLIB_CONFIGURE(..)
20
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
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
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
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
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
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
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
81 LIBC_SYSCALL_LIB=
82 if test -n "${syscall_dir}"; then
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
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
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
99 fi
100 AC_SUBST(LIBC_UNIX_LIB)
101 AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
102
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
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
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
121 fi
122 AC_SUBST(LIBC_SYS_LIB)
123 AC_SUBST(sys_dir)
124
125 dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
126 AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x)
127
128 if test -n "${machine_dir}"; then
129   if test "${use_libtool}" = "yes"; then
130     LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
131   else
132     LIBC_MACHINE_LIB=machine/lib.${aext}
133   fi
134 fi
135 AC_SUBST(LIBC_MACHINE_LIB)
136 AC_SUBST(machine_dir)
137
138 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)