nt-kit revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#! /bin/sh -ex
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Copyright (C) 1999, 2000 Internet Software Consortium.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Permission to use, copy, modify, and distribute this software for any
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# purpose with or without fee is hereby granted, provided that the above
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# copyright notice and this permission notice appear in all copies.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# $Id: nt-kit,v 1.5 2000/08/01 01:33:34 tale Exp $
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# XXX no command line options at all. especially useful would be a way
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# to specify the target directory on the NT machine, since it is needed
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright# in the Makefiles and otherwise config.status.win32 needs to be edited.
12b65585e720714b31036daaa2b30eb76014048eGordon Ross
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright# XXX long term something different clearly needs to be done, so someone
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# without any Unix boxes at all could download the source kit and compile.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# it'll happen; it has been a higher priority just to try to work
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# on the code issues.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwZIP=bind9-nt.zip
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwDOZIP=false
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwcase "$1" in
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw-nozip) DOZIP=false; shift ;;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw-zip) DOZIP=true ; shift ;;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwesac
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwcase $# in
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw0)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw dstdir=../bind9-nt
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rmtdir=g:/proj/bind9-nt
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ;;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw1)
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas dstdir=../bind9-nt
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rmtdir="$1"
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States ;;
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States2)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw dstdir="$2"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rmtdir="$1"
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego ;;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw*)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw echo "usage: $0 rmtdir [dstdir]" >&2
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas exit 99
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb ;;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwesac
3db3f65c6274eb042354801a308c8e9bc4994553amw
12b65585e720714b31036daaa2b30eb76014048eGordon Rosstest -f version || {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw echo "$0: must be run in bind9 top level directory" >&2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw exit 1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossset -- `ls -i version`
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossthis_version=$1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwif test -e "$dstdir/version"; then
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw set -- `ls -i "$dstdir/version" 2>&1`
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwelse
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw set -- 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwfi
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwthat_version=$1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Try to make an effort to not wipe out current directory or non-bind directory
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwtest "0$this_version" -eq "0$that_version" && {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw echo "$0: dstdir must not be current directory" >&2
8d7e41661dc4633488e93b13363137523ce59977jose borrego exit 1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwtest ! -d $dstdir -o "$that_version" -ne 0 || {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw echo "$0: existing dstdir must be a bind9 source directory" >&2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw exit 1
cb174861876aea6950a7ab4ce944aff84b1914cdjoyce mcintosh}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwrm -rf $dstdir
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwmkdir $dstdir
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwtar cf - . | (cd $dstdir; tar xfp -)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwcd $dstdir
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# XXX Tale BSD/OS special
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwrm -f stdio.h
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Start with a clean slate. This is not done in the source tree before
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# the copy so as not to disturb things there.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw./configure
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwmake clean
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# XXX header files that (currently) need to be built on Unix
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw##cd lib/isc
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw##make
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw##cd ../dns
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw##make code.h include/dns/enumtype.h include/dns/enumclass.h include/dns/rdatastruct.h
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw##cd ../..
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# XXX Need a better way
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwperl -pi -e '$_ = "" if /chmod\(.*\)/' lib/dns/sec/dst/dst_parse.c
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# XXX grrr.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwperl -pi -e 'last if /^##confparser\.c/' lib/dns/config/Makefile.in
# Adjust Makefiles to have NT paths and nmake-compatible variable expansion.
set +x
echo doing Makefile substitutions
while read file type dates; do
case $file in
*/Makefile.in|./make/includes.in|./version)
echo $file
perl -pi -e 'tr%{}/%()\\%;
s%(-I.*)unix%$1win32%;
s%(-I.*)pthreads.*?(\\?)$%$2%;
s%-I ?%/I %g;
s%-D%/D %g;
s%(\$\(ARFLAGS\)) \$@%$1 /out:\$@%;
s%\$\(UNIXOBJS\)%\$(WIN32OBJS)%;
s%\$\(PTHREADOBJS\)%%;
s%^(SUBDIRS.*)(pthreads)(.*)%$1$3%;
s%^(SUBDIRS.*)(unix)(.*)%$1win32$3%;
s%rm -f%-del /q /f%;
s%rm -rf%-rd /q /s%;
s%touch%copy NUL:%' $file
;;
./make/rules.in)
echo frobbing conditionals in $file
# /K is specified in MAKEDEFS *YUCK* because nmake
# for some BRAINDAMAGED REASON does not put K
# in MAKEFLAGS (confirm with "nmake /PKN foo";
# only P and N are in Makeflags.) However ... doing
# things this way ends up putting /K when you might not
# want it. Thanks, Microsoft.
perl -pi -e \
'print "MAKEDEFS = /nologo /K\$(MAKEFLAGS)\n"
if $. == 1;
tr%{}/%()\\%;
s%-I%/I %g;
s%-D%/D %g;
s%-c%/c %g;
s/\.c\.o:/.c.obj:/;
s%rm -f%-del /q /f%;
s%rm -rf%-rd /q /s%;
s/for\ i\ in\ \$\(ALL_SUBDIRS\).*
/for %i in (\$(ALL_SUBDIRS)) do \\/x;
s/if\ \[\ (\S+)\ !=\ "nulldir".*
/\@if NOT $1=="nulldir" \\/x;
s/^.*echo "making .* in .*\n//;
s/\(cd\ (\S+);\ (.*)\);\ \\
/pushd $1 && cd && $2 && popd || popd/x;
s/\$\$i/%i/g;
s/^\t+(fi|done).*\n//' $file
;;
esac
done < util/copyrights
set -x
# Make Makefiles
./config.status.win32 $rmtdir
# Copy win32 special files
cp config.h.win32 config.h
if $DOZIP; then
dir="`basename $dstdir`"
cd ..
rm -f $ZIP
# q = quiet
# r = recurse
# l = LF -> CRLF
# 9 = highest compression
zip -qrl9 $ZIP $dir
fi
exit 0