1 # To compile this into a configure script, you need:
2 # * Autoconf 2.50 or newer
3 # * Gtk (for $prefix/share/aclocal/gtk.m4)
4 # * Automake (for aclocal)
5 # If you've got them, running "autoreconf" should work.
8 AC_CONFIG_FILES([Makefile])
9 AC_CONFIG_HEADERS([uxconfig.h:uxconfig.in])
13 if test "X$GCC" = Xyes; then
14 PUTTYCFLAGS="-Wall -Werror"
21 [AS_HELP_STRING([--without-gssapi],
22 [disable GSSAPI support])],
27 AS_IF([test "x$with_gssapi" != xno],
28 [AC_DEFINE([WITH_GSSAPI], [1], [Define if building with GSSAPI support.])])
30 AC_ARG_WITH([gtk-version],
31 [AS_HELP_STRING([--with-gtk-version],
32 [specify GTK version to use (1 or 2) (optional)])],
33 [gtk_version_desired="$withval"],
34 [gtk_version_desired="any"])
36 case "$gtk_version_desired" in
38 *) AC_ERROR([Invalid GTK version specified])
41 AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
42 #include <sys/types.h>
45 # Look for both GTK 1 and GTK 2.
49 case "$gtk_version_desired" in
52 AM_PATH_GTK([1.2.0], [gtk=1], [])
53 ],[AC_WARNING([generating configure script without GTK 1 autodetection])])
57 case "$gtk_version_desired" in
59 ifdef([AM_PATH_GTK_2_0],[
60 AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
61 ],[AC_WARNING([generating configure script without GTK 2 autodetection])])
65 if test "$gtk" = "none"; then
68 all_targets="all-cli all-gtk"
71 if test "$gtk" = "2"; then
72 ac_save_CFLAGS="$CFLAGS"
74 CFLAGS="$CFLAGS $GTK_CFLAGS"
75 LIBS="$GTK_LIBS $LIBS"
76 AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families])
77 CFLAGS="$ac_save_CFLAGS"
80 AC_SUBST([all_targets])
82 AC_SEARCH_LIBS([socket], [xnet])
84 AS_IF([test "x$with_gssapi" != xno],
88 [AC_DEFINE([NO_LIBDL], [1], [Define if we could not find libdl.])
89 AC_CHECK_HEADERS([gssapi/gssapi.h])
91 [gss_init_sec_context],[gssapi gssapi_krb5 gss],
93 [AC_DEFINE([NO_GSSAPI_LIB], [1], [Define if we could not find a gssapi library])])])])
95 AC_CHECK_LIB(X11, XOpenDisplay)
97 AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
102 /* Convert autoconf definitions to ones that PuTTY wants. */
104 #ifndef HAVE_GETADDRINFO
107 #ifndef HAVE_SETRESUID
108 # define HAVE_NO_SETRESUID
110 #ifndef HAVE_STRSIGNAL
111 # define HAVE_NO_STRSIGNAL
113 #if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX)
119 #ifndef HAVE_SYS_SELECT_H
120 # define HAVE_NO_SYS_SELECT_H
122 #ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
123 # define PANGO_PRE_1POINT4
125 #ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES
126 # define PANGO_PRE_1POINT6
128 #if !defined(WITH_GSSAPI)
131 #if !defined(NO_GSSAPI) && defined(NO_LIBDL)
132 # if !defined(HAVE_GSSAPI_GSSAPI_H) || defined(NO_GSSAPI_LIB)