1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 11:02:48 -05:00

Switch to using automake for the Unix autoconfigured build.

mkfiles.pl no longer generates a Makefile.in, but instead generates a
Makefile.am on which mkauto.sh runs automake. This means that the
autoconfigured makefile now does build-time dependency tracking (a
standard feature of automake-generated makefiles), and is generally
more like what Unix people will expect.

Some of the old-style make command-line settings (VER=-DRELEASE=foo,
XFLAGS=-DDEBUG) will still work; the COMPAT settings are better done
by autoconfiguration, and my habitual 'XFLAGS="-g -O0"' for an easily
debuggable build will actually not work any more because CFLAGS is
specified _after_ XFLAGS, so I should instead write 'make CFLAGS=-O0'
(-g is the default in automake, removed at 'make install' time).

The new makefile will automatically degrade into one that builds the
command-line tools only, in the case where GTK could not be found. In
principle, therefore, it should be an adequate replacement for _both_
the static Unix makefiles, Makefile.gtk and Makefile.ux. I haven't
actually retired those in this commit, but I'm pretty tempted.

[originally from svn r9239]
This commit is contained in:
Simon Tatham
2011-07-23 11:33:29 +00:00
parent 860cd79efd
commit 64150a5ef2
7 changed files with 211 additions and 125 deletions

View File

@ -4,18 +4,41 @@
# * Automake (for aclocal)
# If you've got them, running "autoreconf" should work.
AC_INIT
# Version number is substituted by Buildscr for releases, snapshots
# and custom builds out of svn; X.XX shows up in ad-hoc developer
# builds, which shouldn't matter
AC_INIT(putty, X.XX)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([uxconfig.h:uxconfig.in])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_INSTALL
AC_PROG_CC
if test "X$GCC" = Xyes; then
PUTTYCFLAGS="-Wall -Werror"
else
PUTTYCFLAGS=""
fi
AC_SUBST(PUTTYCFLAGS)
AC_PROG_RANLIB
# Mild abuse of the '--enable' option format to allow manual
# specification of setuid or setgid setup in pterm.
setidtype=none
AC_ARG_ENABLE([setuid],
[AS_HELP_STRING([--enable-setuid=USER],
[make pterm setuid to a given user])],
[case "$enableval" in
no) setidtype=none;;
*) setidtype=setuid; setidval="$enableval";;
esac])
AC_ARG_ENABLE([setgid],
[AS_HELP_STRING([--enable-setgid=GROUP],
[make pterm setgid to a given group])],
[case "$enableval" in
no) setidtype=none;;
*) setidtype=setgid; setidval="$enableval";;
esac])
AM_CONDITIONAL(HAVE_SETID_CMD, [test "$setidtype" != "none"])
AS_IF([test "x$setidtype" = "xsetuid"],
[SETID_CMD="chown $setidval"; SETID_MODE="4755"])
AS_IF([test "x$setidtype" = "xsetgid"],
[SETID_CMD="chgrp $setidval"; SETID_MODE="2755"])
AC_SUBST(SETID_CMD)
AC_SUBST(SETID_MODE)
AC_ARG_WITH([gssapi],
[AS_HELP_STRING([--without-gssapi],
@ -42,7 +65,8 @@ AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
#include <sys/types.h>
#include <utmp.h>])
# Look for both GTK 1 and GTK 2.
# Look for both GTK 1 and GTK 2. If we can't find either, have the
# makefile only build the CLI programs.
gtk=none
@ -62,11 +86,7 @@ case "$gtk_version_desired" in
;;
esac
if test "$gtk" = "none"; then
all_targets="all-cli"
else
all_targets="all-cli all-gtk"
fi
AM_CONDITIONAL(HAVE_GTK, [test "$gtk" != "none"])
if test "$gtk" = "2"; then
ac_save_CFLAGS="$CFLAGS"
@ -77,7 +97,6 @@ if test "$gtk" = "2"; then
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
AC_SUBST([all_targets])
AC_SEARCH_LIBS([socket], [xnet])
@ -100,6 +119,16 @@ AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
AC_OUTPUT
if test "$gtk" = "none"; then cat <<EOF
'configure' was unable to find either the GTK 1 or GTK 2 libraries on
your system. Therefore, PuTTY itself and the other GUI utilities will
not be built by the generated Makefile: only the command-line tools
such as puttygen, plink and psftp will be built.
EOF
fi
AH_BOTTOM([
/* Convert autoconf definitions to ones that PuTTY wants. */