dnl CF_SED_CONFIG_H version: 9 updated: 1998/05/17 00:30:22
dnl ---------------
dnl This bypasses the normal autoconf process because we're generating an
dnl arbitrary number of NEED_xxxx definitions with the CF_HAVE_FUNCS macro.
dnl Rather than populate an aclocal.h file with all of those definitions, we do
dnl it here.
dnl
dnl Parameters:
dnl $1 = input, which configure has done substitutions upon (will delete)
dnl $2 = target file
dnl $3 = preamble, if any (a 'here' document)
dnl $4 = trailer, if any (a 'here' document)
dnl
AC_DEFUN([CF_SED_CONFIG_H],[
cf_config_h=conf$$
rm -f $cf_config_h
## PREAMBLE
ifelse($3,,[
echo '/* generated by configure-script */' >$cf_config_h
],[cat >$cf_config_h <<CF_EOF
$3[]dnl
CF_EOF])
## DEFINITIONS
if test -n "$ac_cv_path_TD_CONFIG" ; then
	$ac_cv_path_TD_CONFIG $1 |egrep -v '^#' >$cf_config_h
	$ac_cv_path_TD_CONFIG $1 |egrep '^#' | sort >>$cf_config_h
else
grep -v '^ -D' $1 >>$cf_config_h
changequote(,)dnl
sed	-e '/^ -D/!d' \
	-e '/^# /d' \
	-e 's/ -D/\
#define /g' \
	-e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1	/g' \
	-e 's@\\@@g' \
	$1 | sort >>$cf_config_h
changequote([,])dnl
fi
## TRAILER
ifelse($4,,,
[cat >>$cf_config_h <<CF_EOF
$4[]dnl
CF_EOF])
CF_OUTPUT_IF_CHANGED($cf_config_h,$2)
rm -f $1 $cf_config_h
])dnl
