Lines Matching +full:- +full:name

1 # lib-link.m4 serial 28
2 dnl Copyright (C) 2001-2019 Free Software Foundation, Inc.
11 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
13 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
15 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
16 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
21 pushdef([Name],[m4_translit([$1],[./+-], [____])])
22 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
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"
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 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
41 HAVE_LIB[]NAME=yes
42 popdef([NAME])
43 popdef([Name])
46 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
49 dnl the ability to compile and link the specified testcode. The missing-message
51 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
52 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
53 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
54 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
55 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
56 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
61 pushdef([Name],[m4_translit([$1],[./+-], [____])])
62 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
65 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
69 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
70 dnl so that if lib[]Name is installed, it will be used (unless
71 dnl disabled via --without-lib[]Name-prefix).
73 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
75 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
77 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
78 dnl because these -l options might require -L options that are present in
79 dnl LIBS. -l options benefit only from the -L options listed before it.
84 case " $LIB[]NAME" in
85 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
86 *) LIBS="$LIB[]NAME $LIBS" ;;
90 [ac_cv_lib[]Name=yes],
91 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
94 if test "$ac_cv_lib[]Name" = yes; then
95 HAVE_LIB[]NAME=yes
96 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
98 AC_MSG_RESULT([$LIB[]NAME])
100 HAVE_LIB[]NAME=no
101 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
102 dnl $INC[]NAME either.
104 LIB[]NAME=
105 LTLIB[]NAME=
106 LIB[]NAME[]_PREFIX=
108 AC_SUBST([HAVE_LIB]NAME)
109 AC_SUBST([LIB]NAME)
110 AC_SUBST([LTLIB]NAME)
111 AC_SUBST([LIB]NAME[_PREFIX])
112 popdef([NAME])
113 popdef([Name])
135 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
137 rm -f ./conftest.sh
151 [ --disable-rpath do not hardcode runtime library paths],
155 dnl AC_LIB_FROMPACKAGE(name, package)
157 dnl will then not have a --with-libname-prefix option but a
158 dnl --with-package-prefix option. Several libraries can come from the same
163 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
165 define([acl_frompackage_]NAME, [$2])
166 popdef([NAME])
168 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
176 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
178 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
179 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
180 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
184 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
186 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
187 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
189 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
196 AC_ARG_WITH(PACK[-prefix],
197 [[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
198 --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
212 && test ! -d "$withval/$acl_libdirstem"; then
219 dnl $LDFLAGS. Using breadth-first-search.
220 LIB[]NAME=
221 LTLIB[]NAME=
222 INC[]NAME=
223 LIB[]NAME[]_PREFIX=
224 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
226 HAVE_LIB[]NAME=
231 while test -n "$names_next_round"; do
234 for name in $names_this_round; do
237 if test "$n" = "$name"; then
242 if test -z "$already_handled"; then
243 names_already_handled="$names_already_handled $name"
246 …uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|…
248 if test -n "$value"; then
251 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
253 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
260 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
266 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
267 if test -n "$acl_shlibext"; then
276 if test -n "$acl_shlibext"; then
277 if test -f "$dir/$libname$shrext"; then
284 | sed -e "s,^$libname$shrext\\\\.,," \
285 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
287 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
294 if test -f "$dir/$f"; then
305 if test -f "$dir/$libname.$acl_libext"; then
311 if test -f "$dir/$libname.la"; then
317 for x in $LDFLAGS $LTLIB[]NAME; do
320 -L*)
321 dir=`echo "X$x" | sed -e 's/^X-L//'`
323 if test -n "$acl_shlibext"; then
324 if test -f "$dir/$libname$shrext"; then
331 | sed -e "s,^$libname$shrext\\\\.,," \
332 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
334 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
341 if test -f "$dir/$f"; then
352 if test -f "$dir/$libname.$acl_libext"; then
358 if test -f "$dir/$libname.la"; then
371 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
380 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
393 if test -z "$haveit"; then
400 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
402 … if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
405 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
415 if test -z "$haveit"; then
419 dnl Rely on "-L$found_dir".
423 for x in $LDFLAGS $LIB[]NAME; do
425 if test "X$x" = "X-L$found_dir"; then
430 if test -z "$haveit"; then
431 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
435 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
437 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
444 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
446 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
454 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
458 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
465 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
466 if test "$name" = '$1'; then
467 LIB[]NAME[]_PREFIX="$basedir"
472 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
473 if test "$name" = '$1'; then
474 LIB[]NAME[]_PREFIX="$basedir"
490 if test -n "$GCC"; then
492 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
496 if test -z "$haveit"; then
497 for x in $CPPFLAGS $INC[]NAME; do
499 if test "X$x" = "X-I$additional_includedir"; then
504 if test -z "$haveit"; then
505 if test -d "$additional_includedir"; then
507 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
514 if test -n "$found_la"; then
527 -L*)
528 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
541 if test -n "$GCC"; then
543 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
547 if test -z "$haveit"; then
549 for x in $LDFLAGS $LIB[]NAME; do
551 if test "X$x" = "X-L$additional_libdir"; then
556 if test -z "$haveit"; then
557 if test -d "$additional_libdir"; then
559 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
563 for x in $LDFLAGS $LTLIB[]NAME; do
565 if test "X$x" = "X-L$additional_libdir"; then
570 if test -z "$haveit"; then
571 if test -d "$additional_libdir"; then
573 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
579 -R*)
580 dir=`echo "X$dep" | sed -e 's/^X-R//'`
591 if test -z "$haveit"; then
603 if test -z "$haveit"; then
608 -l*)
610 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
614 dnl directory; it is already contained in a preceding -L
616 …names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,…
619 dnl Most likely an immediate library name.
620 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
621 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
631 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
632 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
639 if test -n "$acl_hardcode_libdir_separator"; then
640 dnl Weird platform: only the last -rpath option counts, the user must
652 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
654 dnl The -rpath options are cumulative.
660 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
666 dnl executables is -R. The -R options are cumulative.
668 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
674 popdef([NAME])
692 if test -z "$haveit"; then
698 dnl For those cases where a variable contains several -L and -l options
701 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
703 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
711 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
717 if test -n "$next"; then
727 -L) next=yes ;;
728 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
740 if test -n ""$3""; then
741 dnl libtool is used for linking. Use -R options.
743 $1="${$1}${$1:+ }-R$dir"
747 if test -n "$acl_hardcode_libdir_separator"; then
748 dnl Weird platform: only the last -rpath option counts, the user
760 dnl The -rpath options are cumulative.