1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00
putty-source/mkunxarc.sh
Simon Tatham a947c49bec Move the Unix configure script up to the top level.
Previously, 'configure' and its assorted machinery lived in the 'unix'
subdir, because that seemed like a clean place to keep it given that
all the other per-platform Makefiles live in their platform
directories. However, this never sat all that happily with autotools,
and even less so now that it likes to have object file pathnames
parallel source file pathnames: if you have Makefile.am refer to
source files outside its subdir as "../terminal.c" and enable
subdir-objects then any out-of-tree build calls the corresponding
object file "../terminal.o" and so your build products mostly end up
at the directory above your build dir! And as of autotools 1.14 my
previous compensatory bodge of prefixing every source file path in
Makefile.am with "$(srcdir)" has stopped working too.

So I'm giving in to necessity, and changing policy by moving the
configure machinery up to the top level of the source tree where
autotools will be less confused by it. This should not be taken as any
indication of the primacy of the Unix port, only of the recalcitrance
of autotools.

Whereas before we had a trivial script called 'configure' at the top
level that invoked unix/configure to effectively do an 'out-of-tree
build' (for make purposes) at the top level of the source tree, we now
have a similar script in unix/configure. So this _should_ make very
little difference: people who were previously running configure from
the top level should still be able to, and likewise people who were
running it from the unix subdir.

[originally from svn r10141]
2014-02-22 18:01:32 +00:00

78 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# Build a Unix source distribution from the PuTTY CVS area.
#
# Pass an argument of the form `2004-02-08' to have the archive
# tagged as a development snapshot; of the form `0.54' to have it
# tagged as a release; of the form `r1234' to have it tagged as a
# custom build. Otherwise it'll be tagged as unidentified.
case "$1" in
????-??-??)
case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
autoconfver="`cat LATEST.VER`-$1"
arcsuffix="-$autoconfver"
ver="-DSNAPSHOT=$1"
docver=
;;
r*)
autoconfver="$1"
arcsuffix="-$autoconfver"
ver="-DSVN_REV=${1#r}"
docver=
;;
'')
autoconfver="X.XX" # got to put something in here!
arcsuffix=
ver=
docver=
;;
*pre)
set -- "${1%pre}" "$2"
case "$1" in *[!.0-9a-z~]*) echo "Malformed prerelease ID '$1'">&2;exit 1;;esac
case "$2" in *[!.0-9a-z~]*) echo "Malformed prerelease revision '$1'">&2;exit 1;;esac
autoconfver="$1~pre$2"
arcsuffix="-$autoconfver"
ver="-DPRERELEASE=$1 -DSVN_REV=$2"
docver="VERSION=\"PuTTY prerelease $1:r$2\""
;;
*)
case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
autoconfver="$1"
arcsuffix="-$autoconfver"
ver="-DRELEASE=$1"
docver="VERSION=\"PuTTY release $1\""
;;
esac
perl mkfiles.pl
(cd doc && make -s ${docver:+"$docver"})
relver=`cat LATEST.VER`
arcname="putty$arcsuffix"
mkdir uxarc
mkdir uxarc/$arcname
find . -name uxarc -prune -o \
-name CVS -prune -o \
-name .svn -prune -o \
-name . -o \
-type d -exec mkdir uxarc/$arcname/{} \;
find . -name uxarc -prune -o \
-name CVS -prune -o \
-name .cvsignore -prune -o \
-name .svn -prune -o \
-name configure.ac -prune -o \
-name '*.zip' -prune -o \
-name '*.tar.gz' -prune -o \
-type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
if test "x$ver" != "x"; then
(cd uxarc/$arcname;
md5sum `find . -name '*.[ch]' -print` > manifest;
echo "$ver" > version.def)
fi
sed "s/^AC_INIT(putty,.*/AC_INIT(putty, $autoconfver)/" configure.ac > uxarc/$arcname/configure.ac
(cd uxarc/$arcname && sh mkauto.sh) 2>errors || { cat errors >&2; exit 1; }
tar -C uxarc -chzof $arcname.tar.gz $arcname
rm -rf uxarc