dnl CF_SLANG_CPPFLAGS version: 9 updated: 2010/04/03 15:30:05
dnl -----------------
dnl Look for the slang header files in the standard places, adjusting the
dnl CPPFLAGS variable.
dnl
dnl $1 = parameter to search for "slang2" class, e.g., for pkgsrc.
AC_DEFUN([CF_SLANG_CPPFLAGS],
[
AC_CACHE_CHECK(for $1 header file,cf_cv_$1_header,[
	cf_cv_$1_header=no
	AC_TRY_COMPILE([#include <slang.h>],
	[printf("%s\n", SLANG_VERSION)],
	[cf_cv_$1_header=predefined],[
	CF_HEADER_PATH(cf_search,$1)
	for cf_incdir in $cf_search
	do
		for cf_header in \
			slang.h
		do
			echo trying $cf_incdir/$cf_header 1>&AC_FD_CC
			if egrep "SLANG_VERSION" $cf_incdir/$cf_header 1>&AC_FD_CC 2>&1; then
				cf_cv_$1_header=$cf_incdir/$cf_header
				break
			fi
		done
		test "$cf_cv_$1_header" != no && break
	done
	])])

if test "x$cf_cv_$1_header" != xno
then
	AC_DEFINE(USE_SLANG)

	CF_DIRNAME(cf_incdir,$cf_cv_$1_header)

	case $cf_cv_$1_header in # (vi
	predefined) # (vi
		;;
	*)
		CF_ADD_INCDIR($cf_incdir)
		;;
	esac
fi
])dnl
