Annotation of OpenXM_contrib/gnuplot/m4/path-hdr.m4, Revision 1.1.1.1
1.1 maekawa 1: ## --------------------------------------------- ##
2: ## Search several directories for header file. ##
3: ## Built around a non-caching and silent version ##
4: ## of AC_CHECK_HEADER. ##
5: ## From Lars Hecking ##
6: ## --------------------------------------------- ##
7:
8: # serial 2
9:
10: dnl GP_PATH_HEADER(HEADER-FILE, SEARCH-DIRS [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
11: AC_DEFUN(GP_PATH_HEADER,
12: [ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
13: changequote(, )dnl
14: ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15: changequote([, ])dnl
16: AC_MSG_CHECKING([for $1])
17: AC_CACHE_VAL(ac_cv_header_$ac_safe,
18: [gp_save_CPPFLAGS="$CPPFLAGS"
19: if test "$2" != yes && test "$2" != no; then
20: gp_h_path=`echo "$2" | sed -e 's%/lib$1\.a$%%'`
21: gp_h_prfx=`echo "$gp_h_path" | sed -e 's%/lib$%%' -e 's%/include$%%'`
22: gp_h_list="$gp_h_prfx $gp_h_prfx/include $gp_h_path"
23: else
24: gp_h_list=''
25: fi
26: for ac_dir in $gp_h_list '' /usr/local/include ; do
27: test x${ac_dir} != x && CPPFLAGS="$gp_save_CPPFLAGS -I${ac_dir}"
28: AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=${ac_dir}",
29: eval "ac_cv_header_$ac_safe=no")
30: CPPFLAGS="$gp_save_CPPFLAGS"
31: if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" != no"; then
32: break
33: fi
34: done
35: ])
36: if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" != no"; then
37: if eval "test \"`echo x'$ac_cv_header_'$ac_safe`\" != x" && eval "test \"`echo x'$ac_cv_header_'$ac_safe`\" != xyes"; then
38: eval "CPPFLAGS=\"$gp_save_CPPFLAGS -I`echo '$ac_cv_header_'$ac_safe`\""
39: fi
40: AC_DEFINE_UNQUOTED($ac_tr_hdr)
41: AC_MSG_RESULT(yes)
42: ifelse([$3], , :, [$3])
43: else
44: AC_MSG_RESULT(no)
45: ifelse([$4], , , [$4
46: ])dnl
47: fi
48: ])
49:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>