| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
AC_PREREQ(2.54) |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
AC_DEFUN([AC_LIB_LINKFLAGS], |
|---|
| 18 |
[ |
|---|
| 19 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
|---|
| 20 |
AC_REQUIRE([AC_LIB_RPATH]) |
|---|
| 21 |
define([Name],[translit([$1],[./-], [___])]) |
|---|
| 22 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|---|
| 23 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|---|
| 24 |
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ |
|---|
| 25 |
AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
|---|
| 26 |
ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
|---|
| 27 |
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
|---|
| 28 |
ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
|---|
| 29 |
ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" |
|---|
| 30 |
]) |
|---|
| 31 |
LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
|---|
| 32 |
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
|---|
| 33 |
INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
|---|
| 34 |
LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" |
|---|
| 35 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
|---|
| 36 |
AC_SUBST([LIB]NAME) |
|---|
| 37 |
AC_SUBST([LTLIB]NAME) |
|---|
| 38 |
AC_SUBST([LIB]NAME[_PREFIX]) |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
HAVE_LIB[]NAME=yes |
|---|
| 42 |
undefine([Name]) |
|---|
| 43 |
undefine([NAME]) |
|---|
| 44 |
]) |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
|---|
| 57 |
[ |
|---|
| 58 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
|---|
| 59 |
AC_REQUIRE([AC_LIB_RPATH]) |
|---|
| 60 |
define([Name],[translit([$1],[./-], [___])]) |
|---|
| 61 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|---|
| 62 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
ac_save_CPPFLAGS="$CPPFLAGS" |
|---|
| 72 |
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
|---|
| 73 |
|
|---|
| 74 |
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ |
|---|
| 75 |
ac_save_LIBS="$LIBS" |
|---|
| 76 |
LIBS="$LIBS $LIB[]NAME" |
|---|
| 77 |
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) |
|---|
| 78 |
LIBS="$ac_save_LIBS" |
|---|
| 79 |
]) |
|---|
| 80 |
if test "$ac_cv_lib[]Name" = yes; then |
|---|
| 81 |
HAVE_LIB[]NAME=yes |
|---|
| 82 |
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) |
|---|
| 83 |
AC_MSG_CHECKING([how to link with lib[]$1]) |
|---|
| 84 |
AC_MSG_RESULT([$LIB[]NAME]) |
|---|
| 85 |
else |
|---|
| 86 |
HAVE_LIB[]NAME=no |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
CPPFLAGS="$ac_save_CPPFLAGS" |
|---|
| 90 |
LIB[]NAME= |
|---|
| 91 |
LTLIB[]NAME= |
|---|
| 92 |
LIB[]NAME[]_PREFIX= |
|---|
| 93 |
fi |
|---|
| 94 |
AC_SUBST([HAVE_LIB]NAME) |
|---|
| 95 |
AC_SUBST([LIB]NAME) |
|---|
| 96 |
AC_SUBST([LTLIB]NAME) |
|---|
| 97 |
AC_SUBST([LIB]NAME[_PREFIX]) |
|---|
| 98 |
undefine([Name]) |
|---|
| 99 |
undefine([NAME]) |
|---|
| 100 |
]) |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
AC_DEFUN([AC_LIB_RPATH], |
|---|
| 110 |
[ |
|---|
| 111 |
|
|---|
| 112 |
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) |
|---|
| 113 |
AC_REQUIRE([AC_PROG_CC]) |
|---|
| 114 |
AC_REQUIRE([AC_LIB_PROG_LD]) |
|---|
| 115 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
|---|
| 116 |
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) |
|---|
| 117 |
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ |
|---|
| 118 |
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ |
|---|
| 119 |
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
|---|
| 120 |
. ./conftest.sh |
|---|
| 121 |
rm -f ./conftest.sh |
|---|
| 122 |
acl_cv_rpath=done |
|---|
| 123 |
]) |
|---|
| 124 |
wl="$acl_cv_wl" |
|---|
| 125 |
acl_libext="$acl_cv_libext" |
|---|
| 126 |
acl_shlibext="$acl_cv_shlibext" |
|---|
| 127 |
acl_libname_spec="$acl_cv_libname_spec" |
|---|
| 128 |
acl_library_names_spec="$acl_cv_library_names_spec" |
|---|
| 129 |
acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
|---|
| 130 |
acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
|---|
| 131 |
acl_hardcode_direct="$acl_cv_hardcode_direct" |
|---|
| 132 |
acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" |
|---|
| 133 |
|
|---|
| 134 |
AC_ARG_ENABLE(rpath, |
|---|
| 135 |
[ --disable-rpath do not hardcode runtime library paths], |
|---|
| 136 |
:, enable_rpath=yes) |
|---|
| 137 |
]) |
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
|---|
| 145 |
[ |
|---|
| 146 |
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) |
|---|
| 147 |
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|---|
| 148 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|---|
| 149 |
|
|---|
| 150 |
define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) |
|---|
| 151 |
|
|---|
| 152 |
use_additional=yes |
|---|
| 153 |
AC_LIB_WITH_FINAL_PREFIX([ |
|---|
| 154 |
eval additional_includedir=\"$includedir\" |
|---|
| 155 |
eval additional_libdir=\"$libdir\" |
|---|
| 156 |
]) |
|---|
| 157 |
AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], |
|---|
| 158 |
[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
|---|
| 159 |
--without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], |
|---|
| 160 |
[ |
|---|
| 161 |
if test "X$withval" = "Xno"; then |
|---|
| 162 |
use_additional=no |
|---|
| 163 |
else |
|---|
| 164 |
if test "X$withval" = "X"; then |
|---|
| 165 |
AC_LIB_WITH_FINAL_PREFIX([ |
|---|
| 166 |
eval additional_includedir=\"$includedir\" |
|---|
| 167 |
eval additional_libdir=\"$libdir\" |
|---|
| 168 |
]) |
|---|
| 169 |
else |
|---|
| 170 |
additional_includedir="$withval/include" |
|---|
| 171 |
additional_libdir="$withval/$acl_libdirstem" |
|---|
| 172 |
fi |
|---|
| 173 |
fi |
|---|
| 174 |
]) |
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
LIB[]NAME= |
|---|
| 178 |
LTLIB[]NAME= |
|---|
| 179 |
INC[]NAME= |
|---|
| 180 |
LIB[]NAME[]_PREFIX= |
|---|
| 181 |
rpathdirs= |
|---|
| 182 |
ltrpathdirs= |
|---|
| 183 |
names_already_handled= |
|---|
| 184 |
names_next_round='$1 $2' |
|---|
| 185 |
while test -n "$names_next_round"; do |
|---|
| 186 |
names_this_round="$names_next_round" |
|---|
| 187 |
names_next_round= |
|---|
| 188 |
for name in $names_this_round; do |
|---|
| 189 |
already_handled= |
|---|
| 190 |
for n in $names_already_handled; do |
|---|
| 191 |
if test "$n" = "$name"; then |
|---|
| 192 |
already_handled=yes |
|---|
| 193 |
break |
|---|
| 194 |
fi |
|---|
| 195 |
done |
|---|
| 196 |
if test -z "$already_handled"; then |
|---|
| 197 |
names_already_handled="$names_already_handled $name" |
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` |
|---|
| 201 |
eval value=\"\$HAVE_LIB$uppername\" |
|---|
| 202 |
if test -n "$value"; then |
|---|
| 203 |
if test "$value" = yes; then |
|---|
| 204 |
eval value=\"\$LIB$uppername\" |
|---|
| 205 |
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" |
|---|
| 206 |
eval value=\"\$LTLIB$uppername\" |
|---|
| 207 |
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" |
|---|
| 208 |
else |
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
: |
|---|
| 212 |
fi |
|---|
| 213 |
else |
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
found_dir= |
|---|
| 217 |
found_la= |
|---|
| 218 |
found_so= |
|---|
| 219 |
found_a= |
|---|
| 220 |
eval libname=\"$acl_libname_spec\" |
|---|
| 221 |
if test -n "$acl_shlibext"; then |
|---|
| 222 |
shrext=".$acl_shlibext" |
|---|
| 223 |
else |
|---|
| 224 |
shrext= |
|---|
| 225 |
fi |
|---|
| 226 |
if test $use_additional = yes; then |
|---|
| 227 |
dir="$additional_libdir" |
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
if test -n "$acl_shlibext"; then |
|---|
| 231 |
if test -f "$dir/$libname$shrext"; then |
|---|
| 232 |
found_dir="$dir" |
|---|
| 233 |
found_so="$dir/$libname$shrext" |
|---|
| 234 |
else |
|---|
| 235 |
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then |
|---|
| 236 |
ver=`(cd "$dir" && \ |
|---|
| 237 |
for f in "$libname$shrext".*; do echo "$f"; done \ |
|---|
| 238 |
| sed -e "s,^$libname$shrext\\\\.,," \ |
|---|
| 239 |
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ |
|---|
| 240 |
| sed 1q ) 2>/dev/null` |
|---|
| 241 |
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then |
|---|
| 242 |
found_dir="$dir" |
|---|
| 243 |
found_so="$dir/$libname$shrext.$ver" |
|---|
| 244 |
fi |
|---|
| 245 |
else |
|---|
| 246 |
eval library_names=\"$acl_library_names_spec\" |
|---|
| 247 |
for f in $library_names; do |
|---|
| 248 |
if test -f "$dir/$f"; then |
|---|
| 249 |
found_dir="$dir" |
|---|
| 250 |
found_so="$dir/$f" |
|---|
| 251 |
break |
|---|
| 252 |
fi |
|---|
| 253 |
done |
|---|
| 254 |
fi |
|---|
| 255 |
fi |
|---|
| 256 |
fi |
|---|
| 257 |
|
|---|
| 258 |
if test "X$found_dir" = "X"; then |
|---|
| 259 |
if test -f "$dir/$libname.$acl_libext"; then |
|---|
| 260 |
found_dir="$dir" |
|---|
| 261 |
found_a="$dir/$libname.$acl_libext" |
|---|
| 262 |
fi |
|---|
| 263 |
fi |
|---|
| 264 |
if test "X$found_dir" != "X"; then |
|---|
| 265 |
if test -f "$dir/$libname.la"; then |
|---|
| 266 |
found_la="$dir/$libname.la" |
|---|
| 267 |
fi |
|---|
| 268 |
fi |
|---|
| 269 |
fi |
|---|
| 270 |
if test "X$found_dir" = "X"; then |
|---|
| 271 |
for x in $LDFLAGS $LTLIB[]NAME; do |
|---|
| 272 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 273 |
case "$x" in |
|---|
| 274 |
-L*) |
|---|
| 275 |
dir=`echo "X$x" | sed -e 's/^X-L//'` |
|---|
| 276 |
|
|---|
| 277 |
if test -n "$acl_shlibext"; then |
|---|
| 278 |
if test -f "$dir/$libname$shrext"; then |
|---|
| 279 |
found_dir="$dir" |
|---|
| 280 |
found_so="$dir/$libname$shrext" |
|---|
| 281 |
else |
|---|
| 282 |
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then |
|---|
| 283 |
ver=`(cd "$dir" && \ |
|---|
| 284 |
for f in "$libname$shrext".*; do echo "$f"; done \ |
|---|
| 285 |
| sed -e "s,^$libname$shrext\\\\.,," \ |
|---|
| 286 |
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ |
|---|
| 287 |
| sed 1q ) 2>/dev/null` |
|---|
| 288 |
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then |
|---|
| 289 |
found_dir="$dir" |
|---|
| 290 |
found_so="$dir/$libname$shrext.$ver" |
|---|
| 291 |
fi |
|---|
| 292 |
else |
|---|
| 293 |
eval library_names=\"$acl_library_names_spec\" |
|---|
| 294 |
for f in $library_names; do |
|---|
| 295 |
if test -f "$dir/$f"; then |
|---|
| 296 |
found_dir="$dir" |
|---|
| 297 |
found_so="$dir/$f" |
|---|
| 298 |
break |
|---|
| 299 |
fi |
|---|
| 300 |
done |
|---|
| 301 |
fi |
|---|
| 302 |
fi |
|---|
| 303 |
fi |
|---|
| 304 |
|
|---|
| 305 |
if test "X$found_dir" = "X"; then |
|---|
| 306 |
if test -f "$dir/$libname.$acl_libext"; then |
|---|
| 307 |
found_dir="$dir" |
|---|
| 308 |
found_a="$dir/$libname.$acl_libext" |
|---|
| 309 |
fi |
|---|
| 310 |
fi |
|---|
| 311 |
if test "X$found_dir" != "X"; then |
|---|
| 312 |
if test -f "$dir/$libname.la"; then |
|---|
| 313 |
found_la="$dir/$libname.la" |
|---|
| 314 |
fi |
|---|
| 315 |
fi |
|---|
| 316 |
;; |
|---|
| 317 |
esac |
|---|
| 318 |
if test "X$found_dir" != "X"; then |
|---|
| 319 |
break |
|---|
| 320 |
fi |
|---|
| 321 |
done |
|---|
| 322 |
fi |
|---|
| 323 |
if test "X$found_dir" != "X"; then |
|---|
| 324 |
|
|---|
| 325 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" |
|---|
| 326 |
if test "X$found_so" != "X"; then |
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
|
|---|
| 330 |
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then |
|---|
| 331 |
|
|---|
| 332 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 333 |
else |
|---|
| 334 |
|
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
haveit= |
|---|
| 339 |
for x in $ltrpathdirs; do |
|---|
| 340 |
if test "X$x" = "X$found_dir"; then |
|---|
| 341 |
haveit=yes |
|---|
| 342 |
break |
|---|
| 343 |
fi |
|---|
| 344 |
done |
|---|
| 345 |
if test -z "$haveit"; then |
|---|
| 346 |
ltrpathdirs="$ltrpathdirs $found_dir" |
|---|
| 347 |
fi |
|---|
| 348 |
|
|---|
| 349 |
if test "$acl_hardcode_direct" = yes; then |
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 353 |
else |
|---|
| 354 |
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then |
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
haveit= |
|---|
| 361 |
for x in $rpathdirs; do |
|---|
| 362 |
if test "X$x" = "X$found_dir"; then |
|---|
| 363 |
haveit=yes |
|---|
| 364 |
break |
|---|
| 365 |
fi |
|---|
| 366 |
done |
|---|
| 367 |
if test -z "$haveit"; then |
|---|
| 368 |
rpathdirs="$rpathdirs $found_dir" |
|---|
| 369 |
fi |
|---|
| 370 |
else |
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 |
haveit= |
|---|
| 375 |
for x in $LDFLAGS $LIB[]NAME; do |
|---|
| 376 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 377 |
if test "X$x" = "X-L$found_dir"; then |
|---|
| 378 |
haveit=yes |
|---|
| 379 |
break |
|---|
| 380 |
fi |
|---|
| 381 |
done |
|---|
| 382 |
if test -z "$haveit"; then |
|---|
| 383 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
|---|
| 384 |
fi |
|---|
| 385 |
if test "$acl_hardcode_minus_L" != no; then |
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
|---|
| 390 |
else |
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
|---|
| 399 |
fi |
|---|
| 400 |
fi |
|---|
| 401 |
fi |
|---|
| 402 |
fi |
|---|
| 403 |
else |
|---|
| 404 |
if test "X$found_a" != "X"; then |
|---|
| 405 |
|
|---|
| 406 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" |
|---|
| 407 |
else |
|---|
| 408 |
|
|---|
| 409 |
|
|---|
| 410 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" |
|---|
| 411 |
fi |
|---|
| 412 |
fi |
|---|
| 413 |
|
|---|
| 414 |
additional_includedir= |
|---|
| 415 |
case "$found_dir" in |
|---|
| 416 |
*/$acl_libdirstem | */$acl_libdirstem/) |
|---|
| 417 |
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` |
|---|
| 418 |
LIB[]NAME[]_PREFIX="$basedir" |
|---|
| 419 |
additional_includedir="$basedir/include" |
|---|
| 420 |
;; |
|---|
| 421 |
esac |
|---|
| 422 |
if test "X$additional_includedir" != "X"; then |
|---|
| 423 |
|
|---|
| 424 |
|
|---|
| 425 |
|
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 |
|
|---|
| 429 |
|
|---|
| 430 |
if test "X$additional_includedir" != "X/usr/include"; then |
|---|
| 431 |
haveit= |
|---|
| 432 |
if test "X$additional_includedir" = "X/usr/local/include"; then |
|---|
| 433 |
if test -n "$GCC"; then |
|---|
| 434 |
case $host_os in |
|---|
| 435 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
|---|
| 436 |
esac |
|---|
| 437 |
fi |
|---|
| 438 |
fi |
|---|
| 439 |
if test -z "$haveit"; then |
|---|
| 440 |
for x in $CPPFLAGS $INC[]NAME; do |
|---|
| 441 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 442 |
if test "X$x" = "X-I$additional_includedir"; then |
|---|
| 443 |
haveit=yes |
|---|
| 444 |
break |
|---|
| 445 |
fi |
|---|
| 446 |
done |
|---|
| 447 |
if test -z "$haveit"; then |
|---|
| 448 |
if test -d "$additional_includedir"; then |
|---|
| 449 |
|
|---|
| 450 |
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" |
|---|
| 451 |
fi |
|---|
| 452 |
fi |
|---|
| 453 |
fi |
|---|
| 454 |
fi |
|---|
| 455 |
fi |
|---|
| 456 |
|
|---|
| 457 |
if test -n "$found_la"; then |
|---|
| 458 |
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
save_libdir="$libdir" |
|---|
| 462 |
case "$found_la" in |
|---|
| 463 |
*/* | *\\*) . "$found_la" ;; |
|---|
| 464 |
*) . "./$found_la" ;; |
|---|
| 465 |
esac |
|---|
| 466 |
libdir="$save_libdir" |
|---|
| 467 |
|
|---|
| 468 |
for dep in $dependency_libs; do |
|---|
| 469 |
case "$dep" in |
|---|
| 470 |
-L*) |
|---|
| 471 |
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` |
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
dnl constructed $LIBNAME, |
|---|
| 478 |
t exist as a directory. |
|---|
| 479 |
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then |
|---|
| 480 |
haveit= |
|---|
| 481 |
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then |
|---|
| 482 |
if test -n "$GCC"; then |
|---|
| 483 |
case $host_os in |
|---|
| 484 |
linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
|---|
| 485 |
esac |
|---|
| 486 |
fi |
|---|
| 487 |
fi |
|---|
| 488 |
if test -z "$haveit"; then |
|---|
| 489 |
haveit= |
|---|
| 490 |
for x in $LDFLAGS $LIB[]NAME; do |
|---|
| 491 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 492 |
if test "X$x" = "X-L$additional_libdir"; then |
|---|
| 493 |
haveit=yes |
|---|
| 494 |
break |
|---|
| 495 |
fi |
|---|
| 496 |
done |
|---|
| 497 |
if test -z "$haveit"; then |
|---|
| 498 |
if test -d "$additional_libdir"; then |
|---|
| 499 |
|
|---|
| 500 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" |
|---|
| 501 |
fi |
|---|
| 502 |
fi |
|---|
| 503 |
haveit= |
|---|
| 504 |
for x in $LDFLAGS $LTLIB[]NAME; do |
|---|
| 505 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 506 |
if test "X$x" = "X-L$additional_libdir"; then |
|---|
| 507 |
haveit=yes |
|---|
| 508 |
break |
|---|
| 509 |
fi |
|---|
| 510 |
done |
|---|
| 511 |
if test -z "$haveit"; then |
|---|
| 512 |
if test -d "$additional_libdir"; then |
|---|
| 513 |
|
|---|
| 514 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" |
|---|
| 515 |
fi |
|---|
| 516 |
fi |
|---|
| 517 |
fi |
|---|
| 518 |
fi |
|---|
| 519 |
;; |
|---|
| 520 |
-R*) |
|---|
| 521 |
dir=`echo "X$dep" | sed -e 's/^X-R//'` |
|---|
| 522 |
if test "$enable_rpath" != no; then |
|---|
| 523 |
|
|---|
| 524 |
|
|---|
| 525 |
haveit= |
|---|
| 526 |
for x in $rpathdirs; do |
|---|
| 527 |
if test "X$x" = "X$dir"; then |
|---|
| 528 |
haveit=yes |
|---|
| 529 |
break |
|---|
| 530 |
fi |
|---|
| 531 |
done |
|---|
| 532 |
if test -z "$haveit"; then |
|---|
| 533 |
rpathdirs="$rpathdirs $dir" |
|---|
| 534 |
fi |
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
haveit= |
|---|
| 538 |
for x in $ltrpathdirs; do |
|---|
| 539 |
if test "X$x" = "X$dir"; then |
|---|
| 540 |
haveit=yes |
|---|
| 541 |
break |
|---|
| 542 |
fi |
|---|
| 543 |
done |
|---|
| 544 |
if test -z "$haveit"; then |
|---|
| 545 |
ltrpathdirs="$ltrpathdirs $dir" |
|---|
| 546 |
fi |
|---|
| 547 |
fi |
|---|
| 548 |
;; |
|---|
| 549 |
-l*) |
|---|
| 550 |
|
|---|
| 551 |
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` |
|---|
| 552 |
;; |
|---|
| 553 |
*.la) |
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 |
|
|---|
| 557 |
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` |
|---|
| 558 |
;; |
|---|
| 559 |
*) |
|---|
| 560 |
|
|---|
| 561 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" |
|---|
| 562 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" |
|---|
| 563 |
;; |
|---|
| 564 |
esac |
|---|
| 565 |
done |
|---|
| 566 |
fi |
|---|
| 567 |
else |
|---|
| 568 |
|
|---|
| 569 |
|
|---|
| 570 |
|
|---|
| 571 |
|
|---|
| 572 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
|---|
| 573 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" |
|---|
| 574 |
fi |
|---|
| 575 |
fi |
|---|
| 576 |
fi |
|---|
| 577 |
done |
|---|
| 578 |
done |
|---|
| 579 |
if test "X$rpathdirs" != "X"; then |
|---|
| 580 |
if test -n "$acl_hardcode_libdir_separator"; then |
|---|
| 581 |
|
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 |
alldirs= |
|---|
| 585 |
for found_dir in $rpathdirs; do |
|---|
| 586 |
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" |
|---|
| 587 |
done |
|---|
| 588 |
|
|---|
| 589 |
acl_save_libdir="$libdir" |
|---|
| 590 |
libdir="$alldirs" |
|---|
| 591 |
eval flag=\"$acl_hardcode_libdir_flag_spec\" |
|---|
| 592 |
libdir="$acl_save_libdir" |
|---|
| 593 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
|---|
| 594 |
else |
|---|
| 595 |
|
|---|
| 596 |
for found_dir in $rpathdirs; do |
|---|
| 597 |
acl_save_libdir="$libdir" |
|---|
| 598 |
libdir="$found_dir" |
|---|
| 599 |
eval flag=\"$acl_hardcode_libdir_flag_spec\" |
|---|
| 600 |
libdir="$acl_save_libdir" |
|---|
| 601 |
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
|---|
| 602 |
done |
|---|
| 603 |
fi |
|---|
| 604 |
fi |
|---|
| 605 |
if test "X$ltrpathdirs" != "X"; then |
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 |
for found_dir in $ltrpathdirs; do |
|---|
| 609 |
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" |
|---|
| 610 |
done |
|---|
| 611 |
fi |
|---|
| 612 |
]) |
|---|
| 613 |
|
|---|
| 614 |
|
|---|
| 615 |
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 |
AC_DEFUN([AC_LIB_APPENDTOVAR], |
|---|
| 619 |
[ |
|---|
| 620 |
for element in [$2]; do |
|---|
| 621 |
haveit= |
|---|
| 622 |
for x in $[$1]; do |
|---|
| 623 |
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
|---|
| 624 |
if test "X$x" = "X$element"; then |
|---|
| 625 |
haveit=yes |
|---|
| 626 |
break |
|---|
| 627 |
fi |
|---|
| 628 |
done |
|---|
| 629 |
if test -z "$haveit"; then |
|---|
| 630 |
[$1]="${[$1]}${[$1]:+ }$element" |
|---|
| 631 |
fi |
|---|
| 632 |
done |
|---|
| 633 |
]) |
|---|
| 634 |
|
|---|
| 635 |
|
|---|
| 636 |
|
|---|
| 637 |
|
|---|
| 638 |
|
|---|
| 639 |
|
|---|
| 640 |
|
|---|
| 641 |
|
|---|
| 642 |
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], |
|---|
| 643 |
[ |
|---|
| 644 |
AC_REQUIRE([AC_LIB_RPATH]) |
|---|
| 645 |
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) |
|---|
| 646 |
$1= |
|---|
| 647 |
if test "$enable_rpath" != no; then |
|---|
| 648 |
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then |
|---|
| 649 |
|
|---|
| 650 |
|
|---|
| 651 |
rpathdirs= |
|---|
| 652 |
next= |
|---|
| 653 |
for opt in $2; do |
|---|
| 654 |
if test -n "$next"; then |
|---|
| 655 |
dir="$next" |
|---|
| 656 |
|
|---|
| 657 |
if test "X$dir" != "X/usr/$acl_libdirstem"; then |
|---|
| 658 |
rpathdirs="$rpathdirs $dir" |
|---|
| 659 |
fi |
|---|
| 660 |
next= |
|---|
| 661 |
else |
|---|
| 662 |
case $opt in |
|---|
| 663 |
-L) next=yes ;; |
|---|
| 664 |
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` |
|---|
| 665 |
|
|---|
| 666 |
if test "X$dir" != "X/usr/$acl_libdirstem"; then |
|---|
| 667 |
rpathdirs="$rpathdirs $dir" |
|---|
| 668 |
fi |
|---|
| 669 |
next= ;; |
|---|
| 670 |
*) next= ;; |
|---|
| 671 |
esac |
|---|
| 672 |
fi |
|---|
| 673 |
done |
|---|
| 674 |
if test "X$rpathdirs" != "X"; then |
|---|
| 675 |
if test -n ""$3""; then |
|---|
| 676 |
|
|---|
| 677 |
for dir in $rpathdirs; do |
|---|
| 678 |
$1="${$1}${$1:+ }-R$dir" |
|---|
| 679 |
done |
|---|
| 680 |
else |
|---|
| 681 |
|
|---|
| 682 |
if test -n "$acl_hardcode_libdir_separator"; then |
|---|
| 683 |
|
|---|
| 684 |
|
|---|
| 685 |
alldirs= |
|---|
| 686 |
for dir in $rpathdirs; do |
|---|
| 687 |
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" |
|---|
| 688 |
done |
|---|
| 689 |
acl_save_libdir="$libdir" |
|---|
| 690 |
libdir="$alldirs" |
|---|
| 691 |
eval flag=\"$acl_hardcode_libdir_flag_spec\" |
|---|
| 692 |
libdir="$acl_save_libdir" |
|---|
| 693 |
$1="$flag" |
|---|
| 694 |
else |
|---|
| 695 |
|
|---|
| 696 |
for dir in $rpathdirs; do |
|---|
| 697 |
acl_save_libdir="$libdir" |
|---|
| 698 |
libdir="$dir" |
|---|
| 699 |
eval flag=\"$acl_hardcode_libdir_flag_spec\" |
|---|
| 700 |
libdir="$acl_save_libdir" |
|---|
| 701 |
$1="${$1}${$1:+ }$flag" |
|---|
| 702 |
done |
|---|
| 703 |
fi |
|---|
| 704 |
fi |
|---|
| 705 |
fi |
|---|
| 706 |
fi |
|---|
| 707 |
fi |
|---|
| 708 |
AC_SUBST([$1]) |
|---|
| 709 |
]) |
|---|