"Fossies" - the Fresh Open Source Software Archive 
Member "which-2.21/acinclude.m4" (25 May 2007, 2515 Bytes) of package /linux/privat/which-2.21.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 dnl AC_CHECK_STATICLIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND
2 dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
3 dnl Like AC_CHECK_LIB but looking for static libraries.
4 dnl LIBRARY must be of the form libxxx.a.
5 dnl The current language must be C (AC_LANG_C).
6 AC_DEFUN([AC_CHECK_STATICLIB],
7 [AC_MSG_CHECKING([for $2 in $1])
8 dnl Use a cache variable name containing both the library and function name,
9 dnl because the test really is for library $1 defining function $2, not
10 dnl just for library $1. Separate tests with the same $1 and different $2s
11 dnl may have different results.
12 ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
13 AC_CACHE_VAL(ac_cv_lib_static_$ac_lib_var,
14 if test -r /etc/ld.so.conf ; then
15 ld_so_paths="/lib /usr/lib `cat /etc/ld.so.conf`"
16 else
17 ld_so_paths="/lib /usr/lib"
18 fi
19 for path in $ld_so_paths; do
20 [ac_save_LIBS="$LIBS"
21 LIBS="$path/$1 $5 $LIBS"
22 AC_TRY_LINK(dnl
23 ifelse([$2], [main], , dnl Avoid conflicting decl of main.
24 [/* Override any gcc2 internal prototype to avoid an error. */
25 ]dnl
26 [/* We use char because int might match the return type of a gcc2
27 builtin and then its argument prototype would still apply. */
28 char $2();
29 ]),
30 [$2()],
31 eval "ac_cv_lib_static_$ac_lib_var=$path/$1",
32 eval "ac_cv_lib_static_$ac_lib_var=no")
33 LIBS="$ac_save_LIBS"
34 if eval "test \"`echo '$ac_cv_lib_static_'$ac_lib_var`\" != no"; then
35 break
36 fi
37 done
38 ])dnl
39 eval result=\"`echo '$ac_cv_lib_static_'$ac_lib_var`\"
40 if test "$result" != no; then
41 AC_MSG_RESULT($result)
42 ifelse([$3], ,
43 [changequote(, )dnl
44 ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
45 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
46 changequote([, ])dnl
47 AC_DEFINE_UNQUOTED($ac_tr_lib, 1, Define if static library is available.)
48 LIBS="$result $LIBS"
49 ], [$3])
50 else
51 AC_MSG_RESULT(no)
52 ifelse([$4], , , [$4
53 ])dnl
54 fi
55 ])
56
57 AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
58 [AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
59 AC_CACHE_VAL(bash_cv_can_redecl_getpw,
60 [AC_TRY_COMPILE([#include <sys/types.h>
61 #include <pwd.h>
62 extern struct passwd *getpwent();
63 extern struct passwd *getpwuid();
64 extern struct passwd *getpwnam();],
65 [struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");],
66 bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
67 AC_MSG_RESULT($bash_cv_can_redecl_getpw)
68 if test $bash_cv_can_redecl_getpw = no; then
69 AC_DEFINE([HAVE_GETPW_DECLS], 1, [Define this when you are able to redeclare getpw functions.])
70 fi
71 ])