5451
|
1 dnl @synopsis ACX_CHECK_HEADER_IN_DIRS (HEADER, DIR-LIST, [ |
|
2 dnl ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND[, MESSAGE]]]) |
|
3 dnl |
|
4 dnl This macro looks for a header file in the include directories |
|
5 dnl and in the sub-directories specified by DIR-LIST. |
|
6 dnl |
|
7 dnl This macro requires autoconf 2.50 or later. |
|
8 dnl |
|
9 dnl @version $Id: acx_include_dirs.m4,v 1.2 2005-09-15 19:52:50 jwe Exp $ |
|
10 dnl @author David Bateman <dbateman@free.fr> |
|
11 dnl |
|
12 AC_DEFUN([ACX_CHECK_HEADER_IN_DIRS], [ |
|
13 AC_PREREQ(2.50) |
|
14 acx_include_ok=no |
|
15 acx_include_dir= |
|
16 |
|
17 # First check the header in the base directory |
|
18 AC_CHECK_HEADER($1, [acx_include_ok=yes]) |
|
19 |
|
20 # Now check the other directories |
|
21 if test x"$acx_include_ok" = xno; then |
|
22 for dir in $2; do |
|
23 AC_CHECK_HEADER(${dir}/$1, [acx_include_ok=yes; acx_include_dir=${dir}; break]) |
|
24 done |
|
25 fi |
|
26 |
|
27 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: |
|
28 if test x"$acx_include_ok" = xyes; then |
|
29 acx_header=HEADER_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ |
|
30 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
|
31 ifelse([$3],,AC_DEFINE(${acx_header},$acx_include_dir/$1,[$5]),[$3]) |
|
32 else |
|
33 $4 |
|
34 fi |
|
35 ])dnl ACX_CHECK_HEADER_IN_DIRS |