nt-kit revision 7d32c065c7bb56f281651ae3dd2888f32ce4f1d9
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Copyright (C) 1999, 2000 Internet Software Consortium.
1124950b35ae05a12e804e670607fe5ba775cb4aTinderbox User# Permission to use, copy, modify, and distribute this software for any
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# purpose with or without fee is hereby granted, provided that the above
f202f2587b9ba4753afba49b796f599cc12b4d0fAndreas Gustafsson# copyright notice and this permission notice appear in all copies.
f202f2587b9ba4753afba49b796f599cc12b4d0fAndreas Gustafsson# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
f202f2587b9ba4753afba49b796f599cc12b4d0fAndreas Gustafsson# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
f202f2587b9ba4753afba49b796f599cc12b4d0fAndreas Gustafsson# 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
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# XXX no command line options at all. especially useful would be a way
f202f2587b9ba4753afba49b796f599cc12b4d0fAndreas Gustafsson# to specify the target directory on the NT machine, since it is needed
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews# in the Makefiles and otherwise config.status.win32 needs to be edited.
b5ad6dfea4cc3e7d1d322ac99f1e5a31096837c4Mark Andrews# XXX long term something different clearly needs to be done, so someone
f202f2587b9ba4753afba49b796f599cc12b4d0fAndreas Gustafsson# without any Unix boxes at all could download the source kit and compile.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# it'll happen; it has been a higher priority just to try to work
8012d70ea4906ba739036cc9903cb0ac0fc72e9fJeremy C. Reed# on the code issues.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein echo "$0: must be run in bind9 top level directory" >&2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinif test -e "$dstdir/version"; then
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Try to make an effort to not wipe out current directory or non-bind directory
0db6bf459f7afa1f9dc0690a521df19955c89dbfJeremy Reed echo "$0: dstdir must not be current directory" >&2
c6d4f781529d2f28693546b25b2967d44ec89e60Mark Andrews echo "$0: existing dstdir must be a bind9 source directory" >&2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# XXX Tale BSD/OS special
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Start with a clean slate. This is not done in the source tree before
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# the copy so as not to disturb things there.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# XXX header files that (currently) need to be built on Unix
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein##make code.h include/dns/enumtype.h include/dns/enumclass.h include/dns/rdatastruct.h
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# XXX Need a better way
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinperl -pi -e '$_ = "" if /chmod\(.*\)/' lib/dns/sec/dst/dst_parse.c
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinperl -pi -e 'last if /^##confparser\.c/' lib/dns/config/Makefile.in
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Adjust Makefiles to have NT paths and nmake-compatible variable expansion.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%(-I.*)unix%$1win32%;
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark Andrews s%(-I.*)pthreads.*?(\\?)$%$2%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%-I ?%/I %g;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%(\$\(ARFLAGS\)) \$@%$1 /out:\$@%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%\$\(UNIXOBJS\)%\$(WIN32OBJS)%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%\$\(PTHREADOBJS\)%%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%^(SUBDIRS.*)(pthreads)(.*)%$1$3%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%^(SUBDIRS.*)(unix)(.*)%$1win32$3%;
3b9d9ad58b2d85a10960819f5c7a4606b33e9ab2Evan Hunt s%rm -f%-del /q /f%;
8012d70ea4906ba739036cc9903cb0ac0fc72e9fJeremy C. Reed s%rm -rf%-rd /q /s%;
d4f032db535ad5194d442fec535123f269422055Jeremy Reed # /K is specified in MAKEDEFS *YUCK* because nmake
d4f032db535ad5194d442fec535123f269422055Jeremy Reed # for some BRAINDAMAGED REASON does not put K
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein # in MAKEFLAGS (confirm with "nmake /PKN foo";
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein # only P and N are in Makeflags.) However ... doing
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein # things this way ends up putting /K when you might not
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein # want it. Thanks, Microsoft.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein 'print "MAKEDEFS = /nologo /K\$(MAKEFLAGS)\n"
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein tr%{}/%()\\%;
065c66d9bf1c349600027bb50e3759a3736f73abMark Andrews s%rm -f%-del /q /f%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s%rm -rf%-rd /q /s%;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s/for\ i\ in\ \$\(ALL_SUBDIRS\).*
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein /for %i in (\$(ALL_SUBDIRS)) do \\/x;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s/if\ \[\ (\S+)\ !=\ "nulldir".*
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein /\@if NOT $1=="nulldir" \\/x;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s/^.*echo "making .* in .*\n//;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s/\(cd\ (\S+);\ (.*)\);\ \\
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein /pushd $1 && cd && $2 && popd || popd/x;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein s/\$\$i/%i/g;
3b9d9ad58b2d85a10960819f5c7a4606b33e9ab2Evan Hunt# Make Makefiles
3b9d9ad58b2d85a10960819f5c7a4606b33e9ab2Evan Hunt# Copy win32 special files
3b9d9ad58b2d85a10960819f5c7a4606b33e9ab2Evan Hunt # r = recurse
3b9d9ad58b2d85a10960819f5c7a4606b33e9ab2Evan Hunt # l = LF -> CRLF
3b9d9ad58b2d85a10960819f5c7a4606b33e9ab2Evan Hunt # 9 = highest compression