|
2
|
1 |
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
|
|
0
|
2 |
|
|
2
|
3 |
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
|
0
|
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 TRY_CXX_FLAG(FLAG,[ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
|
|
|
14 |
AC_DEFUN(TRY_CXX_FLAG,
|
|
|
15 |
[echo >conftest.cc
|
|
|
16 |
if ${CXX-g++} ${CXXFLAGS} -c [$1] conftest.cc >/dev/null 2>&1; then
|
|
|
17 |
ifelse([$2], , :, [rm -f conftest*
|
|
|
18 |
$2])
|
|
|
19 |
else
|
|
|
20 |
ifelse([$3], , :, [rm -f conftest*
|
|
|
21 |
$3])
|
|
|
22 |
fi
|
|
|
23 |
rm -f conftest*])
|
|
|
24 |
|
|
|
25 |
AC_DEFUN(CXX_NO_RTTI,
|
|
|
26 |
[AC_CACHE_CHECK(whether ${CXX-g++} accepts -fno-rtti,
|
|
|
27 |
local_cv_flag_NO_RTTI,
|
|
|
28 |
TRY_CXX_FLAG(-fno-rtti,
|
|
|
29 |
local_cv_flag_NO_RTTI=yes,
|
|
|
30 |
local_cv_flag_NO_RTTI=no))
|
|
|
31 |
test "$local_cv_flag_NO_RTTI" = yes && CXXFLAGS="$CXXFLAGS -fno-rtti"
|
|
|
32 |
])
|
|
|
33 |
|
|
|
34 |
AC_DEFUN(CXX_NO_EXCEPTIONS,
|
|
|
35 |
[AC_CACHE_CHECK(whether ${CXX-g++} accepts -fno-exceptions,
|
|
|
36 |
local_cv_flag_NO_EXCEPTIONS,
|
|
|
37 |
TRY_CXX_FLAG(-fno-exceptions,
|
|
|
38 |
local_cv_flag_NO_EXCEPTIONS=yes,
|
|
|
39 |
local_cv_flag_NO_EXCEPTIONS=no))
|
|
|
40 |
test "$local_cv_flag_NO_EXCEPTIONS" = yes && CXXFLAGS="$CXXFLAGS -fno-exceptions"
|
|
|
41 |
])
|
|
|
42 |
|
|
|
43 |
|
|
2
|
44 |
# lib-prefix.m4 serial 4 (gettext-0.14.2)
|
|
|
45 |
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
|
|
|
46 |
dnl This file is free software; the Free Software Foundation
|
|
|
47 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
48 |
dnl with or without modifications, as long as this notice is preserved.
|
|
|
49 |
|
|
|
50 |
dnl From Bruno Haible.
|
|
|
51 |
|
|
|
52 |
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
|
|
|
53 |
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
|
|
|
54 |
dnl require excessive bracketing.
|
|
|
55 |
ifdef([AC_HELP_STRING],
|
|
|
56 |
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
|
|
|
57 |
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
|
|
|
58 |
|
|
|
59 |
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
|
|
|
60 |
dnl to access previously installed libraries. The basic assumption is that
|
|
|
61 |
dnl a user will want packages to use other packages he previously installed
|
|
|
62 |
dnl with the same --prefix option.
|
|
|
63 |
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
|
|
|
64 |
dnl libraries, but is otherwise very convenient.
|
|
|
65 |
AC_DEFUN([AC_LIB_PREFIX],
|
|
|
66 |
[
|
|
|
67 |
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
|
|
|
68 |
AC_REQUIRE([AC_PROG_CC])
|
|
|
69 |
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
|
70 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
|
|
71 |
dnl By default, look in $includedir and $libdir.
|
|
|
72 |
use_additional=yes
|
|
|
73 |
AC_LIB_WITH_FINAL_PREFIX([
|
|
|
74 |
eval additional_includedir=\"$includedir\"
|
|
|
75 |
eval additional_libdir=\"$libdir\"
|
|
|
76 |
])
|
|
|
77 |
AC_LIB_ARG_WITH([lib-prefix],
|
|
|
78 |
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
|
|
|
79 |
--without-lib-prefix don't search for libraries in includedir and libdir],
|
|
|
80 |
[
|
|
|
81 |
if test "X$withval" = "Xno"; then
|
|
|
82 |
use_additional=no
|
|
|
83 |
else
|
|
|
84 |
if test "X$withval" = "X"; then
|
|
|
85 |
AC_LIB_WITH_FINAL_PREFIX([
|
|
|
86 |
eval additional_includedir=\"$includedir\"
|
|
|
87 |
eval additional_libdir=\"$libdir\"
|
|
|
88 |
])
|
|
|
89 |
else
|
|
|
90 |
additional_includedir="$withval/include"
|
|
|
91 |
additional_libdir="$withval/lib"
|
|
|
92 |
fi
|
|
|
93 |
fi
|
|
|
94 |
])
|
|
|
95 |
if test $use_additional = yes; then
|
|
|
96 |
dnl Potentially add $additional_includedir to $CPPFLAGS.
|
|
|
97 |
dnl But don't add it
|
|
|
98 |
dnl 1. if it's the standard /usr/include,
|
|
|
99 |
dnl 2. if it's already present in $CPPFLAGS,
|
|
|
100 |
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
|
|
|
101 |
dnl 4. if it doesn't exist as a directory.
|
|
|
102 |
if test "X$additional_includedir" != "X/usr/include"; then
|
|
|
103 |
haveit=
|
|
|
104 |
for x in $CPPFLAGS; do
|
|
|
105 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
106 |
if test "X$x" = "X-I$additional_includedir"; then
|
|
|
107 |
haveit=yes
|
|
|
108 |
break
|
|
|
109 |
fi
|
|
|
110 |
done
|
|
|
111 |
if test -z "$haveit"; then
|
|
|
112 |
if test "X$additional_includedir" = "X/usr/local/include"; then
|
|
|
113 |
if test -n "$GCC"; then
|
|
|
114 |
case $host_os in
|
|
|
115 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
|
|
116 |
esac
|
|
|
117 |
fi
|
|
|
118 |
fi
|
|
|
119 |
if test -z "$haveit"; then
|
|
|
120 |
if test -d "$additional_includedir"; then
|
|
|
121 |
dnl Really add $additional_includedir to $CPPFLAGS.
|
|
|
122 |
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
|
|
|
123 |
fi
|
|
|
124 |
fi
|
|
|
125 |
fi
|
|
|
126 |
fi
|
|
|
127 |
dnl Potentially add $additional_libdir to $LDFLAGS.
|
|
|
128 |
dnl But don't add it
|
|
|
129 |
dnl 1. if it's the standard /usr/lib,
|
|
|
130 |
dnl 2. if it's already present in $LDFLAGS,
|
|
|
131 |
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
|
|
|
132 |
dnl 4. if it doesn't exist as a directory.
|
|
|
133 |
if test "X$additional_libdir" != "X/usr/lib"; then
|
|
|
134 |
haveit=
|
|
|
135 |
for x in $LDFLAGS; do
|
|
|
136 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
137 |
if test "X$x" = "X-L$additional_libdir"; then
|
|
|
138 |
haveit=yes
|
|
|
139 |
break
|
|
|
140 |
fi
|
|
|
141 |
done
|
|
|
142 |
if test -z "$haveit"; then
|
|
|
143 |
if test "X$additional_libdir" = "X/usr/local/lib"; then
|
|
|
144 |
if test -n "$GCC"; then
|
|
|
145 |
case $host_os in
|
|
|
146 |
linux*) haveit=yes;;
|
|
|
147 |
esac
|
|
|
148 |
fi
|
|
|
149 |
fi
|
|
|
150 |
if test -z "$haveit"; then
|
|
|
151 |
if test -d "$additional_libdir"; then
|
|
|
152 |
dnl Really add $additional_libdir to $LDFLAGS.
|
|
|
153 |
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
|
|
|
154 |
fi
|
|
|
155 |
fi
|
|
|
156 |
fi
|
|
|
157 |
fi
|
|
|
158 |
fi
|
|
|
159 |
])
|
|
|
160 |
|
|
|
161 |
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
|
|
|
162 |
dnl acl_final_exec_prefix, containing the values to which $prefix and
|
|
|
163 |
dnl $exec_prefix will expand at the end of the configure script.
|
|
|
164 |
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
|
|
|
165 |
[
|
|
|
166 |
dnl Unfortunately, prefix and exec_prefix get only finally determined
|
|
|
167 |
dnl at the end of configure.
|
|
|
168 |
if test "X$prefix" = "XNONE"; then
|
|
|
169 |
acl_final_prefix="$ac_default_prefix"
|
|
|
170 |
else
|
|
|
171 |
acl_final_prefix="$prefix"
|
|
|
172 |
fi
|
|
|
173 |
if test "X$exec_prefix" = "XNONE"; then
|
|
|
174 |
acl_final_exec_prefix='${prefix}'
|
|
|
175 |
else
|
|
|
176 |
acl_final_exec_prefix="$exec_prefix"
|
|
|
177 |
fi
|
|
|
178 |
acl_save_prefix="$prefix"
|
|
|
179 |
prefix="$acl_final_prefix"
|
|
|
180 |
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
|
|
|
181 |
prefix="$acl_save_prefix"
|
|
|
182 |
])
|
|
|
183 |
|
|
|
184 |
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
|
|
|
185 |
dnl variables prefix and exec_prefix bound to the values they will have
|
|
|
186 |
dnl at the end of the configure script.
|
|
|
187 |
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
|
|
|
188 |
[
|
|
|
189 |
acl_save_prefix="$prefix"
|
|
|
190 |
prefix="$acl_final_prefix"
|
|
|
191 |
acl_save_exec_prefix="$exec_prefix"
|
|
|
192 |
exec_prefix="$acl_final_exec_prefix"
|
|
|
193 |
$1
|
|
|
194 |
exec_prefix="$acl_save_exec_prefix"
|
|
|
195 |
prefix="$acl_save_prefix"
|
|
|
196 |
])
|
|
|
197 |
|
|
|
198 |
# lib-link.m4 serial 6 (gettext-0.14.3)
|
|
|
199 |
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
|
|
|
200 |
dnl This file is free software; the Free Software Foundation
|
|
|
201 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
202 |
dnl with or without modifications, as long as this notice is preserved.
|
|
|
203 |
|
|
|
204 |
dnl From Bruno Haible.
|
|
|
205 |
|
|
|
206 |
AC_PREREQ(2.50)
|
|
|
207 |
|
|
|
208 |
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
|
|
|
209 |
dnl the libraries corresponding to explicit and implicit dependencies.
|
|
|
210 |
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
|
|
|
211 |
dnl augments the CPPFLAGS variable.
|
|
|
212 |
AC_DEFUN([AC_LIB_LINKFLAGS],
|
|
|
213 |
[
|
|
|
214 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
|
|
215 |
AC_REQUIRE([AC_LIB_RPATH])
|
|
|
216 |
define([Name],[translit([$1],[./-], [___])])
|
|
|
217 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
|
|
218 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
|
|
219 |
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
|
|
|
220 |
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
|
|
221 |
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
|
|
|
222 |
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
|
|
|
223 |
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
|
|
|
224 |
])
|
|
|
225 |
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
|
|
|
226 |
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
|
|
|
227 |
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
|
|
|
228 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
|
|
229 |
AC_SUBST([LIB]NAME)
|
|
|
230 |
AC_SUBST([LTLIB]NAME)
|
|
|
231 |
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
|
|
|
232 |
dnl results of this search when this library appears as a dependency.
|
|
|
233 |
HAVE_LIB[]NAME=yes
|
|
|
234 |
undefine([Name])
|
|
|
235 |
undefine([NAME])
|
|
|
236 |
])
|
|
|
237 |
|
|
|
238 |
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
|
|
|
239 |
dnl searches for libname and the libraries corresponding to explicit and
|
|
|
240 |
dnl implicit dependencies, together with the specified include files and
|
|
|
241 |
dnl the ability to compile and link the specified testcode. If found, it
|
|
|
242 |
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
|
|
|
243 |
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
|
|
|
244 |
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
|
|
|
245 |
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
|
|
|
246 |
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
|
|
247 |
[
|
|
|
248 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
|
|
249 |
AC_REQUIRE([AC_LIB_RPATH])
|
|
|
250 |
define([Name],[translit([$1],[./-], [___])])
|
|
|
251 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
|
|
252 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
|
|
253 |
|
|
|
254 |
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
|
|
|
255 |
dnl accordingly.
|
|
|
256 |
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
|
|
257 |
|
|
|
258 |
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
|
|
|
259 |
dnl because if the user has installed lib[]Name and not disabled its use
|
|
|
260 |
dnl via --without-lib[]Name-prefix, he wants to use it.
|
|
|
261 |
ac_save_CPPFLAGS="$CPPFLAGS"
|
|
|
262 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
|
|
263 |
|
|
|
264 |
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
|
|
|
265 |
ac_save_LIBS="$LIBS"
|
|
|
266 |
LIBS="$LIBS $LIB[]NAME"
|
|
|
267 |
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
|
|
|
268 |
LIBS="$ac_save_LIBS"
|
|
|
269 |
])
|
|
|
270 |
if test "$ac_cv_lib[]Name" = yes; then
|
|
|
271 |
HAVE_LIB[]NAME=yes
|
|
|
272 |
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
|
|
|
273 |
AC_MSG_CHECKING([how to link with lib[]$1])
|
|
|
274 |
AC_MSG_RESULT([$LIB[]NAME])
|
|
|
275 |
else
|
|
|
276 |
HAVE_LIB[]NAME=no
|
|
|
277 |
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
|
|
|
278 |
dnl $INC[]NAME either.
|
|
|
279 |
CPPFLAGS="$ac_save_CPPFLAGS"
|
|
|
280 |
LIB[]NAME=
|
|
|
281 |
LTLIB[]NAME=
|
|
|
282 |
fi
|
|
|
283 |
AC_SUBST([HAVE_LIB]NAME)
|
|
|
284 |
AC_SUBST([LIB]NAME)
|
|
|
285 |
AC_SUBST([LTLIB]NAME)
|
|
|
286 |
undefine([Name])
|
|
|
287 |
undefine([NAME])
|
|
|
288 |
])
|
|
|
289 |
|
|
|
290 |
dnl Determine the platform dependent parameters needed to use rpath:
|
|
|
291 |
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
|
|
|
292 |
dnl hardcode_direct, hardcode_minus_L.
|
|
|
293 |
AC_DEFUN([AC_LIB_RPATH],
|
|
|
294 |
[
|
|
|
295 |
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
|
|
|
296 |
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
|
|
|
297 |
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
|
|
|
298 |
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
|
|
|
299 |
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
|
|
|
300 |
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
|
|
|
301 |
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
|
|
|
302 |
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
|
|
|
303 |
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
|
|
|
304 |
. ./conftest.sh
|
|
|
305 |
rm -f ./conftest.sh
|
|
|
306 |
acl_cv_rpath=done
|
|
|
307 |
])
|
|
|
308 |
wl="$acl_cv_wl"
|
|
|
309 |
libext="$acl_cv_libext"
|
|
|
310 |
shlibext="$acl_cv_shlibext"
|
|
|
311 |
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
|
|
|
312 |
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
|
|
|
313 |
hardcode_direct="$acl_cv_hardcode_direct"
|
|
|
314 |
hardcode_minus_L="$acl_cv_hardcode_minus_L"
|
|
|
315 |
dnl Determine whether the user wants rpath handling at all.
|
|
|
316 |
AC_ARG_ENABLE(rpath,
|
|
|
317 |
[ --disable-rpath do not hardcode runtime library paths],
|
|
|
318 |
:, enable_rpath=yes)
|
|
|
319 |
])
|
|
|
320 |
|
|
|
321 |
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
|
|
|
322 |
dnl the libraries corresponding to explicit and implicit dependencies.
|
|
|
323 |
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
|
|
|
324 |
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
|
|
325 |
[
|
|
|
326 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
|
|
327 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
|
|
328 |
dnl By default, look in $includedir and $libdir.
|
|
|
329 |
use_additional=yes
|
|
|
330 |
AC_LIB_WITH_FINAL_PREFIX([
|
|
|
331 |
eval additional_includedir=\"$includedir\"
|
|
|
332 |
eval additional_libdir=\"$libdir\"
|
|
|
333 |
])
|
|
|
334 |
AC_LIB_ARG_WITH([lib$1-prefix],
|
|
|
335 |
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
|
|
|
336 |
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
|
|
|
337 |
[
|
|
|
338 |
if test "X$withval" = "Xno"; then
|
|
|
339 |
use_additional=no
|
|
|
340 |
else
|
|
|
341 |
if test "X$withval" = "X"; then
|
|
|
342 |
AC_LIB_WITH_FINAL_PREFIX([
|
|
|
343 |
eval additional_includedir=\"$includedir\"
|
|
|
344 |
eval additional_libdir=\"$libdir\"
|
|
|
345 |
])
|
|
|
346 |
else
|
|
|
347 |
additional_includedir="$withval/include"
|
|
|
348 |
additional_libdir="$withval/lib"
|
|
|
349 |
fi
|
|
|
350 |
fi
|
|
|
351 |
])
|
|
|
352 |
dnl Search the library and its dependencies in $additional_libdir and
|
|
|
353 |
dnl $LDFLAGS. Using breadth-first-seach.
|
|
|
354 |
LIB[]NAME=
|
|
|
355 |
LTLIB[]NAME=
|
|
|
356 |
INC[]NAME=
|
|
|
357 |
rpathdirs=
|
|
|
358 |
ltrpathdirs=
|
|
|
359 |
names_already_handled=
|
|
|
360 |
names_next_round='$1 $2'
|
|
|
361 |
while test -n "$names_next_round"; do
|
|
|
362 |
names_this_round="$names_next_round"
|
|
|
363 |
names_next_round=
|
|
|
364 |
for name in $names_this_round; do
|
|
|
365 |
already_handled=
|
|
|
366 |
for n in $names_already_handled; do
|
|
|
367 |
if test "$n" = "$name"; then
|
|
|
368 |
already_handled=yes
|
|
|
369 |
break
|
|
|
370 |
fi
|
|
|
371 |
done
|
|
|
372 |
if test -z "$already_handled"; then
|
|
|
373 |
names_already_handled="$names_already_handled $name"
|
|
|
374 |
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
|
|
|
375 |
dnl or AC_LIB_HAVE_LINKFLAGS call.
|
|
|
376 |
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
|
|
|
377 |
eval value=\"\$HAVE_LIB$uppername\"
|
|
|
378 |
if test -n "$value"; then
|
|
|
379 |
if test "$value" = yes; then
|
|
|
380 |
eval value=\"\$LIB$uppername\"
|
|
|
381 |
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
|
|
|
382 |
eval value=\"\$LTLIB$uppername\"
|
|
|
383 |
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
|
|
|
384 |
else
|
|
|
385 |
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
|
|
|
386 |
dnl that this library doesn't exist. So just drop it.
|
|
|
387 |
:
|
|
|
388 |
fi
|
|
|
389 |
else
|
|
|
390 |
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
|
|
|
391 |
dnl and the already constructed $LIBNAME/$LTLIBNAME.
|
|
|
392 |
found_dir=
|
|
|
393 |
found_la=
|
|
|
394 |
found_so=
|
|
|
395 |
found_a=
|
|
|
396 |
if test $use_additional = yes; then
|
|
|
397 |
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
|
|
|
398 |
found_dir="$additional_libdir"
|
|
|
399 |
found_so="$additional_libdir/lib$name.$shlibext"
|
|
|
400 |
if test -f "$additional_libdir/lib$name.la"; then
|
|
|
401 |
found_la="$additional_libdir/lib$name.la"
|
|
|
402 |
fi
|
|
|
403 |
else
|
|
|
404 |
if test -f "$additional_libdir/lib$name.$libext"; then
|
|
|
405 |
found_dir="$additional_libdir"
|
|
|
406 |
found_a="$additional_libdir/lib$name.$libext"
|
|
|
407 |
if test -f "$additional_libdir/lib$name.la"; then
|
|
|
408 |
found_la="$additional_libdir/lib$name.la"
|
|
|
409 |
fi
|
|
|
410 |
fi
|
|
|
411 |
fi
|
|
|
412 |
fi
|
|
|
413 |
if test "X$found_dir" = "X"; then
|
|
|
414 |
for x in $LDFLAGS $LTLIB[]NAME; do
|
|
|
415 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
416 |
case "$x" in
|
|
|
417 |
-L*)
|
|
|
418 |
dir=`echo "X$x" | sed -e 's/^X-L//'`
|
|
|
419 |
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
|
|
|
420 |
found_dir="$dir"
|
|
|
421 |
found_so="$dir/lib$name.$shlibext"
|
|
|
422 |
if test -f "$dir/lib$name.la"; then
|
|
|
423 |
found_la="$dir/lib$name.la"
|
|
|
424 |
fi
|
|
|
425 |
else
|
|
|
426 |
if test -f "$dir/lib$name.$libext"; then
|
|
|
427 |
found_dir="$dir"
|
|
|
428 |
found_a="$dir/lib$name.$libext"
|
|
|
429 |
if test -f "$dir/lib$name.la"; then
|
|
|
430 |
found_la="$dir/lib$name.la"
|
|
|
431 |
fi
|
|
|
432 |
fi
|
|
|
433 |
fi
|
|
|
434 |
;;
|
|
|
435 |
esac
|
|
|
436 |
if test "X$found_dir" != "X"; then
|
|
|
437 |
break
|
|
|
438 |
fi
|
|
|
439 |
done
|
|
|
440 |
fi
|
|
|
441 |
if test "X$found_dir" != "X"; then
|
|
|
442 |
dnl Found the library.
|
|
|
443 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
|
|
|
444 |
if test "X$found_so" != "X"; then
|
|
|
445 |
dnl Linking with a shared library. We attempt to hardcode its
|
|
|
446 |
dnl directory into the executable's runpath, unless it's the
|
|
|
447 |
dnl standard /usr/lib.
|
|
|
448 |
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
|
|
|
449 |
dnl No hardcoding is needed.
|
|
|
450 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
|
451 |
else
|
|
|
452 |
dnl Use an explicit option to hardcode DIR into the resulting
|
|
|
453 |
dnl binary.
|
|
|
454 |
dnl Potentially add DIR to ltrpathdirs.
|
|
|
455 |
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
|
|
456 |
haveit=
|
|
|
457 |
for x in $ltrpathdirs; do
|
|
|
458 |
if test "X$x" = "X$found_dir"; then
|
|
|
459 |
haveit=yes
|
|
|
460 |
break
|
|
|
461 |
fi
|
|
|
462 |
done
|
|
|
463 |
if test -z "$haveit"; then
|
|
|
464 |
ltrpathdirs="$ltrpathdirs $found_dir"
|
|
|
465 |
fi
|
|
|
466 |
dnl The hardcoding into $LIBNAME is system dependent.
|
|
|
467 |
if test "$hardcode_direct" = yes; then
|
|
|
468 |
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
|
|
|
469 |
dnl resulting binary.
|
|
|
470 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
|
471 |
else
|
|
|
472 |
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
|
|
|
473 |
dnl Use an explicit option to hardcode DIR into the resulting
|
|
|
474 |
dnl binary.
|
|
|
475 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
|
476 |
dnl Potentially add DIR to rpathdirs.
|
|
|
477 |
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
|
|
478 |
haveit=
|
|
|
479 |
for x in $rpathdirs; do
|
|
|
480 |
if test "X$x" = "X$found_dir"; then
|
|
|
481 |
haveit=yes
|
|
|
482 |
break
|
|
|
483 |
fi
|
|
|
484 |
done
|
|
|
485 |
if test -z "$haveit"; then
|
|
|
486 |
rpathdirs="$rpathdirs $found_dir"
|
|
|
487 |
fi
|
|
|
488 |
else
|
|
|
489 |
dnl Rely on "-L$found_dir".
|
|
|
490 |
dnl But don't add it if it's already contained in the LDFLAGS
|
|
|
491 |
dnl or the already constructed $LIBNAME
|
|
|
492 |
haveit=
|
|
|
493 |
for x in $LDFLAGS $LIB[]NAME; do
|
|
|
494 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
495 |
if test "X$x" = "X-L$found_dir"; then
|
|
|
496 |
haveit=yes
|
|
|
497 |
break
|
|
|
498 |
fi
|
|
|
499 |
done
|
|
|
500 |
if test -z "$haveit"; then
|
|
|
501 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
|
|
|
502 |
fi
|
|
|
503 |
if test "$hardcode_minus_L" != no; then
|
|
|
504 |
dnl FIXME: Not sure whether we should use
|
|
|
505 |
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
|
|
506 |
dnl here.
|
|
|
507 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
|
508 |
else
|
|
|
509 |
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
|
|
|
510 |
dnl here, because this doesn't fit in flags passed to the
|
|
|
511 |
dnl compiler. So give up. No hardcoding. This affects only
|
|
|
512 |
dnl very old systems.
|
|
|
513 |
dnl FIXME: Not sure whether we should use
|
|
|
514 |
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
|
|
515 |
dnl here.
|
|
|
516 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
|
|
517 |
fi
|
|
|
518 |
fi
|
|
|
519 |
fi
|
|
|
520 |
fi
|
|
|
521 |
else
|
|
|
522 |
if test "X$found_a" != "X"; then
|
|
|
523 |
dnl Linking with a static library.
|
|
|
524 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
|
|
|
525 |
else
|
|
|
526 |
dnl We shouldn't come here, but anyway it's good to have a
|
|
|
527 |
dnl fallback.
|
|
|
528 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
|
|
|
529 |
fi
|
|
|
530 |
fi
|
|
|
531 |
dnl Assume the include files are nearby.
|
|
|
532 |
additional_includedir=
|
|
|
533 |
case "$found_dir" in
|
|
|
534 |
*/lib | */lib/)
|
|
|
535 |
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
|
|
|
536 |
additional_includedir="$basedir/include"
|
|
|
537 |
;;
|
|
|
538 |
esac
|
|
|
539 |
if test "X$additional_includedir" != "X"; then
|
|
|
540 |
dnl Potentially add $additional_includedir to $INCNAME.
|
|
|
541 |
dnl But don't add it
|
|
|
542 |
dnl 1. if it's the standard /usr/include,
|
|
|
543 |
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
|
|
|
544 |
dnl 3. if it's already present in $CPPFLAGS or the already
|
|
|
545 |
dnl constructed $INCNAME,
|
|
|
546 |
dnl 4. if it doesn't exist as a directory.
|
|
|
547 |
if test "X$additional_includedir" != "X/usr/include"; then
|
|
|
548 |
haveit=
|
|
|
549 |
if test "X$additional_includedir" = "X/usr/local/include"; then
|
|
|
550 |
if test -n "$GCC"; then
|
|
|
551 |
case $host_os in
|
|
|
552 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
|
|
553 |
esac
|
|
|
554 |
fi
|
|
|
555 |
fi
|
|
|
556 |
if test -z "$haveit"; then
|
|
|
557 |
for x in $CPPFLAGS $INC[]NAME; do
|
|
|
558 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
559 |
if test "X$x" = "X-I$additional_includedir"; then
|
|
|
560 |
haveit=yes
|
|
|
561 |
break
|
|
|
562 |
fi
|
|
|
563 |
done
|
|
|
564 |
if test -z "$haveit"; then
|
|
|
565 |
if test -d "$additional_includedir"; then
|
|
|
566 |
dnl Really add $additional_includedir to $INCNAME.
|
|
|
567 |
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
|
|
|
568 |
fi
|
|
|
569 |
fi
|
|
|
570 |
fi
|
|
|
571 |
fi
|
|
|
572 |
fi
|
|
|
573 |
dnl Look for dependencies.
|
|
|
574 |
if test -n "$found_la"; then
|
|
|
575 |
dnl Read the .la file. It defines the variables
|
|
|
576 |
dnl dlname, library_names, old_library, dependency_libs, current,
|
|
|
577 |
dnl age, revision, installed, dlopen, dlpreopen, libdir.
|
|
|
578 |
save_libdir="$libdir"
|
|
|
579 |
case "$found_la" in
|
|
|
580 |
*/* | *\\*) . "$found_la" ;;
|
|
|
581 |
*) . "./$found_la" ;;
|
|
|
582 |
esac
|
|
|
583 |
libdir="$save_libdir"
|
|
|
584 |
dnl We use only dependency_libs.
|
|
|
585 |
for dep in $dependency_libs; do
|
|
|
586 |
case "$dep" in
|
|
|
587 |
-L*)
|
|
|
588 |
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
|
|
|
589 |
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
|
|
|
590 |
dnl But don't add it
|
|
|
591 |
dnl 1. if it's the standard /usr/lib,
|
|
|
592 |
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
|
|
|
593 |
dnl 3. if it's already present in $LDFLAGS or the already
|
|
|
594 |
dnl constructed $LIBNAME,
|
|
|
595 |
dnl 4. if it doesn't exist as a directory.
|
|
|
596 |
if test "X$additional_libdir" != "X/usr/lib"; then
|
|
|
597 |
haveit=
|
|
|
598 |
if test "X$additional_libdir" = "X/usr/local/lib"; then
|
|
|
599 |
if test -n "$GCC"; then
|
|
|
600 |
case $host_os in
|
|
|
601 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
|
|
602 |
esac
|
|
|
603 |
fi
|
|
|
604 |
fi
|
|
|
605 |
if test -z "$haveit"; then
|
|
|
606 |
haveit=
|
|
|
607 |
for x in $LDFLAGS $LIB[]NAME; do
|
|
|
608 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
609 |
if test "X$x" = "X-L$additional_libdir"; then
|
|
|
610 |
haveit=yes
|
|
|
611 |
break
|
|
|
612 |
fi
|
|
|
613 |
done
|
|
|
614 |
if test -z "$haveit"; then
|
|
|
615 |
if test -d "$additional_libdir"; then
|
|
|
616 |
dnl Really add $additional_libdir to $LIBNAME.
|
|
|
617 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
|
|
|
618 |
fi
|
|
|
619 |
fi
|
|
|
620 |
haveit=
|
|
|
621 |
for x in $LDFLAGS $LTLIB[]NAME; do
|
|
|
622 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
623 |
if test "X$x" = "X-L$additional_libdir"; then
|
|
|
624 |
haveit=yes
|
|
|
625 |
break
|
|
|
626 |
fi
|
|
|
627 |
done
|
|
|
628 |
if test -z "$haveit"; then
|
|
|
629 |
if test -d "$additional_libdir"; then
|
|
|
630 |
dnl Really add $additional_libdir to $LTLIBNAME.
|
|
|
631 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
|
|
|
632 |
fi
|
|
|
633 |
fi
|
|
|
634 |
fi
|
|
|
635 |
fi
|
|
|
636 |
;;
|
|
|
637 |
-R*)
|
|
|
638 |
dir=`echo "X$dep" | sed -e 's/^X-R//'`
|
|
|
639 |
if test "$enable_rpath" != no; then
|
|
|
640 |
dnl Potentially add DIR to rpathdirs.
|
|
|
641 |
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
|
|
642 |
haveit=
|
|
|
643 |
for x in $rpathdirs; do
|
|
|
644 |
if test "X$x" = "X$dir"; then
|
|
|
645 |
haveit=yes
|
|
|
646 |
break
|
|
|
647 |
fi
|
|
|
648 |
done
|
|
|
649 |
if test -z "$haveit"; then
|
|
|
650 |
rpathdirs="$rpathdirs $dir"
|
|
|
651 |
fi
|
|
|
652 |
dnl Potentially add DIR to ltrpathdirs.
|
|
|
653 |
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
|
|
654 |
haveit=
|
|
|
655 |
for x in $ltrpathdirs; do
|
|
|
656 |
if test "X$x" = "X$dir"; then
|
|
|
657 |
haveit=yes
|
|
|
658 |
break
|
|
|
659 |
fi
|
|
|
660 |
done
|
|
|
661 |
if test -z "$haveit"; then
|
|
|
662 |
ltrpathdirs="$ltrpathdirs $dir"
|
|
|
663 |
fi
|
|
|
664 |
fi
|
|
|
665 |
;;
|
|
|
666 |
-l*)
|
|
|
667 |
dnl Handle this in the next round.
|
|
|
668 |
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
|
|
|
669 |
;;
|
|
|
670 |
*.la)
|
|
|
671 |
dnl Handle this in the next round. Throw away the .la's
|
|
|
672 |
dnl directory; it is already contained in a preceding -L
|
|
|
673 |
dnl option.
|
|
|
674 |
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
|
|
|
675 |
;;
|
|
|
676 |
*)
|
|
|
677 |
dnl Most likely an immediate library name.
|
|
|
678 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
|
|
|
679 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
|
|
|
680 |
;;
|
|
|
681 |
esac
|
|
|
682 |
done
|
|
|
683 |
fi
|
|
|
684 |
else
|
|
|
685 |
dnl Didn't find the library; assume it is in the system directories
|
|
|
686 |
dnl known to the linker and runtime loader. (All the system
|
|
|
687 |
dnl directories known to the linker should also be known to the
|
|
|
688 |
dnl runtime loader, otherwise the system is severely misconfigured.)
|
|
|
689 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
|
|
690 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
|
|
|
691 |
fi
|
|
|
692 |
fi
|
|
|
693 |
fi
|
|
|
694 |
done
|
|
|
695 |
done
|
|
|
696 |
if test "X$rpathdirs" != "X"; then
|
|
|
697 |
if test -n "$hardcode_libdir_separator"; then
|
|
|
698 |
dnl Weird platform: only the last -rpath option counts, the user must
|
|
|
699 |
dnl pass all path elements in one option. We can arrange that for a
|
|
|
700 |
dnl single library, but not when more than one $LIBNAMEs are used.
|
|
|
701 |
alldirs=
|
|
|
702 |
for found_dir in $rpathdirs; do
|
|
|
703 |
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
|
|
|
704 |
done
|
|
|
705 |
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
|
|
|
706 |
acl_save_libdir="$libdir"
|
|
|
707 |
libdir="$alldirs"
|
|
|
708 |
eval flag=\"$hardcode_libdir_flag_spec\"
|
|
|
709 |
libdir="$acl_save_libdir"
|
|
|
710 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
|
|
711 |
else
|
|
|
712 |
dnl The -rpath options are cumulative.
|
|
|
713 |
for found_dir in $rpathdirs; do
|
|
|
714 |
acl_save_libdir="$libdir"
|
|
|
715 |
libdir="$found_dir"
|
|
|
716 |
eval flag=\"$hardcode_libdir_flag_spec\"
|
|
|
717 |
libdir="$acl_save_libdir"
|
|
|
718 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
|
|
719 |
done
|
|
|
720 |
fi
|
|
|
721 |
fi
|
|
|
722 |
if test "X$ltrpathdirs" != "X"; then
|
|
|
723 |
dnl When using libtool, the option that works for both libraries and
|
|
|
724 |
dnl executables is -R. The -R options are cumulative.
|
|
|
725 |
for found_dir in $ltrpathdirs; do
|
|
|
726 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
|
|
|
727 |
done
|
|
|
728 |
fi
|
|
|
729 |
])
|
|
|
730 |
|
|
|
731 |
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
|
|
|
732 |
dnl unless already present in VAR.
|
|
|
733 |
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
|
|
|
734 |
dnl contains two or three consecutive elements that belong together.
|
|
|
735 |
AC_DEFUN([AC_LIB_APPENDTOVAR],
|
|
|
736 |
[
|
|
|
737 |
for element in [$2]; do
|
|
|
738 |
haveit=
|
|
|
739 |
for x in $[$1]; do
|
|
|
740 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
|
741 |
if test "X$x" = "X$element"; then
|
|
|
742 |
haveit=yes
|
|
|
743 |
break
|
|
|
744 |
fi
|
|
|
745 |
done
|
|
|
746 |
if test -z "$haveit"; then
|
|
|
747 |
[$1]="${[$1]}${[$1]:+ }$element"
|
|
|
748 |
fi
|
|
|
749 |
done
|
|
|
750 |
])
|
|
|
751 |
|
|
|
752 |
# lib-ld.m4 serial 3 (gettext-0.13)
|
|
|
753 |
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
|
|
|
754 |
dnl This file is free software; the Free Software Foundation
|
|
|
755 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
756 |
dnl with or without modifications, as long as this notice is preserved.
|
|
|
757 |
|
|
|
758 |
dnl Subroutines of libtool.m4,
|
|
|
759 |
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
|
|
|
760 |
dnl with libtool.m4.
|
|
|
761 |
|
|
|
762 |
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
|
|
|
763 |
AC_DEFUN([AC_LIB_PROG_LD_GNU],
|
|
|
764 |
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
|
|
|
765 |
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
|
|
766 |
case `$LD -v 2>&1 </dev/null` in
|
|
|
767 |
*GNU* | *'with BFD'*)
|
|
|
768 |
acl_cv_prog_gnu_ld=yes ;;
|
|
|
769 |
*)
|
|
|
770 |
acl_cv_prog_gnu_ld=no ;;
|
|
|
771 |
esac])
|
|
|
772 |
with_gnu_ld=$acl_cv_prog_gnu_ld
|
|
|
773 |
])
|
|
|
774 |
|
|
|
775 |
dnl From libtool-1.4. Sets the variable LD.
|
|
|
776 |
AC_DEFUN([AC_LIB_PROG_LD],
|
|
|
777 |
[AC_ARG_WITH(gnu-ld,
|
|
|
778 |
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
|
|
779 |
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
|
|
780 |
AC_REQUIRE([AC_PROG_CC])dnl
|
|
|
781 |
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
|
782 |
# Prepare PATH_SEPARATOR.
|
|
|
783 |
# The user is always right.
|
|
|
784 |
if test "${PATH_SEPARATOR+set}" != set; then
|
|
|
785 |
echo "#! /bin/sh" >conf$$.sh
|
|
|
786 |
echo "exit 0" >>conf$$.sh
|
|
|
787 |
chmod +x conf$$.sh
|
|
|
788 |
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
|
|
789 |
PATH_SEPARATOR=';'
|
|
|
790 |
else
|
|
|
791 |
PATH_SEPARATOR=:
|
|
|
792 |
fi
|
|
|
793 |
rm -f conf$$.sh
|
|
|
794 |
fi
|
|
|
795 |
ac_prog=ld
|
|
|
796 |
if test "$GCC" = yes; then
|
|
|
797 |
# Check if gcc -print-prog-name=ld gives a path.
|
|
|
798 |
AC_MSG_CHECKING([for ld used by GCC])
|
|
|
799 |
case $host in
|
|
|
800 |
*-*-mingw*)
|
|
|
801 |
# gcc leaves a trailing carriage return which upsets mingw
|
|
|
802 |
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
|
|
|
803 |
*)
|
|
|
804 |
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
|
|
|
805 |
esac
|
|
|
806 |
case $ac_prog in
|
|
|
807 |
# Accept absolute paths.
|
|
|
808 |
[[\\/]* | [A-Za-z]:[\\/]*)]
|
|
|
809 |
[re_direlt='/[^/][^/]*/\.\./']
|
|
|
810 |
# Canonicalize the path of ld
|
|
|
811 |
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
|
|
812 |
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
|
|
813 |
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
|
|
814 |
done
|
|
|
815 |
test -z "$LD" && LD="$ac_prog"
|
|
|
816 |
;;
|
|
|
817 |
"")
|
|
|
818 |
# If it fails, then pretend we aren't using GCC.
|
|
|
819 |
ac_prog=ld
|
|
|
820 |
;;
|
|
|
821 |
*)
|
|
|
822 |
# If it is relative, then search for the first ld in PATH.
|
|
|
823 |
with_gnu_ld=unknown
|
|
|
824 |
;;
|
|
|
825 |
esac
|
|
|
826 |
elif test "$with_gnu_ld" = yes; then
|
|
|
827 |
AC_MSG_CHECKING([for GNU ld])
|
|
|
828 |
else
|
|
|
829 |
AC_MSG_CHECKING([for non-GNU ld])
|
|
|
830 |
fi
|
|
|
831 |
AC_CACHE_VAL(acl_cv_path_LD,
|
|
|
832 |
[if test -z "$LD"; then
|
|
|
833 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
|
834 |
for ac_dir in $PATH; do
|
|
|
835 |
test -z "$ac_dir" && ac_dir=.
|
|
|
836 |
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
|
|
837 |
acl_cv_path_LD="$ac_dir/$ac_prog"
|
|
|
838 |
# Check to see if the program is GNU ld. I'd rather use --version,
|
|
|
839 |
# but apparently some GNU ld's only accept -v.
|
|
|
840 |
# Break only if it was the GNU/non-GNU ld that we prefer.
|
|
|
841 |
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
|
|
|
842 |
*GNU* | *'with BFD'*)
|
|
|
843 |
test "$with_gnu_ld" != no && break ;;
|
|
|
844 |
*)
|
|
|
845 |
test "$with_gnu_ld" != yes && break ;;
|
|
|
846 |
esac
|
|
|
847 |
fi
|
|
|
848 |
done
|
|
|
849 |
IFS="$ac_save_ifs"
|
|
|
850 |
else
|
|
|
851 |
acl_cv_path_LD="$LD" # Let the user override the test with a path.
|
|
|
852 |
fi])
|
|
|
853 |
LD="$acl_cv_path_LD"
|
|
|
854 |
if test -n "$LD"; then
|
|
|
855 |
AC_MSG_RESULT($LD)
|
|
|
856 |
else
|
|
|
857 |
AC_MSG_RESULT(no)
|
|
|
858 |
fi
|
|
|
859 |
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
|
|
860 |
AC_LIB_PROG_LD_GNU
|
|
|
861 |
])
|
|
|
862 |
|
|
0
|
863 |
# Do all the work for Automake. This macro actually does too much --
|
|
|
864 |
# some checks are only needed if your package does certain things.
|
|
|
865 |
# But this isn't really a big deal.
|
|
|
866 |
|
|
|
867 |
# serial 1
|
|
|
868 |
|
|
|
869 |
dnl Usage:
|
|
|
870 |
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
|
|
871 |
|
|
2
|
872 |
AC_DEFUN([AM_INIT_AUTOMAKE],
|
|
|
873 |
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
|
|
874 |
AC_REQUIRE([AC_PROG_INSTALL])
|
|
0
|
875 |
PACKAGE=[$1]
|
|
|
876 |
AC_SUBST(PACKAGE)
|
|
|
877 |
VERSION=[$2]
|
|
|
878 |
AC_SUBST(VERSION)
|
|
|
879 |
dnl test to see if srcdir already configured
|
|
|
880 |
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
|
|
881 |
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
|
|
882 |
fi
|
|
|
883 |
ifelse([$3],,
|
|
|
884 |
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
|
|
885 |
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
|
|
886 |
AC_REQUIRE([AM_SANITY_CHECK])
|
|
|
887 |
AC_REQUIRE([AC_ARG_PROGRAM])
|
|
|
888 |
dnl FIXME This is truly gross.
|
|
|
889 |
missing_dir=`cd $ac_aux_dir && pwd`
|
|
2
|
890 |
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
|
|
0
|
891 |
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
|
2
|
892 |
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
|
|
0
|
893 |
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
|
|
894 |
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
|
|
895 |
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
|
|
896 |
|
|
2
|
897 |
# Copyright 2002 Free Software Foundation, Inc.
|
|
|
898 |
|
|
|
899 |
# This program is free software; you can redistribute it and/or modify
|
|
|
900 |
# it under the terms of the GNU General Public License as published by
|
|
|
901 |
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
902 |
# any later version.
|
|
|
903 |
|
|
|
904 |
# This program is distributed in the hope that it will be useful,
|
|
|
905 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
906 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
907 |
# GNU General Public License for more details.
|
|
|
908 |
|
|
|
909 |
# You should have received a copy of the GNU General Public License
|
|
|
910 |
# along with this program; if not, write to the Free Software
|
|
|
911 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
912 |
|
|
|
913 |
# AM_AUTOMAKE_VERSION(VERSION)
|
|
|
914 |
# ----------------------------
|
|
|
915 |
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
|
|
916 |
# generated from the m4 files accompanying Automake X.Y.
|
|
|
917 |
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
|
|
|
918 |
|
|
|
919 |
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
|
|
920 |
# -------------------------------
|
|
|
921 |
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
|
|
922 |
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
|
|
923 |
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
|
|
924 |
[AM_AUTOMAKE_VERSION([1.4-p6])])
|
|
|
925 |
|
|
0
|
926 |
#
|
|
|
927 |
# Check to make sure that the build environment is sane.
|
|
|
928 |
#
|
|
|
929 |
|
|
2
|
930 |
AC_DEFUN([AM_SANITY_CHECK],
|
|
0
|
931 |
[AC_MSG_CHECKING([whether build environment is sane])
|
|
|
932 |
# Just in case
|
|
|
933 |
sleep 1
|
|
|
934 |
echo timestamp > conftestfile
|
|
|
935 |
# Do `set' in a subshell so we don't clobber the current shell's
|
|
|
936 |
# arguments. Must try -L first in case configure is actually a
|
|
|
937 |
# symlink; some systems play weird games with the mod time of symlinks
|
|
|
938 |
# (eg FreeBSD returns the mod time of the symlink's containing
|
|
|
939 |
# directory).
|
|
|
940 |
if (
|
|
|
941 |
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
|
|
942 |
if test "[$]*" = "X"; then
|
|
|
943 |
# -L didn't work.
|
|
|
944 |
set X `ls -t $srcdir/configure conftestfile`
|
|
|
945 |
fi
|
|
|
946 |
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
|
|
947 |
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
|
|
948 |
|
|
|
949 |
# If neither matched, then we have a broken ls. This can happen
|
|
|
950 |
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
|
|
951 |
# broken ls alias from the environment. This has actually
|
|
|
952 |
# happened. Such a system could not be considered "sane".
|
|
|
953 |
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|
|
954 |
alias in your environment])
|
|
|
955 |
fi
|
|
|
956 |
|
|
|
957 |
test "[$]2" = conftestfile
|
|
|
958 |
)
|
|
|
959 |
then
|
|
|
960 |
# Ok.
|
|
|
961 |
:
|
|
|
962 |
else
|
|
|
963 |
AC_MSG_ERROR([newly created file is older than distributed files!
|
|
|
964 |
Check your system clock])
|
|
|
965 |
fi
|
|
|
966 |
rm -f conftest*
|
|
|
967 |
AC_MSG_RESULT(yes)])
|
|
|
968 |
|
|
|
969 |
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
|
|
970 |
dnl The program must properly implement --version.
|
|
2
|
971 |
AC_DEFUN([AM_MISSING_PROG],
|
|
0
|
972 |
[AC_MSG_CHECKING(for working $2)
|
|
|
973 |
# Run test in a subshell; some versions of sh will print an error if
|
|
|
974 |
# an executable is not found, even if stderr is redirected.
|
|
|
975 |
# Redirect stdin to placate older versions of autoconf. Sigh.
|
|
|
976 |
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
|
|
977 |
$1=$2
|
|
|
978 |
AC_MSG_RESULT(found)
|
|
|
979 |
else
|
|
|
980 |
$1="$3/missing $2"
|
|
|
981 |
AC_MSG_RESULT(missing)
|
|
|
982 |
fi
|
|
|
983 |
AC_SUBST($1)])
|
|
|
984 |
|
|
|
985 |
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
|
|
986 |
|
|
2
|
987 |
AC_DEFUN([AM_CONFIG_HEADER],
|
|
0
|
988 |
[AC_PREREQ([2.12])
|
|
|
989 |
AC_CONFIG_HEADER([$1])
|
|
|
990 |
dnl When config.status generates a header, we must update the stamp-h file.
|
|
|
991 |
dnl This file resides in the same directory as the config header
|
|
|
992 |
dnl that is generated. We must strip everything past the first ":",
|
|
|
993 |
dnl and everything past the last "/".
|
|
|
994 |
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
|
|
995 |
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
|
|
996 |
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
|
|
997 |
<<am_indx=1
|
|
|
998 |
for am_file in <<$1>>; do
|
|
|
999 |
case " <<$>>CONFIG_HEADERS " in
|
|
|
1000 |
*" <<$>>am_file "*<<)>>
|
|
|
1001 |
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
|
|
1002 |
;;
|
|
|
1003 |
esac
|
|
|
1004 |
am_indx=`expr "<<$>>am_indx" + 1`
|
|
|
1005 |
done<<>>dnl>>)
|
|
|
1006 |
changequote([,]))])
|
|
|
1007 |
|
|
|
1008 |
# Define a conditional.
|
|
|
1009 |
|
|
2
|
1010 |
AC_DEFUN([AM_CONDITIONAL],
|
|
0
|
1011 |
[AC_SUBST($1_TRUE)
|
|
|
1012 |
AC_SUBST($1_FALSE)
|
|
|
1013 |
if $2; then
|
|
|
1014 |
$1_TRUE=
|
|
|
1015 |
$1_FALSE='#'
|
|
|
1016 |
else
|
|
|
1017 |
$1_TRUE='#'
|
|
|
1018 |
$1_FALSE=
|
|
|
1019 |
fi])
|
|
|
1020 |
|