X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c349ffb1106d7d67490203b2b4099a5e912cf1ea..181865609371cf61a40e89dcc69af822772ac972:/unix/configure.ac diff --git a/unix/configure.ac b/unix/configure.ac index d84d61e1..12329172 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -17,24 +17,57 @@ else fi AC_SUBST(PUTTYCFLAGS) -AC_ARG_WITH(gssapi, -[ --without-gssapi disable GSS-API support]) +AC_ARG_WITH([gssapi], + [AS_HELP_STRING([--without-gssapi], + [disable GSSAPI support])], + [], + [with_gssapi=yes]) + +WITH_GSSAPI= +AS_IF([test "x$with_gssapi" != xno], + [AC_DEFINE([WITH_GSSAPI], [1], [Define if building with GSSAPI support.])]) + +AC_ARG_WITH([gtk-version], + [AS_HELP_STRING([--with-gtk-version], + [specify GTK version to use (1 or 2) (optional)])], + [gtk_version_desired="$withval"], + [gtk_version_desired="any"]) + +case "$gtk_version_desired" in + 1 | 2 | any) ;; + *) AC_ERROR([Invalid GTK version specified]) +esac AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[ #include #include ]) -if test "$with_gssapi" != "no"; then - AC_CHECK_HEADERS([gssapi/gssapi.h]) -fi # Look for both GTK 1 and GTK 2. -AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none]) -AM_PATH_GTK_2_0([2.0.0], [gtk=2], []) + +gtk=none + +case "$gtk_version_desired" in + 1 | any) + ifdef([AM_PATH_GTK],[ + AM_PATH_GTK([1.2.0], [gtk=1], []) + ],[AC_WARNING([generating configure script without GTK 1 autodetection])]) + ;; +esac + +case "$gtk_version_desired" in + 2 | any) + ifdef([AM_PATH_GTK_2_0],[ + AM_PATH_GTK_2_0([2.0.0], [gtk=2], []) + ],[AC_WARNING([generating configure script without GTK 2 autodetection])]) + ;; +esac + if test "$gtk" = "none"; then all_targets="all-cli" else all_targets="all-cli all-gtk" fi + if test "$gtk" = "2"; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" @@ -47,9 +80,17 @@ fi AC_SUBST([all_targets]) AC_SEARCH_LIBS([socket], [xnet]) -if test "$with_gssapi" != "no"; then - AC_SEARCH_LIBS([gss_init_sec_context], [gssapi gssapi_krb5 gss]) -fi + +AS_IF([test "x$with_gssapi" != xno], + [AC_SEARCH_LIBS( + [dlopen],[dl], + [], + [AC_DEFINE([NO_LIBDL], [1], [Define if we could not find libdl.]) + AC_CHECK_HEADERS([gssapi/gssapi.h]) + AC_SEARCH_LIBS( + [gss_init_sec_context],[gssapi gssapi_krb5 gss], + [], + [AC_DEFINE([NO_GSSAPI_LIB], [1], [Define if we could not find a gssapi library])])])]) AC_CHECK_LIB(X11, XOpenDisplay) @@ -84,7 +125,12 @@ AH_BOTTOM([ #ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES # define PANGO_PRE_1POINT6 #endif -#ifndef HAVE_GSSAPI_GSSAPI_H +#if !defined(WITH_GSSAPI) # define NO_GSSAPI #endif +#if !defined(NO_GSSAPI) && defined(NO_LIBDL) +# if !defined(HAVE_GSSAPI_GSSAPI_H) || defined(NO_GSSAPI_LIB) +# define NO_GSSAPI +# endif +#endif ])