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