OSDN Git Service

* Makefile.shared: New file.
[pf3gnuchains/pf3gnuchains3x.git] / newlib / libc / sys / decstation / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl This provides configure definitions used by all the newlib
14 dnl configure.in files.
15
16 dnl Basic newlib configury.  This calls basic introductory stuff,
17 dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST.  It also runs
18 dnl configure.host.  The only argument is the relative path to the top
19 dnl newlib directory.
20
21 AC_DEFUN(NEWLIB_CONFIGURE,
22 [
23 dnl Default to --enable-multilib
24 AC_ARG_ENABLE(multilib,
25 [  --enable-multilib         build many library versions (default)],
26 [case "${enableval}" in
27   yes) multilib=yes ;;
28   no)  multilib=no ;;
29   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
30  esac], [multilib=yes])dnl
31
32 dnl Support --enable-target-optspace
33 AC_ARG_ENABLE(target-optspace,
34 [  --enable-target-optspace  optimize for space],
35 [case "${enableval}" in
36   yes) target_optspace=yes ;;
37   no)  target_optspace=no ;;
38   *)   AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
39  esac], [target_optspace=])dnl
40
41 dnl Support --enable-malloc-debugging - currently only supported for Cygwin
42 AC_ARG_ENABLE(malloc-debugging,
43 [  --enable-malloc-debugging indicate malloc debugging requested],
44 [case "${enableval}" in
45   yes) malloc_debugging=yes ;;
46   no)  malloc_debugging=no ;;
47   *)   AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
48  esac], [malloc_debugging=])dnl
49
50 dnl Support --enable-newlib-mb
51 AC_ARG_ENABLE(newlib-mb,
52 [  --enable-newlib-mb        enable multibyte support],
53 [case "${enableval}" in
54   yes) newlib_mb=yes ;;
55   no)  newlib_mb=no ;;
56   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
57  esac], [newlib_mb=no])dnl
58
59 dnl We may get other options which we don't document:
60 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
61
62 test -z "[$]{with_target_subdir}" && with_target_subdir=.
63
64 if test "[$]{srcdir}" = "."; then
65   if test "[$]{with_target_subdir}" != "."; then
66     newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
67   else
68     newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
69   fi
70 else
71   newlib_basedir="[$]{srcdir}/$1"
72 fi
73 AC_SUBST(newlib_basedir)
74
75 AC_CANONICAL_HOST
76
77 AM_INIT_AUTOMAKE(newlib, 1.10.0)
78
79 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
80 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
81 # are probably using a cross compiler, which will not be able to fully
82 # link an executable.  This should really be fixed in autoconf
83 # itself.
84
85 AC_DEFUN(LIB_AC_PROG_CC,
86 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
87 AC_CHECK_PROG(CC, gcc, gcc)
88 if test -z "$CC"; then
89   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
90   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
91 fi
92
93 AC_PROG_CC_GNU
94
95 if test $ac_cv_prog_gcc = yes; then
96   GCC=yes
97 dnl Check whether -g works, even if CFLAGS is set, in case the package
98 dnl plays around with CFLAGS (such as to build both debugging and
99 dnl normal versions of a library), tasteless as that idea is.
100   ac_test_CFLAGS="${CFLAGS+set}"
101   ac_save_CFLAGS="$CFLAGS"
102   CFLAGS=
103   AC_PROG_CC_G
104   if test "$ac_test_CFLAGS" = set; then
105     CFLAGS="$ac_save_CFLAGS"
106   elif test $ac_cv_prog_cc_g = yes; then
107     CFLAGS="-g -O2"
108   else
109     CFLAGS="-O2"
110   fi
111 else
112   GCC=
113   test "${CFLAGS+set}" = set || CFLAGS="-g"
114 fi
115 ])
116
117 LIB_AC_PROG_CC
118
119 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
120 # run it explicitly here, it will be run implicitly before
121 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
122 # be run before AC_CANONICAL_HOST.
123 AC_CANONICAL_BUILD
124
125 AC_CHECK_TOOL(AS, as)
126 AC_CHECK_TOOL(AR, ar)
127 AC_CHECK_TOOL(RANLIB, ranlib, :)
128
129 AC_PROG_INSTALL
130
131 AM_MAINTAINER_MODE
132
133 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
134 # at least currently, we never actually build a program, so we never
135 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
136 # fails, because we are probably configuring with a cross compiler
137 # which can't create executables.  So we include AC_EXEEXT to keep
138 # automake happy, but we don't execute it, since we don't care about
139 # the result.
140 if false; then
141   AC_EXEEXT
142 fi
143
144 . [$]{newlib_basedir}/configure.host
145
146 case [$]{newlib_basedir} in
147 /* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
148 *) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
149 esac
150
151 newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
152 case "${host}" in
153   *-*-cygwin*)
154     newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include  -I[$]{newlib_flagbasedir}/../winsup/w32api/include"
155     ;;
156 esac
157
158 newlib_cflags="[$]{newlib_cflags} -fno-builtin"
159
160 NEWLIB_CFLAGS=${newlib_cflags}
161 AC_SUBST(NEWLIB_CFLAGS)
162
163 LDFLAGS=${ldflags}
164 AC_SUBST(LDFLAGS)
165
166 AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
167 AC_SUBST(oext)
168 AC_SUBST(aext)
169
170 AC_SUBST(libm_machine_dir)
171 AC_SUBST(machine_dir)
172 AC_SUBST(sys_dir)
173 ])
174
175 # Do all the work for Automake.  This macro actually does too much --
176 # some checks are only needed if your package does certain things.
177 # But this isn't really a big deal.
178
179 # serial 1
180
181 dnl Usage:
182 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
183
184 AC_DEFUN(AM_INIT_AUTOMAKE,
185 [AC_REQUIRE([AC_PROG_INSTALL])
186 PACKAGE=[$1]
187 AC_SUBST(PACKAGE)
188 VERSION=[$2]
189 AC_SUBST(VERSION)
190 dnl test to see if srcdir already configured
191 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
192   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
193 fi
194 ifelse([$3],,
195 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
196 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
197 AC_REQUIRE([AM_SANITY_CHECK])
198 AC_REQUIRE([AC_ARG_PROGRAM])
199 dnl FIXME This is truly gross.
200 missing_dir=`cd $ac_aux_dir && pwd`
201 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
202 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
203 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
204 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
205 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
206 AC_REQUIRE([AC_PROG_MAKE_SET])])
207
208 #
209 # Check to make sure that the build environment is sane.
210 #
211
212 AC_DEFUN(AM_SANITY_CHECK,
213 [AC_MSG_CHECKING([whether build environment is sane])
214 # Just in case
215 sleep 1
216 echo timestamp > conftestfile
217 # Do `set' in a subshell so we don't clobber the current shell's
218 # arguments.  Must try -L first in case configure is actually a
219 # symlink; some systems play weird games with the mod time of symlinks
220 # (eg FreeBSD returns the mod time of the symlink's containing
221 # directory).
222 if (
223    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
224    if test "[$]*" = "X"; then
225       # -L didn't work.
226       set X `ls -t $srcdir/configure conftestfile`
227    fi
228    if test "[$]*" != "X $srcdir/configure conftestfile" \
229       && test "[$]*" != "X conftestfile $srcdir/configure"; then
230
231       # If neither matched, then we have a broken ls.  This can happen
232       # if, for instance, CONFIG_SHELL is bash and it inherits a
233       # broken ls alias from the environment.  This has actually
234       # happened.  Such a system could not be considered "sane".
235       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
236 alias in your environment])
237    fi
238
239    test "[$]2" = conftestfile
240    )
241 then
242    # Ok.
243    :
244 else
245    AC_MSG_ERROR([newly created file is older than distributed files!
246 Check your system clock])
247 fi
248 rm -f conftest*
249 AC_MSG_RESULT(yes)])
250
251 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
252 dnl The program must properly implement --version.
253 AC_DEFUN(AM_MISSING_PROG,
254 [AC_MSG_CHECKING(for working $2)
255 # Run test in a subshell; some versions of sh will print an error if
256 # an executable is not found, even if stderr is redirected.
257 # Redirect stdin to placate older versions of autoconf.  Sigh.
258 if ($2 --version) < /dev/null > /dev/null 2>&1; then
259    $1=$2
260    AC_MSG_RESULT(found)
261 else
262    $1="$3/missing $2"
263    AC_MSG_RESULT(missing)
264 fi
265 AC_SUBST($1)])
266
267 # Add --enable-maintainer-mode option to configure.
268 # From Jim Meyering
269
270 # serial 1
271
272 AC_DEFUN(AM_MAINTAINER_MODE,
273 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
274   dnl maintainer-mode is disabled by default
275   AC_ARG_ENABLE(maintainer-mode,
276 [  --enable-maintainer-mode enable make rules and dependencies not useful
277                           (and sometimes confusing) to the casual installer],
278       USE_MAINTAINER_MODE=$enableval,
279       USE_MAINTAINER_MODE=no)
280   AC_MSG_RESULT($USE_MAINTAINER_MODE)
281   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
282   MAINT=$MAINTAINER_MODE_TRUE
283   AC_SUBST(MAINT)dnl
284 ]
285 )
286
287 # Define a conditional.
288
289 AC_DEFUN(AM_CONDITIONAL,
290 [AC_SUBST($1_TRUE)
291 AC_SUBST($1_FALSE)
292 if $2; then
293   $1_TRUE=
294   $1_FALSE='#'
295 else
296   $1_TRUE='#'
297   $1_FALSE=
298 fi])
299