OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libm/] [aclocal.m4] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.