# Configure sysconftool
# Copyright 2000-2005 S. Varshavchik.  See COPYING for
# distribution information.
#
# AC_PROG_SYSCONFTOOL

AC_DEFUN([AC_PROG_SYSCONFTOOL],
[

	AC_PATH_PROGS(SYSCONFTOOL_PERL, perl5 perl, perl)

	if test "$SYSCONFTOOL_PERL" = "perl"
	then
		AC_MSG_ERROR(perl not found - please install perl)
	fi

	AC_MSG_CHECKING(for sysconftool...)
	SYSCONFTOOL=""
	for sysconf_dir in $ac_aux_dir . .. ../..
	do
		if test -f $srcdir/$sysconf_dir/sysconftool
		then
			SYSCONFTOOL=$srcdir/$sysconf_dir/sysconftool
			break
		fi
	done

	if test "$SYSCONFTOOL" = ""
	then
		AC_MSG_ERROR(sysconftool missing - not in the package)
	fi

	AC_MSG_RESULT( $SYSCONFTOOL)
	SYSCONFTOOL="$SYSCONFTOOL_PERL $SYSCONFTOOL"
	AC_SUBST(SYSCONFTOOL)
]
)
