nt-kit revision 7d32c065c7bb56f281651ae3dd2888f32ce4f1d9
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# Copyright (C) 1999, 2000 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# Permission to use, copy, modify, and distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# purpose with or without fee is hereby granted, provided that the above
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein# XXX no command line options at all. especially useful would be a way
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# to specify the target directory on the NT machine, since it is needed
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# in the Makefiles and otherwise config.status.win32 needs to be edited.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# XXX long term something different clearly needs to be done, so someone
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein# without any Unix boxes at all could download the source kit and compile.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein# it'll happen; it has been a higher priority just to try to work
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley# on the code issues.
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington echo "$0: must be run in bind9 top level directory" >&2
84cb41f729e2a8526300dd7a6cffaa66da5cf6cdMark Andrewsif test -e "$dstdir/version"; then
618e871c2eb80021673bedf083496ccd1bf65cd0Brian Wellington# Try to make an effort to not wipe out current directory or non-bind directory
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellingtontest "0$this_version" -eq "0$that_version" && {
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington echo "$0: dstdir must not be current directory" >&2
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellingtontest ! -d $dstdir -o "$that_version" -ne 0 || {
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington echo "$0: existing dstdir must be a bind9 source directory" >&2
04b8111f2137a9cf9b0b71228f76b3e40ffa1173Brian Wellington# XXX Tale BSD/OS special
ccad3c9ecbe8a1060ff7b407a318ccd592de536eBrian Wellington# Start with a clean slate. This is not done in the source tree before
ccad3c9ecbe8a1060ff7b407a318ccd592de536eBrian Wellington# the copy so as not to disturb things there.
8224be5129daebea8f0f5e8be5f925679ec893f1Brian Wellington# XXX header files that (currently) need to be built on Unix
659175b7d430afe13b439e499442a964e2c9110fMark Andrews##make code.h include/dns/enumtype.h include/dns/enumclass.h include/dns/rdatastruct.h
7b4dcbb89b71b17f5c16ca19a0e705e09509f063Bob Halley# XXX Need a better way
73af6575e00f8cf4942abce177f435797b9cfe41Brian Wellingtonperl -pi -e '$_ = "" if /chmod\(.*\)/' lib/dns/sec/dst/dst_parse.c
f53e43c37f2c978ccec0b49ed829426b213f9933Bob Halleyperl -pi -e 'last if /^##confparser\.c/' lib/dns/config/Makefile.in
e1f16346db02486f751c6db683fffe53c866c186Andreas Gustafsson# Adjust Makefiles to have NT paths and nmake-compatible variable expansion.
b55c30f2de6e1baaa3a9ba69b92f428f2c255ac3Mark Andrews s%(-I.*)unix%$1win32%;
e21d199dca95aff5d50f133d6b064309e209af00Brian Wellington s%(-I.*)pthreads.*?(\\?)$%$2%;
15af30dfc1c54a02d252dcf4c6f3b8759eaf0327Bob Halley s%(\$\(ARFLAGS\)) \$@%$1 /out:\$@%;
15af30dfc1c54a02d252dcf4c6f3b8759eaf0327Bob Halley s%\$\(UNIXOBJS\)%\$(WIN32OBJS)%;
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington s%\$\(PTHREADOBJS\)%%;
a93cf7e83be621d3d68f51e37121a47a70a6757bMark Andrews s%^(SUBDIRS.*)(pthreads)(.*)%$1$3%;
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews s%^(SUBDIRS.*)(unix)(.*)%$1win32$3%;
5ea0d11ca45bfd1ea9db8db07f18fbb02f500661Brian Wellington s%rm -f%-del /q /f%;
a9ef4854464fcc56d95f72331b6e09e9563bb5f3Andreas Gustafsson s%rm -rf%-rd /q /s%;
4b171ebd702d72200a4d7609f11c5f79d6b6f964Brian Wellington # /K is specified in MAKEDEFS *YUCK* because nmake
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews # for some BRAINDAMAGED REASON does not put K
4d9f3f00d93fcb8743b1105e8cf82e862be220d1Mark Andrews # in MAKEFLAGS (confirm with "nmake /PKN foo";
5bd76af084edfdcd1cb4db9453ac781d32dde6f7Mark Andrews # only P and N are in Makeflags.) However ... doing
5bd76af084edfdcd1cb4db9453ac781d32dde6f7Mark Andrews # things this way ends up putting /K when you might not
5bd76af084edfdcd1cb4db9453ac781d32dde6f7Mark Andrews # want it. Thanks, Microsoft.
5bd76af084edfdcd1cb4db9453ac781d32dde6f7Mark Andrews 'print "MAKEDEFS = /nologo /K\$(MAKEFLAGS)\n"
8b5de9701428e2b5eb50aba96af23dc1186124ddMark Andrews tr%{}/%()\\%;
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews s%rm -f%-del /q /f%;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley s%rm -rf%-rd /q /s%;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley s/for\ i\ in\ \$\(ALL_SUBDIRS\).*
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley /for %i in (\$(ALL_SUBDIRS)) do \\/x;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley s/if\ \[\ (\S+)\ !=\ "nulldir".*
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley /\@if NOT $1=="nulldir" \\/x;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley s/^.*echo "making .* in .*\n//;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley s/\(cd\ (\S+);\ (.*)\);\ \\
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley /pushd $1 && cd && $2 && popd || popd/x;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley s/\$\$i/%i/g;
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley# Make Makefiles
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley# Copy win32 special files
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence # r = recurse
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence # l = LF -> CRLF
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence # 9 = highest compression