nt-kit revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright (C) 1999, 2000 Internet Software Consortium.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Permission to use, copy, modify, and distribute this software for any
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# purpose with or without fee is hereby granted, provided that the above
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copyright notice and this permission notice appear in all copies.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# $Id: nt-kit,v 1.5 2000/08/01 01:33:34 tale Exp $
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# XXX no command line options at all. especially useful would be a way
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# to specify the target directory on the NT machine, since it is needed
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# in the Makefiles and otherwise config.status.win32 needs to be edited.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# XXX long term something different clearly needs to be done, so someone
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# without any Unix boxes at all could download the source kit and compile.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# it'll happen; it has been a higher priority just to try to work
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# on the code issues.
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews echo "$0: must be run in bind9 top level directory" >&2
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox Userif test -e "$dstdir/version"; then
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User# Try to make an effort to not wipe out current directory or non-bind directory
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User echo "$0: dstdir must not be current directory" >&2
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox Usertest ! -d $dstdir -o "$that_version" -ne 0 || {
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "$0: existing dstdir must be a bind9 source directory" >&2
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User# XXX Tale BSD/OS special
2b4d1b54f6ca406b8233d9e6fea9593df6dad035Tinderbox User# Start with a clean slate. This is not done in the source tree before
2b4d1b54f6ca406b8233d9e6fea9593df6dad035Tinderbox User# the copy so as not to disturb things there.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# XXX header files that (currently) need to be built on Unix
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein##make code.h include/dns/enumtype.h include/dns/enumclass.h include/dns/rdatastruct.h
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User# XXX Need a better way
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updaterperl -pi -e '$_ = "" if /chmod\(.*\)/' lib/dns/sec/dst/dst_parse.c
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userperl -pi -e 'last if /^##confparser\.c/' lib/dns/config/Makefile.in
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Adjust Makefiles to have NT paths and nmake-compatible variable expansion.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User s%(-I.*)unix%$1win32%;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User s%(-I.*)pthreads.*?(\\?)$%$2%;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User s%-I ?%/I %g;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt s%(\$\(ARFLAGS\)) \$@%$1 /out:\$@%;
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater s%\$\(UNIXOBJS\)%\$(WIN32OBJS)%;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User s%\$\(PTHREADOBJS\)%%;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User s%^(SUBDIRS.*)(pthreads)(.*)%$1$3%;
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox User s%^(SUBDIRS.*)(unix)(.*)%$1win32$3%;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt s%rm -f%-del /q /f%;
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox User s%rm -rf%-rd /q /s%;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # /K is specified in MAKEDEFS *YUCK* because nmake
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # for some BRAINDAMAGED REASON does not put K
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater # in MAKEFLAGS (confirm with "nmake /PKN foo";
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # only P and N are in Makeflags.) However ... doing
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater # things this way ends up putting /K when you might not
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # want it. Thanks, Microsoft.
bcf15a19ae0efa72a22cdfb50666a3c6ce39eb9fTinderbox User 'print "MAKEDEFS = /nologo /K\$(MAKEFLAGS)\n"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User tr%{}/%()\\%;
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox User s%rm -f%-del /q /f%;
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User s%rm -rf%-rd /q /s%;
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox User s/for\ i\ in\ \$\(ALL_SUBDIRS\).*
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox User /for %i in (\$(ALL_SUBDIRS)) do \\/x;
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein s/if\ \[\ (\S+)\ !=\ "nulldir".*
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews /\@if NOT $1=="nulldir" \\/x;
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User s/^.*echo "making .* in .*\n//;
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein s/\(cd\ (\S+);\ (.*)\);\ \\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews /pushd $1 && cd && $2 && popd || popd/x;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt s/\$\$i/%i/g;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Make Makefiles
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Copy win32 special files
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User # r = recurse
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User # l = LF -> CRLF
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User # 9 = highest compression