| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
ifdef([AC_HELP_STRING], |
|---|
| 25 |
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], |
|---|
| 26 |
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
AC_DEFUN([AC_LIB_PREFIX], |
|---|
| 35 |
[ |
|---|
| 36 |
AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) |
|---|
| 37 |
AC_REQUIRE([AC_PROG_CC]) |
|---|
| 38 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
|---|
| 39 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
|---|
| 40 |
|
|---|
| 41 |
use_additional=yes |
|---|
| 42 |
AC_LIB_WITH_FINAL_PREFIX([ |
|---|
| 43 |
eval additional_includedir=\"$includedir\" |
|---|
| 44 |
eval additional_libdir=\"$libdir\" |
|---|
| 45 |
]) |
|---|
| 46 |
AC_LIB_ARG_WITH([lib-prefix], |
|---|
| 47 |
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib |
|---|
| 48 |
--without-lib-prefix don't search for libraries in includedir and libdir], |
|---|
| 49 |
[ |
|---|
| 50 |
if test "X$withval" = "Xno"; then |
|---|
| 51 |
use_additional=no |
|---|
| 52 |
else |
|---|
| 53 |
if test "X$withval" = "X"; then |
|---|
| 54 |
AC_LIB_WITH_FINAL_PREFIX([ |
|---|
| 55 |
eval additional_includedir=\"$includedir\" |
|---|
| 56 |
eval additional_libdir=\"$libdir\" |
|---|
| 57 |
]) |
|---|
| 58 |
else |
|---|
| 59 |
additional_includedir="$withval/include" |
|---|
| 60 |
additional_libdir="$withval/lib" |
|---|
| 61 |
fi |
|---|
| 62 |
fi |
|---|
| 63 |
]) |
|---|
| 64 |
if test $use_additional = yes; then |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
if test "X$additional_includedir" != "X/usr/include"; then |
|---|
| 72 |
haveit= |
|---|
| 73 |
for x in $CPPFLAGS; do |
|---|
| 74 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 75 |
if test "X$x" = "X-I$additional_includedir"; then |
|---|
| 76 |
haveit=yes |
|---|
| 77 |
break |
|---|
| 78 |
fi |
|---|
| 79 |
done |
|---|
| 80 |
if test -z "$haveit"; then |
|---|
| 81 |
if test "X$additional_includedir" = "X/usr/local/include"; then |
|---|
| 82 |
if test -n "$GCC"; then |
|---|
| 83 |
case $host_os in |
|---|
| 84 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
|---|
| 85 |
esac |
|---|
| 86 |
fi |
|---|
| 87 |
fi |
|---|
| 88 |
if test -z "$haveit"; then |
|---|
| 89 |
if test -d "$additional_includedir"; then |
|---|
| 90 |
|
|---|
| 91 |
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" |
|---|
| 92 |
fi |
|---|
| 93 |
fi |
|---|
| 94 |
fi |
|---|
| 95 |
fi |
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
if test "X$additional_libdir" != "X/usr/lib"; then |
|---|
| 103 |
haveit= |
|---|
| 104 |
for x in $LDFLAGS; do |
|---|
| 105 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 106 |
if test "X$x" = "X-L$additional_libdir"; then |
|---|
| 107 |
haveit=yes |
|---|
| 108 |
break |
|---|
| 109 |
fi |
|---|
| 110 |
done |
|---|
| 111 |
if test -z "$haveit"; then |
|---|
| 112 |
if test "X$additional_libdir" = "X/usr/local/lib"; then |
|---|
| 113 |
if test -n "$GCC"; then |
|---|
| 114 |
case $host_os in |
|---|
| 115 |
linux*) haveit=yes;; |
|---|
| 116 |
esac |
|---|
| 117 |
fi |
|---|
| 118 |
fi |
|---|
| 119 |
if test -z "$haveit"; then |
|---|
| 120 |
if test -d "$additional_libdir"; then |
|---|
| 121 |
|
|---|
| 122 |
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" |
|---|
| 123 |
fi |
|---|
| 124 |
fi |
|---|
| 125 |
fi |
|---|
| 126 |
fi |
|---|
| 127 |
fi |
|---|
| 128 |
]) |
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
AC_DEFUN([AC_LIB_PREPARE_PREFIX], |
|---|
| 134 |
[ |
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
if test "X$prefix" = "XNONE"; then |
|---|
| 138 |
acl_final_prefix="$ac_default_prefix" |
|---|
| 139 |
else |
|---|
| 140 |
acl_final_prefix="$prefix" |
|---|
| 141 |
fi |
|---|
| 142 |
if test "X$exec_prefix" = "XNONE"; then |
|---|
| 143 |
acl_final_exec_prefix='${prefix}' |
|---|
| 144 |
else |
|---|
| 145 |
acl_final_exec_prefix="$exec_prefix" |
|---|
| 146 |
fi |
|---|
| 147 |
acl_save_prefix="$prefix" |
|---|
| 148 |
prefix="$acl_final_prefix" |
|---|
| 149 |
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" |
|---|
| 150 |
prefix="$acl_save_prefix" |
|---|
| 151 |
]) |
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], |
|---|
| 157 |
[ |
|---|
| 158 |
acl_save_prefix="$prefix" |
|---|
| 159 |
prefix="$acl_final_prefix" |
|---|
| 160 |
acl_save_exec_prefix="$exec_prefix" |
|---|
| 161 |
exec_prefix="$acl_final_exec_prefix" |
|---|
| 162 |
$1 |
|---|
| 163 |
exec_prefix="$acl_save_exec_prefix" |
|---|
| 164 |
prefix="$acl_save_prefix" |
|---|
| 165 |
]) |
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
AC_PREREQ(2.50) |
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
AC_DEFUN([AC_LIB_LINKFLAGS], |
|---|
| 182 |
[ |
|---|
| 183 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
|---|
| 184 |
AC_REQUIRE([AC_LIB_RPATH]) |
|---|
| 185 |
define([Name],[translit([$1],[./-], [___])]) |
|---|
| 186 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|---|
| 187 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|---|
| 188 |
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ |
|---|
| 189 |
AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
|---|
| 190 |
ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
|---|
| 191 |
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
|---|
| 192 |
ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
|---|
| 193 |
]) |
|---|
| 194 |
LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
|---|
| 195 |
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
|---|
| 196 |
INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
|---|
| 197 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
|---|
| 198 |
AC_SUBST([LIB]NAME) |
|---|
| 199 |
AC_SUBST([LTLIB]NAME) |
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
HAVE_LIB[]NAME=yes |
|---|
| 203 |
undefine([Name]) |
|---|
| 204 |
undefine([NAME]) |
|---|
| 205 |
]) |
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
|---|
| 216 |
[ |
|---|
| 217 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
|---|
| 218 |
AC_REQUIRE([AC_LIB_RPATH]) |
|---|
| 219 |
define([Name],[translit([$1],[./-], [___])]) |
|---|
| 220 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|---|
| 221 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
|---|
| 226 |
|
|---|
| 227 |
|
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
ac_save_CPPFLAGS="$CPPFLAGS" |
|---|
| 231 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
|---|
| 232 |
|
|---|
| 233 |
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ |
|---|
| 234 |
ac_save_LIBS="$LIBS" |
|---|
| 235 |
LIBS="$LIBS $LIB[]NAME" |
|---|
| 236 |
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) |
|---|
| 237 |
LIBS="$ac_save_LIBS" |
|---|
| 238 |
]) |
|---|
| 239 |
if test "$ac_cv_lib[]Name" = yes; then |
|---|
| 240 |
HAVE_LIB[]NAME=yes |
|---|
| 241 |
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) |
|---|
| 242 |
AC_MSG_CHECKING([how to link with lib[]$1]) |
|---|
| 243 |
AC_MSG_RESULT([$LIB[]NAME]) |
|---|
| 244 |
else |
|---|
| 245 |
HAVE_LIB[]NAME=no |
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 |
CPPFLAGS="$ac_save_CPPFLAGS" |
|---|
| 249 |
LIB[]NAME= |
|---|
| 250 |
LTLIB[]NAME= |
|---|
| 251 |
fi |
|---|
| 252 |
AC_SUBST([HAVE_LIB]NAME) |
|---|
| 253 |
AC_SUBST([LIB]NAME) |
|---|
| 254 |
AC_SUBST([LTLIB]NAME) |
|---|
| 255 |
undefine([Name]) |
|---|
| 256 |
undefine([NAME]) |
|---|
| 257 |
]) |
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
AC_DEFUN([AC_LIB_RPATH], |
|---|
| 263 |
[ |
|---|
| 264 |
|
|---|
| 265 |
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) |
|---|
| 266 |
AC_REQUIRE([AC_PROG_CC]) |
|---|
| 267 |
AC_REQUIRE([AC_LIB_PROG_LD]) |
|---|
| 268 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
|---|
| 269 |
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) |
|---|
| 270 |
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ |
|---|
| 271 |
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ |
|---|
| 272 |
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
|---|
| 273 |
. ./conftest.sh |
|---|
| 274 |
rm -f ./conftest.sh |
|---|
| 275 |
acl_cv_rpath=done |
|---|
| 276 |
]) |
|---|
| 277 |
wl="$acl_cv_wl" |
|---|
| 278 |
libext="$acl_cv_libext" |
|---|
| 279 |
shlibext="$acl_cv_shlibext" |
|---|
| 280 |
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
|---|
| 281 |
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
|---|
| 282 |
hardcode_direct="$acl_cv_hardcode_direct" |
|---|
| 283 |
hardcode_minus_L="$acl_cv_hardcode_minus_L" |
|---|
| 284 |
|
|---|
| 285 |
AC_ARG_ENABLE(rpath, |
|---|
| 286 |
[ --disable-rpath do not hardcode runtime library paths], |
|---|
| 287 |
:, enable_rpath=yes) |
|---|
| 288 |
]) |
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
|---|
| 294 |
[ |
|---|
| 295 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|---|
| 296 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|---|
| 297 |
|
|---|
| 298 |
use_additional=yes |
|---|
| 299 |
AC_LIB_WITH_FINAL_PREFIX([ |
|---|
| 300 |
eval additional_includedir=\"$includedir\" |
|---|
| 301 |
eval additional_libdir=\"$libdir\" |
|---|
| 302 |
]) |
|---|
| 303 |
AC_LIB_ARG_WITH([lib$1-prefix], |
|---|
| 304 |
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
|---|
| 305 |
--without-lib$1-prefix don't search for lib$1 in includedir and libdir], |
|---|
| 306 |
[ |
|---|
| 307 |
if test "X$withval" = "Xno"; then |
|---|
| 308 |
use_additional=no |
|---|
| 309 |
else |
|---|
| 310 |
if test "X$withval" = "X"; then |
|---|
| 311 |
AC_LIB_WITH_FINAL_PREFIX([ |
|---|
| 312 |
eval additional_includedir=\"$includedir\" |
|---|
| 313 |
eval additional_libdir=\"$libdir\" |
|---|
| 314 |
]) |
|---|
| 315 |
else |
|---|
| 316 |
additional_includedir="$withval/include" |
|---|
| 317 |
additional_libdir="$withval/lib" |
|---|
| 318 |
fi |
|---|
| 319 |
fi |
|---|
| 320 |
]) |
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
LIB[]NAME= |
|---|
| 324 |
LTLIB[]NAME= |
|---|
| 325 |
INC[]NAME= |
|---|
| 326 |
rpathdirs= |
|---|
| 327 |
ltrpathdirs= |
|---|
| 328 |
names_already_handled= |
|---|
| 329 |
names_next_round='$1 $2' |
|---|
| 330 |
while test -n "$names_next_round"; do |
|---|
| 331 |
names_this_round="$names_next_round" |
|---|
| 332 |
names_next_round= |
|---|
| 333 |
for name in $names_this_round; do |
|---|
| 334 |
already_handled= |
|---|
| 335 |
for n in $names_already_handled; do |
|---|
| 336 |
if test "$n" = "$name"; then |
|---|
| 337 |
already_handled=yes |
|---|
| 338 |
break |
|---|
| 339 |
fi |
|---|
| 340 |
done |
|---|
| 341 |
if test -z "$already_handled"; then |
|---|
| 342 |
names_already_handled="$names_already_handled $name" |
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` |
|---|
| 346 |
eval value=\"\$HAVE_LIB$uppername\" |
|---|
| 347 |
if test -n "$value"; then |
|---|
| 348 |
if test "$value" = yes; then |
|---|
| 349 |
eval value=\"\$LIB$uppername\" |
|---|
| 350 |
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" |
|---|
| 351 |
eval value=\"\$LTLIB$uppername\" |
|---|
| 352 |
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" |
|---|
| 353 |
else |
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
: |
|---|
| 357 |
fi |
|---|
| 358 |
else |
|---|
| 359 |
|
|---|
| 360 |
|
|---|
| 361 |
found_dir= |
|---|
| 362 |
found_la= |
|---|
| 363 |
found_so= |
|---|
| 364 |
found_a= |
|---|
| 365 |
if test $use_additional = yes; then |
|---|
| 366 |
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then |
|---|
| 367 |
found_dir="$additional_libdir" |
|---|
| 368 |
found_so="$additional_libdir/lib$name.$shlibext" |
|---|
| 369 |
if test -f "$additional_libdir/lib$name.la"; then |
|---|
| 370 |
found_la="$additional_libdir/lib$name.la" |
|---|
| 371 |
fi |
|---|
| 372 |
else |
|---|
| 373 |
if test -f "$additional_libdir/lib$name.$libext"; then |
|---|
| 374 |
found_dir="$additional_libdir" |
|---|
| 375 |
found_a="$additional_libdir/lib$name.$libext" |
|---|
| 376 |
if test -f "$additional_libdir/lib$name.la"; then |
|---|
| 377 |
found_la="$additional_libdir/lib$name.la" |
|---|
| 378 |
fi |
|---|
| 379 |
fi |
|---|
| 380 |
fi |
|---|
| 381 |
fi |
|---|
| 382 |
if test "X$found_dir" = "X"; then |
|---|
| 383 |
for x in $LDFLAGS $LTLIB[]NAME; do |
|---|
| 384 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 385 |
case "$x" in |
|---|
| 386 |
-L*) |
|---|
| 387 |
dir=`echo "X$x" | sed -e 's/^X-L//'` |
|---|
| 388 |
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then |
|---|
| 389 |
found_dir="$dir" |
|---|
| 390 |
found_so="$dir/lib$name.$shlibext" |
|---|
| 391 |
if test -f "$dir/lib$name.la"; then |
|---|
| 392 |
found_la="$dir/lib$name.la" |
|---|
| 393 |
fi |
|---|
| 394 |
else |
|---|
| 395 |
if test -f "$dir/lib$name.$libext"; then |
|---|
| 396 |
found_dir="$dir" |
|---|
| 397 |
found_a="$dir/lib$name.$libext" |
|---|
| 398 |
if test -f "$dir/lib$name.la"; then |
|---|
| 399 |
found_la="$dir/lib$name.la" |
|---|
| 400 |
fi |
|---|
| 401 |
fi |
|---|
| 402 |
fi |
|---|
| 403 |
;; |
|---|
| 404 |
esac |
|---|
| 405 |
if test "X$found_dir" != "X"; then |
|---|
| 406 |
break |
|---|
| 407 |
fi |
|---|
| 408 |
done |
|---|
| 409 |
fi |
|---|
| 410 |
if test "X$found_dir" != "X"; then |
|---|
| 411 |
|
|---|
| 412 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" |
|---|
| 413 |
if test "X$found_so" != "X"; then |
|---|
| 414 |
|
|---|
| 415 |
|
|---|
| 416 |
|
|---|
| 417 |
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then |
|---|
| 418 |
|
|---|
| 419 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 420 |
else |
|---|
| 421 |
|
|---|
| 422 |
|
|---|
| 423 |
|
|---|
| 424 |
|
|---|
| 425 |
haveit= |
|---|
| 426 |
for x in $ltrpathdirs; do |
|---|
| 427 |
if test "X$x" = "X$found_dir"; then |
|---|
| 428 |
haveit=yes |
|---|
| 429 |
break |
|---|
| 430 |
fi |
|---|
| 431 |
done |
|---|
| 432 |
if test -z "$haveit"; then |
|---|
| 433 |
ltrpathdirs="$ltrpathdirs $found_dir" |
|---|
| 434 |
fi |
|---|
| 435 |
|
|---|
| 436 |
if test "$hardcode_direct" = yes; then |
|---|
| 437 |
|
|---|
| 438 |
|
|---|
| 439 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 440 |
else |
|---|
| 441 |
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then |
|---|
| 442 |
|
|---|
| 443 |
|
|---|
| 444 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 |
haveit= |
|---|
| 448 |
for x in $rpathdirs; do |
|---|
| 449 |
if test "X$x" = "X$found_dir"; then |
|---|
| 450 |
haveit=yes |
|---|
| 451 |
break |
|---|
| 452 |
fi |
|---|
| 453 |
done |
|---|
| 454 |
if test -z "$haveit"; then |
|---|
| 455 |
rpathdirs="$rpathdirs $found_dir" |
|---|
| 456 |
fi |
|---|
| 457 |
else |
|---|
| 458 |
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
haveit= |
|---|
| 462 |
for x in $LDFLAGS $LIB[]NAME; do |
|---|
| 463 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 464 |
if test "X$x" = "X-L$found_dir"; then |
|---|
| 465 |
haveit=yes |
|---|
| 466 |
break |
|---|
| 467 |
fi |
|---|
| 468 |
done |
|---|
| 469 |
if test -z "$haveit"; then |
|---|
| 470 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
|---|
| 471 |
fi |
|---|
| 472 |
if test "$hardcode_minus_L" != no; then |
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 477 |
else |
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
|---|
| 486 |
fi |
|---|
| 487 |
fi |
|---|
| 488 |
fi |
|---|
| 489 |
fi |
|---|
| 490 |
else |
|---|
| 491 |
if test "X$found_a" != "X"; then |
|---|
| 492 |
|
|---|
| 493 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" |
|---|
| 494 |
else |
|---|
| 495 |
|
|---|
| 496 |
|
|---|
| 497 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" |
|---|
| 498 |
fi |
|---|
| 499 |
fi |
|---|
| 500 |
|
|---|
| 501 |
additional_includedir= |
|---|
| 502 |
case "$found_dir" in |
|---|
| 503 |
*/lib | */lib/) |
|---|
| 504 |
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` |
|---|
| 505 |
additional_includedir="$basedir/include" |
|---|
| 506 |
;; |
|---|
| 507 |
esac |
|---|
| 508 |
if test "X$additional_includedir" != "X"; then |
|---|
| 509 |
|
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
dnl 4. if it doesn't exist as a directory. |
|---|
| 516 |
if test "X$additional_includedir" != "X/usr/include"; then |
|---|
| 517 |
haveit= |
|---|
| 518 |
if test "X$additional_includedir" = "X/usr/local/include"; then |
|---|
| 519 |
if test -n "$GCC"; then |
|---|
| 520 |
case $host_os in |
|---|
| 521 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
|---|
| 522 |
esac |
|---|
| 523 |
fi |
|---|
| 524 |
fi |
|---|
| 525 |
if test -z "$haveit"; then |
|---|
| 526 |
for x in $CPPFLAGS $INC[]NAME; do |
|---|
| 527 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 528 |
if test "X$x" = "X-I$additional_includedir"; then |
|---|
| 529 |
haveit=yes |
|---|
| 530 |
break |
|---|
| 531 |
fi |
|---|
| 532 |
done |
|---|
| 533 |
if test -z "$haveit"; then |
|---|
| 534 |
if test -d "$additional_includedir"; then |
|---|
| 535 |
|
|---|
| 536 |
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" |
|---|
| 537 |
fi |
|---|
| 538 |
fi |
|---|
| 539 |
fi |
|---|
| 540 |
fi |
|---|
| 541 |
fi |
|---|
| 542 |
|
|---|
| 543 |
if test -n "$found_la"; then |
|---|
| 544 |
|
|---|
| 545 |
|
|---|
| 546 |
|
|---|
| 547 |
save_libdir="$libdir" |
|---|
| 548 |
case "$found_la" in |
|---|
| 549 |
*/* | *\\*) . "$found_la" ;; |
|---|
| 550 |
*) . "./$found_la" ;; |
|---|
| 551 |
esac |
|---|
| 552 |
libdir="$save_libdir" |
|---|
| 553 |
|
|---|
| 554 |
for dep in $dependency_libs; do |
|---|
| 555 |
case "$dep" in |
|---|
| 556 |
-L*) |
|---|
| 557 |
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` |
|---|
| 558 |
|
|---|
| 559 |
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 |
|
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
if test "X$additional_libdir" != "X/usr/lib"; then |
|---|
| 566 |
haveit= |
|---|
| 567 |
if test "X$additional_libdir" = "X/usr/local/lib"; then |
|---|
| 568 |
if test -n "$GCC"; then |
|---|
| 569 |
case $host_os in |
|---|
| 570 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
|---|
| 571 |
esac |
|---|
| 572 |
fi |
|---|
| 573 |
fi |
|---|
| 574 |
if test -z "$haveit"; then |
|---|
| 575 |
haveit= |
|---|
| 576 |
for x in $LDFLAGS $LIB[]NAME; do |
|---|
| 577 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 578 |
if test "X$x" = "X-L$additional_libdir"; then |
|---|
| 579 |
haveit=yes |
|---|
| 580 |
break |
|---|
| 581 |
fi |
|---|
| 582 |
done |
|---|
| 583 |
if test -z "$haveit"; then |
|---|
| 584 |
if test -d "$additional_libdir"; then |
|---|
| 585 |
|
|---|
| 586 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" |
|---|
| 587 |
fi |
|---|
| 588 |
fi |
|---|
| 589 |
haveit= |
|---|
| 590 |
for x in $LDFLAGS $LTLIB[]NAME; do |
|---|
| 591 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 592 |
if test "X$x" = "X-L$additional_libdir"; then |
|---|
| 593 |
haveit=yes |
|---|
| 594 |
break |
|---|
| 595 |
fi |
|---|
| 596 |
done |
|---|
| 597 |
if test -z "$haveit"; then |
|---|
| 598 |
if test -d "$additional_libdir"; then |
|---|
| 599 |
|
|---|
| 600 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" |
|---|
| 601 |
fi |
|---|
| 602 |
fi |
|---|
| 603 |
fi |
|---|
| 604 |
fi |
|---|
| 605 |
;; |
|---|
| 606 |
-R*) |
|---|
| 607 |
dir=`echo "X$dep" | sed -e 's/^X-R//'` |
|---|
| 608 |
if test "$enable_rpath" != no; then |
|---|
| 609 |
|
|---|
| 610 |
|
|---|
| 611 |
haveit= |
|---|
| 612 |
for x in $rpathdirs; do |
|---|
| 613 |
if test "X$x" = "X$dir"; then |
|---|
| 614 |
haveit=yes |
|---|
| 615 |
break |
|---|
| 616 |
fi |
|---|
| 617 |
done |
|---|
| 618 |
if test -z "$haveit"; then |
|---|
| 619 |
rpathdirs="$rpathdirs $dir" |
|---|
| 620 |
fi |
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 |
haveit= |
|---|
| 624 |
for x in $ltrpathdirs; do |
|---|
| 625 |
if test "X$x" = "X$dir"; then |
|---|
| 626 |
haveit=yes |
|---|
| 627 |
break |
|---|
| 628 |
fi |
|---|
| 629 |
done |
|---|
| 630 |
if test -z "$haveit"; then |
|---|
| 631 |
ltrpathdirs="$ltrpathdirs $dir" |
|---|
| 632 |
fi |
|---|
| 633 |
fi |
|---|
| 634 |
;; |
|---|
| 635 |
-l*) |
|---|
| 636 |
|
|---|
| 637 |
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` |
|---|
| 638 |
;; |
|---|
| 639 |
*.la) |
|---|
| 640 |
|
|---|
| 641 |
|
|---|
| 642 |
|
|---|
| 643 |
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` |
|---|
| 644 |
;; |
|---|
| 645 |
*) |
|---|
| 646 |
|
|---|
| 647 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" |
|---|
| 648 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" |
|---|
| 649 |
;; |
|---|
| 650 |
esac |
|---|
| 651 |
done |
|---|
| 652 |
fi |
|---|
| 653 |
else |
|---|
| 654 |
|
|---|
| 655 |
|
|---|
| 656 |
|
|---|
| 657 |
|
|---|
| 658 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
|---|
| 659 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" |
|---|
| 660 |
fi |
|---|
| 661 |
fi |
|---|
| 662 |
fi |
|---|
| 663 |
done |
|---|
| 664 |
done |
|---|
| 665 |
if test "X$rpathdirs" != "X"; then |
|---|
| 666 |
if test -n "$hardcode_libdir_separator"; then |
|---|
| 667 |
|
|---|
| 668 |
|
|---|
| 669 |
|
|---|
| 670 |
alldirs= |
|---|
| 671 |
for found_dir in $rpathdirs; do |
|---|
| 672 |
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" |
|---|
| 673 |
done |
|---|
| 674 |
|
|---|
| 675 |
acl_save_libdir="$libdir" |
|---|
| 676 |
libdir="$alldirs" |
|---|
| 677 |
eval flag=\"$hardcode_libdir_flag_spec\" |
|---|
| 678 |
libdir="$acl_save_libdir" |
|---|
| 679 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
|---|
| 680 |
else |
|---|
| 681 |
|
|---|
| 682 |
for found_dir in $rpathdirs; do |
|---|
| 683 |
acl_save_libdir="$libdir" |
|---|
| 684 |
libdir="$found_dir" |
|---|
| 685 |
eval flag=\"$hardcode_libdir_flag_spec\" |
|---|
| 686 |
libdir="$acl_save_libdir" |
|---|
| 687 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
|---|
| 688 |
done |
|---|
| 689 |
fi |
|---|
| 690 |
fi |
|---|
| 691 |
if test "X$ltrpathdirs" != "X"; then |
|---|
| 692 |
|
|---|
| 693 |
|
|---|
| 694 |
for found_dir in $ltrpathdirs; do |
|---|
| 695 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" |
|---|
| 696 |
done |
|---|
| 697 |
fi |
|---|
| 698 |
]) |
|---|
| 699 |
|
|---|
| 700 |
|
|---|
| 701 |
|
|---|
| 702 |
|
|---|
| 703 |
|
|---|
| 704 |
AC_DEFUN([AC_LIB_APPENDTOVAR], |
|---|
| 705 |
[ |
|---|
| 706 |
for element in [$2]; do |
|---|
| 707 |
haveit= |
|---|
| 708 |
for x in $[$1]; do |
|---|
| 709 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 710 |
if test "X$x" = "X$element"; then |
|---|
| 711 |
haveit=yes |
|---|
| 712 |
break |
|---|
| 713 |
fi |
|---|
| 714 |
done |
|---|
| 715 |
if test -z "$haveit"; then |
|---|
| 716 |
[$1]="${[$1]}${[$1]:+ }$element" |
|---|
| 717 |
fi |
|---|
| 718 |
done |
|---|
| 719 |
]) |
|---|
| 720 |
|
|---|
| 721 |
|
|---|
| 722 |
|
|---|
| 723 |
|
|---|
| 724 |
|
|---|
| 725 |
|
|---|
| 726 |
|
|---|
| 727 |
|
|---|
| 728 |
|
|---|
| 729 |
|
|---|
| 730 |
|
|---|
| 731 |
|
|---|
| 732 |
AC_DEFUN([AC_LIB_PROG_LD_GNU], |
|---|
| 733 |
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, |
|---|
| 734 |
[ |
|---|
| 735 |
case `$LD -v 2>&1 </dev/null` in |
|---|
| 736 |
*GNU* | *'with BFD'*) |
|---|
| 737 |
acl_cv_prog_gnu_ld=yes ;; |
|---|
| 738 |
*) |
|---|
| 739 |
acl_cv_prog_gnu_ld=no ;; |
|---|
| 740 |
esac]) |
|---|
| 741 |
with_gnu_ld=$acl_cv_prog_gnu_ld |
|---|
| 742 |
]) |
|---|
| 743 |
|
|---|
| 744 |
|
|---|
| 745 |
AC_DEFUN([AC_LIB_PROG_LD], |
|---|
| 746 |
[AC_ARG_WITH(gnu-ld, |
|---|
| 747 |
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
|---|
| 748 |
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
|---|
| 749 |
AC_REQUIRE([AC_PROG_CC]) |
|---|
| 750 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
|---|
| 751 |
|
|---|
| 752 |
|
|---|
| 753 |
if test "${PATH_SEPARATOR+set}" != set; then |
|---|
| 754 |
echo " |
|---|
| 755 |
echo "exit 0" >>conf$$.sh |
|---|
| 756 |
chmod +x conf$$.sh |
|---|
| 757 |
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then |
|---|
| 758 |
PATH_SEPARATOR=';' |
|---|
| 759 |
else |
|---|
| 760 |
PATH_SEPARATOR=: |
|---|
| 761 |
fi |
|---|
| 762 |
rm -f conf$$.sh |
|---|
| 763 |
fi |
|---|
| 764 |
ac_prog=ld |
|---|
| 765 |
if test "$GCC" = yes; then |
|---|
| 766 |
|
|---|
| 767 |
AC_MSG_CHECKING([for ld used by GCC]) |
|---|
| 768 |
case $host in |
|---|
| 769 |
*-*-mingw*) |
|---|
| 770 |
|
|---|
| 771 |
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; |
|---|
| 772 |
*) |
|---|
| 773 |
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; |
|---|
| 774 |
esac |
|---|
| 775 |
case $ac_prog in |
|---|
| 776 |
|
|---|
| 777 |
[[\\/]* | [A-Za-z]:[\\/]*)] |
|---|
| 778 |
[re_direlt='/[^/][^/]*/\.\./'] |
|---|
| 779 |
|
|---|
| 780 |
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
|---|
| 781 |
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
|---|
| 782 |
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
|---|
| 783 |
done |
|---|
| 784 |
test -z "$LD" && LD="$ac_prog" |
|---|
| 785 |
;; |
|---|
| 786 |
"") |
|---|
| 787 |
|
|---|
| 788 |
ac_prog=ld |
|---|
| 789 |
;; |
|---|
| 790 |
*) |
|---|
| 791 |
|
|---|
| 792 |
with_gnu_ld=unknown |
|---|
| 793 |
;; |
|---|
| 794 |
esac |
|---|
| 795 |
elif test "$with_gnu_ld" = yes; then |
|---|
| 796 |
AC_MSG_CHECKING([for GNU ld]) |
|---|
| 797 |
else |
|---|
| 798 |
AC_MSG_CHECKING([for non-GNU ld]) |
|---|
| 799 |
fi |
|---|
| 800 |
AC_CACHE_VAL(acl_cv_path_LD, |
|---|
| 801 |
[if test -z "$LD"; then |
|---|
| 802 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
|---|
| 803 |
for ac_dir in $PATH; do |
|---|
| 804 |
test -z "$ac_dir" && ac_dir=. |
|---|
| 805 |
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
|---|
| 806 |
acl_cv_path_LD="$ac_dir/$ac_prog" |
|---|
| 807 |
|
|---|
| 808 |
|
|---|
| 809 |
|
|---|
| 810 |
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in |
|---|
| 811 |
*GNU* | *'with BFD'*) |
|---|
| 812 |
test "$with_gnu_ld" != no && break ;; |
|---|
| 813 |
*) |
|---|
| 814 |
test "$with_gnu_ld" != yes && break ;; |
|---|
| 815 |
esac |
|---|
| 816 |
fi |
|---|
| 817 |
done |
|---|
| 818 |
IFS="$ac_save_ifs" |
|---|
| 819 |
else |
|---|
| 820 |
acl_cv_path_LD="$LD" |
|---|
| 821 |
fi]) |
|---|
| 822 |
LD="$acl_cv_path_LD" |
|---|
| 823 |
if test -n "$LD"; then |
|---|
| 824 |
AC_MSG_RESULT($LD) |
|---|
| 825 |
else |
|---|
| 826 |
AC_MSG_RESULT(no) |
|---|
| 827 |
fi |
|---|
| 828 |
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
|---|
| 829 |
AC_LIB_PROG_LD_GNU |
|---|
| 830 |
]) |
|---|
| 831 |
|
|---|
| 832 |
|
|---|
| 833 |
|
|---|
| 834 |
AC_DEFUN([AM_CONFIG_HEADER], |
|---|
| 835 |
[AC_PREREQ([2.12]) |
|---|
| 836 |
AC_CONFIG_HEADER([$1]) |
|---|
| 837 |
|
|---|
| 838 |
|
|---|
| 839 |
|
|---|
| 840 |
|
|---|
| 841 |
AC_OUTPUT_COMMANDS(changequote(<<,>>) |
|---|
| 842 |
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, |
|---|
| 843 |
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>> |
|---|
| 844 |
<<am_indx=1 |
|---|
| 845 |
for am_file in <<$1>>; do |
|---|
| 846 |
case " <<$>>CONFIG_HEADERS " in |
|---|
| 847 |
*" <<$>>am_file "*<<)>> |
|---|
| 848 |
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx |
|---|
| 849 |
;; |
|---|
| 850 |
esac |
|---|
| 851 |
am_indx=`expr "<<$>>am_indx" + 1` |
|---|
| 852 |
done<<>> |
|---|
| 853 |
changequote([,]))]) |
|---|
| 854 |
|
|---|
| 855 |
|
|---|
| 856 |
|
|---|