Damien Miller | 8dd33fd | 2000-06-26 10:20:19 +1000 | [diff] [blame] | 1 | dnl $Id: aclocal.m4,v 1.4 2000/06/26 00:20:19 djm Exp $ |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 2 | dnl |
| 3 | dnl OpenSSH-specific autoconf macros |
| 4 | dnl |
| 5 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 6 | |
| 7 | dnl OSSH_CHECK_HEADER_FOR_FIELD(field, header, symbol) |
| 8 | dnl Does AC_EGREP_HEADER on 'header' for the string 'field' |
| 9 | dnl If found, set 'symbol' to be defined. Cache the result. |
| 10 | dnl TODO: This is not foolproof, better to compile and read from there |
| 11 | AC_DEFUN(OSSH_CHECK_HEADER_FOR_FIELD, [ |
| 12 | # look for field '$1' in header '$2' |
| 13 | dnl This strips characters illegal to m4 from the header filename |
| 14 | ossh_safe=`echo "$2" | sed 'y%./+-%__p_%'` |
| 15 | dnl |
| 16 | ossh_varname="ossh_cv_$ossh_safe""_has_"$1 |
| 17 | AC_MSG_CHECKING(for $1 field in $2) |
| 18 | AC_CACHE_VAL($ossh_varname, [ |
| 19 | AC_EGREP_HEADER($1, $2, [ dnl |
| 20 | eval "$ossh_varname=yes" dnl |
| 21 | ], [ dnl |
| 22 | eval "$ossh_varname=no" dnl |
| 23 | ]) dnl |
| 24 | ]) |
Damien Miller | 8dd33fd | 2000-06-26 10:20:19 +1000 | [diff] [blame] | 25 | ossh_result=`eval 'echo $'"$ossh_varname"` |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 26 | if test -n "`echo $ossh_varname`"; then |
| 27 | AC_MSG_RESULT($ossh_result) |
| 28 | if test "x$ossh_result" = "xyes"; then |
| 29 | AC_DEFINE($3) |
| 30 | fi |
| 31 | else |
| 32 | AC_MSG_RESULT(no) |
| 33 | fi |
| 34 | ]) |
| 35 | |
| 36 | dnl OSSH_PATH_ENTROPY_PROG(variablename, command): |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 37 | dnl Tidiness function, sets 'undef' if not found, and does the AC_SUBST |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 38 | AC_DEFUN(OSSH_PATH_ENTROPY_PROG, [ |
| 39 | AC_PATH_PROG($1, $2) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 40 | if test -z "[$]$1" ; then |
| 41 | $1="undef" |
| 42 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 43 | AC_SUBST($1) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 44 | ]) |
| 45 | |