d84d61e1e4ce2bb9f8a0f3d82f5f98f5b7c601b3
[u/mdw/putty] / unix / configure.ac
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.
6
7 AC_INIT
8 AC_CONFIG_FILES([Makefile])
9 AC_CONFIG_HEADERS([uxconfig.h:uxconfig.in])
10
11 AC_PROG_INSTALL
12 AC_PROG_CC
13 if test "X$GCC" = Xyes; then
14 PUTTYCFLAGS="-Wall -Werror"
15 else
16 PUTTYCFLAGS=""
17 fi
18 AC_SUBST(PUTTYCFLAGS)
19
20 AC_ARG_WITH(gssapi,
21 [ --without-gssapi disable GSS-API support])
22
23 AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
24 #include <sys/types.h>
25 #include <utmp.h>])
26 if test "$with_gssapi" != "no"; then
27 AC_CHECK_HEADERS([gssapi/gssapi.h])
28 fi
29
30 # Look for both GTK 1 and GTK 2.
31 AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
32 AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
33 if test "$gtk" = "none"; then
34 all_targets="all-cli"
35 else
36 all_targets="all-cli all-gtk"
37 fi
38 if test "$gtk" = "2"; then
39 ac_save_CFLAGS="$CFLAGS"
40 ac_save_LIBS="$LIBS"
41 CFLAGS="$CFLAGS $GTK_CFLAGS"
42 LIBS="$GTK_LIBS $LIBS"
43 AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families])
44 CFLAGS="$ac_save_CFLAGS"
45 LIBS="$ac_save_LIBS"
46 fi
47 AC_SUBST([all_targets])
48
49 AC_SEARCH_LIBS([socket], [xnet])
50 if test "$with_gssapi" != "no"; then
51 AC_SEARCH_LIBS([gss_init_sec_context], [gssapi gssapi_krb5 gss])
52 fi
53
54 AC_CHECK_LIB(X11, XOpenDisplay)
55
56 AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
57
58 AC_OUTPUT
59
60 AH_BOTTOM([
61 /* Convert autoconf definitions to ones that PuTTY wants. */
62
63 #ifndef HAVE_GETADDRINFO
64 # define NO_IPV6
65 #endif
66 #ifndef HAVE_SETRESUID
67 # define HAVE_NO_SETRESUID
68 #endif
69 #ifndef HAVE_STRSIGNAL
70 # define HAVE_NO_STRSIGNAL
71 #endif
72 #if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX)
73 # define OMIT_UTMP
74 #endif
75 #ifndef HAVE_PTSNAME
76 # define BSD_PTYS
77 #endif
78 #ifndef HAVE_SYS_SELECT_H
79 # define HAVE_NO_SYS_SELECT_H
80 #endif
81 #ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
82 # define PANGO_PRE_1POINT4
83 #endif
84 #ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES
85 # define PANGO_PRE_1POINT6
86 #endif
87 #ifndef HAVE_GSSAPI_GSSAPI_H
88 # define NO_GSSAPI
89 #endif
90 ])