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