]> sourceware.org Git - newlib-cygwin.git/blame - newlib/acinclude.m4
* libm/common/s_fdim.c: New file.
[newlib-cygwin.git] / newlib / acinclude.m4
CommitLineData
8a0efa53
CF
1dnl This provides configure definitions used by all the newlib
2dnl configure.in files.
3
4dnl Basic newlib configury. This calls basic introductory stuff,
5dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
6dnl configure.host. The only argument is the relative path to the top
7dnl newlib directory.
8
9AC_DEFUN(NEWLIB_CONFIGURE,
10[
11dnl Default to --enable-multilib
12AC_ARG_ENABLE(multilib,
13[ --enable-multilib build many library versions (default)],
14[case "${enableval}" in
15 yes) multilib=yes ;;
16 no) multilib=no ;;
17 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
18 esac], [multilib=yes])dnl
19
20dnl Support --enable-target-optspace
21AC_ARG_ENABLE(target-optspace,
22[ --enable-target-optspace optimize for space],
23[case "${enableval}" in
24 yes) target_optspace=yes ;;
25 no) target_optspace=no ;;
26 *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
27 esac], [target_optspace=])dnl
28
3ac6f3a7
JJ
29dnl Support --enable-malloc-debugging - currently only supported for Cygwin
30AC_ARG_ENABLE(malloc-debugging,
31[ --enable-malloc-debugging indicate malloc debugging requested],
32[case "${enableval}" in
33 yes) malloc_debugging=yes ;;
34 no) malloc_debugging=no ;;
35 *) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
36 esac], [malloc_debugging=])dnl
37
8a0efa53
CF
38dnl Support --enable-newlib-mb
39AC_ARG_ENABLE(newlib-mb,
40[ --enable-newlib-mb enable multibyte support],
41[case "${enableval}" in
42 yes) newlib_mb=yes ;;
43 no) newlib_mb=no ;;
44 *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
45 esac], [newlib_mb=no])dnl
46
0c048a9a
TF
47dnl Support --enable-newlib-multithread
48AC_ARG_ENABLE(newlib-multithread,
49[ --enable-newlib-multithread enable support for multiple threads],
50[case "${enableval}" in
51 yes) newlib_multithread=yes ;;
52 no) newlib_multithread=no ;;
53 *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
54 esac], [newlib_multithread=yes])dnl
55
afecf2fa
JJ
56dnl Support --disable-newlib-io-float
57AC_ARG_ENABLE(newlib-io-float,
58[ --disable-newlib-io-float disable printf/scanf family float support],
59[case "${enableval}" in
60 yes) newlib_io_float=yes ;;
61 no) newlib_io_float=no ;;
62 *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
63 esac], [newlib_io_float=yes])dnl
64
65
8a0efa53
CF
66dnl We may get other options which we don't document:
67dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
68
69test -z "[$]{with_target_subdir}" && with_target_subdir=.
70
71if test "[$]{srcdir}" = "."; then
72 if test "[$]{with_target_subdir}" != "."; then
73 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
74 else
75 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
76 fi
77else
78 newlib_basedir="[$]{srcdir}/$1"
79fi
80AC_SUBST(newlib_basedir)
81
eaa75b70 82AC_CANONICAL_SYSTEM
8a0efa53 83
2e1a7175 84AM_INIT_AUTOMAKE(newlib, 1.10.0)
8a0efa53
CF
85
86# FIXME: We temporarily define our own version of AC_PROG_CC. This is
87# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
88# are probably using a cross compiler, which will not be able to fully
89# link an executable. This should really be fixed in autoconf
90# itself.
91
92AC_DEFUN(LIB_AC_PROG_CC,
93[AC_BEFORE([$0], [AC_PROG_CPP])dnl
94AC_CHECK_PROG(CC, gcc, gcc)
95if test -z "$CC"; then
96 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
97 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
98fi
99
100AC_PROG_CC_GNU
101
102if test $ac_cv_prog_gcc = yes; then
103 GCC=yes
104dnl Check whether -g works, even if CFLAGS is set, in case the package
105dnl plays around with CFLAGS (such as to build both debugging and
106dnl normal versions of a library), tasteless as that idea is.
107 ac_test_CFLAGS="${CFLAGS+set}"
108 ac_save_CFLAGS="$CFLAGS"
109 CFLAGS=
110 AC_PROG_CC_G
111 if test "$ac_test_CFLAGS" = set; then
112 CFLAGS="$ac_save_CFLAGS"
113 elif test $ac_cv_prog_cc_g = yes; then
114 CFLAGS="-g -O2"
115 else
116 CFLAGS="-O2"
117 fi
118else
119 GCC=
120 test "${CFLAGS+set}" = set || CFLAGS="-g"
121fi
122])
123
124LIB_AC_PROG_CC
125
8a0efa53
CF
126AC_CHECK_TOOL(AS, as)
127AC_CHECK_TOOL(AR, ar)
128AC_CHECK_TOOL(RANLIB, ranlib, :)
129
130AC_PROG_INSTALL
131
132AM_MAINTAINER_MODE
133
134# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
135# at least currently, we never actually build a program, so we never
136# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
137# fails, because we are probably configuring with a cross compiler
138# which can't create executables. So we include AC_EXEEXT to keep
139# automake happy, but we don't execute it, since we don't care about
140# the result.
141if false; then
142 AC_EXEEXT
143fi
144
145. [$]{newlib_basedir}/configure.host
146
8a0efa53
CF
147newlib_cflags="[$]{newlib_cflags} -fno-builtin"
148
149NEWLIB_CFLAGS=${newlib_cflags}
150AC_SUBST(NEWLIB_CFLAGS)
151
2e1a7175
TF
152LDFLAGS=${ldflags}
153AC_SUBST(LDFLAGS)
154
155AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
0953fe64
TF
156
157# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
158# use oext, which is set in configure.host based on the target platform.
159OBJEXT=${oext}
160
161AC_SUBST(OBJEXT)
2e1a7175
TF
162AC_SUBST(oext)
163AC_SUBST(aext)
164
165AC_SUBST(libm_machine_dir)
8a0efa53
CF
166AC_SUBST(machine_dir)
167AC_SUBST(sys_dir)
168])
This page took 0.071513 seconds and 5 git commands to generate.