dnl ensure recent enough version of Autoconf
AC_PREREQ([2.50])

dnl Use 'VERSION' files to get version.
m4_define([SIPE_VERSION_DATA], m4_include([VERSION]))

dnl Strip off newline characters.
m4_define([SIPE_VERSION],
	m4_substr(SIPE_VERSION_DATA,
		  [0], m4_decr(m4_len(SIPE_VERSION_DATA))))

dnl homepage
m4_define([SIPE_HOMEPAGE], [http://sipe.sourceforge.net/])

dnl initialize package name, version, bugtracker & homepage
AC_INIT([pidgin-sipe], SIPE_VERSION,
	[https://sourceforge.net/p/sipe/bugs/], [],
	SIPE_HOMEPAGE)

AC_DEFINE([SIPE_TRANSLATIONS_URL],
	["https://www.transifex.com/stefanb/pidgin-sipe/"],
	[URL for submitting translations.])

dnl define optional git commit ID generated by autogen.sh
m4_define([SIPE_GIT_COMMIT], m4_sinclude([GITVERSION]))
AS_IF([test "x"SIPE_GIT_COMMIT != x],
	[AC_MSG_NOTICE([set git commit])
	 AC_DEFINE(PACKAGE_GIT_COMMIT, "SIPE_GIT_COMMIT", [Define to the git commit for this package.])
])

dnl setup automake and require recent enough version
AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-xz no-define tar-ustar])

AC_CANONICAL_HOST

dnl set PACKAGE_URL for autoconf < 2.64
AS_IF([test "x${PACKAGE_URL}" = x],
	[AC_MSG_NOTICE([set PACKAGE_URL for autoconf < 2.64])
	 AC_DEFINE(PACKAGE_URL, "SIPE_HOMEPAGE", [Define to the home page for this package.])
])

dnl set programming language
AC_LANG(C)
AM_PROG_CC_C_O
AC_HEADER_STDC

dnl setup shared library generation
LT_INIT([disable-static])

dnl checks for tools
IT_PROG_INTLTOOL([0.35.0])
AC_PROG_INSTALL
AC_PROG_RANLIB

dnl ******************************
dnl Win32
dnl ******************************
AC_MSG_CHECKING([for Win32])
AS_CASE(["$host"],
		[*-mingw*], [os_win32=yes],
		[os_win32=no])
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(SIPE_OS_WIN32, [test "x${os_win32}" = xyes])

dnl checks for header files
AC_CHECK_HEADERS([])

dnl checks for library functions
AC_CHECK_FUNCS([])

dnl tell pkgconfig to look in the same prefix where we're installing this to,
dnl as that is likely where libpurple will be found if it is not in the default
dnl pkgconfig path
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${libdir}/pkgconfig"
export PKG_CONFIG_PATH

dnl debug mode
AC_ARG_ENABLE(debug,
	[AS_HELP_STRING([--enable-debug],
			[compile with debugging support @<:@default=no@:>@])],
	[],
	[enable_debug=no])

AS_IF([test "x$enable_debug" = xyes],
	[AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])])
AC_SUBST(DEBUG_CFLAGS)

dnl quality check mode
dnl For people who are interested in finding bugs and not hiding them
AC_ARG_ENABLE(quality-check,
	[AS_HELP_STRING([--enable-quality-check],
			[compile with compiler checks enabled @<:@default=yes@:>@])],
	[],
	[enable_quality_check=yes])

AS_IF([test "x$enable_quality_check" = xyes],
	[dnl default quality configuration
         QUALITY_CFLAGS="$QUALITY_CFLAGS -Werror -Wall"

	 dnl enable warnings supported by the GCC on the build system
	 for newflag in \
			"-Wextra" \
			"-Waggregate-return" \
			"-Wcast-align" \
			"-Wdeclaration-after-statement" \
			"-Wdeprecated-declarations" \
			"-Winit-self" \
			"-Wmaybe-uninitialized" \
			"-Wmissing-declarations" \
			"-Wmissing-prototypes" \
			"-Wnested-externs" \
			"-Wpointer-arith" \
			"-Wundef" \
			"-Wunused-but-set-variable" \
	 ; do
		 ac_save_CFLAGS="$CFLAGS"
		 AC_MSG_CHECKING([if $CC supports $newflag])
		 CFLAGS="$CFLAGS $QUALITY_CFLAGS $newflag"
		 AC_COMPILE_IFELSE(
			[AC_LANG_SOURCE([[]])],
			[AC_MSG_RESULT(yes)
			 QUALITY_CFLAGS="$QUALITY_CFLAGS $newflag"],
			[AC_MSG_RESULT(no)]
		 )
		 CFLAGS="$ac_save_CFLAGS"
	 done
	])
AC_SUBST(QUALITY_CFLAGS)

dnl check for availability of addition linker flags
for newflag in \
	"-Wl,-Bsymbolic-functions" \
; do
	ac_save_LDFLAGS="$LDFLAGS"
	AC_MSG_CHECKING([if $CC supports $newflag])
	LDFLAGS="$LDFLAGS $ADDITIONAL_LDFLAGS $newflag"
	AC_LINK_IFELSE(
		[AC_LANG_SOURCE([[
int main(int argc, char *argv[])
{
	return(0);
}
		 ]])],
		[AC_MSG_RESULT(yes)
		 ADDITIONAL_LDFLAGS="$ADDITIONAL_LDFLAGS $newflag"],
		[AC_MSG_RESULT(no)]
	)
	LDFLAGS="$ac_save_LDFLAGS"
done
AC_SUBST(ADDITIONAL_LDFLAGS)

dnl Check for pkg-config before using it
PKG_PROG_PKG_CONFIG

dnl check for valgrind (optional, only needed for debugging)
PKG_CHECK_MODULES(VALGRIND, [valgrind],
	[AC_DEFINE(HAVE_VALGRIND, 1, [Define to 1 if you have the valgrind headers])],
	[AC_MSG_RESULT(no)])

dnl build option: with voice & video support (for all backends)
AC_ARG_WITH(vv,
	[AC_HELP_STRING([--with-vv],
		[compile with voice and video support @<:@default=check@:>@])],
	[AS_IF([test "x$withval" = xyes], [with_vv=yes])],
	[with_vv=check])

dnl check for Kerberos 5 support
AC_ARG_WITH([krb5],
	[AC_HELP_STRING([--with-krb5],
		[compile with Kerberos 5 support @<:@default=check@:>@])],
	[AS_IF([test "x$withval" = xyes], [with_krb5=check])],
	[with_krb5=check])

AS_IF([test "x$with_krb5" = xno], [], dnl disabled by user
      [test "x$with_krb5" = xcheck],  dnl autodetect with krb5-config
	[AC_MSG_CHECKING(if Kerberos 5 is available)
	 AS_IF([AC_RUN_LOG([krb5-config --version])],
		[KRB5_CFLAGS=`krb5-config --cflags 2>/dev/null`
		 KRB5_LDFLAGS=""

		 dnl same as AC_CHECK_LIB()
		 LIBS="$LIBS `krb5-config --libs gssapi 2>/dev/null`"],
		[AC_MSG_RESULT(no)
		 with_krb5=no])],
      [                               dnl path specified by user
	KRB5_CFLAGS="-I${with_krb5}/include"
	KRB5_LDFLAGS="-L${with_krb5}/lib"
      ])
AS_IF([test "x$with_krb5" != xno],
      [ac_save_CFLAGS="$CFLAGS"
       ac_save_LDFLAGS="$LDFLAGS"
       CFLAGS="$CFLAGS $KRB5_CFLAGS"
       LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
       AC_CHECK_HEADERS([gssapi/gssapi.h gssapi/gssapi_krb5.h],
			[],
			[AC_ERROR([GSSAPI headers not found])])
       AC_CHECK_FUNC([gss_init_sec_context],
		     [],
		     [AC_ERROR([GSSAPI libraries not found])])

       dnl older GSSAPI releases don't have gss_acquire_cred_with_passwd()
       AC_CHECK_HEADER([gssapi/gssapi_ext.h],
		       [AC_CHECK_FUNC([gss_acquire_cred_with_password],
				      [AC_DEFINE(HAVE_GSSAPI_PASSWORD_SUPPORT, 1, [Define to 1 if gssapi has gss_acquire_cred_with_passwd()])],
				      [AC_MSG_NOTICE([gss_acquire_cred_with_passwd() required: disabling GSSAPI non-SSO support])])],
		       [AC_MSG_NOTICE([gssapi/gssapi_ext.h required: disabling GSSAPI non-SSO support])])

       CFLAGS="$ac_save_CFLAGS"
       LDFLAGS="$ac_save_LDFLAGS"
      ])

AM_CONDITIONAL(SIP_SEC_GSSAPI, [test "x$with_krb5" != xno])
AC_SUBST(KRB5_CFLAGS)
AC_SUBST(KRB5_LDFLAGS)

AC_ARG_ENABLE(gssapi_only,
	[AS_HELP_STRING([--enable-gssapi-only],
			[disable all internal authentication code and only use
                         GSSAPI for authentication @<:@default=yes@:>@])],
	[],
        dnl requires Kerberos which provides GSSAPI
	[enable_gssapi_only=$with_krb5])
AS_IF([test "x$enable_gssapi_only" != xno],
	[AC_CHECK_HEADER([gssapi/gssapi_ntlmssp.h],
		       [AC_DEFINE(HAVE_GSSAPI_ONLY, 1, [Define to 1 to enable GSSAPI-only mode])],
		       [AC_MSG_NOTICE([gssapi/gssapi_ntlm.h required: falling back to internal authentication implementation])
                        enable_gssapi_only=no])
        ])
AM_CONDITIONAL(SIP_SEC_GSSAPI_ONLY, [test "x$enable_gssapi_only" != xno])

dnl check for glib
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.12.0])
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.12.0])

dnl check for gmime
dnl See also: https://bugzilla.gnome.org/show_bug.cgi?id=613653#c8
PKG_CHECK_MODULES(GMIME, [gmime-2.6 >= 2.5.2],
	[ac_have_gmime=yes],
	[PKG_CHECK_MODULES(GMIME, [gmime-2.4 >= 2.4.16],
		[ac_have_gmime=yes],
		[ac_have_gmime=no])
])
AM_CONDITIONAL(SIPE_MIME_GMIME, [test "x$ac_have_gmime" = xyes])
AS_IF([test "x$ac_have_gmime" = xyes],
	[AC_DEFINE(HAVE_GMIME, 1, [Define if gmime should be used in sipe.])])

dnl check for NSS
AC_ARG_ENABLE(nss,
	[AS_HELP_STRING([--enable-nss],
			[use NSS as crypto backend @<:@default=yes@:>@])],
	[],
	[enable_nss=yes])
AS_IF([test "x$enable_nss" != xno],
	[PKG_CHECK_MODULES(NSS, [nss],
		[],
		[PKG_CHECK_MODULES(NSS, [mozilla-nss],
			[],
			[PKG_CHECK_MODULES(NSS, [microb-engine-nss],
				[],
				[enable_nss=no])
			])
		])
	])

dnl check for OpenSSL
AC_ARG_ENABLE(openssl,
	[AS_HELP_STRING([--enable-openssl],
			[use OpenSSL as crypto backend @<:@default=yes@:>@])],
	[],
	[enable_openssl=yes])
AS_IF([test "x$enable_openssl" != xno],
	[PKG_CHECK_MODULES(OPENSSL, [libcrypto],
		   [],
		   [enable_openssl=no])
	])
AS_IF(
	[test "x$enable_nss" != xno],
		[ dnl NSS has priority over OpenSSL
		  enable_openssl=no
		  AC_MSG_NOTICE([using NSS as crypto backend.])],
	[test "x$enable_openssl" != xno],
		[AC_MSG_NOTICE([using OpenSSL as crypto backend.])],
	[AC_ERROR([nss, mozilla-nss, microb-engine-nss or libcrypto package is required])])
AM_CONDITIONAL(SIPE_OPENSSL, [test "x$enable_openssl" != xno])

dnl check for libxml2
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0])

dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c)
AC_MSG_CHECKING([that sizeof(uuid_t) is 16])
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $GLIB_CFLAGS $QUALITY_CFLAGS"
dnl note the [[[ quoting: our code contains []!
AC_RUN_IFELSE(
	[AC_LANG_PROGRAM(
		[[
#include <glib.h>
#include <stdio.h>

/* Copied from uuid.c */
typedef struct {
   guint32 time_low;
   guint16 time_mid;
   guint16 time_hi_and_version;
   guint8  clock_seq_hi_and_reserved;
   guint8  clock_seq_low;
   guint8  node[6];
} uuid_t;
		]],
		[[if (sizeof(uuid_t) == 16) {
			return(0);
		 } else {
			printf("\n\nOoops, sizeof(uuid_t) is %" G_GSIZE_FORMAT ".\n\n", sizeof(uuid_t));
			return(1);
		 }]])],
	[AC_MSG_RESULT(yes)],
	[AC_MSG_FAILURE([sizeof(uuid_t) is not 16

Please notify the SIPE developers.

Copy & paste all lines starting with the line

  checking that sizeof(uuid_t) is 16...

to the report and attach the file "config.log".

Compiler information:

 host:     $host
 build:    $build
 compiler: $CC
])],
	[AC_MSG_WARN([cross compiling: not checking])])
CFLAGS="$ac_save_CFLAGS"

dnl build option: OCS2005 client hack
AC_ARG_ENABLE([ocs2005-message-hack],
	[AC_HELP_STRING([--enable-ocs2005-message-hack], [disable message timeout for OCS2005 clients
							  which causes "false" not delivered error messages
							  @<:@default=no@:>@])],
	[AC_DEFINE([ENABLE_OCS2005_MESSAGE_HACK], [1],
	           [Define to 1 to disable SIP MESSAGE timeout feature.
		    OCS2005 clients don't seem to acknowledge MESSAGEs and
		    disabling the timeout suppresses "false" error messages])])

dnl build option: purple backend
AC_ARG_ENABLE([purple],
	[AC_HELP_STRING([--enable-purple], [build purple plugin @<:@default=yes@:>@])],
	[],
	[enable_purple=yes])
ac_have_appshare=no
ac_have_xdata=no
with_purple_vv=no
AS_IF([test "x$enable_purple" != xno],
	[PKG_CHECK_MODULES(PURPLE, [purple-3],
		[purple_pkgconfig=purple-3],
		[PKG_CHECK_MODULES(PURPLE, [purple >= 2.4.0],
			[purple_pkgconfig=purple],
			[enable_purple=no])])

	 AS_IF([test "x$enable_purple" != xno],
		[AC_MSG_NOTICE([using package "$purple_pkgconfig".])

		 dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
		 PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion $purple_pkgconfig | cut -d. -f 1`
		 AC_SUBST(PURPLE_MAJOR_VERSION)

		 ac_save_CFLAGS="$CFLAGS"
		 ac_save_LIBS="$LIBS"
		 CFLAGS="$CFLAGS $PURPLE_CFLAGS $QUALITY_CFLAGS"
		 LIBS="$LIBS $PURPLE_LIBS"

		 dnl check whether enable voice and video support
		 AS_IF([test "x$with_vv" = xno], [], dnl disabled by user
		       [AC_MSG_CHECKING(for purple voice and video support)
		        AC_RUN_IFELSE(
				[AC_LANG_PROGRAM([[
#include <media.h>
					]],
					[[return (purple_media_get_type() == G_TYPE_NONE ? 1 : 0);]]
				)],
				[AC_MSG_RESULT(ok)
				 PKG_CHECK_MODULES(NICE, [nice >= 0.1.0],
					dnl sipe-media.c uses g_slist_free_full()
					[PKG_CHECK_MODULES(_SIPE_MEDIA_RECHECK_PLEASE_IGNORE, [$purple_pkgconfig >= 2.8.0],
						dnl check purple pkgconfig for gstreamer version
						[gstreamer_pkgconfig=`$PKG_CONFIG --variable=gstreamer $purple_pkgconfig`
						AS_IF([test "x$gstreamer_pkgconfig" == x],
							[AS_IF([test "x$purple_pkgconfig" == xpurple-3],
								[gstreamer_pkgconfig=1.0], [gstreamer_pkgconfig=0.10])])
						gstreamer_pkgconfig="gstreamer-$gstreamer_pkgconfig gstreamer-rtp-$gstreamer_pkgconfig"

						AC_MSG_NOTICE([using packages "$gstreamer_pkgconfig".])
						PKG_CHECK_MODULES(GSTREAMER, [$gstreamer_pkgconfig],
							[PKG_CHECK_MODULES(FARSTREAM, [farstream-0.2],
								[with_purple_vv=yes

								 AC_COMPILE_IFELSE(
									[AC_LANG_PROGRAM([[
#include <media.h>
										]],
										[[return (PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE);]]
									)],
									[AC_DEFINE(HAVE_PURPLE_NEW_TCP_ENUMS, 1, [Define if libpurple has new TCP enums in media backend.])]
								)],
								[AC_MSG_NOTICE(Farstream required: disabling purple voice and video support)])],
							[AC_MSG_NOTICE(GStreamer required: disabling purple voice and video support)])],
						[AC_MSG_NOTICE(libpurple >= 2.8.0 required: disabling purple voice and video support)])],
					[AC_MSG_NOTICE(libnice required: disabling purple voice and video support)])],
				[AC_MSG_RESULT(no - your purple hasn't been compiled with voice and video support.)],
				[AC_MSG_WARN([cross compiling: not checking])])
		       ])

		 dnl SRTP and XDATA require media backend
		 AS_IF([test "x$with_purple_vv" != xno],
			[AC_LINK_IFELSE(
				[AC_LANG_PROGRAM([[
#include <media.h>
					]],
					[[purple_media_set_encryption_parameters(NULL, "", "", "", "", 0);
					  purple_media_set_decryption_parameters(NULL, "", "", "", "", "", 0);]]
				 )],
				 [AC_DEFINE(HAVE_SRTP, 1, [Define if we have SRTP support in media backend.])]
			 )

			 AC_COMPILE_IFELSE(
				[AC_LANG_PROGRAM([[
#include <media.h>
					]],
					[[return (PURPLE_MEDIA_APPLICATION);]]
				 )],
				 [dnl libpurple supports raw data RTP connections
				  ac_have_xdata=yes

				  dnl gio-2.0 is mandatory for application sharing support
				  PKG_CHECK_MODULES(GIO, [gio-2.0], [ac_have_appshare=yes])
				 ]
			 )
			],
			[AS_IF([test "x$with_vv" = xyes], dnl explicitly requested by user
				[AC_ERROR([Voice and video support explicitly requested, but not available])]
			 )]
		 )

		 CFLAGS="$ac_save_CFLAGS"
		 LIBS="$ac_save_LIBS"])])
AM_CONDITIONAL(SIPE_INCLUDE_PURPLE, [test "x$enable_purple" != xno])
AM_CONDITIONAL(SIPE_PURPLE3, [test "x$purple_pkgconfig" = xpurple-3])

dnl build option: telepathy backend
AC_ARG_ENABLE([telepathy],
	[AC_HELP_STRING([--enable-telepathy], [build telepathy plugin @<:@default=yes@:>@])],
	[],
	[enable_telepathy=yes])
AS_IF([test "x$enable_telepathy" != xno],
	[PKG_CHECK_MODULES(TELEPATHY_GLIB, [telepathy-glib >= 0.18.0],
		[dnl GMIME is a build requirement
		 AS_IF([test "x$ac_have_gmime" = xyes],
			[],
			[AC_ERROR(GMIME package is required for telepathy plugin)])

		 dnl telepathy is based on GObject & D-Bus GLib
		 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
		 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1])

		 dnl telepathy uses from gio:
		 dnl  - GIOStream      (>= 2.22.0)
		 dnl  - GResolver      (>= 2.22.0)
		 dnl  - GSocketClient  (>= 2.32.0)
		 dnl  - GTlsConnection (>= 2.28.0)
		 PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.32.0])

		],
		[enable_telepathy=no])])
AM_CONDITIONAL(SIPE_INCLUDE_TELEPATHY, [test "x$enable_telepathy" != xno])

dnl sanity check
AS_IF([test "x$enable_purple" = xno -a "x$enable_telepathy" = xno],
	[AC_ERROR(at least one plugin must be selected

If you didn't use a --enable option then please check that you have
the headers for the packages "purple" or "telepathy-glib" installed.
)],
	[])

dnl enable voice & video support if any backend supports it
AS_IF([test "x$with_purple_vv" != xno],
	[AC_DEFINE(HAVE_VV, 1, [Define if voice & video is enabled.])])
AM_CONDITIONAL(SIPE_WITH_VV, [test "x$with_purple_vv" != xno])

dnl raw data RTP streams enable Lync file transfer
AM_CONDITIONAL(SIPE_HAVE_XDATA, [test "x$ac_have_xdata" == xyes])
AS_IF([test "x$ac_have_xdata" == xyes],
	[AC_DEFINE(HAVE_XDATA, 1, [Define if we have raw data RTP in media backend.])])

dnl enable appshare support
AM_CONDITIONAL(SIPE_HAVE_APPSHARE, [test "x$ac_have_appshare" == xyes])
AS_IF([test "x$ac_have_appshare" == xyes],
	[AC_DEFINE(HAVE_APPSHARE, 1, [Define to 1 if we have appshare support.])])

dnl these code parts rely on interfaces that require GValueArray. This
dnl type has been declared "deprectated" in glib-2.0 >= 2.32.0, but there
dnl is no backward compatible replacement implementation possible
AS_IF([test "x$with_purple_vv" != xno -o "x$enable_telepathy" != xno],
	[AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_28,
                   [We need GValueArray for which no replacement is available])])

dnl i18n
AC_MSG_CHECKING([locale_CPPFLAGS])
LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(datadir)/locale\"'
AC_SUBST([LOCALE_CPPFLAGS])
AC_MSG_RESULT([$LOCALE_CPPFLAGS])
AM_GLIB_GNU_GETTEXT
AC_SUBST(GETTEXT_PACKAGE, "${PACKAGE_NAME}")

dnl codeset
AM_LANGINFO_CODESET

dnl substitutions and generated files
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
	Makefile
	pixmaps/Makefile
	m4macros/Makefile
	po/Makefile.in
	pixmaps/16/Makefile
	pixmaps/22/Makefile
	pixmaps/24/Makefile
	pixmaps/32/Makefile
	pixmaps/48/Makefile
	pixmaps/scalable/Makefile
	src/Makefile
	src/core/Makefile
	src/api/Makefile
	src/purple/Makefile
	src/telepathy/Makefile
	src/telepathy/data/Makefile
	])

dnl generate files
AC_OUTPUT()

dnl additional info for the user
AS_ECHO()
AS_IF([test "x$enable_purple" = xno],
	[AS_ECHO("Not building purple plugin")],
	[AS_ECHO("Build purple plugin")
	 AS_ECHO("PURPLE_CFLAGS  : $PURPLE_CFLAGS")
	 AS_ECHO("PURPLE_LIBS    : $PURPLE_LIBS")
	 AS_ECHO_N("Voice and video: ")
	 AS_IF([test "x$with_purple_vv" = xno],
	  [AS_ECHO("disabled")],
	  [AS_ECHO("enabled")])
	])
AS_ECHO()
AS_IF([test "x$enable_telepathy" = xno],
	[AS_ECHO("Not building telepathy plugin")],
	[AS_ECHO("Build telepathy plugin")
	 AS_ECHO("TELEPATHY_GLIB_CFLAGS: $TELEPATHY_GLIB_CFLAGS")
	 AS_ECHO("TELEPATHY_GLIB_LIBS  : $TELEPATHY_GLIB_LIBS")])
AS_ECHO()
AS_IF([test "x$with_krb5" = xno],
	[AS_ECHO("Not building with Kerberos 5 support")],
	[AS_ECHO("Build with Kerberos 5 support")
	 AS_ECHO("KRB5_CFLAGS    : $KRB5_CFLAGS")
	 AS_ECHO("KRB5_LDFLAGS   : $KRB5_LDFLAGS")])
AS_ECHO()
AS_IF([test "x$enable_gssapi_only" = xno],
	[AS_ECHO("Using internal authentication implementation")],
	[AS_ECHO("Using only GSSAPI for authentication")])
AS_ECHO()
AS_IF([test "x$enable_debug" = xno],
	[AS_ECHO("Debugging not enabled")],
	[AS_ECHO("Build with debugging enabled")
	 AS_ECHO("DEBUG_CFLAGS   : $DEBUG_CFLAGS")])
AS_ECHO()
AS_IF([test "x$QUALITY_CFLAGS" = x],
	[AS_ECHO("Compiler checks disabled")],
	[AS_ECHO("Build with compiler checks enabled")
	 AS_ECHO("QUALITY_CFLAGS : $QUALITY_CFLAGS")])
AS_ECHO()
AS_ECHO("configure complete. Now run 'make'")
AS_ECHO()

dnl The End.
