annotate m4/lib-link.m4 @ 2865:d226b83fa329 trunk

BSD relicensing (pass 6).
author William Pitcock <nenolod@atheme.org>
date Sat, 23 Jun 2007 22:51:13 -0500
parents 69897c4b6f53
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-link.m4 serial 4 (gettext-0.12)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 dnl Copyright (C) 2001-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 From Bruno Haible.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 dnl the libraries corresponding to explicit and implicit dependencies.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 dnl augments the CPPFLAGS variable.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 AC_DEFUN([AC_LIB_LINKFLAGS],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 AC_REQUIRE([AC_LIB_RPATH])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 define([Name],[translit([$1],[./-], [___])])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 AC_LIB_LINKFLAGS_BODY([$1], [$2])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 AC_SUBST([LIB]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 AC_SUBST([LTLIB]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 dnl results of this search when this library appears as a dependency.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 HAVE_LIB[]NAME=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 undefine([Name])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 undefine([NAME])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 dnl searches for libname and the libraries corresponding to explicit and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 dnl implicit dependencies, together with the specified include files and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 dnl the ability to compile and link the specified testcode. If found, it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 AC_REQUIRE([AC_LIB_RPATH])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 define([Name],[translit([$1],[./-], [___])])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 dnl accordingly.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 AC_LIB_LINKFLAGS_BODY([$1], [$2])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 dnl because if the user has installed lib[]Name and not disabled its use
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 dnl via --without-lib[]Name-prefix, he wants to use it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 ac_save_CPPFLAGS="$CPPFLAGS"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 ac_save_LIBS="$LIBS"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 LIBS="$LIBS $LIB[]NAME"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 LIBS="$ac_save_LIBS"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 if test "$ac_cv_lib[]Name" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 HAVE_LIB[]NAME=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 AC_MSG_CHECKING([how to link with lib[]$1])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 AC_MSG_RESULT([$LIB[]NAME])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 HAVE_LIB[]NAME=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 dnl $INC[]NAME either.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 CPPFLAGS="$ac_save_CPPFLAGS"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 LIB[]NAME=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 LTLIB[]NAME=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 AC_SUBST([HAVE_LIB]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 AC_SUBST([LIB]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 AC_SUBST([LTLIB]NAME)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 undefine([Name])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 undefine([NAME])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 dnl Determine the platform dependent parameters needed to use rpath:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 dnl hardcode_direct, hardcode_minus_L.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 AC_DEFUN([AC_LIB_RPATH],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 . ./conftest.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 rm -f ./conftest.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 acl_cv_rpath=done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 wl="$acl_cv_wl"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 libext="$acl_cv_libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 shlibext="$acl_cv_shlibext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 hardcode_direct="$acl_cv_hardcode_direct"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 hardcode_minus_L="$acl_cv_hardcode_minus_L"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 dnl the libraries corresponding to explicit and implicit dependencies.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 dnl By default, look in $includedir and $libdir.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 use_additional=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 AC_LIB_WITH_FINAL_PREFIX([
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 eval additional_includedir=\"$includedir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 eval additional_libdir=\"$libdir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 AC_LIB_ARG_WITH([lib$1-prefix],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135 if test "X$withval" = "Xno"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 use_additional=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 if test "X$withval" = "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 AC_LIB_WITH_FINAL_PREFIX([
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 eval additional_includedir=\"$includedir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 eval additional_libdir=\"$libdir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 additional_includedir="$withval/include"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 additional_libdir="$withval/lib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 dnl Search the library and its dependencies in $additional_libdir and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 dnl $LDFLAGS. Using breadth-first-seach.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151 LIB[]NAME=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 LTLIB[]NAME=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153 INC[]NAME=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 rpathdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155 ltrpathdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 names_already_handled=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157 names_next_round='$1 $2'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 while test -n "$names_next_round"; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159 names_this_round="$names_next_round"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 names_next_round=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161 for name in $names_this_round; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162 already_handled=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 for n in $names_already_handled; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164 if test "$n" = "$name"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165 already_handled=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 if test -z "$already_handled"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170 names_already_handled="$names_already_handled $name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172 dnl or AC_LIB_HAVE_LINKFLAGS call.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 eval value=\"\$HAVE_LIB$uppername\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 if test -n "$value"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176 if test "$value" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 eval value=\"\$LIB$uppername\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179 eval value=\"\$LTLIB$uppername\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183 dnl that this library doesn't exist. So just drop it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 dnl and the already constructed $LIBNAME/$LTLIBNAME.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 found_dir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190 found_la=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191 found_so=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 found_a=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193 if test $use_additional = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195 found_dir="$additional_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 found_so="$additional_libdir/lib$name.$shlibext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197 if test -f "$additional_libdir/lib$name.la"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 found_la="$additional_libdir/lib$name.la"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201 if test -f "$additional_libdir/lib$name.$libext"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 found_dir="$additional_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 found_a="$additional_libdir/lib$name.$libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 if test -f "$additional_libdir/lib$name.la"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 found_la="$additional_libdir/lib$name.la"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
207 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
209 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
210 if test "X$found_dir" = "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
211 for x in $LDFLAGS $LTLIB[]NAME; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
212 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
213 case "$x" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
214 -L*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
215 dir=`echo "X$x" | sed -e 's/^X-L//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
216 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
217 found_dir="$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
218 found_so="$dir/lib$name.$shlibext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
219 if test -f "$dir/lib$name.la"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
220 found_la="$dir/lib$name.la"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
221 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
222 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
223 if test -f "$dir/lib$name.$libext"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
224 found_dir="$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
225 found_a="$dir/lib$name.$libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
226 if test -f "$dir/lib$name.la"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
227 found_la="$dir/lib$name.la"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
228 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
229 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
230 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
231 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
232 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
233 if test "X$found_dir" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
234 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
235 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
236 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
237 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
238 if test "X$found_dir" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
239 dnl Found the library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
240 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
241 if test "X$found_so" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
242 dnl Linking with a shared library. We attempt to hardcode its
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
243 dnl directory into the executable's runpath, unless it's the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
244 dnl standard /usr/lib.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
245 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
246 dnl No hardcoding is needed.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
247 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
248 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
249 dnl Use an explicit option to hardcode DIR into the resulting
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
250 dnl binary.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
251 dnl Potentially add DIR to ltrpathdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
252 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
253 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
254 for x in $ltrpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
255 if test "X$x" = "X$found_dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
256 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
257 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
258 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
259 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
260 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
261 ltrpathdirs="$ltrpathdirs $found_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
262 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
263 dnl The hardcoding into $LIBNAME is system dependent.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
264 if test "$hardcode_direct" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
265 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
266 dnl resulting binary.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
267 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
268 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
269 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
270 dnl Use an explicit option to hardcode DIR into the resulting
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
271 dnl binary.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
272 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
273 dnl Potentially add DIR to rpathdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
274 dnl The rpathdirs will be appended to $LIBNAME at the end.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
275 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
276 for x in $rpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
277 if test "X$x" = "X$found_dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
278 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
279 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
280 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
281 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
282 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
283 rpathdirs="$rpathdirs $found_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
284 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
285 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
286 dnl Rely on "-L$found_dir".
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
287 dnl But don't add it if it's already contained in the LDFLAGS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
288 dnl or the already constructed $LIBNAME
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
289 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
290 for x in $LDFLAGS $LIB[]NAME; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
291 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
292 if test "X$x" = "X-L$found_dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
293 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
294 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
295 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
296 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
297 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
298 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
299 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
300 if test "$hardcode_minus_L" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
301 dnl FIXME: Not sure whether we should use
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
302 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
303 dnl here.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
304 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
305 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
306 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
307 dnl here, because this doesn't fit in flags passed to the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
308 dnl compiler. So give up. No hardcoding. This affects only
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
309 dnl very old systems.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
310 dnl FIXME: Not sure whether we should use
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
311 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
312 dnl here.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
313 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
314 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
315 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
316 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
317 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
318 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
319 if test "X$found_a" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
320 dnl Linking with a static library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
321 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
322 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
323 dnl We shouldn't come here, but anyway it's good to have a
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
324 dnl fallback.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
325 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
326 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
327 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
328 dnl Assume the include files are nearby.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
329 additional_includedir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
330 case "$found_dir" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
331 */lib | */lib/)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
332 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
333 additional_includedir="$basedir/include"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
334 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
335 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
336 if test "X$additional_includedir" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
337 dnl Potentially add $additional_includedir to $INCNAME.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
338 dnl But don't add it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
339 dnl 1. if it's the standard /usr/include,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
340 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
341 dnl 3. if it's already present in $CPPFLAGS or the already
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
342 dnl constructed $INCNAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
343 dnl 4. if it doesn't exist as a directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
344 if test "X$additional_includedir" != "X/usr/include"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
345 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
346 if test "X$additional_includedir" = "X/usr/local/include"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
347 if test -n "$GCC"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
348 case $host_os in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
349 linux*) haveit=yes;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
350 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
351 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
352 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
353 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
354 for x in $CPPFLAGS $INC[]NAME; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
355 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
356 if test "X$x" = "X-I$additional_includedir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
357 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
358 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
359 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
360 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
361 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
362 if test -d "$additional_includedir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
363 dnl Really add $additional_includedir to $INCNAME.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
364 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
365 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
366 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
367 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
368 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
369 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
370 dnl Look for dependencies.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
371 if test -n "$found_la"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
372 dnl Read the .la file. It defines the variables
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
373 dnl dlname, library_names, old_library, dependency_libs, current,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
374 dnl age, revision, installed, dlopen, dlpreopen, libdir.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
375 save_libdir="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
376 case "$found_la" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
377 */* | *\\*) . "$found_la" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
378 *) . "./$found_la" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
379 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
380 libdir="$save_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
381 dnl We use only dependency_libs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
382 for dep in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
383 case "$dep" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
384 -L*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
385 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
386 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
387 dnl But don't add it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
388 dnl 1. if it's the standard /usr/lib,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
389 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
390 dnl 3. if it's already present in $LDFLAGS or the already
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
391 dnl constructed $LIBNAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
392 dnl 4. if it doesn't exist as a directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
393 if test "X$additional_libdir" != "X/usr/lib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
394 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
395 if test "X$additional_libdir" = "X/usr/local/lib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
396 if test -n "$GCC"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
397 case $host_os in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
398 linux*) haveit=yes;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
399 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
400 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
401 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
402 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
403 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
404 for x in $LDFLAGS $LIB[]NAME; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
405 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
406 if test "X$x" = "X-L$additional_libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
407 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
408 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
409 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
410 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
411 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
412 if test -d "$additional_libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
413 dnl Really add $additional_libdir to $LIBNAME.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
414 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
415 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
416 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
417 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
418 for x in $LDFLAGS $LTLIB[]NAME; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
419 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
420 if test "X$x" = "X-L$additional_libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
421 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
422 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
423 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
424 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
425 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
426 if test -d "$additional_libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
427 dnl Really add $additional_libdir to $LTLIBNAME.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
428 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
429 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
430 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
431 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
432 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
433 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
434 -R*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
435 dir=`echo "X$dep" | sed -e 's/^X-R//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
436 if test "$enable_rpath" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
437 dnl Potentially add DIR to rpathdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
438 dnl The rpathdirs will be appended to $LIBNAME at the end.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
439 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
440 for x in $rpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
441 if test "X$x" = "X$dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
442 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
443 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
444 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
445 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
446 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
447 rpathdirs="$rpathdirs $dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
448 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
449 dnl Potentially add DIR to ltrpathdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
450 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
451 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
452 for x in $ltrpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
453 if test "X$x" = "X$dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
454 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
455 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
456 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
457 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
458 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
459 ltrpathdirs="$ltrpathdirs $dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
460 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
461 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
462 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
463 -l*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
464 dnl Handle this in the next round.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
465 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
466 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
467 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
468 dnl Handle this in the next round. Throw away the .la's
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
469 dnl directory; it is already contained in a preceding -L
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
470 dnl option.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
471 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
472 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
473 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
474 dnl Most likely an immediate library name.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
475 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
476 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
477 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
478 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
479 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
480 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
481 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
482 dnl Didn't find the library; assume it is in the system directories
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
483 dnl known to the linker and runtime loader. (All the system
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
484 dnl directories known to the linker should also be known to the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
485 dnl runtime loader, otherwise the system is severely misconfigured.)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
486 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
487 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
488 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
489 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
490 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
491 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
492 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
493 if test "X$rpathdirs" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
494 if test -n "$hardcode_libdir_separator"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
495 dnl Weird platform: only the last -rpath option counts, the user must
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
496 dnl pass all path elements in one option. We can arrange that for a
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
497 dnl single library, but not when more than one $LIBNAMEs are used.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
498 alldirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
499 for found_dir in $rpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
500 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
501 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
502 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
503 acl_save_libdir="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
504 libdir="$alldirs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
505 eval flag=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
506 libdir="$acl_save_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
507 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
508 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
509 dnl The -rpath options are cumulative.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
510 for found_dir in $rpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
511 acl_save_libdir="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
512 libdir="$found_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
513 eval flag=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
514 libdir="$acl_save_libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
515 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
516 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
517 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
518 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
519 if test "X$ltrpathdirs" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
520 dnl When using libtool, the option that works for both libraries and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
521 dnl executables is -R. The -R options are cumulative.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
522 for found_dir in $ltrpathdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
523 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
524 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
525 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
526 ])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
527
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
528 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
529 dnl unless already present in VAR.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
530 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
531 dnl contains two or three consecutive elements that belong together.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
532 AC_DEFUN([AC_LIB_APPENDTOVAR],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
533 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
534 for element in [$2]; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
535 haveit=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
536 for x in $[$1]; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
537 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
538 if test "X$x" = "X$element"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
539 haveit=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
540 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
541 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
542 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
543 if test -z "$haveit"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
544 [$1]="${[$1]}${[$1]:+ }$element"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
545 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
546 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
547 ])