At last, merge the putty-gtk2 branch back into the trunk!
[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
14 CFLAGS="$CFLAGS -Wall -Werror"
15fi
16
154c73d5 17AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
bea25c48 18#include <sys/types.h>
19#include <utmp.h>])
dbf58cfa 20
f160b7b8 21# Look for both GTK 1 and GTK 2.
22AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
23AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
24if test "$gtk" = "none"; then
25 all_targets="all-cli"
26else
27 all_targets="all-cli all-gtk"
28fi
29if test "$gtk" = "2"; then
30 ac_save_CFLAGS="$CFLAGS"
31 ac_save_LIBS="$LIBS"
32 CFLAGS="$CFLAGS $GTK_CFLAGS"
33 LIBS="$GTK_LIBS $LIBS"
34 AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families])
35 CFLAGS="$ac_save_CFLAGS"
36 LIBS="$ac_save_LIBS"
37fi
76d3a838 38AC_SUBST([all_targets])
39
40AC_SEARCH_LIBS([socket], [xnet])
41
b0f0a9f5 42AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
76d3a838 43
44AC_OUTPUT
45
46AH_BOTTOM([
47/* Convert autoconf definitions to ones that PuTTY wants. */
48
49#ifndef HAVE_GETADDRINFO
50# define NO_IPV6
51#endif
52#ifndef HAVE_SETRESUID
53# define HAVE_NO_SETRESUID
54#endif
55#ifndef HAVE_STRSIGNAL
56# define HAVE_NO_STRSIGNAL
57#endif
b0f0a9f5 58#if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX)
76d3a838 59# define OMIT_UTMP
60#endif
61#ifndef HAVE_PTSNAME
62# define BSD_PTYS
63#endif
154c73d5 64#ifndef HAVE_SYS_SELECT_H
65# define HAVE_NO_SYS_SELECT_H
66#endif
f160b7b8 67#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
68# define PANGO_PRE_1POINT4
69#endif
70#ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES
71# define PANGO_PRE_1POINT6
72#endif
76d3a838 73])