annotate m4/lib-ld.m4 @ 977:773c485cf628 trunk

[svn] - Revert: Okay, I'm a fool. There was a reason they weren't included.
author nhjm449
date Wed, 26 Apr 2006 21:26:03 -0700
parents cb178e5ad177
children 2df5e83c9bf4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 # lib-ld.m4 serial 2 (gettext-0.12)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 dnl This file is free software, distributed under the terms of the GNU
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 dnl General Public License. As a special exception to the GNU General
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 dnl Public License, this file may be distributed as part of a program
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 dnl that contains a configuration script generated by Autoconf, under
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 dnl the same distribution terms as the rest of that program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 dnl Subroutines of libtool.m4,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 dnl with libtool.m4.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 AC_DEFUN([AC_LIB_PROG_LD_GNU],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 acl_cv_prog_gnu_ld=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 acl_cv_prog_gnu_ld=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 fi])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 with_gnu_ld=$acl_cv_prog_gnu_ld
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 dnl From libtool-1.4. Sets the variable LD.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 AC_DEFUN([AC_LIB_PROG_LD],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 [AC_ARG_WITH(gnu-ld,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 AC_REQUIRE([AC_PROG_CC])dnl
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 AC_REQUIRE([AC_CANONICAL_HOST])dnl
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 # Prepare PATH_SEPARATOR.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 # The user is always right.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 if test "${PATH_SEPARATOR+set}" != set; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 echo "#! /bin/sh" >conf$$.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 echo "exit 0" >>conf$$.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 chmod +x conf$$.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 PATH_SEPARATOR=';'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 PATH_SEPARATOR=:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 rm -f conf$$.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 ac_prog=ld
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 if test "$GCC" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 # Check if gcc -print-prog-name=ld gives a path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 AC_MSG_CHECKING([for ld used by GCC])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 *-*-mingw*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 # gcc leaves a trailing carriage return which upsets mingw
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 case $ac_prog in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 # Accept absolute paths.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 [[\\/]* | [A-Za-z]:[\\/]*)]
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 [re_direlt='/[^/][^/]*/\.\./']
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 # Canonicalize the path of ld
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 test -z "$LD" && LD="$ac_prog"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 "")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 # If it fails, then pretend we aren't using GCC.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 ac_prog=ld
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 # If it is relative, then search for the first ld in PATH.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 with_gnu_ld=unknown
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 elif test "$with_gnu_ld" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 AC_MSG_CHECKING([for GNU ld])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 AC_MSG_CHECKING([for non-GNU ld])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 AC_CACHE_VAL(acl_cv_path_LD,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 [if test -z "$LD"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 for ac_dir in $PATH; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 test -z "$ac_dir" && ac_dir=.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 acl_cv_path_LD="$ac_dir/$ac_prog"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 # Check to see if the program is GNU ld. I'd rather use --version,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 # but apparently some GNU ld's only accept -v.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 # Break only if it was the GNU/non-GNU ld that we prefer.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 test "$with_gnu_ld" != no && break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 test "$with_gnu_ld" != yes && break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 IFS="$ac_save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 acl_cv_path_LD="$LD" # Let the user override the test with a path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 fi])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 LD="$acl_cv_path_LD"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 if test -n "$LD"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 AC_MSG_RESULT($LD)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 AC_MSG_RESULT(no)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 AC_LIB_PROG_LD_GNU
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 ])