AC_INIT(src/gtkicq.c)

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gtkicq, 0.62)

AM_MAINTAINER_MODE

#AM_ACLOCAL_INCLUDE(macros)

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_STDC_HEADERS

AC_ARG_PROGRAM

AM_PATH_GTK(1.1.12,,exit 1)
GTKICQ_INCLUDES="$GTK_CFLAGS"
GTKICQ_LDADD="$GTK_LIBS"

xss_ldflags=""
AC_ARG_WITH(xss, [  --with-xss[=prefix]     Enable XScreenSaver support (default: check for it)],
	if test "x$withval" != "xno"; then
		want_xss=yes
		if test "x$withval" != "xyes" && test -d "$withval/lib"; then
			xss_ldflags="-L$withval/lib"
		fi
	else
		want_xss=no
	fi,
	want_xss=yes)

if test "x$want_xss" = xyes; then
	AC_CHECK_LIB(Xext, XextCreateExtension,
		have_xext=yes,
		have_xext=no,
		$GTK_LIBS)

	AC_CHECK_LIB(Xss, XScreenSaverRegister,
		have_xss=yes,
		have_xss=no,
		$GTK_LIBS $xss_ldflags)

	if test "x$have_xext" = xyes && test "x$have_xss" = xyes; then
		CFLAGS="$CFLAGS -DUSE_XSCREENSAVER"

		LIBS="$LIBS $xss_ldflags -lXext -lXss"
	fi
fi


dnl ## internationalization support
dnl ALL_LINGUAS=""
dnl AM_GNU_GETTEXT
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)

AC_SUBST(GTKICQ_LDADD)
AC_SUBST(GTKICQ_INCLUDES)

AC_OUTPUT(
Makefile
dnl ## internationalization support
dnl po/Makefile.in
dnl intl/Makefile
macros/Makefile
src/Makefile
src/xpms/Makefile)

dnl ## internationalization support
dnl stamp.h],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
