dnl
dnl AC_SEARCH_AND_DEFINE_CONFIG(prog, have, cflags, libs)
dnl
AC_DEFUN(AC_SEARCH_AND_DEFINE_CONFIG,[
	AC_CHECK_PROG($2, $1, $1, none)
	if test "X$$2" != "Xnone" ; then
		AC_DEFINE($2)
		ac_search_and_define_config_cflags="`$1 --cflags`"
		case $CFLAGS in
		  *$ac_search_and_define_config_cflags*) ;;
		  *) $3="$ac_search_and_define_config_cflags" ;;
		esac
		ac_search_and_define_config_libs="`$1 --libs`"
		case $LIBS in
		  *$ac_search_and_define_config_libs*) ;;
		  *) $4="$ac_search_and_define_config_libs" ;;
		esac
	else
		AC_NOCONFIG_MSG_WARN($1)
	fi
])

