Annotation of OpenXM_contrib/gnuplot/m4/path-lib.m4, Revision 1.1.1.1
1.1 maekawa 1: ## ------------------------------ ##
2: ## Like AC_CHECK_LIB, but quiet, ##
3: ## and no caching. ##
4: ## From Lars Hecking ##
5: ## ------------------------------ ##
6:
7: # serial 2
8:
9: dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, OTHER-LIBRARIES])
10: AC_DEFUN(GP_CHECK_LIB_QUIET,
11: [ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
12: ac_save_LIBS="$LIBS"
13: LIBS="$TERMLIBS $TERMXLIBS -l$1 $3 $LIBS"
14: AC_TRY_LINK(dnl
15: ifelse([$2], [main], , dnl Avoid conflicting decl of main.
16: [/* Override any gcc2 internal prototype to avoid an error. */
17: ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
18: extern "C"
19: #endif
20: ])dnl
21: [/* We use char because int might match the return type of a gcc2
22: builtin and then its argument prototype would still apply. */
23: char $2();
24: ]),
25: [$2()],
26: eval "ac_cv_lib_$ac_lib_var=yes",
27: eval "ac_cv_lib_$ac_lib_var=no")
28: LIBS="$ac_save_LIBS"
29: if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
30: changequote(, )dnl
31: ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
32: -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
33: changequote([, ])dnl
34: dnl LIBS="$LIBS -l$1"
35: fi
36: ])
37:
38: ## ------------------------------------------- ##
39: ## Search several directories for library. ##
40: ## NOTE: OTHER_LIBRARIES are NOT automatically ##
41: ## added to TERMLIBS. This must be done in ##
42: ## configure.in! ##
43: ## From Lars Hecking ##
44: ## ------------------------------------------- ##
45:
46: # serial 2
47:
48: dnl GP_PATH_LIB(LIBRARY, FUNCTION, SEARCH-DIRS [, OTHER-LIBRARIES])
49: AC_DEFUN(GP_PATH_LIB,
50: [ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
51: changequote(, )dnl
52: gp_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
53: -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
54: changequote([, ])dnl
55: AC_MSG_CHECKING([for $2 in -l$1])
56: AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
57: [gp_save_TERMLIBS="$TERMLIBS"
58: if test "$3" != yes && test "$3" != no; then
59: gp_l_path=`echo "$3" | sed -e 's%/lib$1\.a$%%'`
60: gp_l_prfx=`echo $gp_l_path | sed -e 's%/lib$%%' -e 's%/include$%%'`
61: gp_l_list="$gp_l_prfx $gp_l_prfx/lib $gp_l_path"
62: fi
63: for ac_dir in $gp_l_list '' /usr/local/lib ; do
64: test x${ac_dir} != x && TERMLIBS="-L${ac_dir} $gp_save_TERMLIBS"
65: GP_CHECK_LIB_QUIET($1,$2,$4)
66: TERMLIBS="$gp_save_TERMLIBS"
67: if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
68: eval "ac_cv_lib_$ac_lib_var=${ac_dir}"
69: break
70: fi
71: done
72: ])
73: if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" != no"; then
74: if eval "test \"`echo x'$ac_cv_lib_'$ac_lib_var`\" != x" && eval "test \"`echo x'$ac_cv_lib_'$ac_lib_var`\" != xyes"; then
75: eval "TERMLIBS=\"$gp_save_TERMLIBS -L`echo '$ac_cv_lib_'$ac_lib_var`\""
76: fi
77: TERMLIBS="$TERMLIBS -l$1"
78: AC_MSG_RESULT(yes)
79: else
80: AC_MSG_RESULT(no)
81: fi
82: ])
83:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>