At last, merge the putty-gtk2 branch back into the trunk!
[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 CFLAGS="$CFLAGS -Wall -Werror"
15 fi
16
17 AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
18 #include <sys/types.h>
19 #include <utmp.h>])
20
21 # Look for both GTK 1 and GTK 2.
22 AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
23 AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
24 if test "$gtk" = "none"; then
25 all_targets="all-cli"
26 else
27 all_targets="all-cli all-gtk"
28 fi
29 if 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"
37 fi
38 AC_SUBST([all_targets])
39
40 AC_SEARCH_LIBS([socket], [xnet])
41
42 AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
43
44 AC_OUTPUT
45
46 AH_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
58 #if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX)
59 # define OMIT_UTMP
60 #endif
61 #ifndef HAVE_PTSNAME
62 # define BSD_PTYS
63 #endif
64 #ifndef HAVE_SYS_SELECT_H
65 # define HAVE_NO_SYS_SELECT_H
66 #endif
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
73 ])