* configure.in: Call AM_PROG_LEX rather than AC_PROG_LEX and
[deliverable/binutils-gdb.git] / bfd / acinclude.m4
CommitLineData
5e377ed2
ILT
1sinclude(acmacros.m4)
2
3dnl This is a copy of AM_PROG_LIBTOOL from libtool 1.0, modified to
4dnl not produce a shared library by default.
5AC_DEFUN(AM_PROG_LIBTOOL,
6[AC_REQUIRE([AC_CANONICAL_HOST])
7AC_REQUIRE([AC_PROG_CC])
8AC_REQUIRE([AC_PROG_RANLIB])
9AC_REQUIRE([AM_PROG_LD])
10AC_REQUIRE([AC_PROG_LN_S])
11
12# Always use our own libtool.
13LIBTOOL='$(top_builddir)/libtool'
14AC_SUBST(LIBTOOL)
15
16dnl Allow the --disable-shared flag to stop us from building shared libs.
17AC_ARG_ENABLE(shared,
18[ --enable-shared build shared libraries [default=yes]],
19test "$enableval" = no && libtool_shared=" --disable-shared",
20libtool_shared=--disable-shared)
21
22dnl Allow the --disable-static flag to stop us from building static libs.
23AC_ARG_ENABLE(static,
24[ --enable-static build static libraries [default=yes]],
25test "$enableval" = no && libtool_static=" --disable-static",
26libtool_static=)
27
28libtool_flags="$libtool_shared$libtool_static"
29test "$silent" = yes && libtool_flags="$libtool_flags --silent"
30test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
31test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
32
33# Some flags need to be propagated to the compiler or linker for good
34# libtool support.
35[case "$host" in
36*-*-irix6*)
37 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
38 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
39 LD="${LD-ld} $f"
40 fi
41 done
42 ;;
43
44*-*-sco3.2v5*)
45 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
46 CFLAGS="$CFLAGS -belf"
47 ;;
48esac]
49
50# Actually configure libtool. ac_aux_dir is where install-sh is found.
51CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
52LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
53${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
54$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
55|| AC_MSG_ERROR([libtool configure failed])
56])
57
58# AM_PROG_LD - find the path to the GNU or non-GNU linker
59AC_DEFUN(AM_PROG_LD,
60[AC_ARG_WITH(gnu-ld,
61[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
62test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
63if test "$with_gnu_ld" = yes; then
64 AC_MSG_CHECKING([for GNU ld])
65else
66 AC_MSG_CHECKING([for non-GNU ld])
c0734708 67fi
5e377ed2
ILT
68AC_CACHE_VAL(ac_cv_path_LD,
69[case "$LD" in
70 /*)
71 ac_cv_path_LD="$LD" # Let the user override the test with a path.
72 ;;
73 *)
74 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
75 for ac_dir in $PATH; do
76 test -z "$ac_dir" && ac_dir=.
77 if test -f "$ac_dir/ld"; then
78 ac_cv_path_LD="$ac_dir/ld"
79 # Check to see if the program is GNU ld. I'd rather use --version,
80 # but apparently some GNU ld's only accept -v.
81 # Break only if it was the GNU/non-GNU ld that we prefer.
82 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
83 test "$with_gnu_ld" = yes && break
84 else
85 test "$with_gnu_ld" != yes && break
86 fi
87 fi
88 done
89 IFS="$ac_save_ifs"
90 ;;
91esac])
92LD="$ac_cv_path_LD"
93if test -n "$LD"; then
94 AC_MSG_RESULT($LD)
95else
96 AC_MSG_RESULT(no)
c0734708 97fi
5e377ed2
ILT
98test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
99AC_SUBST(LD)
100AM_PROG_LD_GNU
101])
102
103AC_DEFUN(AM_PROG_LD_GNU,
104[AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
105[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
106if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
107 ac_cv_prog_gnu_ld=yes
108else
109 ac_cv_prog_gnu_ld=no
110fi])
111])
This page took 0.162533 seconds and 4 git commands to generate.