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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib-1.10.0/] [newlib/] [aclocal.m4] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 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
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
 
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.