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

Subversion Repositories or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1010 ivang
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-malloc-debugging - currently only supported for Cygwin
55
AC_ARG_ENABLE(malloc-debugging,
56
[  --enable-malloc-debugging indicate malloc debugging requested],
57
[case "${enableval}" in
58
  yes) malloc_debugging=yes ;;
59
  no)  malloc_debugging=no ;;
60
  *)   AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
61
 esac], [malloc_debugging=])dnl
62
 
63
dnl Support --enable-newlib-mb
64
AC_ARG_ENABLE(newlib-mb,
65
[  --enable-newlib-mb        enable multibyte support],
66
[case "${enableval}" in
67
  yes) newlib_mb=yes ;;
68
  no)  newlib_mb=no ;;
69
  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
70
 esac], [newlib_mb=no])dnl
71
 
72
dnl We may get other options which we don't document:
73
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
74
 
75
test -z "[$]{with_target_subdir}" && with_target_subdir=.
76
 
77
if test "[$]{srcdir}" = "."; then
78
  if test "[$]{with_target_subdir}" != "."; then
79
    newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
80
  else
81
    newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
82
  fi
83
else
84
  newlib_basedir="[$]{srcdir}/$1"
85
fi
86
AC_SUBST(newlib_basedir)
87
 
88
AC_CANONICAL_HOST
89
 
90
AM_INIT_AUTOMAKE(newlib, 1.10.0)
91
 
92
# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
93
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
94
# are probably using a cross compiler, which will not be able to fully
95
# link an executable.  This should really be fixed in autoconf
96
# itself.
97
 
98
AC_DEFUN(LIB_AC_PROG_CC,
99
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
100
AC_CHECK_PROG(CC, gcc, gcc)
101
if test -z "$CC"; then
102
  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
103
  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
104
fi
105
 
106
AC_PROG_CC_GNU
107
 
108
if test $ac_cv_prog_gcc = yes; then
109
  GCC=yes
110
dnl Check whether -g works, even if CFLAGS is set, in case the package
111
dnl plays around with CFLAGS (such as to build both debugging and
112
dnl normal versions of a library), tasteless as that idea is.
113
  ac_test_CFLAGS="${CFLAGS+set}"
114
  ac_save_CFLAGS="$CFLAGS"
115
  CFLAGS=
116
  AC_PROG_CC_G
117
  if test "$ac_test_CFLAGS" = set; then
118
    CFLAGS="$ac_save_CFLAGS"
119
  elif test $ac_cv_prog_cc_g = yes; then
120
    CFLAGS="-g -O2"
121
  else
122
    CFLAGS="-O2"
123
  fi
124
else
125
  GCC=
126
  test "${CFLAGS+set}" = set || CFLAGS="-g"
127
fi
128
])
129
 
130
LIB_AC_PROG_CC
131
 
132
# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
133
# run it explicitly here, it will be run implicitly before
134
# NEWLIB_CONFIGURE, which doesn't work because that means that it will
135
# be run before AC_CANONICAL_HOST.
136
AC_CANONICAL_BUILD
137
 
138
AC_CHECK_TOOL(AS, as)
139
AC_CHECK_TOOL(AR, ar)
140
AC_CHECK_TOOL(RANLIB, ranlib, :)
141
 
142
AC_PROG_INSTALL
143
 
144
AM_MAINTAINER_MODE
145
 
146
# We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
147
# at least currently, we never actually build a program, so we never
148
# need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
149
# fails, because we are probably configuring with a cross compiler
150
# which can't create executables.  So we include AC_EXEEXT to keep
151
# automake happy, but we don't execute it, since we don't care about
152
# the result.
153
if false; then
154
  AC_EXEEXT
155
fi
156
 
157
. [$]{newlib_basedir}/configure.host
158
 
159
case [$]{newlib_basedir} in
160
/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
161
*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
162
esac
163
 
164
newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
165
case "${host}" in
166
  *-*-cygwin*)
167
    newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include  -I[$]{newlib_flagbasedir}/../winsup/w32api/include"
168
    ;;
169
esac
170
 
171
newlib_cflags="[$]{newlib_cflags} -fno-builtin"
172
 
173
NEWLIB_CFLAGS=${newlib_cflags}
174
AC_SUBST(NEWLIB_CFLAGS)
175
 
176
LDFLAGS=${ldflags}
177
AC_SUBST(LDFLAGS)
178
 
179
AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
180
AC_SUBST(oext)
181
AC_SUBST(aext)
182
 
183
AC_SUBST(libm_machine_dir)
184
AC_SUBST(machine_dir)
185
AC_SUBST(sys_dir)
186
])
187
 
188
# Do all the work for Automake.  This macro actually does too much --
189
# some checks are only needed if your package does certain things.
190
# But this isn't really a big deal.
191
 
192
# serial 1
193
 
194
dnl Usage:
195
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
196
 
197
AC_DEFUN(AM_INIT_AUTOMAKE,
198
[AC_REQUIRE([AC_PROG_INSTALL])
199
PACKAGE=[$1]
200
AC_SUBST(PACKAGE)
201
VERSION=[$2]
202
AC_SUBST(VERSION)
203
dnl test to see if srcdir already configured
204
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
205
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
206
fi
207
ifelse([$3],,
208
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
209
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
210
AC_REQUIRE([AM_SANITY_CHECK])
211
AC_REQUIRE([AC_ARG_PROGRAM])
212
dnl FIXME This is truly gross.
213
missing_dir=`cd $ac_aux_dir && pwd`
214
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
215
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
216
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
217
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
218
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
219
AC_REQUIRE([AC_PROG_MAKE_SET])])
220
 
221
#
222
# Check to make sure that the build environment is sane.
223
#
224
 
225
AC_DEFUN(AM_SANITY_CHECK,
226
[AC_MSG_CHECKING([whether build environment is sane])
227
# Just in case
228
sleep 1
229
echo timestamp > conftestfile
230
# Do `set' in a subshell so we don't clobber the current shell's
231
# arguments.  Must try -L first in case configure is actually a
232
# symlink; some systems play weird games with the mod time of symlinks
233
# (eg FreeBSD returns the mod time of the symlink's containing
234
# directory).
235
if (
236
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
237
   if test "[$]*" = "X"; then
238
      # -L didn't work.
239
      set X `ls -t $srcdir/configure conftestfile`
240
   fi
241
   if test "[$]*" != "X $srcdir/configure conftestfile" \
242
      && test "[$]*" != "X conftestfile $srcdir/configure"; then
243
 
244
      # If neither matched, then we have a broken ls.  This can happen
245
      # if, for instance, CONFIG_SHELL is bash and it inherits a
246
      # broken ls alias from the environment.  This has actually
247
      # happened.  Such a system could not be considered "sane".
248
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
249
alias in your environment])
250
   fi
251
 
252
   test "[$]2" = conftestfile
253
   )
254
then
255
   # Ok.
256
   :
257
else
258
   AC_MSG_ERROR([newly created file is older than distributed files!
259
Check your system clock])
260
fi
261
rm -f conftest*
262
AC_MSG_RESULT(yes)])
263
 
264
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
265
dnl The program must properly implement --version.
266
AC_DEFUN(AM_MISSING_PROG,
267
[AC_MSG_CHECKING(for working $2)
268
# Run test in a subshell; some versions of sh will print an error if
269
# an executable is not found, even if stderr is redirected.
270
# Redirect stdin to placate older versions of autoconf.  Sigh.
271
if ($2 --version) < /dev/null > /dev/null 2>&1; then
272
   $1=$2
273
   AC_MSG_RESULT(found)
274
else
275
   $1="$3/missing $2"
276
   AC_MSG_RESULT(missing)
277
fi
278
AC_SUBST($1)])
279
 
280
# Add --enable-maintainer-mode option to configure.
281
# From Jim Meyering
282
 
283
# serial 1
284
 
285
AC_DEFUN(AM_MAINTAINER_MODE,
286
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
287
  dnl maintainer-mode is disabled by default
288
  AC_ARG_ENABLE(maintainer-mode,
289
[  --enable-maintainer-mode enable make rules and dependencies not useful
290
                          (and sometimes confusing) to the casual installer],
291
      USE_MAINTAINER_MODE=$enableval,
292
      USE_MAINTAINER_MODE=no)
293
  AC_MSG_RESULT($USE_MAINTAINER_MODE)
294
  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
295
  MAINT=$MAINTAINER_MODE_TRUE
296
  AC_SUBST(MAINT)dnl
297
]
298
)
299
 
300
 
301
# serial 40 AC_PROG_LIBTOOL
302
AC_DEFUN(AC_PROG_LIBTOOL,
303
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
304
 
305
# Save cache, so that ltconfig can load it
306
AC_CACHE_SAVE
307
 
308
# Actually configure libtool.  ac_aux_dir is where install-sh is found.
309
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
310
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
311
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
312
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
313
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
314
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
315
|| AC_MSG_ERROR([libtool configure failed])
316
 
317
# Reload cache, that may have been modified by ltconfig
318
AC_CACHE_LOAD
319
 
320
# This can be used to rebuild libtool when needed
321
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
322
 
323
# Always use our own libtool.
324
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
325
AC_SUBST(LIBTOOL)dnl
326
 
327
# Redirect the config.log output again, so that the ltconfig log is not
328
# clobbered by the next message.
329
exec 5>>./config.log
330
])
331
 
332
AC_DEFUN(AC_LIBTOOL_SETUP,
333
[AC_PREREQ(2.13)dnl
334
AC_REQUIRE([AC_ENABLE_SHARED])dnl
335
AC_REQUIRE([AC_ENABLE_STATIC])dnl
336
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
337
AC_REQUIRE([AC_CANONICAL_HOST])dnl
338
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
339
AC_REQUIRE([AC_PROG_RANLIB])dnl
340
AC_REQUIRE([AC_PROG_CC])dnl
341
AC_REQUIRE([AC_PROG_LD])dnl
342
AC_REQUIRE([AC_PROG_NM])dnl
343
AC_REQUIRE([AC_PROG_LN_S])dnl
344
dnl
345
 
346
# Check for any special flags to pass to ltconfig.
347
libtool_flags="--cache-file=$cache_file"
348
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
349
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
350
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
351
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
352
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
353
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
354
[libtool_flags="$libtool_flags --enable-dlopen"])
355
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
356
[libtool_flags="$libtool_flags --enable-win32-dll"])
357
AC_ARG_ENABLE(libtool-lock,
358
  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
359
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
360
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
361
 
362
# Some flags need to be propagated to the compiler or linker for good
363
# libtool support.
364
case "$host" in
365
*-*-irix6*)
366
  # Find out which ABI we are using.
367
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
368
  if AC_TRY_EVAL(ac_compile); then
369
    case "`/usr/bin/file conftest.o`" in
370
    *32-bit*)
371
      LD="${LD-ld} -32"
372
      ;;
373
    *N32*)
374
      LD="${LD-ld} -n32"
375
      ;;
376
    *64-bit*)
377
      LD="${LD-ld} -64"
378
      ;;
379
    esac
380
  fi
381
  rm -rf conftest*
382
  ;;
383
 
384
*-*-sco3.2v5*)
385
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
386
  SAVE_CFLAGS="$CFLAGS"
387
  CFLAGS="$CFLAGS -belf"
388
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
389
    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
390
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
391
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
392
    CFLAGS="$SAVE_CFLAGS"
393
  fi
394
  ;;
395
 
396
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
397
[*-*-cygwin* | *-*-mingw*)
398
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
399
  AC_CHECK_TOOL(AS, as, false)
400
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
401
  ;;
402
])
403
esac
404
])
405
 
406
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
407
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
408
 
409
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
410
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
411
 
412
# AC_ENABLE_SHARED - implement the --enable-shared flag
413
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
414
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
415
#   `yes'.
416
AC_DEFUN(AC_ENABLE_SHARED, [dnl
417
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
418
AC_ARG_ENABLE(shared,
419
changequote(<<, >>)dnl
420
<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
421
changequote([, ])dnl
422
[p=${PACKAGE-default}
423
case "$enableval" in
424
yes) enable_shared=yes ;;
425
no) enable_shared=no ;;
426
*)
427
  enable_shared=no
428
  # Look at the argument we got.  We use all the common list separators.
429
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
430
  for pkg in $enableval; do
431
    if test "X$pkg" = "X$p"; then
432
      enable_shared=yes
433
    fi
434
  done
435
  IFS="$ac_save_ifs"
436
  ;;
437
esac],
438
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
439
])
440
 
441
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
442
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
443
AC_ENABLE_SHARED(no)])
444
 
445
# AC_ENABLE_STATIC - implement the --enable-static flag
446
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
447
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
448
#   `yes'.
449
AC_DEFUN(AC_ENABLE_STATIC, [dnl
450
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
451
AC_ARG_ENABLE(static,
452
changequote(<<, >>)dnl
453
<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
454
changequote([, ])dnl
455
[p=${PACKAGE-default}
456
case "$enableval" in
457
yes) enable_static=yes ;;
458
no) enable_static=no ;;
459
*)
460
  enable_static=no
461
  # Look at the argument we got.  We use all the common list separators.
462
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
463
  for pkg in $enableval; do
464
    if test "X$pkg" = "X$p"; then
465
      enable_static=yes
466
    fi
467
  done
468
  IFS="$ac_save_ifs"
469
  ;;
470
esac],
471
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
472
])
473
 
474
# AC_DISABLE_STATIC - set the default static flag to --disable-static
475
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
476
AC_ENABLE_STATIC(no)])
477
 
478
 
479
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
480
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
481
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
482
#   `yes'.
483
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
484
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
485
AC_ARG_ENABLE(fast-install,
486
changequote(<<, >>)dnl
487
<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
488
changequote([, ])dnl
489
[p=${PACKAGE-default}
490
case "$enableval" in
491
yes) enable_fast_install=yes ;;
492
no) enable_fast_install=no ;;
493
*)
494
  enable_fast_install=no
495
  # Look at the argument we got.  We use all the common list separators.
496
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
497
  for pkg in $enableval; do
498
    if test "X$pkg" = "X$p"; then
499
      enable_fast_install=yes
500
    fi
501
  done
502
  IFS="$ac_save_ifs"
503
  ;;
504
esac],
505
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
506
])
507
 
508
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
509
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
510
AC_ENABLE_FAST_INSTALL(no)])
511
 
512
# AC_PROG_LD - find the path to the GNU or non-GNU linker
513
AC_DEFUN(AC_PROG_LD,
514
[AC_ARG_WITH(gnu-ld,
515
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
516
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
517
AC_REQUIRE([AC_PROG_CC])dnl
518
AC_REQUIRE([AC_CANONICAL_HOST])dnl
519
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
520
ac_prog=ld
521
if test "$ac_cv_prog_gcc" = yes; then
522
  # Check if gcc -print-prog-name=ld gives a path.
523
  AC_MSG_CHECKING([for ld used by GCC])
524
  ac_prog=`($CC -print-prog-name=ld) 2>&5`
525
  case "$ac_prog" in
526
    # Accept absolute paths.
527
changequote(,)dnl
528
    [\\/]* | [A-Za-z]:[\\/]*)
529
      re_direlt='/[^/][^/]*/\.\./'
530
changequote([,])dnl
531
      # Canonicalize the path of ld
532
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
533
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
534
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
535
      done
536
      test -z "$LD" && LD="$ac_prog"
537
      ;;
538
  "")
539
    # If it fails, then pretend we aren't using GCC.
540
    ac_prog=ld
541
    ;;
542
  *)
543
    # If it is relative, then search for the first ld in PATH.
544
    with_gnu_ld=unknown
545
    ;;
546
  esac
547
elif test "$with_gnu_ld" = yes; then
548
  AC_MSG_CHECKING([for GNU ld])
549
else
550
  AC_MSG_CHECKING([for non-GNU ld])
551
fi
552
AC_CACHE_VAL(ac_cv_path_LD,
553
[if test -z "$LD"; then
554
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
555
  for ac_dir in $PATH; do
556
    test -z "$ac_dir" && ac_dir=.
557
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
558
      ac_cv_path_LD="$ac_dir/$ac_prog"
559
      # Check to see if the program is GNU ld.  I'd rather use --version,
560
      # but apparently some GNU ld's only accept -v.
561
      # Break only if it was the GNU/non-GNU ld that we prefer.
562
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
563
        test "$with_gnu_ld" != no && break
564
      else
565
        test "$with_gnu_ld" != yes && break
566
      fi
567
    fi
568
  done
569
  IFS="$ac_save_ifs"
570
else
571
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
572
fi])
573
LD="$ac_cv_path_LD"
574
if test -n "$LD"; then
575
  AC_MSG_RESULT($LD)
576
else
577
  AC_MSG_RESULT(no)
578
fi
579
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
580
AC_PROG_LD_GNU
581
])
582
 
583
AC_DEFUN(AC_PROG_LD_GNU,
584
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
585
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
586
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
587
  ac_cv_prog_gnu_ld=yes
588
else
589
  ac_cv_prog_gnu_ld=no
590
fi])
591
])
592
 
593
# AC_PROG_NM - find the path to a BSD-compatible name lister
594
AC_DEFUN(AC_PROG_NM,
595
[AC_MSG_CHECKING([for BSD-compatible nm])
596
AC_CACHE_VAL(ac_cv_path_NM,
597
[if test -n "$NM"; then
598
  # Let the user override the test.
599
  ac_cv_path_NM="$NM"
600
else
601
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
602
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
603
    test -z "$ac_dir" && ac_dir=.
604
    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
605
      # Check to see if the nm accepts a BSD-compat flag.
606
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
607
      #   nm: unknown option "B" ignored
608
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
609
        ac_cv_path_NM="$ac_dir/nm -B"
610
        break
611
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
612
        ac_cv_path_NM="$ac_dir/nm -p"
613
        break
614
      else
615
        ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
616
        continue # so that we can try to find one that supports BSD flags
617
      fi
618
    fi
619
  done
620
  IFS="$ac_save_ifs"
621
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
622
fi])
623
NM="$ac_cv_path_NM"
624
AC_MSG_RESULT([$NM])
625
])
626
 
627
# AC_CHECK_LIBM - check for math library
628
AC_DEFUN(AC_CHECK_LIBM,
629
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
630
LIBM=
631
case "$host" in
632
*-*-beos* | *-*-cygwin*)
633
  # These system don't have libm
634
  ;;
635
*-ncr-sysv4.3*)
636
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
637
  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
638
  ;;
639
*)
640
  AC_CHECK_LIB(m, main, LIBM="-lm")
641
  ;;
642
esac
643
])
644
 
645
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
646
# the libltdl convenience library, adds --enable-ltdl-convenience to
647
# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
648
# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
649
# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
650
# '${top_builddir}/' (note the single quotes!) if your package is not
651
# flat, and, if you're not using automake, define top_builddir as
652
# appropriate in the Makefiles.
653
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
654
  case "$enable_ltdl_convenience" in
655
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
656
  "") enable_ltdl_convenience=yes
657
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
658
  esac
659
  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
660
  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
661
])
662
 
663
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
664
# the libltdl installable library, and adds --enable-ltdl-install to
665
# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
666
# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
667
# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
668
# '${top_builddir}/' (note the single quotes!) if your package is not
669
# flat, and, if you're not using automake, define top_builddir as
670
# appropriate in the Makefiles.
671
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
672
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
673
  AC_CHECK_LIB(ltdl, main,
674
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
675
  [if test x"$enable_ltdl_install" = xno; then
676
     AC_MSG_WARN([libltdl not installed, but installation disabled])
677
   else
678
     enable_ltdl_install=yes
679
   fi
680
  ])
681
  if test x"$enable_ltdl_install" = x"yes"; then
682
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
683
    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
684
    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
685
  else
686
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
687
    LIBLTDL="-lltdl"
688
    INCLTDL=
689
  fi
690
])
691
 
692
dnl old names
693
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
694
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
695
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
696
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
697
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
698
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
699
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
700
 
701
dnl This is just to silence aclocal about the macro not being used
702
ifelse([AC_DISABLE_FAST_INSTALL])dnl
703
 

powered by: WebSVN 2.1.0

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