Support for re-running autoconf in the absence of the autoconf macro
[u/mdw/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
b3d375b2 20AC_ARG_WITH([gssapi],
21 [AS_HELP_STRING([--without-gssapi],
22 [disable GSSAPI support])],
23 [],
24 [with_gssapi=yes])
25
26WITH_GSSAPI=
27AS_IF([test "x$with_gssapi" != xno],
28 [AC_DEFINE([WITH_GSSAPI], [1], [Define if building with GSSAPI support.])])
95aec249 29
154c73d5 30AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
bea25c48 31#include <sys/types.h>
32#include <utmp.h>])
dbf58cfa 33
f160b7b8 34# Look for both GTK 1 and GTK 2.
76984713 35ifdef([AM_PATH_GTK],[
9b5284fd 36AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
76984713 37],[AC_WARNING([generating configure script without GTK 1 autodetection])])
38ifdef([AM_PATH_GTK_2_0],[
f160b7b8 39AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
76984713 40],[AC_WARNING([generating configure script without GTK 2 autodetection])])
f160b7b8 41if test "$gtk" = "none"; then
42 all_targets="all-cli"
43else
44 all_targets="all-cli all-gtk"
45fi
46if test "$gtk" = "2"; then
47 ac_save_CFLAGS="$CFLAGS"
48 ac_save_LIBS="$LIBS"
49 CFLAGS="$CFLAGS $GTK_CFLAGS"
50 LIBS="$GTK_LIBS $LIBS"
51 AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families])
52 CFLAGS="$ac_save_CFLAGS"
53 LIBS="$ac_save_LIBS"
54fi
76d3a838 55AC_SUBST([all_targets])
56
57AC_SEARCH_LIBS([socket], [xnet])
b3d375b2 58
59AS_IF([test "x$with_gssapi" != xno],
60 [AC_SEARCH_LIBS(
61 [dlopen],[dl],
62 [],
63 [AC_DEFINE([NO_LIBDL], [1], [Define if we could not find libdl.])
64 AC_CHECK_HEADERS([gssapi/gssapi.h])
65 AC_SEARCH_LIBS(
66 [gss_init_sec_context],[gssapi gssapi_krb5 gss],
67 [],
68 [AC_DEFINE([NO_GSSAPI_LIB], [1], [Define if we could not find a gssapi library])])])])
76d3a838 69
c349ffb1 70AC_CHECK_LIB(X11, XOpenDisplay)
71
b0f0a9f5 72AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
76d3a838 73
74AC_OUTPUT
75
76AH_BOTTOM([
77/* Convert autoconf definitions to ones that PuTTY wants. */
78
79#ifndef HAVE_GETADDRINFO
80# define NO_IPV6
81#endif
82#ifndef HAVE_SETRESUID
83# define HAVE_NO_SETRESUID
84#endif
85#ifndef HAVE_STRSIGNAL
86# define HAVE_NO_STRSIGNAL
87#endif
b0f0a9f5 88#if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX)
76d3a838 89# define OMIT_UTMP
90#endif
91#ifndef HAVE_PTSNAME
92# define BSD_PTYS
93#endif
154c73d5 94#ifndef HAVE_SYS_SELECT_H
95# define HAVE_NO_SYS_SELECT_H
96#endif
f160b7b8 97#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
98# define PANGO_PRE_1POINT4
99#endif
100#ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES
101# define PANGO_PRE_1POINT6
102#endif
b3d375b2 103#if !defined(WITH_GSSAPI)
95aec249 104# define NO_GSSAPI
105#endif
b3d375b2 106#if !defined(NO_GSSAPI) && defined(NO_LIBDL)
107# if !defined(HAVE_GSSAPI_GSSAPI_H) || defined(NO_GSSAPI_LIB)
108# define NO_GSSAPI
109# endif
110#endif
76d3a838 111])