summaryrefslogtreecommitdiff
path: root/dmake
diff options
context:
space:
mode:
Diffstat (limited to 'dmake')
-rw-r--r--dmake/.gitignore11
-rwxr-xr-xdmake/AUTHORS0
-rwxr-xr-xdmake/COPYING37
-rwxr-xr-xdmake/ChangeLog4259
-rwxr-xr-xdmake/INSTALL3
-rwxr-xr-xdmake/Makefile.am64
-rwxr-xr-xdmake/Makefile.in869
-rwxr-xr-xdmake/NEWS316
-rwxr-xr-xdmake/acinclude.m43
-rwxr-xr-xdmake/aclocal.m4908
-rw-r--r--dmake/alloc.h59
-rwxr-xr-xdmake/autogen.sh63
-rwxr-xr-xdmake/compile142
-rwxr-xr-xdmake/config.guess1463
-rw-r--r--dmake/config.h.in184
-rwxr-xr-xdmake/config.sub1579
-rwxr-xr-xdmake/configure9000
-rwxr-xr-xdmake/configure.in220
-rw-r--r--dmake/dag.c697
-rw-r--r--dmake/db.h66
-rw-r--r--dmake/dbug/dbug.mk66
-rw-r--r--dmake/dbug/dbug/dbug.c1806
-rw-r--r--dmake/dbug/dbug/dbug.h164
-rwxr-xr-xdmake/dbug/dbug/dbug.txt1452
-rw-r--r--dmake/dbug/dbug/dbug.uue368
-rwxr-xr-xdmake/dbug/dbug/example1.c12
-rwxr-xr-xdmake/dbug/dbug/example2.c17
-rwxr-xr-xdmake/dbug/dbug/example3.c16
-rwxr-xr-xdmake/dbug/dbug/factorial.c15
-rwxr-xr-xdmake/dbug/dbug/main.c27
-rwxr-xr-xdmake/dbug/dbug/makeman.sh18
-rw-r--r--dmake/dbug/dbug/readme52
-rwxr-xr-xdmake/dbug/dbug/user.r938
-rw-r--r--dmake/dbug/getwd.c6
-rw-r--r--dmake/dbug/malloc/_changes9
-rw-r--r--dmake/dbug/malloc/_readme133
-rw-r--r--dmake/dbug/malloc/calloc.c49
-rw-r--r--dmake/dbug/malloc/debug.h99
-rw-r--r--dmake/dbug/malloc/dump.c103
-rw-r--r--dmake/dbug/malloc/free.c150
-rw-r--r--dmake/dbug/malloc/m_init.c79
-rw-r--r--dmake/dbug/malloc/m_perror.c73
-rw-r--r--dmake/dbug/malloc/makefile77
-rw-r--r--dmake/dbug/malloc/malloc.3223
-rw-r--r--dmake/dbug/malloc/malloc.c627
-rw-r--r--dmake/dbug/malloc/malloc.h85
-rw-r--r--dmake/dbug/malloc/mallopt.c98
-rw-r--r--dmake/dbug/malloc/memory.c195
-rw-r--r--dmake/dbug/malloc/mlc_chk.c256
-rw-r--r--dmake/dbug/malloc/mlc_chn.c188
-rw-r--r--dmake/dbug/malloc/patchlev1
-rw-r--r--dmake/dbug/malloc/realloc.c180
-rw-r--r--dmake/dbug/malloc/string.c533
-rw-r--r--dmake/dbug/malloc/testmem.c618
-rw-r--r--dmake/dbug/malloc/testmlc.c176
-rw-r--r--dmake/dbug/malloc/tostring.c132
-rw-r--r--dmake/dbug/malloc/tostring.h13
-rw-r--r--dmake/dbug/readme13
-rwxr-xr-xdmake/depcomp530
-rw-r--r--dmake/dmake.c947
-rw-r--r--dmake/dmake.h230
-rw-r--r--dmake/dmakeroot.h.in6
-rw-r--r--dmake/dmdump.c287
-rw-r--r--dmake/dmstring.c300
-rw-r--r--dmake/dstdarg.h43
-rw-r--r--dmake/expand.c1204
-rw-r--r--dmake/extern.h192
-rw-r--r--dmake/function.c726
-rw-r--r--dmake/getinp.c854
-rw-r--r--dmake/hash.c54
-rw-r--r--dmake/imacs.c206
-rw-r--r--dmake/infer.c904
-rwxr-xr-xdmake/install-sh323
-rw-r--r--dmake/itypes.h82
-rw-r--r--dmake/macparse.c232
-rwxr-xr-xdmake/make.bat273
-rw-r--r--dmake/make.c1774
-rwxr-xr-xdmake/make.cmd115
-rw-r--r--dmake/makefile.mk432
-rw-r--r--dmake/man/dmake.nc3644
-rw-r--r--dmake/man/dmake.tf3480
-rw-r--r--dmake/man/readme12
-rwxr-xr-xdmake/missing360
-rwxr-xr-xdmake/mkinstalldirs158
-rw-r--r--dmake/msdos/arlib.c56
-rw-r--r--dmake/msdos/borland/bcc30/config.h48
-rw-r--r--dmake/msdos/borland/bcc30/config.mk8
-rw-r--r--dmake/msdos/borland/bcc30/lib.rsp1
-rw-r--r--dmake/msdos/borland/bcc30/libswp.rsp1
-rwxr-xr-xdmake/msdos/borland/bcc30/mkswp.bat107
-rw-r--r--dmake/msdos/borland/bcc30/obj.rsp34
-rw-r--r--dmake/msdos/borland/bcc30/objswp.rsp36
-rw-r--r--dmake/msdos/borland/bcc30/public.h170
-rw-r--r--dmake/msdos/borland/bcc30/template.mk7
-rw-r--r--dmake/msdos/borland/bcc40/config.h51
-rw-r--r--dmake/msdos/borland/bcc40/config.mk7
-rw-r--r--dmake/msdos/borland/bcc40/lib.rsp2
-rw-r--r--dmake/msdos/borland/bcc40/libswp.rsp1
-rwxr-xr-xdmake/msdos/borland/bcc40/mkswp.bat107
-rw-r--r--dmake/msdos/borland/bcc40/obj.rsp34
-rw-r--r--dmake/msdos/borland/bcc40/objswp.rsp36
-rw-r--r--dmake/msdos/borland/bcc40/public.h170
-rw-r--r--dmake/msdos/borland/bcc40/template.mk7
-rw-r--r--dmake/msdos/borland/bcc45/config.h51
-rw-r--r--dmake/msdos/borland/bcc45/config.mk7
-rw-r--r--dmake/msdos/borland/bcc45/lib.rsp2
-rw-r--r--dmake/msdos/borland/bcc45/libswp.rsp1
-rwxr-xr-xdmake/msdos/borland/bcc45/mkswp.bat107
-rw-r--r--dmake/msdos/borland/bcc45/obj.rsp34
-rw-r--r--dmake/msdos/borland/bcc45/objswp.rsp36
-rw-r--r--dmake/msdos/borland/bcc45/public.h170
-rw-r--r--dmake/msdos/borland/bcc45/template.mk7
-rw-r--r--dmake/msdos/borland/bcc50/config.h51
-rw-r--r--dmake/msdos/borland/bcc50/config.mk7
-rw-r--r--dmake/msdos/borland/bcc50/lib.rsp2
-rw-r--r--dmake/msdos/borland/bcc50/libswp.rsp1
-rwxr-xr-xdmake/msdos/borland/bcc50/mkswp.bat107
-rw-r--r--dmake/msdos/borland/bcc50/obj.rsp34
-rw-r--r--dmake/msdos/borland/bcc50/objswp.rsp36
-rw-r--r--dmake/msdos/borland/bcc50/public.h170
-rw-r--r--dmake/msdos/borland/bcc50/template.mk7
-rw-r--r--dmake/msdos/borland/config.mk46
-rw-r--r--dmake/msdos/borland/tcc20/config.h48
-rw-r--r--dmake/msdos/borland/tcc20/config.mk10
-rw-r--r--dmake/msdos/borland/tcc20/libswp.rsp1
-rwxr-xr-xdmake/msdos/borland/tcc20/mkswp.bat107
-rw-r--r--dmake/msdos/borland/tcc20/objswp.rsp36
-rw-r--r--dmake/msdos/borland/tcc20/public.h170
-rw-r--r--dmake/msdos/borland/tcc20/template.mk7
-rw-r--r--dmake/msdos/borland/tempnam.c109
-rw-r--r--dmake/msdos/borland/utime.c66
-rw-r--r--dmake/msdos/config.mk71
-rw-r--r--dmake/msdos/dchdir.c47
-rw-r--r--dmake/msdos/dirbrk.c42
-rw-r--r--dmake/msdos/dirent.h32
-rw-r--r--dmake/msdos/dirlib.c285
-rw-r--r--dmake/msdos/dosdta.h16
-rw-r--r--dmake/msdos/dstrlwr.c49
-rw-r--r--dmake/msdos/exec.asm1234
-rw-r--r--dmake/msdos/exec.h43
-rw-r--r--dmake/msdos/exec.uue63
-rw-r--r--dmake/msdos/find.c130
-rw-r--r--dmake/msdos/microsft/config.h77
-rw-r--r--dmake/msdos/microsft/config.mk59
-rw-r--r--dmake/msdos/microsft/msc51/config.mk11
-rw-r--r--dmake/msdos/microsft/msc51/lib.rsp1
-rw-r--r--dmake/msdos/microsft/msc51/libswp.rsp1
-rwxr-xr-xdmake/msdos/microsft/msc51/mk.bat102
-rwxr-xr-xdmake/msdos/microsft/msc51/mkswp.bat104
-rw-r--r--dmake/msdos/microsft/msc51/obj.rsp33
-rw-r--r--dmake/msdos/microsft/msc51/objswp.rsp34
-rw-r--r--dmake/msdos/microsft/msc51/public.h170
-rw-r--r--dmake/msdos/microsft/msc51/template.mk7
-rw-r--r--dmake/msdos/microsft/msc60/config.mk11
-rw-r--r--dmake/msdos/microsft/msc60/lib.rsp1
-rw-r--r--dmake/msdos/microsft/msc60/libswp.rsp1
-rwxr-xr-xdmake/msdos/microsft/msc60/mk.bat102
-rwxr-xr-xdmake/msdos/microsft/msc60/mkswp.bat104
-rw-r--r--dmake/msdos/microsft/msc60/obj.rsp33
-rw-r--r--dmake/msdos/microsft/msc60/objswp.rsp34
-rw-r--r--dmake/msdos/microsft/msc60/public.h170
-rw-r--r--dmake/msdos/microsft/msc60/template.mk7
-rw-r--r--dmake/msdos/microsft/optoff.h27
-rw-r--r--dmake/msdos/microsft/tempnam.c110
-rw-r--r--dmake/msdos/rmprq.c44
-rw-r--r--dmake/msdos/ruletab.c45
-rw-r--r--dmake/msdos/runargv.c188
-rw-r--r--dmake/msdos/spawn.c415
-rw-r--r--dmake/msdos/startup.h26
-rw-r--r--dmake/msdos/switchar.c55
-rw-r--r--dmake/msdos/sysintf.h52
-rw-r--r--dmake/msdos/tee.c31
-rw-r--r--dmake/msdos/zortech/config.h52
-rw-r--r--dmake/msdos/zortech/config.mk73
-rw-r--r--dmake/msdos/zortech/environ.c59
-rw-r--r--dmake/msdos/zortech/lib.rsp1
-rw-r--r--dmake/msdos/zortech/libswp.rsp1
-rwxr-xr-xdmake/msdos/zortech/mkswp.bat36
-rw-r--r--dmake/msdos/zortech/obj.rsp34
-rw-r--r--dmake/msdos/zortech/objswp.rsp35
-rw-r--r--dmake/msdos/zortech/public.h169
-rw-r--r--dmake/msdos/zortech/startup.mk153
-rw-r--r--dmake/msdos/zortech/tempnam.c106
-rw-r--r--dmake/os2/config.mk54
-rw-r--r--dmake/os2/dchdir.c41
-rw-r--r--dmake/os2/dirent.h36
-rw-r--r--dmake/os2/ibm/config.h78
-rw-r--r--dmake/os2/ibm/config.mk54
-rw-r--r--dmake/os2/ibm/icc/config.mk11
-rw-r--r--dmake/os2/ibm/icc/lib.rsp1
-rwxr-xr-xdmake/os2/ibm/icc/mk.cmd96
-rw-r--r--dmake/os2/ibm/icc/obj.rsp31
-rw-r--r--dmake/os2/ibm/icc/public.h169
-rw-r--r--dmake/os2/ibm/icc/template.mk7
-rw-r--r--dmake/os2/ibm/icc3/config.mk11
-rw-r--r--dmake/os2/ibm/icc3/lib.rsp1
-rwxr-xr-xdmake/os2/ibm/icc3/mk.cmd192
-rw-r--r--dmake/os2/ibm/icc3/obj.rsp30
-rw-r--r--dmake/os2/ibm/icc3/public.h169
-rw-r--r--dmake/os2/ibm/icc3/template.mk7
-rw-r--r--dmake/os2/ibm/tempnam.c111
-rw-r--r--dmake/os2/ruletab.c47
-rw-r--r--dmake/os2/startup.h27
-rw-r--r--dmake/os2/switchar.c43
-rw-r--r--dmake/os2/sysintf.h62
-rw-r--r--dmake/parse.c176
-rw-r--r--dmake/path.c337
-rw-r--r--dmake/percent.c251
-rw-r--r--dmake/posix.h66
-rw-r--r--dmake/qssl/config.mk43
-rw-r--r--dmake/qssl/make.sh62
-rw-r--r--dmake/qssl/public.h166
-rw-r--r--dmake/qssl/ruletab.c41
-rw-r--r--dmake/qssl/runargv.c298
-rw-r--r--dmake/qssl/setup40
-rw-r--r--dmake/qssl/startup.h28
-rw-r--r--dmake/qssl/stdlib.h48
-rw-r--r--dmake/qssl/sysintf.h42
-rw-r--r--dmake/qssl/template.mk7
-rw-r--r--dmake/qssl/tempnam.c102
-rw-r--r--dmake/qssl/time.h32
-rw-r--r--dmake/quit.c116
-rw-r--r--dmake/rcsclean.awk57
-rw-r--r--dmake/readme/intro.txt40
-rw-r--r--dmake/readme/license.txt248
-rw-r--r--dmake/readme/public/install.txt203
-rw-r--r--dmake/readme/public/mac.txt43
-rw-r--r--dmake/readme/public/msdos.txt124
-rw-r--r--dmake/readme/public/os2.txt76
-rw-r--r--dmake/readme/public/qssl-qnx.txt5
-rw-r--r--dmake/readme/public/srcorg.txt74
-rw-r--r--dmake/readme/public/tos.txt31
-rw-r--r--dmake/readme/public/unix.txt171
-rw-r--r--dmake/readme/read1st.txt58
-rw-r--r--dmake/readme/release.txt196
-rw-r--r--dmake/rulparse.c1734
-rwxr-xr-xdmake/stamp-h1
-rwxr-xr-xdmake/startup/Makefile.am7
-rw-r--r--dmake/startup/Makefile.in492
-rw-r--r--dmake/startup/config.mk.in5
-rw-r--r--dmake/startup/msdos/borland/bcc30/macros.mk4
-rw-r--r--dmake/startup/msdos/borland/bcc40/macros.mk4
-rw-r--r--dmake/startup/msdos/borland/bcc45/macros.mk4
-rw-r--r--dmake/startup/msdos/borland/bcc50.32/macros.mk4
-rw-r--r--dmake/startup/msdos/borland/bcc50/macros.mk4
-rw-r--r--dmake/startup/msdos/borland/macros.mk33
-rw-r--r--dmake/startup/msdos/borland/tcc20/macros.mk4
-rw-r--r--dmake/startup/msdos/macros.mk62
-rw-r--r--dmake/startup/msdos/microsft/macros.mk34
-rw-r--r--dmake/startup/msdos/recipes.mk9
-rw-r--r--dmake/startup/msdos/zortech/macros.mk30
-rw-r--r--dmake/startup/os2/ibm/macros.mk30
-rw-r--r--dmake/startup/os2/macros.mk60
-rw-r--r--dmake/startup/qssl/macros.mk11
-rw-r--r--dmake/startup/qssl/qnx/macros.mk11
-rw-r--r--dmake/startup/qssl/qnx/recipes.mk8
-rw-r--r--dmake/startup/qssl/recipes.mk8
-rw-r--r--dmake/startup/startup.mk211
-rw-r--r--dmake/startup/summary3
-rw-r--r--dmake/startup/template.mk7
-rw-r--r--dmake/startup/templates/mac/template.mk7
-rw-r--r--dmake/startup/templates/msdos/borland/bcc30/template.mk7
-rw-r--r--dmake/startup/templates/msdos/borland/bcc40/template.mk7
-rw-r--r--dmake/startup/templates/msdos/borland/bcc45/template.mk7
-rw-r--r--dmake/startup/templates/msdos/borland/bcc50/template.mk7
-rw-r--r--dmake/startup/templates/msdos/borland/tcc20/template.mk7
-rw-r--r--dmake/startup/templates/msdos/microsft/msc51/template.mk7
-rw-r--r--dmake/startup/templates/msdos/microsft/msc60/template.mk7
-rw-r--r--dmake/startup/templates/os2/ibm/icc/template.mk7
-rw-r--r--dmake/startup/templates/qssl/template.mk7
-rw-r--r--dmake/startup/templates/tos/template.mk7
-rw-r--r--dmake/startup/templates/unix/386ix/template.mk7
-rw-r--r--dmake/startup/templates/unix/bsd43/template.mk7
-rw-r--r--dmake/startup/templates/unix/bsd43/uw/template.mk7
-rw-r--r--dmake/startup/templates/unix/bsd43/vf/template.mk7
-rw-r--r--dmake/startup/templates/unix/coherent/ver40/template.mk7
-rw-r--r--dmake/startup/templates/unix/coherent/ver42/template.mk7
-rw-r--r--dmake/startup/templates/unix/linux/gnu/template.mk7
-rw-r--r--dmake/startup/templates/unix/solaris/gnu/template.mk7
-rw-r--r--dmake/startup/templates/unix/solaris/template.mk7
-rw-r--r--dmake/startup/templates/unix/sysvr1/template.mk7
-rw-r--r--dmake/startup/templates/unix/sysvr3/pwd/template.mk7
-rw-r--r--dmake/startup/templates/unix/sysvr3/template.mk7
-rw-r--r--dmake/startup/templates/unix/sysvr4/template.mk7
-rw-r--r--dmake/startup/templates/unix/xenix/pwd/template.mk7
-rw-r--r--dmake/startup/templates/unix/xenix/template.mk7
-rw-r--r--dmake/startup/templates/win95/borland/bcc50/template.mk7
-rw-r--r--dmake/startup/templates/win95/microsft/vpp40/template.mk7
-rw-r--r--dmake/startup/templates/winnt/borland/bcc50/template.mk7
-rw-r--r--dmake/startup/templates/winnt/microsft/vpp40/template.mk7
-rw-r--r--dmake/startup/tos/macros.mk24
-rw-r--r--dmake/startup/unix/386ix/macros.mk6
-rwxr-xr-xdmake/startup/unix/Makefile.am8
-rw-r--r--dmake/startup/unix/Makefile.in489
-rw-r--r--dmake/startup/unix/bsd43/macros.mk11
-rw-r--r--dmake/startup/unix/bsd43/recipes.mk13
-rw-r--r--dmake/startup/unix/coherent/macros.mk6
-rw-r--r--dmake/startup/unix/coherent/recipes.mk6
-rw-r--r--dmake/startup/unix/cygwin/Makefile.am6
-rw-r--r--dmake/startup/unix/cygwin/Makefile.in331
-rw-r--r--dmake/startup/unix/cygwin/macros.mk10
-rwxr-xr-xdmake/startup/unix/linux/Makefile.am6
-rw-r--r--dmake/startup/unix/linux/Makefile.in331
-rw-r--r--dmake/startup/unix/linux/gnu/macros.mk6
-rw-r--r--dmake/startup/unix/linux/macros.mk10
-rwxr-xr-xdmake/startup/unix/macosx/Makefile.am6
-rw-r--r--dmake/startup/unix/macosx/Makefile.in331
-rw-r--r--dmake/startup/unix/macosx/gnu/macros.mk6
-rw-r--r--dmake/startup/unix/macosx/macros.mk10
-rw-r--r--dmake/startup/unix/macros.mk5
-rw-r--r--dmake/startup/unix/os2/Makefile.am6
-rw-r--r--dmake/startup/unix/os2/Makefile.in331
-rw-r--r--dmake/startup/unix/os2/macros.mk60
-rw-r--r--dmake/startup/unix/recipes.mk15
-rwxr-xr-xdmake/startup/unix/solaris/Makefile.am6
-rw-r--r--dmake/startup/unix/solaris/Makefile.in331
-rw-r--r--dmake/startup/unix/solaris/macros.mk6
-rw-r--r--dmake/startup/unix/sysvr1/macros.mk6
-rw-r--r--dmake/startup/unix/sysvr3/gnu/macros.mk12
-rw-r--r--dmake/startup/unix/sysvr3/macros.mk7
-rwxr-xr-xdmake/startup/unix/sysvr4/Makefile.am6
-rw-r--r--dmake/startup/unix/sysvr4/Makefile.in331
-rw-r--r--dmake/startup/unix/sysvr4/macros.mk6
-rw-r--r--dmake/startup/unix/xenix/macros.mk6
-rw-r--r--dmake/startup/win95/borland/macros.mk34
-rw-r--r--dmake/startup/win95/macros.mk75
-rw-r--r--dmake/startup/win95/microsft/macros.mk38
-rw-r--r--dmake/startup/win95/recipes.mk9
-rw-r--r--dmake/startup/winnt/Makefile.am8
-rw-r--r--dmake/startup/winnt/Makefile.in489
-rw-r--r--dmake/startup/winnt/borland/macros.mk34
-rw-r--r--dmake/startup/winnt/macros.mk75
-rw-r--r--dmake/startup/winnt/microsft/macros.mk37
-rw-r--r--dmake/startup/winnt/mingw/Makefile.am6
-rw-r--r--dmake/startup/winnt/mingw/Makefile.in331
-rw-r--r--dmake/startup/winnt/mingw/macros.mk10
-rw-r--r--dmake/startup/winnt/msvc6/Makefile.am6
-rw-r--r--dmake/startup/winnt/msvc6/Makefile.in331
-rw-r--r--dmake/startup/winnt/msvc6/macros.mk37
-rw-r--r--dmake/startup/winnt/recipes.mk9
-rw-r--r--dmake/stat.c278
-rw-r--r--dmake/state.c231
-rw-r--r--dmake/stdmacs.h60
-rw-r--r--dmake/struct.h261
-rw-r--r--dmake/sysintf.c1157
-rw-r--r--dmake/tests/Makefile.am22
-rw-r--r--dmake/tests/Makefile.in392
-rw-r--r--dmake/tests/README12
-rwxr-xr-xdmake/tests/function_macros-196
-rwxr-xr-xdmake/tests/function_macros-10122
-rwxr-xr-xdmake/tests/function_macros-264
-rwxr-xr-xdmake/tests/function_macros-340
-rwxr-xr-xdmake/tests/function_macros-435
-rwxr-xr-xdmake/tests/function_macros-546
-rwxr-xr-xdmake/tests/function_macros-642
-rwxr-xr-xdmake/tests/function_macros-739
-rwxr-xr-xdmake/tests/function_macros-8101
-rwxr-xr-xdmake/tests/function_macros-970
-rwxr-xr-xdmake/tests/infra-044
-rwxr-xr-xdmake/tests/macros-141
-rwxr-xr-xdmake/tests/macros-1099
-rwxr-xr-xdmake/tests/macros-11147
-rwxr-xr-xdmake/tests/macros-262
-rwxr-xr-xdmake/tests/macros-371
-rwxr-xr-xdmake/tests/macros-492
-rwxr-xr-xdmake/tests/macros-568
-rwxr-xr-xdmake/tests/macros-662
-rwxr-xr-xdmake/tests/macros-776
-rwxr-xr-xdmake/tests/macros-8157
-rwxr-xr-xdmake/tests/macros-9141
-rwxr-xr-xdmake/tests/misc-135
-rwxr-xr-xdmake/tests/misc-1041
-rwxr-xr-xdmake/tests/misc-1142
-rwxr-xr-xdmake/tests/misc-1240
-rwxr-xr-xdmake/tests/misc-1351
-rwxr-xr-xdmake/tests/misc-1444
-rwxr-xr-xdmake/tests/misc-1553
-rwxr-xr-xdmake/tests/misc-1648
-rwxr-xr-xdmake/tests/misc-1742
-rwxr-xr-xdmake/tests/misc-18169
-rwxr-xr-xdmake/tests/misc-1945
-rwxr-xr-xdmake/tests/misc-240
-rwxr-xr-xdmake/tests/misc-20121
-rwxr-xr-xdmake/tests/misc-2141
-rwxr-xr-xdmake/tests/misc-344
-rwxr-xr-xdmake/tests/misc-462
-rwxr-xr-xdmake/tests/misc-549
-rwxr-xr-xdmake/tests/misc-665
-rwxr-xr-xdmake/tests/misc-747
-rwxr-xr-xdmake/tests/misc-839
-rwxr-xr-xdmake/tests/misc-953
-rwxr-xr-xdmake/tests/recipes-138
-rwxr-xr-xdmake/tests/recipes-241
-rwxr-xr-xdmake/tests/recipes-340
-rwxr-xr-xdmake/tests/recipes-438
-rwxr-xr-xdmake/tests/recipes-562
-rwxr-xr-xdmake/tests/recipes-666
-rwxr-xr-xdmake/tests/recipes-738
-rwxr-xr-xdmake/tests/recipes-8104
-rwxr-xr-xdmake/tests/recipes-9117
-rw-r--r--dmake/tests/targets-178
-rw-r--r--dmake/tests/targets-1050
-rw-r--r--dmake/tests/targets-1138
-rw-r--r--dmake/tests/targets-1247
-rwxr-xr-xdmake/tests/targets-1349
-rwxr-xr-xdmake/tests/targets-1453
-rwxr-xr-xdmake/tests/targets-1556
-rwxr-xr-xdmake/tests/targets-1649
-rwxr-xr-xdmake/tests/targets-1738
-rwxr-xr-xdmake/tests/targets-1852
-rwxr-xr-xdmake/tests/targets-1968
-rw-r--r--dmake/tests/targets-270
-rwxr-xr-xdmake/tests/targets-2065
-rwxr-xr-xdmake/tests/targets-2155
-rwxr-xr-xdmake/tests/targets-2255
-rwxr-xr-xdmake/tests/targets-2356
-rwxr-xr-xdmake/tests/targets-2461
-rwxr-xr-xdmake/tests/targets-2551
-rwxr-xr-xdmake/tests/targets-2657
-rwxr-xr-xdmake/tests/targets-2759
-rwxr-xr-xdmake/tests/targets-28175
-rwxr-xr-xdmake/tests/targets-2959
-rw-r--r--dmake/tests/targets-349
-rwxr-xr-xdmake/tests/targets-3064
-rw-r--r--dmake/tests/targets-470
-rw-r--r--dmake/tests/targets-551
-rw-r--r--dmake/tests/targets-652
-rw-r--r--dmake/tests/targets-754
-rw-r--r--dmake/tests/targets-850
-rw-r--r--dmake/tests/targets-949
-rw-r--r--dmake/tos/config.mk49
-rw-r--r--dmake/tos/make.sh57
-rw-r--r--dmake/tos/public.h166
-rw-r--r--dmake/tos/putenv.c78
-rw-r--r--dmake/tos/ruletab.c42
-rw-r--r--dmake/tos/startup.h28
-rw-r--r--dmake/tos/sysintf.h45
-rw-r--r--dmake/tos/template.mk7
-rw-r--r--dmake/tos/tempnam.c104
-rw-r--r--dmake/unix/386ix/ar.h27
-rw-r--r--dmake/unix/386ix/config.mk27
-rw-r--r--dmake/unix/386ix/make.sh60
-rw-r--r--dmake/unix/386ix/public.h167
-rw-r--r--dmake/unix/386ix/stdlib.h44
-rw-r--r--dmake/unix/386ix/template.mk7
-rw-r--r--dmake/unix/386ix/time.h35
-rwxr-xr-xdmake/unix/Makefile.am7
-rwxr-xr-xdmake/unix/Makefile.in396
-rw-r--r--dmake/unix/arlib.c610
-rw-r--r--dmake/unix/bsd43/config.mk27
-rw-r--r--dmake/unix/bsd43/dirent.h28
-rw-r--r--dmake/unix/bsd43/limits.h32
-rw-r--r--dmake/unix/bsd43/make.sh69
-rw-r--r--dmake/unix/bsd43/public.h167
-rw-r--r--dmake/unix/bsd43/putenv.c78
-rw-r--r--dmake/unix/bsd43/setvbuf.c40
-rw-r--r--dmake/unix/bsd43/stdlib.h44
-rw-r--r--dmake/unix/bsd43/string.h43
-rw-r--r--dmake/unix/bsd43/template.mk7
-rw-r--r--dmake/unix/bsd43/tempnam.c103
-rw-r--r--dmake/unix/bsd43/utime.c70
-rw-r--r--dmake/unix/bsd43/uw/config.mk17
-rw-r--r--dmake/unix/bsd43/uw/make.sh69
-rw-r--r--dmake/unix/bsd43/uw/public.h167
-rw-r--r--dmake/unix/bsd43/uw/template.mk7
-rw-r--r--dmake/unix/bsd43/vf/config.mk11
-rw-r--r--dmake/unix/bsd43/vf/ctype.h51
-rw-r--r--dmake/unix/bsd43/vf/make.sh73
-rw-r--r--dmake/unix/bsd43/vf/memcpy.c36
-rw-r--r--dmake/unix/bsd43/vf/public.h167
-rw-r--r--dmake/unix/bsd43/vf/template.mk7
-rw-r--r--dmake/unix/bsd43/vf/vfprintf.c48
-rw-r--r--dmake/unix/bsdarm32/config.mk27
-rw-r--r--dmake/unix/bsdarm32/dirent.h30
-rw-r--r--dmake/unix/bsdarm32/limits.h29
-rw-r--r--dmake/unix/bsdarm32/make.sh67
-rw-r--r--dmake/unix/bsdarm32/public.h167
-rw-r--r--dmake/unix/bsdarm32/putenv.c78
-rw-r--r--dmake/unix/bsdarm32/stdlib.h44
-rw-r--r--dmake/unix/bsdarm32/string.h42
-rw-r--r--dmake/unix/bsdarm32/template.mk7
-rw-r--r--dmake/unix/bsdarm32/tempnam.c105
-rw-r--r--dmake/unix/bsdarm32/utime.c70
-rw-r--r--dmake/unix/coherent/config.mk26
-rw-r--r--dmake/unix/coherent/stdlib.h44
-rw-r--r--dmake/unix/coherent/time.h32
-rw-r--r--dmake/unix/coherent/ver40/config.mk11
-rw-r--r--dmake/unix/coherent/ver40/getcwd.c49
-rw-r--r--dmake/unix/coherent/ver40/make.sh64
-rw-r--r--dmake/unix/coherent/ver40/public.h167
-rw-r--r--dmake/unix/coherent/ver40/template.mk7
-rw-r--r--dmake/unix/coherent/ver40/vfprintf.c190
-rw-r--r--dmake/unix/coherent/ver42/config.mk11
-rw-r--r--dmake/unix/coherent/ver42/make.sh60
-rw-r--r--dmake/unix/coherent/ver42/public.h167
-rw-r--r--dmake/unix/coherent/ver42/template.mk7
-rw-r--r--dmake/unix/config.mk39
-rw-r--r--dmake/unix/cygwin/public.h172
-rw-r--r--dmake/unix/dcache.c223
-rw-r--r--dmake/unix/dirbrk.c53
-rw-r--r--dmake/unix/linux/config.mk27
-rw-r--r--dmake/unix/linux/gnu/config.mk4
-rw-r--r--dmake/unix/linux/gnu/make.sh193
-rw-r--r--dmake/unix/linux/gnu/public.h172
-rw-r--r--dmake/unix/linux/gnu/template.mk7
-rw-r--r--dmake/unix/macosx/config.mk27
-rw-r--r--dmake/unix/macosx/gnu/config.mk4
-rw-r--r--dmake/unix/macosx/gnu/make.sh63
-rw-r--r--dmake/unix/macosx/gnu/public.h167
-rw-r--r--dmake/unix/macosx/gnu/template.mk7
-rw-r--r--dmake/unix/macosx/tempnam.c102
-rw-r--r--dmake/unix/os2/public.h172
-rw-r--r--dmake/unix/rmprq.c121
-rw-r--r--dmake/unix/ruletab.c44
-rw-r--r--dmake/unix/runargv.c1101
-rw-r--r--dmake/unix/solaris/config.mk27
-rw-r--r--dmake/unix/solaris/getcwd.c231
-rw-r--r--dmake/unix/solaris/gnu/config.mk8
-rw-r--r--dmake/unix/solaris/gnu/make.sh64
-rw-r--r--dmake/unix/solaris/gnu/public.h167
-rw-r--r--dmake/unix/solaris/gnu/template.mk7
-rw-r--r--dmake/unix/solaris/make.sh64
-rw-r--r--dmake/unix/solaris/public.h166
-rw-r--r--dmake/unix/solaris/template.mk7
-rw-r--r--dmake/unix/solaris/tempnam.c103
-rw-r--r--dmake/unix/startup.h27
-rw-r--r--dmake/unix/sysintf.h50
-rw-r--r--dmake/unix/sysvr1/config.mk28
-rw-r--r--dmake/unix/sysvr1/make.sh62
-rw-r--r--dmake/unix/sysvr1/public.h167
-rw-r--r--dmake/unix/sysvr1/putenv.c78
-rw-r--r--dmake/unix/sysvr1/stdlib.h44
-rw-r--r--dmake/unix/sysvr1/template.mk7
-rw-r--r--dmake/unix/sysvr1/time.h32
-rw-r--r--dmake/unix/sysvr1/vfprintf.c58
-rw-r--r--dmake/unix/sysvr3/config.mk27
-rw-r--r--dmake/unix/sysvr3/gnu/public.h165
-rw-r--r--dmake/unix/sysvr3/make.sh60
-rw-r--r--dmake/unix/sysvr3/public.h167
-rw-r--r--dmake/unix/sysvr3/pwd/config.mk20
-rw-r--r--dmake/unix/sysvr3/pwd/getcwd.c231
-rw-r--r--dmake/unix/sysvr3/pwd/make.sh62
-rw-r--r--dmake/unix/sysvr3/pwd/public.h167
-rw-r--r--dmake/unix/sysvr3/pwd/template.mk7
-rw-r--r--dmake/unix/sysvr3/stdlib.h55
-rw-r--r--dmake/unix/sysvr3/template.mk7
-rw-r--r--dmake/unix/sysvr3/time.h32
-rw-r--r--dmake/unix/sysvr4/config.mk27
-rw-r--r--dmake/unix/sysvr4/make.sh60
-rw-r--r--dmake/unix/sysvr4/public.h167
-rw-r--r--dmake/unix/sysvr4/template.mk7
-rw-r--r--dmake/unix/tempnam.c106
-rw-r--r--dmake/unix/xenix/config.mk27
-rw-r--r--dmake/unix/xenix/make.sh60
-rw-r--r--dmake/unix/xenix/public.h167
-rw-r--r--dmake/unix/xenix/pwd/config.mk23
-rw-r--r--dmake/unix/xenix/pwd/getcwd.c231
-rw-r--r--dmake/unix/xenix/pwd/make.sh62
-rw-r--r--dmake/unix/xenix/pwd/public.h167
-rw-r--r--dmake/unix/xenix/pwd/template.mk7
-rw-r--r--dmake/unix/xenix/stdlib.h50
-rw-r--r--dmake/unix/xenix/template.mk7
-rw-r--r--dmake/unix/xenix/time.h32
-rw-r--r--dmake/vextern.h129
-rw-r--r--dmake/win95/borland/bcc50/config.h44
-rw-r--r--dmake/win95/borland/bcc50/config.mk14
-rw-r--r--dmake/win95/borland/bcc50/lib.rsp2
-rwxr-xr-xdmake/win95/borland/bcc50/mk.bat96
-rw-r--r--dmake/win95/borland/bcc50/obj.rsp32
-rw-r--r--dmake/win95/borland/bcc50/public.h168
-rw-r--r--dmake/win95/borland/bcc50/template.mk7
-rw-r--r--dmake/win95/borland/config.mk51
-rw-r--r--dmake/win95/borland/ruletab.c44
-rw-r--r--dmake/win95/borland/sysintf.h55
-rw-r--r--dmake/win95/borland/tempnam.c114
-rw-r--r--dmake/win95/config.mk53
-rw-r--r--dmake/win95/dchdir.c46
-rw-r--r--dmake/win95/microsft/config.h122
-rw-r--r--dmake/win95/microsft/config.mk62
-rw-r--r--dmake/win95/microsft/optoff.h27
-rw-r--r--dmake/win95/microsft/ruletab.c56
-rw-r--r--dmake/win95/microsft/sysintf.h57
-rw-r--r--dmake/win95/microsft/tempnam.c110
-rw-r--r--dmake/win95/microsft/vpp40/config.mk14
-rw-r--r--dmake/win95/microsft/vpp40/lib.rsp1
-rwxr-xr-xdmake/win95/microsft/vpp40/mk.bat41
-rw-r--r--dmake/win95/microsft/vpp40/obj.rsp28
-rw-r--r--dmake/win95/microsft/vpp40/public.h167
-rw-r--r--dmake/win95/microsft/vpp40/runargv.c288
-rw-r--r--dmake/win95/microsft/vpp40/template.mk7
-rw-r--r--dmake/win95/microsft/vpp40/tempnam.c110
-rw-r--r--dmake/win95/startup.h28
-rw-r--r--dmake/win95/switchar.c43
-rw-r--r--dmake/winnt/borland/bcc50/config.h44
-rw-r--r--dmake/winnt/borland/bcc50/config.mk12
-rw-r--r--dmake/winnt/borland/bcc50/lib.rsp2
-rwxr-xr-xdmake/winnt/borland/bcc50/mk.bat95
-rwxr-xr-xdmake/winnt/borland/bcc50/mk.cmd93
-rw-r--r--dmake/winnt/borland/bcc50/obj.rsp31
-rw-r--r--dmake/winnt/borland/bcc50/public.h168
-rw-r--r--dmake/winnt/borland/bcc50/template.mk7
-rw-r--r--dmake/winnt/borland/config.mk51
-rw-r--r--dmake/winnt/borland/ruletab.c44
-rw-r--r--dmake/winnt/borland/sysintf.h55
-rw-r--r--dmake/winnt/borland/tempnam.c114
-rw-r--r--dmake/winnt/config.mk57
-rw-r--r--dmake/winnt/dchdir.c47
-rw-r--r--dmake/winnt/microsft/config.h85
-rw-r--r--dmake/winnt/microsft/config.mk61
-rw-r--r--dmake/winnt/microsft/optoff.h27
-rw-r--r--dmake/winnt/microsft/ruletab.c45
-rw-r--r--dmake/winnt/microsft/sysintf.h57
-rw-r--r--dmake/winnt/microsft/tempnam.c110
-rw-r--r--dmake/winnt/microsft/vpp40/config.mk14
-rw-r--r--dmake/winnt/microsft/vpp40/lib.rsp1
-rwxr-xr-xdmake/winnt/microsft/vpp40/mk.bat32
-rwxr-xr-xdmake/winnt/microsft/vpp40/mk.cmd31
-rw-r--r--dmake/winnt/microsft/vpp40/obj.rsp28
-rw-r--r--dmake/winnt/microsft/vpp40/public.h167
-rw-r--r--dmake/winnt/microsft/vpp40/runargv.c288
-rw-r--r--dmake/winnt/microsft/vpp40/template.mk7
-rw-r--r--dmake/winnt/microsft/vpp40/tempnam.c110
-rw-r--r--dmake/winnt/mingw/public.h167
-rw-r--r--dmake/winnt/mingw/sysintf.h62
-rw-r--r--dmake/winnt/msvc6/public.h167
-rw-r--r--dmake/winnt/msvc6/sysintf.h62
-rw-r--r--dmake/winnt/startup.h29
627 files changed, 88327 insertions, 0 deletions
diff --git a/dmake/.gitignore b/dmake/.gitignore
new file mode 100644
index 000000000000..addefdaaee95
--- /dev/null
+++ b/dmake/.gitignore
@@ -0,0 +1,11 @@
+Makefile
+.deps
+*.o
+/config.h
+/config.log
+/config.status
+/dmake
+/dmakeroot.h
+/stamp-h1
+/startup/config.mk
+/*/.dirstamp
diff --git a/dmake/AUTHORS b/dmake/AUTHORS
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/dmake/AUTHORS
diff --git a/dmake/COPYING b/dmake/COPYING
new file mode 100755
index 000000000000..e5b17204a708
--- /dev/null
+++ b/dmake/COPYING
@@ -0,0 +1,37 @@
+--
+-- SYNOPSIS
+--
+--
+-- DESCRIPTION
+--
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@wticorp.com
+-- Web Tools International, Long Beach, CA, USA
+-- http://dmake.wticorp.com/
+--
+-- WWW
+-- Public: http://dmake.wticorp.com/
+-- Private: http://software.wticorp.com/dmake/
+--
+-- COPYRIGHT
+-- Copyright (c) 1992,1994 by Dennis Vadura. All rights reserved.
+-- Copyright (c) 1996 by WTI Corp. All rights reserved.
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- (version 1), as published by the Free Software Foundation, and
+-- found in the file 'license.txt' included with this distribution.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warrant of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program in readme/license.txt; if not, write to
+-- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+-- Boston, MA 02111-1307, USA.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
diff --git a/dmake/ChangeLog b/dmake/ChangeLog
new file mode 100755
index 000000000000..f5a680eedacf
--- /dev/null
+++ b/dmake/ChangeLog
@@ -0,0 +1,4259 @@
+2008-02-26 18:37 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.tf,
+ win95/microsft/config.h, winnt/microsft/config.h, man/dmake.nc:
+
+ #i83497# Release dmake 4.12.
+
+2008-02-07 14:50 vq
+
+ * function.c, sysintf.c, man/dmake.nc, man/dmake.tf:
+
+ #i83940# Make the result of $(mktmp ..) aware of the .WINPATH setting.
+
+2008-02-07 10:42 vq
+
+ * dmake.c:
+
+ #i85136# The content of INCFILENAME needs no further expansion.
+
+2008-02-07 10:28 vq
+
+ * dmake.c:
+
+ #i85136# Prevent filenames from being expanded if they already are.
+
+2008-02-06 17:22 vq
+
+ * dmake.c:
+
+ #i85136# Do not expand ABSMAKECMD and MAKECMD macros.
+
+2008-02-05 17:02 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-30:
+
+ #i84800# Add testcase.
+
+2008-02-04 16:05 vq
+
+ * make.c:
+
+ #i85381# Fix possible heap corruption for the cygwin dmake version.
+
+2008-01-22 00:34 vq
+
+ * unix/runargv.c:
+
+ #i83540# Separate error handling from pid.
+
+2008-01-07 20:36 vq
+
+ * unix/runargv.c:
+
+ #i83540# Add diagnostics for WaitForMultipleObjects() calls.
+
+2008-01-07 19:31 vq
+
+ * quit.c:
+
+ #i83540# Prevent possible invinite loop when aborting.
+
+2008-01-07 01:07 vq
+
+ * path.c:
+
+ #i84800# Do not collaps the foo/.. entries if foo is '.' or '..'.
+
+2008-01-06 16:21 vq
+
+ * make.c, unix/runargv.c:
+
+ #i85014# Let master targets for targets with multiple (::) rules inherit
+ the newest time stamp of their "sub"-rules.
+ Make runargv() indicate that it finished the command when it had to wait
+ for its completion.
+
+2007-11-28 15:18 vq
+
+ * win95/microsft/config.mk:
+
+ #i83540# Fix dmake's own makefile to build itself.
+
+2007-11-27 23:08 vq
+
+ * Makefile.am, Makefile.in, msdos/rmprq.c,
+ win95/microsft/vpp40/mk.bat:
+
+ #i83540# A parallel runargv needs a corresponding rmprq.
+
+2007-11-26 09:23 vq
+
+ * unix/runargv.c:
+
+ #i83540# Return the pid that was waited for.
+
+2007-11-25 22:37 vq
+
+ * unix/runargv.c:
+
+ #i83540# Fix handle inheritance for native W32 process spawning.
+
+2007-11-25 12:53 vq
+
+ * NEWS:
+
+ #i83540# Add NEWS entry about parallel builds with native W32 dmake.
+
+2007-11-22 10:27 vq
+
+ * unix/runargv.c:
+
+ #i83540# Avoid conflict on solaris, rename NOPID to DMNOPID.
+
+2007-11-11 19:12 vq
+
+ * dag.c, extern.h, imacs.c, sysintf.c, unix/runargv.c,
+ win95/microsft/config.mk, win95/microsft/ruletab.c,
+ win95/microsft/vpp40/mk.bat:
+
+ #i83540# Make dmake buildable with .NET 2003 again.
+
+2007-11-11 18:05 vq
+
+ * Makefile.am, Makefile.in, dag.c, dmake.c, extern.h, imacs.c,
+ sysintf.c, msdos/runargv.c, unix/runargv.c,
+ win95/microsft/ruletab.c:
+
+ #i83540# Enable parallel builds with native W32 dmake. (First MinGW only.)
+
+2007-11-10 19:19 vq
+
+ * sysintf.c:
+
+ #i83523# Post-rename clean up.
+
+2007-11-10 19:03 vq
+
+ * extern.h, function.c, msdos/borland/bcc30/config.h,
+ msdos/borland/bcc40/config.h, msdos/borland/bcc45/config.h,
+ msdos/borland/bcc50/config.h, msdos/borland/tcc20/config.h,
+ msdos/microsft/config.h, msdos/zortech/config.h,
+ os2/ibm/config.h, win95/borland/bcc50/config.h,
+ win95/microsft/config.h, winnt/borland/bcc50/config.h,
+ winnt/microsft/config.h:
+
+ #i83523# Rename macro PVOID to DMPVOID to avoid problems when including
+ windows.h.
+
+2007-11-09 20:54 vq
+
+ * unix/runargv.c:
+
+ #i10000# Small clean up.
+
+2007-11-09 10:50 vq
+
+ * NEWS, configure, configure.in, man/dmake.nc, man/dmake.tf,
+ readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i83497# Bump version to 4.12-cvs.
+
+2007-10-13 19:43 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.nc,
+ man/dmake.tf, win95/microsft/config.h, winnt/microsft/config.h:
+
+ #i79271# Release dmake 4.11.
+
+2007-10-13 18:27 vq
+
+ * tests/misc-20:
+
+ #i10000# Fix typo.
+
+2007-10-13 18:21 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-21:
+
+ #i81252# Add testcase.
+
+2007-10-11 16:57 vq
+
+ * tests/: function_macros-9, misc-9, targets-21, targets-26,
+ targets-27:
+
+ #i50092# Work around Solaris and nfs timing issues.
+ Patch from hjs@openoffice.org.
+
+2007-10-11 16:36 vq
+
+ * make.cmd:
+
+ #i81855# Add a comment about building dmake on OS/2.
+
+2007-10-06 10:33 vq
+
+ * msdos/runargv.c, tests/recipes-9, unix/runargv.c:
+
+ #i80598# Always issue a warning if the actual execution of a recipe line
+ (this does not include sucessfully executed, but failing programs) fails.
+
+2007-09-24 17:45 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-29:
+
+ #i80012# Add testcase.
+
+2007-09-24 13:51 vq
+
+ * unix/runargv.c:
+
+ #i80012# Fix crash when deleting intermediate targets.
+
+2007-09-23 18:12 vq
+
+ * Makefile.in, configure:
+
+ #i81855# Regenerate configure and friends.
+
+2007-09-23 18:05 vq
+
+ * configure.in, dmake.c, expand.c, extern.h, make.cmd, path.c,
+ sysintf.c, startup/unix/os2/Makefile.am,
+ startup/unix/os2/Makefile.in, startup/unix/os2/macros.mk,
+ unix/os2/public.h:
+
+ #i81855# More changes for the OS/2 port.
+ Patch provided by Yuri Dario.
+
+2007-09-22 19:11 vq
+
+ * configure:
+
+ #i81855# Regenerate configure and friends.
+
+2007-09-22 19:05 vq
+
+ * NEWS, imacs.c, os2/sysintf.h, unix/dcache.c, unix/dirbrk.c,
+ unix/sysintf.h:
+
+ #i81855# Clean-up merge from CWS os2port01.
+
+2007-09-22 18:27 vq
+
+ * make.cmd:
+
+ #i81855# Revert change to make.cmd as it refers to a non-existing script
+ in dmake\os2\gcc\emx\mk.cmd.
+
+2007-09-22 18:08 vq
+
+ * unix/runargv.c:
+
+ RESYNC: (1.11-1.12); FILE MERGED
+
+2007-09-22 18:08 vq
+
+ * os2/ruletab.c:
+
+ RESYNC: (1.2-1.3); FILE MERGED
+
+2007-09-22 18:08 vq
+
+ * expand.c:
+
+ RESYNC: (1.6-1.7); FILE MERGED
+
+2007-09-22 18:08 vq
+
+ * dmake.c, sysintf.c:
+
+ RESYNC: (1.10-1.11); FILE MERGED
+
+2007-09-22 18:08 vq
+
+ * configure.in:
+
+ RESYNC: (1.29-1.30); FILE MERGED
+
+2007-09-21 20:46 vq
+
+ * NEWS:
+
+ #i79271# Update NEWS file.
+
+2007-09-21 19:14 vq
+
+ * dmake.c:
+
+ #i81296# Change comment.
+
+2007-09-19 21:50 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i81252# Restore alphabetical order.
+
+2007-09-18 21:03 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i81252# Add documentation for the SHELLCMDQUOTE macro.
+
+2007-09-18 20:34 vq
+
+ * getinp.c, imacs.c, make.c, sysintf.c, vextern.h, mac/public.h,
+ msdos/runargv.c, msdos/spawn.c, msdos/borland/bcc30/public.h,
+ msdos/borland/bcc40/public.h, msdos/borland/bcc45/public.h,
+ msdos/borland/bcc50/public.h, msdos/borland/tcc20/public.h,
+ msdos/microsft/msc51/public.h, msdos/microsft/msc60/public.h,
+ msdos/zortech/public.h, os2/ibm/icc/public.h,
+ os2/ibm/icc3/public.h, qssl/public.h, qssl/runargv.c,
+ startup/win95/macros.mk, startup/winnt/macros.mk, tos/public.h,
+ unix/runargv.c, unix/386ix/public.h, unix/bsd43/public.h,
+ unix/bsd43/uw/public.h, unix/bsd43/vf/public.h,
+ unix/bsdarm32/public.h, unix/coherent/ver40/public.h,
+ unix/coherent/ver42/public.h, unix/cygwin/public.h,
+ unix/linux/gnu/public.h, unix/macosx/gnu/public.h,
+ unix/solaris/public.h, unix/solaris/gnu/public.h,
+ unix/sysvr1/public.h, unix/sysvr3/public.h,
+ unix/sysvr3/gnu/public.h, unix/sysvr3/pwd/public.h,
+ unix/sysvr4/public.h, unix/xenix/public.h,
+ unix/xenix/pwd/public.h, win95/borland/bcc50/public.h,
+ win95/microsft/vpp40/public.h, winnt/borland/bcc50/public.h,
+ winnt/microsft/vpp40/public.h, winnt/mingw/public.h,
+ winnt/msvc6/public.h:
+
+ #i81252# Add a new SHELLCMDQUOTE control macro.
+
+2007-09-17 18:24 vq
+
+ * tests/: function_macros-8, macros-7:
+
+ #i78776# Fix testcases for non-cygwin OS.
+
+2007-09-16 12:35 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-20:
+
+ #i81296# Add testcases.
+
+2007-09-16 00:10 vq
+
+ * tests/macros-11:
+
+ #i74007# Change testcase.
+
+2007-09-15 23:57 vq
+
+ * dmake.c, mac/ruletab.c, man/dmake.nc, man/dmake.tf,
+ msdos/ruletab.c, os2/ruletab.c, unix/ruletab.c,
+ win95/borland/ruletab.c, win95/microsft/ruletab.c,
+ winnt/borland/ruletab.c, winnt/microsft/ruletab.c:
+
+ #i74007# Revert the part of the previous patch that lets OOODMAKEMODE
+ always be imported from the environment. Instead move the definition
+ of targets from the command line after the evaluation of the startup
+ makefile.
+
+2007-09-15 23:16 vq
+
+ * tests/macros-11:
+
+ #i74007# Add testcase.
+
+2007-09-15 23:06 vq
+
+ * man/dmake.nc:
+
+ #i74007# Update text version of the man page.
+
+2007-09-15 23:03 vq
+
+ * dmake.c, mac/ruletab.c, man/dmake.tf, msdos/ruletab.c,
+ os2/ruletab.c, unix/ruletab.c, win95/borland/ruletab.c,
+ win95/microsft/ruletab.c, winnt/borland/ruletab.c,
+ winnt/microsft/ruletab.c:
+
+ #i74007# Always import OOODMAKEMODE from the environment. Define targets from
+ the command line after the macros from the command line and OOODMAKEMODE
+ from the environment are set.
+
+2007-09-13 23:40 vq
+
+ * dmake.c, extern.h, make.c, rulparse.c:
+
+ #i81296# Clear flags indicating that targets that infered makefiles (and
+ their prerequisites) were previously build.
+
+2007-09-13 20:08 vq
+
+ * dmake.h, rulparse.c:
+
+ #i81296# Remove bit recycling for F_VISITED/F_USED. Use only F_VISITED.
+
+2007-09-09 15:11 vq
+
+ * quit.c:
+
+ #i81273# Fixed another MinGW build problem.
+
+2007-09-08 14:20 vq
+
+ * make.c, rulparse.c:
+
+ #i10000# Add some output for .INCLUDE operations when the -vf verbose
+ flag is given.
+
+2007-09-06 10:53 vq
+
+ * quit.c:
+
+ #i81273# Fix MinGW build problem.
+
+2007-09-02 06:57 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-19:
+
+ #i67911# Add testcase.
+
+2007-09-02 06:44 vq
+
+ * make.c, sysintf.c, msdos/runargv.c, qssl/runargv.c,
+ unix/runargv.c, win95/microsft/vpp40/runargv.c,
+ winnt/microsft/vpp40/runargv.c:
+
+ #i67911# Wait with the deletion of temporary files until the target is
+ completely made.
+
+2007-08-31 01:24 vq
+
+ * sysintf.c, man/dmake.nc, man/dmake.tf, tests/targets-21,
+ tests/targets-28:
+
+ #i64572# Issue a warning for virtual targets with corresponding files.
+ Update testcases.
+
+2007-08-30 05:13 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i64572# Add documentation.
+
+2007-08-28 22:27 vq
+
+ * tests/Makefile.am:
+
+ #i64234# Also change Makefile.am.
+
+2007-08-28 22:25 vq
+
+ * tests/: Makefile.in, function_macros-10:
+
+ #i64234# Add testcase.
+
+2007-08-28 14:28 vq
+
+ * function.c, man/dmake.nc, man/dmake.tf:
+
+ #i64234# Fix $(mktmp ..) handling of leading spaces.
+
+2007-08-26 18:22 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-11:
+
+ #i74007# Add testcase.
+
+2007-08-25 16:50 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-28:
+
+ #i64572# Add testcases.
+
+2007-08-25 15:34 vq
+
+ * make.c, sysintf.c:
+
+ #i64572# If a target without recipes has an existing file use its time
+ stamp only if the time is newer than the one of the its newest prerequisite.
+
+2007-08-22 10:02 vq
+
+ * sysintf.c:
+
+ #i64572# Fix the F_RULES problem mentioned before.
+
+2007-08-21 11:09 vq
+
+ * make.c, sysintf.c:
+
+ #i64572# To keep the dependency chains intact targets without recipes inherit
+ the time of their newest prerequisite. (Additional patches are needed as
+ currently the F_RULES flag is not always set correctly.)
+
+2007-08-19 20:05 vq
+
+ * sysintf.c:
+
+ #i64572# Assumes that targets without recipe lines have a current time
+ stamp after they were made (independent of the actual time stamp of the
+ file.
+
+2007-08-18 18:23 vq
+
+ * make.c, sysintf.c:
+
+ #i64572# Make dmake warn if the time stamp of a target is not updated
+ after making the target. This warning can be silenced using the
+ .SILENT attribute.
+
+2007-08-17 23:21 vq
+
+ * make.c:
+
+ #i10000# Remove unused variable.
+
+2007-08-17 23:16 vq
+
+ * dmake.h, make.c, sysintf.c:
+
+ #i10000# Add some comments.
+
+2007-08-15 17:46 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-27:
+
+ #i80687# Add testcase.
+
+2007-08-15 17:25 vq
+
+ * make.c:
+
+ #i80687# Fix building of inferred phony prerequisites.
+
+2007-08-14 13:55 vq
+
+ * make.c:
+
+ #i64572# Revert previous patch.
+
+2007-08-13 11:33 vq
+
+ * make.c:
+
+ #i64572# Make dmake warn if the time stamp of a target is not updated
+ after making the target.
+
+2007-08-11 17:23 vq
+
+ * tests/: Makefile.am, Makefile.in, recipes-9:
+
+ #i80598# Add testcase.
+
+2007-08-11 16:52 vq
+
+ * unix/runargv.c:
+
+ #i80598# Fix handling of ignored errors in the spawn enabled version
+ of dmake.
+
+2007-08-10 13:59 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-26:
+
+ #i66751# Add testcase.
+
+2007-08-10 13:39 vq
+
+ * infer.c:
+
+ #i66751# Make sure that infered phony %-targets do not have a time stamp.
+
+2007-08-10 11:42 vq
+
+ * infer.c, man/dmake.nc, man/dmake.tf:
+
+ #i66751# Accept .PHONY attribute in %-targets.
+
+2007-08-09 15:46 vq
+
+ * macparse.c:
+
+
+ #i69510# Change error on assignment to an empty macro name to a warning.
+
+2007-08-08 22:00 vq
+
+ * tests/: Makefile.am, Makefile.in, recipes-8:
+
+ #i67709# Add testcase.
+
+2007-08-08 21:43 vq
+
+ * parse.c, rulparse.c:
+
+ #i67709# Improve parsing of group recipes.
+
+2007-08-08 13:49 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-10:
+
+ #i69510# Add testcase.
+
+2007-08-08 12:54 vq
+
+ * macparse.c:
+
+ #i69510# Improve error message.
+
+2007-08-08 12:52 vq
+
+ * macparse.c:
+
+ #i69510# Improve macro name syntax check during assignment.
+
+2007-08-06 21:54 vq
+
+ * rulparse.c, man/dmake.nc, man/dmake.tf:
+
+ #i66448# Clarify prerequisites for %-targets.
+
+2007-08-05 17:10 vq
+
+ * function.c, tests/Makefile.am, tests/Makefile.in,
+ tests/function_macros-9:
+
+ #i50092# Enhance $(shell,expand .. ) parsing. Add testcase.
+
+2007-08-05 14:55 vq
+
+ * make.c:
+
+ #i70168# Clear F_MARK flag after dynamic prerequisite expansion is done.
+
+2007-08-05 13:51 vq
+
+ * infer.c:
+
+ #i80144# Clean-up.
+
+2007-08-05 13:03 vq
+
+ * infer.c, tests/targets-24:
+
+ #i80144# Change error about ambigous inference targets to warning.
+
+2007-08-04 14:56 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-25:
+
+ #i80352# Add testcase.
+
+2007-08-04 14:42 vq
+
+ * make.c:
+
+ #i80352# Fix .PRECIOUS attribute.
+
+2007-08-04 00:15 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-23, targets-24:
+
+ #i80144# Add testcases.
+
+2007-07-31 20:45 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-22:
+
+ #i80143# Add testcase.
+
+2007-07-31 20:29 vq
+
+ * infer.c:
+
+ #i80143# Fix problem marking some intermediate targets removable.
+
+2007-07-30 22:23 vq
+
+ * expand.c:
+
+ #i80009# Add missing string initialization.
+
+2007-07-29 22:28 vq
+
+ * infer.c:
+
+ #i80144# Improve check for ambiguous inference chains.
+
+2007-07-29 12:10 vq
+
+ * infer.c, stat.c:
+
+ #i10000# Add comments to documents aspects of the inference mechanism.
+
+2007-07-28 13:12 vq
+
+ * configure, configure.in:
+
+ #i79815# Fix default DMAKEROOT macro value.
+
+2007-07-27 22:03 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-21:
+
+ #i78837# Add testcase.
+
+2007-07-27 21:37 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-9:
+
+ #i80010# Add testcase.
+
+2007-07-27 15:47 vq
+
+ * expand.c:
+
+ #i80010# Keep quotes for :1 and :i macro extensions.
+
+2007-07-27 15:16 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-8:
+
+ #i80009# Add testcase.
+
+2007-07-27 13:06 vq
+
+ * NEWS, man/dmake.nc, man/dmake.tf:
+
+ #i78776# Document new normalizing function macro and macro extension.
+
+2007-07-26 18:27 vq
+
+ * expand.c:
+
+ #i80009# Fix handling of quoted filenames for :b :d :e :f macro expansions.
+
+2007-07-24 20:31 vq
+
+ * tests/: Makefile.am, Makefile.in, function_macros-8, macros-7:
+
+ #i78776# Add testcases.
+
+2007-07-24 19:00 vq
+
+ * dag.c, dmake.h, expand.c, extern.h, function.c, path.c:
+
+ #i78776# New function macro $(normpath[,para] list) to normalise the
+ elements of list and a macro extension $(macro_name:n) to normalise
+ the content of macro_name. The normalization is done token-wise and
+ quotes are preserved.
+ On cygwin the result honors the setting of .WINPATH to determine the
+ output format. If the optional parameter para is given in the
+ $(normpath ...) case its expanded value is used to override the
+ .WINPATH setting for the output of the function macro.
+
+2007-07-12 18:59 vq
+
+ * make.c, tests/Makefile.am, tests/Makefile.in, tests/targets-20:
+
+ #i69462# Do not assume that non-existing prerequisites for %-targets have
+ the same time stamp as the parent target. Testcase added.
+
+2007-07-05 17:17 vq
+
+ * getinp.c:
+
+ #i79200# Remove unneeded error on defined or DEFINED after .IF expression.
+
+2007-07-05 11:58 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.nc,
+ man/dmake.tf, readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i79271# Bump version to 4.11-cvs.
+
+2007-06-25 18:11 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.nc,
+ man/dmake.tf, readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i78508# Release dmake 4.9.
+
+2007-06-22 16:47 vq
+
+ * man/dmake.nc, man/dmake.tf, tests/Makefile.am, tests/Makefile.in,
+ tests/targets-19:
+
+ #i78061# Add testcase and documentation.
+
+2007-06-22 13:36 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i74007# Add documentation to manpage.
+
+2007-06-21 16:28 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-18:
+
+ #i74007# Add testcase.
+
+2007-06-20 18:26 vq
+
+ * dag.c, imacs.c, path.c, vextern.h:
+
+ #i74700# Add a new special macro OOODMAKEMODE that is used to toggle
+ OOo build specific behavior. If OOODMAKEMODE is set (i.e. it begins with y)
+ the leading ./ of a path will no longer be removed.
+ This patch also fixes iz78061.
+
+2007-06-20 18:07 vq
+
+ * configure.in:
+
+ #i78152# Make dmake buildable on GNU/kFreeBSD.
+
+2007-06-17 23:56 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i78033# Document :i macro expansion.
+
+2007-04-24 13:42 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.nc,
+ man/dmake.tf, win95/microsft/config.h, winnt/microsft/config.h:
+
+ #i73700# Release dmake 4.8.
+
+2007-04-09 09:22 vq
+
+ * tests/misc-18:
+
+ #i73499# Fix bash syntax typo.
+
+2007-04-08 23:27 vq
+
+ * tests/misc-18:
+
+ #i73499# Make test work on Solaris.
+
+2007-04-08 23:06 vq
+
+ * make.c:
+
+ #i73499# Fix potential problem with m_at getting freed without being
+ initalized first.
+
+2007-03-27 13:21 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i10000# Fix typos in manual.
+ This patch was provided by shay@openoffice.org.
+
+2007-03-24 00:29 vq
+
+ * make.c, man/dmake.nc, man/dmake.tf:
+
+ #i75697# Document the special treatment of $? for the :! ruleop.
+
+2007-03-23 16:40 vq
+
+ * NEWS, man/dmake.nc, man/dmake.tf, tests/Makefile.am,
+ tests/Makefile.in, tests/misc-18:
+
+ #i73499# Add documentation and testcase.
+
+2007-03-19 00:58 vq
+
+ * sysintf.c:
+
+ #i73499# Restrict function to cygwin only use.
+
+2007-03-18 11:02 vq
+
+ * sysintf.c:
+
+ #i73499# Add missing include statement.
+
+2007-03-17 15:00 vq
+
+ * dag.c, dmake.c, dmake.h, dmdump.c, extern.h, getinp.c, imacs.c,
+ infer.c, make.c, rulparse.c, sysintf.c, vextern.h:
+
+ #i73499# Add new .WINPATH attribute to generate Windows style paths
+ (with regular slashes) instead of the default cygwin style (POSIX)
+ paths for dmake's dynamic macros.
+
+ This attribute is specific for cygwin dmake executables and non-cygwin
+ environments ignore this attribute.
+
+ The windows style paths use regular slashes ('/') instead of the
+ usual windows backslash ('\') as directory separator to avoid quoting
+ problems (It still is a cygwin dmake!) and cygwin as well as native
+ windows programs should have no problems using this (c:/foo/bar) path
+ representation.
+
+ The affected macros are $@, $*, $>, $?, $<, $&, $^ and $(PWD),
+ $(MAKEDIR) and $(TMD).
+
+ Examples:
+
+ Content of $(PWD) without .WINPATH (default): /cygdrive/c/temp
+
+ Content of $(PWD) with .WINPATH set: c:/temp
+
+2007-03-16 22:36 vq
+
+ * sysintf.c:
+
+ #i10000# Trivial fix.
+
+2007-03-13 20:51 vq
+
+ * sysintf.c, unix/rmprq.c:
+
+ #i10000# No real change, only comments were added or modified.
+
+2007-01-29 23:24 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i73996# Update man page.
+
+2007-01-29 21:39 vq
+
+ * make.c, path.c, sysintf.c, vextern.h:
+
+ #i73996# Avoid relative paths going up to the root directory.
+
+2007-01-26 19:51 vq
+
+ * dag.c, imacs.c, make.c:
+
+ #i739183 Mark the internal macros PWD, MAKEDIR and TMD as precious.
+ Also commit some small macro relates clean ups and comment changes.
+
+2007-01-22 21:49 vq
+
+ * dag.c:
+
+ #i10000# Remove warning and add error handling.
+
+2007-01-22 21:25 vq
+
+ * getinp.c, make.c:
+
+ #i10000# Small cosmetic changes.
+
+2007-01-21 18:21 vq
+
+ * configure, configure.in, path.c, man/dmake.nc, man/dmake.tf,
+ unix/dcache.c:
+
+ #i73661# Improve case insensitive directory caching on case sensitive
+ file systems but it is *not* recommended to to so. A comment was added
+ to the man page emphasizing this.
+
+2007-01-20 22:00 vq
+
+ * Makefile.in, configure, configure.in, man/dmake.nc, man/dmake.tf,
+ readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i73700# Bump version to 4.8-cvs.
+
+2007-01-27 20:53 vq
+
+ * configure, configure.in:
+
+ Masterfix from SRC680_m200. This patch fixes a MacOSX problem
+ encountered after integration into the OOo SRC680 master.
+
+2007-01-15 21:36 vq
+
+ * msdos/runargv.c:
+
+ #i61856# There is currently no parallel processing for the native W32 dmake.
+ Let Wait_for_child() always return -1 indicating that there is nothing to
+ wait for on this OS.
+
+2006-12-21 23:45 vq
+
+ * NEWS:
+
+ #i69952# Release dmake 4.7
+ (Some extra changes were done in CWS dmake47.)
+
+2006-12-21 23:36 vq
+
+ * unix/runargv.c:
+
+ #i61856# Remove another verbose debugging statement.
+
+2006-12-20 22:16 vq
+
+ * quit.c, sysintf.c, unix/runargv.c:
+
+ #i61856# Child process handling improvements.
+
+2006-12-06 17:09 vq
+
+ * dmake.c:
+
+ #i72337# Make dmake -V tell whether fork/exec or spawn is used.
+
+2006-12-02 14:35 vq
+
+ * tests/Makefile.am:
+
+ #i72210# Missed an autotool bit.
+
+2006-12-02 14:10 vq
+
+ * tests/Makefile.in, tests/recipes-7, unix/runargv.c:
+
+ #i72210# Add missing detail and a testcase.
+
+2006-12-02 13:25 vq
+
+ * unix/runargv.c:
+
+ #i72210# Teach spawn enabled dmake to honor the '-' recipe switch.
+
+2006-11-30 20:16 vq
+
+ * unix/runargv.c:
+
+ #i61856# Fix "Internal Error: Child is missing .." problem.
+
+2006-11-27 17:23 vq
+
+ * unix/runargv.c:
+
+ #i61856# Improve (dmake internal) process handling.
+
+2006-11-23 11:58 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.nc,
+ man/dmake.tf, win95/microsft/config.h, winnt/microsft/config.h:
+
+ #i69952# Release dmake 4.7.
+
+2006-11-21 06:50 hjs
+
+ * tests/: macros-6, misc-13:
+
+ small cleanup
+
+2006-11-20 20:32 vq
+
+ * tests/misc-13:
+
+ #i71777# Fix testcase - Only test the directory cache for case
+ insensitivity if the FS is also case insensitive.
+
+2006-11-20 12:16 vq
+
+ * tests/: misc-15, recipes-5, recipes-6:
+
+ #i71777# Solaris testcase fixes.
+
+2006-11-20 11:58 vq
+
+ * tests/macros-6:
+
+ #i71777# Fix testcase.
+
+2006-11-20 11:38 vq
+
+ * tests/recipes-6:
+
+ #i71422# Fix testcase.
+
+2006-11-19 16:10 vq
+
+ * man/dmake.nc, man/dmake.tf, tests/Makefile.am, tests/Makefile.in,
+ tests/misc-17:
+
+ #i71704# Add testcase and documentation.
+
+2006-11-19 00:27 vq
+
+ * dag.c, dmake.c, imacs.c, make.c, unix/runargv.c:
+
+ #i71704# Let the global .SEQUENTIAL attribute implicitely set MAXPROCESS=1
+ and disallow MAXPROCESS to be changed if the global .SEQUENTIAL is set.
+
+2006-11-17 18:09 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-16:
+
+ #i61856# Add testcase.
+
+2006-11-17 16:56 vq
+
+ * dmake.h, sysintf.c, unix/runargv.c:
+
+ #i61856# Implement better way to wait for a process queue to finish
+ without obstructing other process queues during parallel makefile
+ processing.
+
+2006-11-15 14:43 vq
+
+ * configure, configure.in, unix/runargv.c:
+
+ #i71582# Make dmake usable on OpenBSD. (Patch separated from CWS openbsd01)
+
+2006-11-13 15:39 vq
+
+ * tests/: Makefile.am, Makefile.in, recipes-5, recipes-6:
+
+ #i71422# Add testcases.
+
+2006-11-13 14:08 vq
+
+ * NEWS, man/dmake.nc, man/dmake.tf:
+
+ #i71422# Document new @@ recipe property.
+
+2006-11-12 00:25 vq
+
+ * Makefile.in, config.h.in, configure, configure.in,
+ startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/cygwin/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ tests/Makefile.in:
+
+ #i71422# Remove unused macro and regenerate autotools files.
+
+2006-11-12 00:06 vq
+
+ * dag.c, dmake.c, dmake.h, extern.h, function.c, getinp.c, make.c,
+ rulparse.c, sysintf.c, vextern.h, mac/public.h, msdos/runargv.c,
+ msdos/borland/bcc30/public.h, msdos/borland/bcc40/public.h,
+ msdos/borland/bcc45/public.h, msdos/borland/bcc50/public.h,
+ msdos/borland/tcc20/public.h, msdos/microsft/msc51/public.h,
+ msdos/microsft/msc60/public.h, msdos/zortech/public.h,
+ os2/ibm/icc/public.h, os2/ibm/icc3/public.h, qssl/public.h,
+ qssl/runargv.c, tos/public.h, unix/runargv.c,
+ unix/386ix/public.h, unix/bsd43/public.h, unix/bsd43/uw/public.h,
+ unix/bsd43/vf/public.h, unix/bsdarm32/public.h,
+ unix/coherent/ver40/public.h, unix/coherent/ver42/public.h,
+ unix/cygwin/public.h, unix/linux/gnu/public.h,
+ unix/macosx/gnu/public.h, unix/solaris/public.h,
+ unix/solaris/gnu/public.h, unix/sysvr1/public.h,
+ unix/sysvr3/public.h, unix/sysvr3/gnu/public.h,
+ unix/sysvr3/pwd/public.h, unix/sysvr4/public.h,
+ unix/xenix/public.h, unix/xenix/pwd/public.h,
+ win95/borland/bcc50/public.h, win95/microsft/vpp40/public.h,
+ winnt/borland/bcc50/public.h, winnt/microsft/vpp40/public.h,
+ winnt/mingw/public.h, winnt/msvc6/public.h:
+
+ #i71422# Add a new feature: Using @@ as a recipe prefix redirects the
+ output (stdout and stderr) of a recipe to /dev/null (or NUL on W32)
+ completely suppressing the output of that recipe to the terminal.
+ As for the @ prefix this can be disabled using the -v[r] switch.
+
+2006-11-09 22:25 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-15:
+
+ #i69943# Add testcase to check directory caching with DOS style path
+ targets on cygwin dmake.
+
+2006-11-09 17:33 vq
+
+ * make.c, path.c:
+
+ #i69821# Fix/improve $(TMD) handling.
+
+2006-11-09 16:31 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-6:
+
+ #i69821# Add testcase to verify that .SETDIR works (with drive letters
+ on cygwin) and sets TMD correctly.
+
+2006-11-09 13:16 vq
+
+ * make.c:
+
+ #i69821# Add comment where TMD is detecting different drive letters for
+ native W32 dmake versions.
+
+2006-10-08 19:27 vq
+
+ * NEWS, make.c, tests/Makefile.am, tests/Makefile.in,
+ tests/targets-17:
+
+ #i70210# Fix dmakes handling of empty dynamic prerequisites.
+
+2006-10-08 18:57 vq
+
+ * make.c:
+
+ #i70168# Remove FIXME.
+
+2006-10-08 18:49 vq
+
+ * NEWS, imacs.c, make.c, rulparse.c, vextern.h, man/dmake.nc,
+ man/dmake.tf, tests/Makefile.am, tests/Makefile.in,
+ tests/targets-16:
+
+ #i70168# Improve $ handling in targets/prerequisites.
+
+2006-10-07 16:23 vq
+
+ * parse.c, tests/Makefile.am, tests/Makefile.in, tests/misc-14:
+
+ #i70027# Fix diagnostic output and add a testcase.
+
+2006-10-07 15:30 vq
+
+ * NEWS, man/dmake.nc, man/dmake.tf:
+
+ #i69742# Add NEWS file entry and mention normalization in the man page.
+
+2006-10-07 14:34 vq
+
+ * dag.c:
+
+ #i69742# Never normalize cells that contain a $ in the pathname.
+
+2006-10-06 22:28 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-15:
+
+ #i69742# Add testcase.
+
+2006-10-06 00:02 vq
+
+ * dag.c, make.c:
+
+ #i69742# Don't targets with $ in the filepath as dynamic macros. ($$ means
+ a single $ in the filepath.)
+
+2006-10-03 23:17 vq
+
+ * dag.c, sysintf.c:
+
+ #i69742# Enable normalization of targets and non-dynamic prerequisites.
+ (Dynamic prerequisites are prerequisites with not expanded macros.)
+
+2006-10-02 20:46 vq
+
+ * path.c:
+
+ #i69742# Fix problem when removing multiple '/'.
+
+2006-10-01 15:18 vq
+
+ * dmake.c, extern.h, path.c:
+
+ #i69742# Create Clean_path() function.
+
+2006-10-01 12:23 vq
+
+ * path.c, unix/dirbrk.c:
+
+ #i69742# Clean up/speed up Build_path().
+
+2006-09-30 11:01 vq
+
+ * mac/sysintf.h, msdos/sysintf.h, os2/sysintf.h, qssl/sysintf.h,
+ tos/sysintf.h, unix/sysintf.h, win95/borland/sysintf.h,
+ win95/microsft/sysintf.h, winnt/borland/sysintf.h,
+ winnt/microsft/sysintf.h, winnt/mingw/sysintf.h,
+ winnt/msvc6/sysintf.h:
+
+ #i69814# Remove the unused DMSTRLWR macro.
+
+2006-09-29 17:20 vq
+
+ * Makefile.in, autogen.sh, config.h.in, configure, configure.in,
+ extern.h, function.c, make.c, sysintf.c:
+
+ #i69953# Remove NO_DRIVE_LETTERS, use HAVE_DRIVE_LETTERS instead.
+
+2006-09-29 14:55 vq
+
+ * tests/macros-5:
+
+ #i69821# Fix testcase.
+
+2006-09-29 14:50 vq
+
+ * dmstring.c, extern.h, imacs.c, make.c, stat.c, man/dmake.nc,
+ man/dmake.tf, tests/Makefile.am, tests/Makefile.in,
+ tests/misc-13, unix/dcache.c, win95/microsft/config.h:
+
+ #i69814# Add/fix option to make directory cache case insensitive. (Make
+ this the default for Windows and Mac OS X.) Added testcase.
+
+2006-09-28 17:42 vq
+
+ * imacs.c, make.c, tests/Makefile.am, tests/Makefile.in,
+ tests/macros-5:
+
+ #i69821# Fix TMD macro and add testcase.
+
+2006-09-28 17:16 vq
+
+ * Makefile.am, Makefile.in, aclocal.m4, autogen.sh, compile,
+ config.guess, config.h.in, configure, configure.in, depcomp,
+ install-sh, missing, mkinstalldirs, msdos/Makefile.am,
+ msdos/Makefile.in, startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/cygwin/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ tests/Makefile.in, win95/Makefile.am, win95/Makefile.in,
+ win95/microsft/Makefile.am, win95/microsft/Makefile.in:
+
+ #i69953# Clean up of the autotooling.
+
+2006-09-28 13:33 vq
+
+ * Makefile.in, configure, configure.in, man/dmake.nc, man/dmake.tf,
+ readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i69952# Bump version to 4.7-cvs.
+
+2006-09-24 19:57 vq
+
+ * tests/targets-12:
+
+ #i69818# Fix testcase.
+
+2006-09-21 16:57 vq
+
+ * Makefile.in, NEWS, configure, configure.in, man/dmake.nc,
+ man/dmake.tf, win95/microsft/config.h, winnt/microsft/config.h:
+
+ #i67689# Release dmake 4.6.
+
+2006-09-21 12:24 vq
+
+ * expand.c:
+
+ #i69743# Optimize expand.c:Apply_edit().
+
+2006-09-20 13:32 vq
+
+ * rulparse.c:
+
+ #i66567# Show the ".SUFFIXES target has no special meaning" warning only
+ if the -v[w] verbose flag is given.
+
+2006-09-14 12:40 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i69536# Make clear that .SUFFIXES is not supported by dmake.
+
+2006-08-29 13:08 vq
+
+ * function.c, sysintf.c:
+
+ #i69071# Don't use umask for the native W32 dmake.
+
+2006-08-21 00:22 vq
+
+ * dmake.h, make.c, rulparse.c, unix/runargv.c:
+
+ #i10000# Add some code comments.
+
+2006-08-20 13:30 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i64569# Improve documentation of the handling of continued makefile lines.
+
+2006-08-15 14:12 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-4:
+
+ #i44961# Add testcase.
+
+2006-08-15 14:11 vq
+
+ * expand.c:
+
+ #i44961# Reject single letter macros with (, {, ), } and : .
+
+2006-08-15 11:07 vq
+
+ * expand.c:
+
+ #i44961# Throw error if inclosed macro brackets are encountered.
+
+2006-08-14 16:35 vq
+
+ * unix/ruletab.c:
+
+ #i52590# Increase limit of parallel jobs for *NIX dmakes to 64.
+
+2006-07-30 23:35 vq
+
+ * function.c:
+
+ #i67585# Remove unneeded variable definitions.
+
+2006-07-30 22:47 vq
+
+ * function.c, sysintf.c, mac/public.h,
+ msdos/borland/bcc30/public.h, msdos/borland/bcc40/public.h,
+ msdos/borland/bcc45/public.h, msdos/borland/bcc50/public.h,
+ msdos/borland/tcc20/public.h, msdos/microsft/msc51/public.h,
+ msdos/microsft/msc60/public.h, msdos/zortech/public.h,
+ os2/ibm/icc/public.h, os2/ibm/icc3/public.h, qssl/public.h,
+ tos/public.h, unix/386ix/public.h, unix/bsd43/public.h,
+ unix/bsd43/uw/public.h, unix/bsd43/vf/public.h,
+ unix/bsdarm32/public.h, unix/coherent/ver40/public.h,
+ unix/coherent/ver42/public.h, unix/cygwin/public.h,
+ unix/linux/gnu/public.h, unix/macosx/gnu/public.h,
+ unix/solaris/public.h, unix/solaris/gnu/public.h,
+ unix/sysvr1/public.h, unix/sysvr3/public.h,
+ unix/sysvr3/gnu/public.h, unix/sysvr3/pwd/public.h,
+ unix/sysvr4/public.h, unix/xenix/public.h,
+ unix/xenix/pwd/public.h, win95/borland/bcc50/public.h,
+ win95/microsft/vpp40/public.h, winnt/borland/bcc50/public.h,
+ winnt/microsft/vpp40/public.h, winnt/mingw/public.h,
+ winnt/msvc6/public.h:
+
+ #i64583# Remove unused parameter from Create_temp() and Get_temp().
+
+2006-07-29 21:47 vq
+
+ * tests/: Makefile.am, Makefile.in, recipes-3, recipes-4:
+
+ #i67589# Add testcases for builtin commands.
+
+2006-07-28 21:55 vq
+
+ * NEWS, man/dmake.nc, man/dmake.tf:
+
+ #i67589# Add documentation and NEWS file entry for builtin commands noop
+ and echo.
+
+2006-07-28 17:19 vq
+
+ * make.c, sysintf.c, unix/runargv.c:
+
+ #i67589# Add the internal commands noop and echo to the *nix version of
+ dmake. This functionality already existed for the native windows version.
+
+2006-07-26 21:10 vq
+
+ * sysintf.c, msdos/runargv.c, msdos/spawn.c:
+
+ #i67808# Fix the internal echo command of the native Windows dmake version.
+ The patch also moves the usage of the global variable Packed_shell to
+ msdos/runargv.c and msdos/spawn.c.
+
+2006-07-25 20:47 vq
+
+ * unix/runargv.c:
+
+ #i10000# Oops, the previous patch should not change this part.
+
+2006-07-25 20:20 vq
+
+ * sysintf.c, unix/runargv.c:
+
+ #i10000# Comment and whitespace changes only.
+
+2006-07-24 18:13 vq
+
+ * tests/: Makefile.am, Makefile.in, function_macros-7, recipes-2:
+
+ #i64583# Add testcase for $(mktmp ...) function macro and group recipe.
+
+2006-07-24 17:43 vq
+
+ * dag.c, function.c, sysintf.c:
+
+ #i64583# Let tempfiles generated by $(mktmp ..) always have 600 permissions.
+ Generate unique and secure tempfiles if a suffix is requested. (Needed for
+ group recipes.)
+
+2006-07-23 00:27 vq
+
+ * Makefile.in, configure, configure.in, man/dmake.nc, man/dmake.tf,
+ readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i67689# Bump version to 4.6-cvs.
+
+2006-07-23 00:05 vq
+
+ * NEWS:
+
+ #i67166# Mention the new warning in the NEWS file.
+
+2006-07-22 23:41 vq
+
+ * tests/: Makefile.am, Makefile.in, function_macros-6:
+
+ #i67585# Add a testcase.
+
+2006-07-22 23:17 vq
+
+ * function.c, man/dmake.nc, man/dmake.tf:
+
+ #i67585# Fix $(nil ...) function macro.
+ The patch also removes some unneeded code from _exec_call() and adds some
+ extra documentation about function macros to the dmake man page.
+
+2006-07-21 23:48 vq
+
+ * dag.c, hash.c:
+
+ #i10000# Add some comments.
+
+2006-07-19 22:41 vq
+
+ * make.c, sysintf.c, msdos/runargv.c, unix/runargv.c:
+
+ #i10000# No code changes. Only comments were added/improved.
+
+2006-07-16 23:13 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-13, targets-14:
+
+ #i67166# Add testcases.
+
+2006-07-16 23:10 vq
+
+ * dag.c, dmake.c, dmake.h, expand.c, macparse.c:
+
+ #i67166# Make dmake issue a warning if a previously unset macro (i.e. it is
+ assumed to be empty) is used and later set to a different value.
+
+2006-07-10 17:01 vq
+
+ * NEWS, tests/Makefile.am, tests/Makefile.in, tests/targets-12:
+
+ #i66567# Add testcase and mention the new warning in the NEWS file.
+
+2006-07-10 16:46 vq
+
+ * rulparse.c, man/dmake.nc, man/dmake.tf:
+
+ #i66567# Deprecate the obsolete special target .SUFFIXES as it has no
+ special meaning.
+
+2006-07-09 21:38 vq
+
+ * NEWS, tests/Makefile.am, tests/Makefile.in, tests/targets-11:
+
+ #i67025# Add testcase and mention this bugfix in the NEWS file as it was
+ a regression in dmake 4.5 with respect to older versions.
+
+2006-07-09 21:08 vq
+
+ * rulparse.c:
+
+ #i67025# Fix problem of %-targets with attribute .SILENT and -vr verbose
+ flag.
+
+2006-06-22 16:48 vq
+
+ * NEWS:
+
+ #i66522# Release dmake 4.5
+ (Two more issues were added and fixed in CWS dmake45.)
+
+2006-06-22 16:45 vq
+
+ * tests/: infra-0, macros-1, macros-2, macros-3, misc-1, misc-10,
+ misc-11, misc-2, misc-3, misc-4, misc-5, misc-7, misc-8, misc-9,
+ recipes-1, targets-1, targets-10, targets-2, targets-3,
+ targets-4, targets-5, targets-6, targets-7, targets-8, targets-9:
+
+ #i66650# Make dmake testsuite more portable. (Usable with Solaris.)
+ Patch by hjs.
+
+2006-06-22 16:14 vq
+
+ * getinp.c, rulparse.c, tests/Makefile.am, tests/Makefile.in,
+ tests/misc-1, tests/misc-12:
+
+ #i66659# Fix evaluation of line continuations in conditional expressions
+ and add testcase.
+
+2006-06-20 10:20 vq
+
+ * Makefile.in, configure, configure.in, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i66522# Release dmake 4.5.
+
+2006-06-17 13:08 vq
+
+ * Makefile.in, configure, configure.in, readme/intro.txt,
+ readme/read1st.txt, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i66522# Increase version number in documentation files and set preliminary
+ dmake version to 4.5-cvs.
+
+2006-06-16 20:41 vq
+
+ * NEWS:
+
+ #i66522# Update NEWS file.
+
+2006-06-16 16:38 vq
+
+ * makefile.mk:
+
+ #i66509# Fix bug in makefile.
+
+2006-06-16 16:24 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i66522# Update manpage.
+
+2006-06-16 14:46 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-11:
+
+ #i65281# Add testcase.
+
+2006-06-16 14:31 vq
+
+ * getinp.c, man/dmake.nc, man/dmake.tf:
+
+ #i65281# Fix comparison with empty string.
+
+2006-06-14 22:42 vq
+
+ * unix/ruletab.c, win95/borland/ruletab.c,
+ win95/microsft/ruletab.c, winnt/borland/ruletab.c,
+ winnt/microsft/ruletab.c:
+
+ #i64889# Increase the default MAXLINELENGTH for all "modern" target OSs.
+
+ This patch was submitted by shay@openoffice.org.
+
+2006-06-14 18:43 vq
+
+ * man/dmake.nc, man/dmake.tf, tests/Makefile.am, tests/Makefile.in,
+ tests/targets-10, tests/targets-7, tests/targets-9:
+
+ #i48087# Add testcases and change man page.
+
+2006-06-13 19:52 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-8:
+
+ #i64331# Add testcase.
+
+2006-06-13 19:31 vq
+
+ * infer.c:
+
+ #i64431# Fix .SETDIR problem with percent targets.
+
+2006-06-13 15:06 vq
+
+ * Makefile.in, configure, configure.in:
+
+ #i64795# Fix typo in configure.in.
+
+2006-06-13 14:33 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-7:
+
+ #i65122# Add testcase.
+
+2006-06-13 13:14 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-6:
+
+ #i66385# Add testcase.
+
+2006-06-13 12:58 vq
+
+ * rulparse.c, man/dmake.nc, man/dmake.tf:
+
+ #i66385# Handle .<suffix> targets regardless of the AUGMAKE (-A) status.
+ Document this and regenerate man page.
+
+2006-06-13 11:03 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-5:
+
+ #i66083# Add testcase.
+
+2006-06-13 01:28 vq
+
+ * rulparse.c:
+
+ #i66083# Check that AUGMAKE meta targets are not mixed with normal targets.
+
+2006-06-03 23:30 vq
+
+ * rulparse.c:
+
+ #i48087# Only warn once about multiple prerequisites for %-targets.
+
+2006-06-03 21:55 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-4:
+
+ #i65360# Add testcase to check for message about empty recipe for
+ special or meta targets.
+
+2006-06-03 21:37 vq
+
+ * rulparse.c:
+
+ #i65360# Improve output of warning for special or meta targets without
+ recipe.
+
+2006-06-03 21:17 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-3:
+
+ #i65360# Add testcase that checks that a warning is issued when .<suffix>
+ targets are ignored.
+
+2006-06-03 20:34 vq
+
+ * tests/: Makefile.am, Makefile.in, targets-1, targets-2:
+
+ #i64869# Add testcases and regenerate autotools files.
+
+2006-05-17 17:44 vq
+
+ * Makefile.in, tests/Makefile.am, tests/Makefile.in,
+ tests/macros-3:
+
+ #i65333# Add testcase and regenerate autotools files.
+
+2006-05-17 00:04 vq
+
+ * man/dmake.tf:
+
+ #i65333# Elaborate on .<suffix> vs. special targets and .INIT and .DONE
+ that also begin with a dot.
+
+2006-05-15 23:43 vq
+
+ * man/dmake.tf:
+
+ #i65333# Collect .<suffix> description at one place in the man page.
+
+2006-05-15 18:50 vq
+
+ * man/dmake.tf:
+
+ #i48087# Document the current %-target handling.
+
+2006-05-14 13:06 vq
+
+ * rulparse.c:
+
+ #i65360# Fix typo.
+
+2006-05-14 12:58 vq
+
+ * rulparse.c:
+
+ #i65360# Warn if dmake ignores an illegal .<suffix> target but keep the
+ behavior of dmake 4.4 and earlier.
+
+2006-05-12 13:36 vq
+
+ * rulparse.c:
+
+ #i48087# Fix typo.
+
+2006-05-12 12:59 vq
+
+ * rulparse.c:
+
+ #i65333# Prevent .ROOT, .TARGETS, .INIT and .DONE from being treates as
+ special .<suffix> targets.
+
+2006-05-10 23:38 vq
+
+ * Makefile.in, man/dmake.nc, tests/Makefile.in:
+
+ #i65281# Regenerate autotools files and plain text version of manpage.
+
+2006-05-10 23:31 vq
+
+ * getinp.c, man/dmake.tf, tests/Makefile.am, tests/misc-10:
+
+ #i65281# Fix crash on numeric comparison and add testcase.
+
+2006-05-10 13:46 vq
+
+ * dmdump.c, rulparse.c, struct.h:
+
+ #i48087# Correct parsing of target definitions with multiple % targets and
+ prerequisites. Also add some comments.
+
+2006-05-05 17:33 vq
+
+ * dmake.h, infer.c, rulparse.c, struct.h, man/dmake.tf:
+
+ #i65122# Fix problem with "non-documented" handling of multiple %-targets
+ plus several improved comments and a man page correction.
+
+2006-05-03 17:47 vq
+
+ * dag.c, dmake.c, getinp.c, imacs.c, parse.c, rulparse.c,
+ vextern.h:
+
+ #i64869# Fix various parsing problems of target definitions and
+ add code comments.
+
+2006-03-31 11:04 vq
+
+ * Makefile.in, NEWS, configure, configure.in, readme/intro.txt,
+ readme/read1st.txt, readme/release.txt, win95/microsft/config.h:
+
+ #i63874# Release dmake 4.4
+ Update version numbers and regenerate autotool files.
+
+2006-03-15 09:43 vq
+
+ * unix/runargv.c:
+
+ #i61940# Add and correct some comments.
+
+2006-03-14 18:23 vq
+
+ * tests/: Makefile.am, Makefile.in, function_macros-5:
+
+ #i61940# Add testcase to check that $(shell ..) does not pick up output from
+ concurrent processes.
+
+2006-03-13 18:21 vq
+
+ * function.c, getinp.c, state.c, unix/arlib.c:
+
+ #i61390# Make dmake (gcc) build -Wall warning free.
+
+2006-03-01 22:46 vq
+
+ * rulparse.c:
+
+ #i61969# Clean F_MADE and F_STAT when recipes or prerequisites are changed
+ so that the target gets rebuild even if it was already build. (As a
+ generated .INCLUDE makefile.)
+
+2006-03-01 22:37 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-9:
+
+ #i61969# Commit testcase for this issue.
+
+2006-02-26 18:33 vq
+
+ * dmake.c:
+
+ #i62118# Fix invalid detection of circular dependencies arising from F_VISITED
+ and F_USED both having the same value but being used in different contexts.
+
+2006-02-26 17:46 vq
+
+ * tests/: Makefile.am, Makefile.in, misc-8:
+
+ #i62118# Add testcase for issue 62118.
+
+2006-02-26 17:23 vq
+
+ * tests/macros-2:
+
+ #i61170# Fix testcase to remove the created "dirwith space" directory.
+
+2006-02-21 18:06 vq
+
+ * unix/runargv.c:
+
+ #i61940# Remove the #undef that unconditionally disabled the use of spawn.
+
+2006-02-11 19:47 vq
+
+ * config.h.in, configure, configure.in, unix/runargv.c:
+
+ #i61940# Enable the alternative use of spawn instead of fork/exec for
+ dmake. Add the configure option --enable-spawn. Regenerate autotool files.
+
+2006-02-06 18:06 vq
+
+ * Makefile.in, man/dmake.tf, tests/Makefile.am, tests/Makefile.in,
+ tests/misc-7:
+
+ #i61714# Correct manpage to state that the usage of .SETDIR like
+ `.SETDIR=foo : targets` is valid and add a testcase to verify this.
+
+2006-02-04 23:02 vq
+
+ * man/dmake.nc:
+
+ #i61170# Regenerate plain text version of the dmake man page.
+
+2006-02-03 14:46 vq
+
+ * NEWS, make.c, makefile.mk, man/dmake.tf:
+
+ #i61170# Let $(TMD)/somedir always be a valid path.
+ Adjust the dmake bootstrap makefile to this change.
+
+2006-02-01 23:50 vq
+
+ * dmake.c:
+
+ #i47919# Fix typo.
+
+2006-02-01 23:39 vq
+
+ * dmake.c, quit.c, sysintf.c, mac/public.h,
+ msdos/borland/bcc30/public.h, msdos/borland/bcc40/public.h,
+ msdos/borland/bcc45/public.h, msdos/borland/bcc50/public.h,
+ msdos/borland/tcc20/public.h, msdos/microsft/msc51/public.h,
+ msdos/microsft/msc60/public.h, msdos/zortech/public.h,
+ os2/ibm/icc/public.h, os2/ibm/icc3/public.h, qssl/public.h,
+ tos/public.h, unix/386ix/public.h, unix/bsd43/public.h,
+ unix/bsd43/uw/public.h, unix/bsd43/vf/public.h,
+ unix/bsdarm32/public.h, unix/coherent/ver40/public.h,
+ unix/coherent/ver42/public.h, unix/cygwin/public.h,
+ unix/linux/gnu/public.h, unix/macosx/gnu/public.h,
+ unix/solaris/public.h, unix/solaris/gnu/public.h,
+ unix/sysvr1/public.h, unix/sysvr3/public.h,
+ unix/sysvr3/gnu/public.h, unix/sysvr3/pwd/public.h,
+ unix/sysvr4/public.h, unix/xenix/public.h,
+ unix/xenix/pwd/public.h, win95/borland/bcc50/public.h,
+ win95/microsft/vpp40/public.h, winnt/borland/bcc50/public.h,
+ winnt/microsft/vpp40/public.h, winnt/mingw/public.h,
+ winnt/msvc6/public.h:
+
+ #i47919# Use the correct handler function for the signal() handling.
+
+2006-02-01 18:37 vq
+
+ * man/dmake.nc:
+
+ #i60948# Regenerate plain text version of the dmake man page.
+
+2006-02-01 18:28 vq
+
+ * Makefile.in, NEWS, config.h.in, configure, configure.in, dmake.c,
+ dmake.h, function.c, make.c, sysintf.c, vextern.h, mac/public.h,
+ man/dmake.tf, msdos/runargv.c, msdos/borland/bcc30/public.h,
+ msdos/borland/bcc40/public.h, msdos/borland/bcc45/public.h,
+ msdos/borland/bcc50/public.h, msdos/borland/tcc20/public.h,
+ msdos/microsft/msc51/public.h, msdos/microsft/msc60/public.h,
+ msdos/zortech/public.h, os2/ibm/icc/public.h,
+ os2/ibm/icc3/public.h, qssl/public.h, tos/public.h,
+ unix/runargv.c, unix/386ix/public.h, unix/bsd43/public.h,
+ unix/bsd43/uw/public.h, unix/bsd43/vf/public.h,
+ unix/bsdarm32/public.h, unix/coherent/ver40/public.h,
+ unix/coherent/ver42/public.h, unix/cygwin/public.h,
+ unix/linux/gnu/public.h, unix/macosx/gnu/public.h,
+ unix/solaris/public.h, unix/solaris/gnu/public.h,
+ unix/sysvr1/public.h, unix/sysvr3/public.h,
+ unix/sysvr3/gnu/public.h, unix/sysvr3/pwd/public.h,
+ unix/sysvr4/public.h, unix/xenix/public.h,
+ unix/xenix/pwd/public.h, win95/borland/bcc50/public.h,
+ win95/microsft/vpp40/public.h, winnt/borland/bcc50/public.h,
+ winnt/microsft/vpp40/public.h, winnt/mingw/public.h,
+ winnt/msvc6/public.h:
+
+ #i60948# Add -m option family to generate timing information for targets
+ and/or recipes. (Autotools files were regenerated.)
+
+2006-02-01 17:08 vq
+
+ * tos/public.h, unix/arlib.c, unix/386ix/public.h,
+ unix/bsd43/public.h, unix/bsd43/uw/public.h,
+ unix/bsd43/vf/public.h, unix/bsdarm32/public.h,
+ unix/coherent/ver40/public.h, unix/coherent/ver42/public.h,
+ unix/cygwin/public.h, unix/linux/gnu/public.h,
+ unix/macosx/gnu/public.h, unix/solaris/public.h,
+ unix/solaris/gnu/public.h, unix/sysvr1/public.h,
+ unix/sysvr3/public.h, unix/sysvr3/gnu/public.h,
+ unix/sysvr3/pwd/public.h, unix/sysvr4/public.h,
+ unix/xenix/public.h, unix/xenix/pwd/public.h:
+
+ #i61390# Add missing prototypes.
+
+2006-01-31 23:18 vq
+
+ * man/dmake.tf:
+
+ #i10000# Small documentation fix.
+
+2006-01-30 15:28 vq
+
+ * quit.c, unix/cygwin/public.h:
+
+ #i61390# Add some missing prototypes to dmake/unix/cygwin/public.h and
+ also revert the copyright disclaimer to the original version. This file
+ is supposed to be auto generated and identical to:
+ dmake/unix/linux/gnu/cygwin/public.h.
+
+2006-01-26 20:22 vq
+
+ * tests/: Makefile.am, Makefile.in, macros-2:
+
+ #i61170# Add testcase and regenerate autotools files.
+
+2006-01-26 20:16 vq
+
+ * make.c:
+
+ #i61170# Add micro optimization as usually PWD is equal to MAKEDIR.
+
+2006-01-25 21:54 vq
+
+ * Makefile.in, config.h.in, configure, configure.in, make.c:
+
+ #i61170# Fix TMD macro and regenerate autotool files.
+
+2006-01-25 21:09 vq
+
+ * configure.in:
+
+ #i53148# Treat MinGW build like MSVC build.
+
+2006-01-11 12:46 rene
+
+ * config.guess, config.sub:
+
+ #i60375# update config.{sub,guess}
+
+2006-01-08 17:20 vq
+
+ * Makefile.in, configure, configure.in:
+
+ #i60168# Expand internal configure variable before using it and
+ regenerate autotool files.
+
+2006-01-08 16:44 vq
+
+ * Makefile.in, configure:
+
+ #i60168# Regenerate autotool files.
+
+2006-01-08 16:37 vq
+
+ * configure.in:
+
+ #i60168# Use the --datadir swich to determine where the startup dir is
+ placed and adapt the default DMAKEROOT macro setting accordingly.
+
+2006-01-05 20:35 vq
+
+ * tests/Makefile.in:
+
+ #i58259# Regenerate autotool files.
+
+2006-01-05 20:24 vq
+
+ * tests/: misc-6, Makefile.am:
+
+ #i58259# Add testcase.
+
+2006-01-03 23:07 vq
+
+ * make.c:
+
+ #i58259# Fix thinko and solve the problems with all testcases from the
+ issue.
+
+2006-01-03 21:13 vq
+
+ * make.c, dmake.h:
+
+ #i58259# Partial fix. This fixes the use of dp after it was freed.
+
+2005-12-15 15:04 vq
+
+ * sysintf.c:
+
+ #i58391# Create better temporary filenames when .NET2003 or newer are used.
+
+2005-10-25 13:19 vq
+
+ * Makefile.in, config.h.in, configure, configure.in, function.c:
+
+ #i53148# Restore old behaviour for non-*NIX dmake versions.
+
+2005-10-11 14:01 vq
+
+ * Makefile.in, tests/Makefile.am, tests/Makefile.in, tests/README,
+ tests/misc-4:
+
+ #i39248# Add testcase and regenerate configure and other autotools files.
+
+2005-10-11 13:48 vq
+
+ * tests/misc-5:
+
+ #i54938# Add testcase for .INCLUDE generation in parallel builds.
+
+2005-10-11 13:39 vq
+
+ * function.c, getinp.c, make.c, vextern.h, unix/runargv.c:
+
+ #i54938# Fix problem when building infered .INCLUDE makefiles and doing
+ parallel builds.
+
+2005-10-04 00:33 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i10000# Fix markup error in man page source and regenerate the ascii version.
+
+2005-09-25 20:43 vq
+
+ * dbug/dbug/: dbug.txt, example1.c, example2.c, example3.c,
+ factorial.c, main.c, makeman.sh, readme, user.r:
+
+ #i55070# Restore the documentation for Fred Fish's "C Program Debugging
+ Package" DBUG.
+
+2005-09-25 20:33 vq
+
+ * Makefile.am, Makefile.in, configure, configure.in, extern.h,
+ dbug/dbug/dbug.c, msdos/Makefile.in, startup/Makefile.in,
+ startup/unix/Makefile.in, startup/unix/cygwin/Makefile.in,
+ startup/unix/linux/Makefile.in, startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ tests/Makefile.in, unix/Makefile.in, win95/Makefile.in,
+ win95/microsft/Makefile.in:
+
+ #i55070# Fix Fred Fishes DBUG macros and add --enable-dbug to enable them
+ in a configure type build. Also regenerate autotool files.
+
+2005-09-21 21:46 vq
+
+ * tempnam.c:
+
+ #i52899# Remove unused file.
+
+2005-09-19 20:50 vq
+
+ * Makefile.in, aclocal.m4, configure, msdos/Makefile.in,
+ startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/cygwin/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ tests/Makefile.am, tests/Makefile.in, tests/misc-3,
+ unix/Makefile.in, win95/Makefile.in, win95/microsft/Makefile.in:
+
+ #i49461# Add testcase and regenerate configure and other autotools files.
+
+2005-09-19 20:01 vq
+
+ * NEWS, man/dmake.nc, man/dmake.tf:
+
+ #i53148# Update NEWS file and man page.
+
+2005-09-19 19:48 vq
+
+ * unix/runargv.c:
+
+ #i53148# Move include directive to get some macros defined before using
+ them.
+
+2005-09-17 19:25 vq
+
+ * unix/runargv.c:
+
+ #i53148# Make sure that the command started from _exec_shell really
+ finished before returning.
+
+2005-09-17 15:47 vq
+
+ * Makefile.in:
+
+ RESYNC: (1.11-1.12); FILE MERGED
+
+2005-09-17 15:47 vq
+
+ * Makefile.am:
+
+ RESYNC: (1.8-1.9); FILE MERGED
+
+2005-09-08 14:00 rt
+
+ * unix/cygwin/public.h:
+
+ INTEGRATION: CWS ooo19126 (1.4.34); FILE MERGED
+ 2005/09/05 17:12:52 rt 1.4.34.1: #i54170# Change license header: remove SISSL
+
+2005-09-06 21:39 vq
+
+ * unix/runargv.c:
+
+ #i53148# Make sure _attach_cmd can not be used for _exec_shell calls.
+
+2005-09-05 17:10 vq
+
+ * tests/: Makefile.am, function_macros-3, function_macros-4:
+
+ #i53148# Add another testcase.
+
+2005-09-05 16:56 vq
+
+ * dmake.c, function.c, vextern.h, unix/runargv.c:
+
+ #i53148# Move redirection of stdout from parent to child and avoid
+ capturing spurious output from other process queues.
+
+2005-09-05 13:23 vq
+
+ * dmake.c, function.c, vextern.h, unix/runargv.c:
+
+ #i53148# Additional patch to make sure that the shell escapes is executed
+ after all previous recipe lines from the same target have finished.
+
+2005-09-04 23:17 vq
+
+ * tests/: Makefile.am, function_macros-3, misc-2:
+
+ #i53148# Add testcase.
+
+2005-09-04 15:38 vq
+
+ * dmake.c, function.c, sysintf.c, vextern.h, unix/runargv.c:
+
+ #i53148# Fix $(shell ...) handling for parallel builds with MAXPROCESS > 1.
+ This certainly includes the -P# switch with # > 1.
+
+2005-09-01 20:25 vq
+
+ * Makefile.in, aclocal.m4, autogen.sh, msdos/Makefile.in,
+ startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/cygwin/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ tests/Makefile.in, unix/Makefile.in, win95/Makefile.in,
+ win95/microsft/Makefile.in:
+
+ #i52238# Regenerate configure and other autotools files.
+
+2005-09-01 19:27 vq
+
+ * tests/: Makefile.am, misc-2:
+
+ #i52238# Add a testcase.
+
+2005-06-04 14:07 vq
+
+ * Makefile.in, startup/Makefile.am, startup/Makefile.in,
+ startup/unix/Makefile.am, startup/unix/Makefile.in,
+ startup/winnt/Makefile.am, startup/winnt/Makefile.in,
+ tests/Makefile.am, tests/Makefile.in, tests/misc-1:
+
+ #i39248# Add another testcase.
+
+2005-06-01 23:58 vq
+
+ * NEWS:
+
+ #i39248# Add entry to NEWS file.
+
+2005-06-01 23:41 vq
+
+ * Makefile.am, Makefile.in, configure, configure.in,
+ tests/Makefile.am, tests/Makefile.in, tests/function_macros-1,
+ tests/function_macros-2, tests/infra-0, tests/macros-1,
+ tests/recipes-1:
+
+ #i39248# Add testsuite for dmake (only tor targets using the autotools).
+
+2005-06-01 19:48 vq
+
+ * function.c:
+
+ #i50091# Echo shell function macro commands.
+
+2005-05-31 22:51 vq
+
+ * unix/dcache.c:
+
+ #i50142# Remove an unneeded warning that was introduced with issue 47135.
+
+2005-05-31 22:27 vq
+
+ * parse.c:
+
+ #i50053# Fix bogus check.
+
+2005-05-31 18:13 vq
+
+ * parse.c:
+
+ #i50053# Fix typo.
+
+2005-05-30 14:37 vq
+
+ * parse.c:
+
+ #i50053# Fix dmake correctly parsing empty makefile lines. This was a
+ regression introduced by issue 44959 and worked before only because
+ the trailing \n of empty lines were accidentally not removed.
+
+2005-05-20 14:18 vq
+
+ * getinp.c:
+
+ #i49461# Fix fall-out from issue 44959. Continued comment lines were not
+ ended if the following line was empty.
+
+2005-05-05 19:12 vq
+
+ * Makefile.in:
+
+ #i47851# Regenerate configure and other autotools files.
+
+2005-05-05 19:06 vq
+
+ * Makefile.am:
+
+ #i47851# Fix dependency checking for subdirectories.
+
+2005-05-05 17:59 vq
+
+ * posix.h:
+
+ #i47135# Leave a comment that the _POSIX_*_MAX values should be set in
+ the architecture dependent sysintf.h files instead of clobbering them
+ in posix.h
+
+2005-05-05 17:45 vq
+
+ * dmake.c, tempnam.c:
+
+ Issue number: 38830
+ Submitted by: waratah@openoffice.org
+ Change dmake's diagnosic output to use "Warning:" or "Error:". Adding the
+ colon makes it easier grep for these diagnostics in long logfiles.
+
+2005-05-05 17:27 vq
+
+ * infer.c, make.c, rulparse.c, sysintf.c:
+
+ #i43310# Fix dmakes handling of multiple (::) targets concerning attributes
+ and flags. Note: An attribute given for a subtarget will also be applied for
+ all other subtargets. (Also add a few comments.)
+
+2005-04-22 00:22 vq
+
+ * stdmacs.h, win95/microsft/config.h, winnt/microsft/config.h:
+
+ Issue number: 47866
+ Submitted by: shay@openoffice.org, vq@openoffice.org
+ Fix MSVC compiler warnings.
+
+2005-04-21 21:27 vq
+
+ * Makefile.in, aclocal.m4, configure, msdos/Makefile.in,
+ startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/cygwin/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ unix/Makefile.in, win95/Makefile.in, win95/microsft/Makefile.in:
+
+ #i47851# Regenerate configure and other autotools files.
+
+2005-04-21 21:17 vq
+
+ * infer.c:
+
+ #i43310# Fix cast.
+
+2005-04-21 21:04 vq
+
+ * NEWS, acinclude.m4, autogen.sh, config.h.in, configure.in,
+ dmake.c, dmakeroot.h.in, win95/microsft/config.h,
+ winnt/microsft/config.h:
+
+ #i47851# Increase the version number to 4.4-cvs and slightly rearrange the
+ output of "dmake -V".
+ Remove the hardcoded (in autotools builds) OS macro. It had the wrong value
+ to be usable with the startup/*.mk and is not mentioned in the man page.
+ Clean up configure.in and friends.
+
+2005-04-21 00:31 vq
+
+ * expand.c:
+
+ #i37053# Fix (unreached) typo.
+
+2005-04-20 11:26 vq
+
+ * NEWS, dmdump.c, infer.c:
+
+ #i43310# Fix percent (%) rules to recognize prerequisites that are defined
+ with the multiple target rule operator (::).
+ This implicitly fixes the similar problem for .<suffix>.<suffix> targets.
+
+2005-04-18 18:08 vq
+
+ * unix/dcache.c:
+
+ #i47135# Fix variable name.
+
+2005-04-18 18:03 vq
+
+ * sysintf.c, unix/dcache.c:
+
+ #i47135# Add code to warn if a filename is longer than NAMEMAX permits.
+
+2005-04-17 12:47 vq
+
+ * win95/borland/sysintf.h, win95/microsft/sysintf.h,
+ winnt/borland/sysintf.h, winnt/microsft/sysintf.h,
+ winnt/mingw/sysintf.h:
+
+ Issue number: 47135
+ Submitted by: shay@openoffice.org
+ Define _POSIX_NAME_MAX and _POSIX_PATH_MAX using the compiler defaults.
+
+2005-04-16 19:05 vq
+
+ * Makefile.in, aclocal.m4, configure, msdos/Makefile.in,
+ startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/cygwin/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.in,
+ startup/winnt/mingw/Makefile.in, startup/winnt/msvc6/Makefile.in,
+ unix/Makefile.in, win95/Makefile.in, win95/microsft/Makefile.in:
+
+ #i47578# Regenerate configure and other autotools files.
+
+2005-04-16 18:53 vq
+
+ * startup/Makefile.am:
+
+ #i47578# Install startup/config.mk instead of the unused startup/template.mk.
+
+2005-04-16 18:29 vq
+
+ * configure.in, startup/config.mk.in:
+
+ #i47578# Generate startup/config.mk during build with autotools.
+
+2005-04-16 12:53 vq
+
+ * NEWS, expand.c, man/dmake.nc, man/dmake.tf:
+
+ #i46987# Fix $(mktmp ...) documentation and add the map escape codes
+ $(macro:m) macro expansion.
+
+2005-04-15 19:55 vq
+
+ * win95/borland/ruletab.c, win95/microsft/ruletab.c,
+ winnt/borland/ruletab.c, winnt/microsft/ruletab.c:
+
+ Issue number: 47137
+ Submitted by: shay@openoffice.org
+ Increase default MAXLINELENGHT to 8190.
+
+2005-04-15 19:34 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i47135# Fix the documentation of the NAMEMAX macro. (Not .NAMEMAX)
+
+2005-04-11 18:16 vq
+
+ * expand.c:
+
+ #i36027# Fix sanity check for end of macro.
+
+2005-04-11 17:13 vq
+
+ * dag.c:
+
+ #i47137# Elaborate a comment.
+
+2005-04-11 16:41 vq
+
+ * getinp.c:
+
+ #i47137# Report and abort when makefile lines are read that are longer than
+ MAXLINELENGTH.
+
+2005-04-10 23:38 vq
+
+ * man/dmake.nc:
+
+ #i43252# Regenerate typeset version of the manual page.
+
+2005-04-10 23:28 vq
+
+ * NEWS, dmake.c, dmake.h, sysintf.c, vextern.h, man/dmake.tf,
+ win95/startup.h, winnt/startup.h:
+
+ #i43252# Introduce the macro ABSMAKECMD that's value for a native Windows
+ dmake executable (compiled with MS Visual C++ or MinGW) is the absolute
+ filename and NULL for other operating systems or dmake build with other
+ compilers.
+ If DMAKEROOT is not changed and only for native Windows dmake versions the
+ value of DMAKEROOT now defaults to "$(ABSMAKECMD:d)startup".
+
+2005-04-09 17:41 vq
+
+ * startup/startup.mk:
+
+ Issue number: 43254
+ Submitted by: shay@openoffice.org
+ Don't import OS, OSRELEASE and OSENVIRONMENT from environment in startup.mk.
+
+2005-04-09 17:22 vq
+
+ * dmake.c, mac/ruletab.c, msdos/ruletab.c, msdos/startup.h,
+ msdos/zortech/startup.mk, os2/ruletab.c, qssl/ruletab.c,
+ qssl/startup.h, startup/msdos/macros.mk, startup/os2/macros.mk,
+ startup/win95/macros.mk, startup/winnt/macros.mk, tos/ruletab.c,
+ tos/startup.h, unix/ruletab.c, win95/startup.h,
+ win95/borland/ruletab.c, win95/microsft/ruletab.c,
+ winnt/startup.h, winnt/borland/ruletab.c,
+ winnt/microsft/ruletab.c:
+
+ #i43254# Make the usage of DMAKEROOT consistent with the man page for
+ all OSs. This includes the removal of "SOLARVER UPD INPATH OS UPDMINOREXT"
+ from the list of macros that are always imported from the environment.
+ Patch inspired in part by shay@openoffice.org.
+
+2005-04-08 11:26 vq
+
+ * msdos/zortech/startup.mk, startup/msdos/macros.mk,
+ startup/os2/macros.mk, startup/win95/macros.mk,
+ startup/winnt/macros.mk:
+
+ Issue number: 47004
+ Submitted by: shay@openoffice
+ Fix syntax errors (warnings) in subst macros.
+
+2005-04-08 11:18 vq
+
+ * NEWS, readme/read1st.txt:
+
+ Issue number: 43241
+ Submitted by: shay@openoffice.org, vq@openoffice.org
+ Add documentation and update NEWS file.
+
+2005-04-07 18:30 vq
+
+ * makefile.mk, win95/microsft/config.mk,
+ win95/microsft/vpp40/mk.bat:
+
+ Issue number: 43241
+ Submitted by: shay@openoffice.org
+ Allow dmake to be build on windows without 4NT.
+
+2005-03-27 10:42 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i43147# Fix man page.
+
+2005-03-16 00:25 vq
+
+ * NEWS:
+
+ #i44959# Update NEWS file.
+
+2005-03-15 01:02 vq
+
+ * getinp.c:
+
+ #i44959# Comment fix.
+
+2005-03-15 00:55 vq
+
+ * getinp.c:
+
+ #i44959# Make sure not to strip the wrong \n.
+
+2005-03-15 00:20 vq
+
+ * getinp.c:
+
+ #i44959# Fix dmake problems for makefiles when continued lines are
+ followed by empty lines.
+
+2005-03-13 22:21 vq
+
+ * dag.c, expand.c, getinp.c, make.c:
+
+ #i37053# Fix continuation char handling.
+
+2005-02-19 15:41 vq
+
+ * NEWS:
+
+ #i36027#, #i37053#, #i37491# Update NEWS file to mention the latest changes.
+
+2004-11-25 11:12 vq
+
+ * getinp.c:
+
+ #i37053# Treat continuation chars as whitespace.
+
+2004-11-25 11:09 vq
+
+ * function.c:
+
+ #i36027# Fix MSVC compilation problem.
+
+2004-11-23 14:57 vq
+
+ * man/: dmake.nc, dmake.tf:
+
+ #i37491# Add documentation for SPACECHAR macro.
+
+2004-11-21 13:00 vq
+
+ * expand.c:
+
+ #i36027# Certainly closing brackets are only accepted when no
+ closing separator is found. fixed.
+
+2004-11-21 12:40 vq
+
+ * function.c:
+
+ #i36027# Improve parsing for dmake function macros.
+
+2004-11-21 12:07 vq
+
+ * expand.c:
+
+ #i36027# Relax the syntax check for closing seperator for subst modifiers.
+
+2004-11-19 20:05 vq
+
+ * imacs.c, vextern.h:
+
+ #i37491# Add a predefined SPACECHAR macro.
+
+2004-11-19 19:31 vq
+
+ * expand.c:
+
+ #i36027# This fixes the problems with the :s#pat#rep# modifier and also
+ handles a missing closing braket for macros with macro modifiers in general.
+
+2004-11-11 22:45 vq
+
+ * dag.c, getinp.c, make.c:
+
+ #i37053# dmake line continuation fix.
+
+2004-10-22 04:11 rt
+
+ * win95/microsft/config.h:
+
+ INTEGRATION: CWS dmake43 (1.5.2); FILE MERGED
+ 2004/10/12 19:07:26 vq 1.5.2.1: #i31647# Update version number for the "native" MS compiler build.
+
+2004-10-22 04:11 rt
+
+ * win95/microsft/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.3.18); FILE MERGED
+ 2004/10/12 18:47:52 vq 1.3.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:10 rt
+
+ * unix/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.8.18); FILE MERGED
+ 2004/10/12 18:47:51 vq 1.8.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:09 rt
+
+ * startup/winnt/msvc6/Makefile.in, win95/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.3.18); FILE MERGED
+ 2004/10/12 18:47:51 vq 1.3.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:09 rt
+
+ * startup/winnt/: Makefile.in, mingw/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.3.18); FILE MERGED
+ 2004/10/12 18:47:50 vq 1.3.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:09 rt
+
+ * startup/unix/sysvr4/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.3.18); FILE MERGED
+ 2004/10/12 18:47:49 vq 1.3.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:08 rt
+
+ * startup/unix/solaris/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.6.18); FILE MERGED
+ 2004/10/12 18:47:49 vq 1.6.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:08 rt
+
+ * startup/unix/macosx/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.6.18); FILE MERGED
+ 2004/10/12 18:47:48 vq 1.6.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:08 rt
+
+ * startup/unix/linux/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.8.18); FILE MERGED
+ 2004/10/12 18:47:48 vq 1.8.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:08 rt
+
+ * startup/unix/cygwin/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.3.18); FILE MERGED
+ 2004/10/12 18:47:48 vq 1.3.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:07 rt
+
+ * startup/: Makefile.in, unix/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.8.18); FILE MERGED
+ 2004/10/12 18:47:47 vq 1.8.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:07 rt
+
+ * readme/: intro.txt, read1st.txt:
+
+ INTEGRATION: CWS dmake43 (1.1.1.1.130); FILE MERGED
+ 2004/10/07 21:57:37 vq 1.1.1.1.130.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-10-22 04:06 rt
+
+ * msdos/Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.3.18); FILE MERGED
+ 2004/10/12 18:47:47 vq 1.3.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:06 rt
+
+ * man/dmake.tf:
+
+ INTEGRATION: CWS dmake43 (1.4.2); FILE MERGED
+ 2004/10/07 22:02:56 vq 1.4.2.1: #i31647# Change the man page also to version 4.3.
+
+2004-10-22 04:06 rt
+
+ * man/dmake.nc:
+
+ INTEGRATION: CWS dmake43 (1.2.2); FILE MERGED
+ 2004/10/07 22:02:56 vq 1.2.2.1: #i31647# Change the man page also to version 4.3.
+
+2004-10-22 04:05 rt
+
+ * sysintf.c:
+
+ INTEGRATION: CWS dmake43 (1.5.28); FILE MERGED
+ 2004/10/07 22:18:47 vq 1.5.28.1: #i34746# Fix timestamp of phony targets with prerequisites.
+
+2004-10-22 04:05 rt
+
+ * makefile.mk:
+
+ INTEGRATION: CWS dmake43 (1.2.78); FILE MERGED
+ 2004/10/07 21:57:36 vq 1.2.78.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-10-22 04:04 rt
+
+ * imacs.c:
+
+ INTEGRATION: CWS dmake43 (1.1.1.1.130); FILE MERGED
+ 2004/10/07 21:57:36 vq 1.1.1.1.130.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-10-22 04:04 rt
+
+ * dmake.c:
+
+ INTEGRATION: CWS dmake43 (1.4.2); FILE MERGED
+ 2004/10/07 21:57:36 vq 1.4.2.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-10-22 04:04 rt
+
+ * configure.in:
+
+ INTEGRATION: CWS dmake43 (1.21.16); FILE MERGED
+ 2004/10/12 19:07:26 vq 1.21.16.2: #i31647# Update version number for the "native" MS compiler build.
+ 2004/10/07 21:57:36 vq 1.21.16.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-10-22 04:04 rt
+
+ * configure:
+
+ INTEGRATION: CWS dmake43 (1.14.16); FILE MERGED
+ 2004/10/12 18:47:46 vq 1.14.16.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:03 rt
+
+ * config.h.in:
+
+ INTEGRATION: CWS dmake43 (1.11.16); FILE MERGED
+ 2004/10/12 18:47:46 vq 1.11.16.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:03 rt
+
+ * aclocal.m4:
+
+ INTEGRATION: CWS dmake43 (1.7.18); FILE MERGED
+ 2004/10/12 18:47:45 vq 1.7.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:02 rt
+
+ * NEWS:
+
+ INTEGRATION: CWS dmake43 (1.2.78); FILE MERGED
+ 2004/10/07 22:18:47 vq 1.2.78.2: #i34746# Fix timestamp of phony targets with prerequisites.
+ 2004/10/07 21:57:35 vq 1.2.78.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-10-22 04:02 rt
+
+ * Makefile.in:
+
+ INTEGRATION: CWS dmake43 (1.10.18); FILE MERGED
+ 2004/10/12 18:47:45 vq 1.10.18.1: #i31647# Regenerate the autotools files with autogen.sh.
+
+2004-10-22 04:01 rt
+
+ * COPYING, acinclude.m4:
+
+ INTEGRATION: CWS dmake43 (1.1.118); FILE MERGED
+ 2004/10/07 21:57:35 vq 1.1.118.1: #i31647# Bump the dmake version number to 4.3 plus some small cleanups.
+
+ Note: The _head file was renamed to COPYING, COPYING is not a new file,
+ but was empty befor.
+
+2004-09-08 12:10 rt
+
+ * unix/linux/gnu/public.h, win95/microsft/config.h:
+
+ INTEGRATION: CWS ooo20040704 (1.4.22); FILE MERGED
+ 2004/07/15 19:47:39 vq 1.4.22.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:09 rt
+
+ * unix/runargv.c:
+
+ INTEGRATION: CWS ooo20040704 (1.7.68); FILE MERGED
+ 2004/07/15 19:47:38 vq 1.7.68.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:09 rt
+
+ * unix/: dcache.c, rmprq.c, ruletab.c:
+
+ INTEGRATION: CWS ooo20040704 (1.3.68); FILE MERGED
+ 2004/07/15 19:47:38 vq 1.3.68.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:08 rt
+
+ * man/readme:
+
+ INTEGRATION: CWS ooo20040704 (1.1.1.1.120); FILE MERGED
+ 2004/07/11 15:15:18 vq 1.1.1.1.120.1: #i31255#, #i17992# Update the documentation of dmake to the new features.
+
+2004-09-08 12:08 rt
+
+ * man/dmake.tf:
+
+ INTEGRATION: CWS ooo20040704 (1.3.22); FILE MERGED
+ 2004/07/11 15:15:17 vq 1.3.22.1: #i31255#, #i17992# Update the documentation of dmake to the new features.
+
+2004-09-08 12:07 rt
+
+ * man/dmake.nc:
+
+ INTEGRATION: CWS ooo20040704 (1.1.1.1.120); FILE MERGED
+ 2004/07/11 15:15:17 vq 1.1.1.1.120.1: #i31255#, #i17992# Update the documentation of dmake to the new features.
+
+2004-09-08 12:07 rt
+
+ * rulparse.c:
+
+ INTEGRATION: CWS ooo20040704 (1.5.68); FILE MERGED
+ 2004/07/15 19:47:37 vq 1.5.68.3: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+ 2004/07/11 14:48:37 vq 1.5.68.2: #i31255# Add verbose recipe echoing option (-vr) to dmake.
+ 2004/07/06 00:03:43 vq 1.5.68.1: #i30779# Fix to allow dmake to echo recipe lines when inference is used
+ to create files that are be read by .INCLUDE.
+
+ Note that this only fixes the possibility to do so. Recipes that start
+ with @ are still not echoed, but dmake -n now shows the recipes.
+
+2004-09-08 12:06 rt
+
+ * parse.c, quit.c, stdmacs.h, unix/arlib.c:
+
+ INTEGRATION: CWS ooo20040704 (1.3.68); FILE MERGED
+ 2004/07/15 19:47:37 vq 1.3.68.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:06 rt
+
+ * make.c:
+
+ INTEGRATION: CWS ooo20040704 (1.4.24); FILE MERGED
+ 2004/07/15 19:47:36 vq 1.4.24.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:06 rt
+
+ * function.c:
+
+ INTEGRATION: CWS ooo20040704 (1.6.22); FILE MERGED
+ 2004/07/15 19:47:36 vq 1.6.22.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:06 rt
+
+ * extern.h:
+
+ INTEGRATION: CWS ooo20040704 (1.7.68); FILE MERGED
+ 2004/07/15 19:47:36 vq 1.7.68.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:05 rt
+
+ * expand.c, infer.c:
+
+ INTEGRATION: CWS ooo20040704 (1.3.68); FILE MERGED
+ 2004/07/15 19:47:36 vq 1.3.68.1: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+
+2004-09-08 12:05 rt
+
+ * dmake.h:
+
+ INTEGRATION: CWS ooo20040704 (1.1.1.1.120); FILE MERGED
+ 2004/07/11 14:48:37 vq 1.1.1.1.120.1: #i31255# Add verbose recipe echoing option (-vr) to dmake.
+
+2004-09-08 12:05 rt
+
+ * dag.c, dmake.c:
+
+ INTEGRATION: CWS ooo20040704 (1.3.68); FILE MERGED
+ 2004/07/15 19:47:35 vq 1.3.68.2: #i30887# Remove the wrongly added LGPL/SISSL license headers.
+ 2004/07/11 14:48:36 vq 1.3.68.1: #i31255# Add verbose recipe echoing option (-vr) to dmake.
+
+2004-09-08 12:04 rt
+
+ * INSTALL:
+
+ INTEGRATION: CWS ooo20040704 (1.1.108); FILE MERGED
+ 2004/07/11 15:15:16 vq 1.1.108.1: #i31255#, #i17992# Update the documentation of dmake to the new features.
+
+2004-04-21 10:10 svesik
+
+ * itypes.h:
+
+ INTEGRATION: CWS ooo20040329 (1.2.54); FILE MERGED
+ 2004/03/19 12:41:09 waratah 1.2.54.1: #i13620# extra definitions to use internal types defined in AIX
+
+2004-04-21 10:10 svesik
+
+ * getinp.c:
+
+ INTEGRATION: CWS ooo20040329 (1.4.8); FILE MERGED
+ 2004/04/01 16:24:25 mmeeks 1.4.8.1: #27319
+
+2004-04-21 10:10 svesik
+
+ * configure.in:
+
+ INTEGRATION: CWS ooo20040329 (1.20.14); FILE MERGED
+ 2004/03/19 12:36:41 waratah 1.20.14.1: #i13620# allow configure to pick up on types defined by AIX and also allow AIX to work in configure
+
+2004-04-21 10:09 svesik
+
+ * configure:
+
+ INTEGRATION: CWS ooo20040329 (1.13.4); FILE MERGED
+ 2004/03/19 12:37:40 waratah 1.13.4.1: #i13620# allow configure to pick up on types defined by AIX and also allow AIX to work in configure
+
+2004-04-21 10:09 svesik
+
+ * config.h.in:
+
+ INTEGRATION: CWS ooo20040329 (1.10.4); FILE MERGED
+ 2004/03/19 12:40:18 waratah 1.10.4.1: #i13620# Extra defines as used by configure
+
+2004-02-25 08:56 kz
+
+ * win95/: Makefile.in, microsft/Makefile.am, microsft/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:29:04 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:56 kz
+
+ * win95/Makefile.am:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:29:03 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:56 kz
+
+ * unix/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.7.48); FILE MERGED
+ 2004/02/20 12:29:03 hr 1.7.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:56 kz
+
+ * unix/Makefile.am:
+
+ INTEGRATION: CWS geordi2q15 (1.4.66); FILE MERGED
+ 2004/02/20 12:29:03 hr 1.4.66.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:55 kz
+
+ * startup/winnt/: mingw/Makefile.in, msvc6/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:29:02 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:55 kz
+
+ * startup/: unix/sysvr4/Makefile.in, winnt/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:29:01 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:54 kz
+
+ * startup/unix/: macosx/Makefile.in, solaris/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.5.48); FILE MERGED
+ 2004/02/20 12:29:00 hr 1.5.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:54 kz
+
+ * startup/unix/linux/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.7.48); FILE MERGED
+ 2004/02/20 12:28:59 hr 1.7.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:54 kz
+
+ * startup/unix/cygwin/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:28:59 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:54 kz
+
+ * startup/: Makefile.in, unix/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.7.48); FILE MERGED
+ 2004/02/20 12:28:58 hr 1.7.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:53 kz
+
+ * msdos/Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:28:58 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:53 kz
+
+ * msdos/Makefile.am:
+
+ INTEGRATION: CWS geordi2q15 (1.2.48); FILE MERGED
+ 2004/02/20 12:28:57 hr 1.2.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:53 kz
+
+ * configure:
+
+ INTEGRATION: CWS geordi2q15 (1.12.10); FILE MERGED
+ 2004/02/20 12:28:56 hr 1.12.10.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:53 kz
+
+ * config.h.in:
+
+ INTEGRATION: CWS geordi2q15 (1.9.10); FILE MERGED
+ 2004/02/20 12:28:56 hr 1.9.10.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:52 kz
+
+ * aclocal.m4:
+
+ INTEGRATION: CWS geordi2q15 (1.6.48); FILE MERGED
+ 2004/02/20 12:28:56 hr 1.6.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:52 kz
+
+ * Makefile.in:
+
+ INTEGRATION: CWS geordi2q15 (1.9.48); FILE MERGED
+ 2004/02/20 12:28:56 hr 1.9.48.1: #111934#: merge CWS ooo111fix3
+
+2004-02-25 08:52 kz
+
+ * Makefile.am:
+
+ INTEGRATION: CWS geordi2q15 (1.7.48); FILE MERGED
+ 2004/02/20 12:28:56 hr 1.7.48.1: #111934#: merge CWS ooo111fix3
+
+2004-01-28 08:21 hjs
+
+ * getinp.c:
+
+ #i17992# applied patch to enable komplex logic in .IF statements
+
+2003-12-17 11:19 vg
+
+ * winnt/msvc6/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.2.38); FILE MERGED
+ 2003/12/16 11:17:47 hr 1.2.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:18 vg
+
+ * winnt/mingw/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.2.38); FILE MERGED
+ 2003/12/16 11:17:46 hr 1.2.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:18 vg
+
+ * winnt/microsft/vpp40/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:46 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:18 vg
+
+ * winnt/borland/bcc50/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:45 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:17 vg
+
+ * win95/microsft/vpp40/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.3.38); FILE MERGED
+ 2003/12/16 11:17:44 hr 1.3.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:17 vg
+
+ * win95/microsft/vpp40/mk.bat:
+
+ INTEGRATION: CWS geordi2q11 (1.2.38); FILE MERGED
+ 2003/12/16 11:17:44 hr 1.2.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:17 vg
+
+ * win95/microsft/config.h:
+
+ INTEGRATION: CWS geordi2q11 (1.3.38); FILE MERGED
+ 2003/12/16 11:17:43 hr 1.3.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:16 vg
+
+ * win95/borland/bcc50/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:43 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:16 vg
+
+ * unix/xenix/pwd/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:42 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:15 vg
+
+ * unix/xenix/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:41 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:15 vg
+
+ * unix/: sysvr3/pwd/public.h, sysvr4/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:40 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:14 vg
+
+ * unix/sysvr3/gnu/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:39 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:14 vg
+
+ * unix/sysvr3/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:38 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:13 vg
+
+ * unix/: solaris/gnu/public.h, sysvr1/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:37 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:13 vg
+
+ * unix/solaris/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.2.46); FILE MERGED
+ 2003/12/16 11:17:36 hr 1.2.46.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:12 vg
+
+ * unix/macosx/gnu/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.3.38); FILE MERGED
+ 2003/12/16 11:17:35 hr 1.3.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:12 vg
+
+ * unix/linux/gnu/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.3.38); FILE MERGED
+ 2003/12/16 11:17:33 hr 1.3.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:11 vg
+
+ * unix/cygwin/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.3.38); FILE MERGED
+ 2003/12/16 11:17:32 hr 1.3.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:11 vg
+
+ * unix/coherent/ver42/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:31 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:10 vg
+
+ * unix/: bsdarm32/public.h, coherent/ver40/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:30 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:10 vg
+
+ * unix/bsd43/vf/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:29 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:09 vg
+
+ * unix/bsd43/: public.h, uw/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:28 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:08 vg
+
+ * unix/386ix/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:27 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:07 vg
+
+ * qssl/public.h, tos/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:26 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:07 vg
+
+ * os2/ibm/icc3/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:25 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:06 vg
+
+ * os2/ibm/icc/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:24 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:05 vg
+
+ * msdos/: microsft/msc60/public.h, zortech/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:23 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:05 vg
+
+ * msdos/microsft/msc51/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:22 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:04 vg
+
+ * msdos/borland/: bcc50/public.h, tcc20/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:21 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:03 vg
+
+ * msdos/borland/bcc45/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:20 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:02 vg
+
+ * msdos/borland/: bcc30/public.h, bcc40/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:19 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:02 vg
+
+ * man/dmake.tf:
+
+ INTEGRATION: CWS geordi2q11 (1.2.56); FILE MERGED
+ 2003/12/16 11:17:18 hr 1.2.56.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:02 vg
+
+ * mac/public.h:
+
+ INTEGRATION: CWS geordi2q11 (1.4.30); FILE MERGED
+ 2003/12/16 11:17:17 hr 1.4.30.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:01 vg
+
+ * sysintf.c:
+
+ INTEGRATION: CWS geordi2q11 (1.4.52); FILE MERGED
+ 2003/12/16 11:17:16 hr 1.4.52.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:01 vg
+
+ * function.c:
+
+ INTEGRATION: CWS geordi2q11 (1.5.8); FILE MERGED
+ 2003/12/16 11:17:16 hr 1.5.8.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:00 vg
+
+ * configure.in:
+
+ INTEGRATION: CWS geordi2q11 (1.19.38); FILE MERGED
+ 2003/12/16 11:17:15 hr 1.19.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 11:00 vg
+
+ * configure:
+
+ INTEGRATION: CWS geordi2q11 (1.11.38); FILE MERGED
+ 2003/12/16 11:17:15 hr 1.11.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-17 10:59 vg
+
+ * config.h.in:
+
+ INTEGRATION: CWS geordi2q11 (1.8.38); FILE MERGED
+ 2003/12/16 11:17:14 hr 1.8.38.1: #111934#: join CWS ooo111fix1
+
+2003-12-01 12:58 rt
+
+ * make.c:
+
+ INTEGRATION: CWS ooo20031110 (1.3.24); FILE MERGED
+ 2003/10/19 22:38:29 waratah 1.3.24.1: #i20504# Correct processing of library code, not always built
+
+2003-08-18 11:04 hjs
+
+ * function.c:
+
+ INTEGRATION: CWS geordi2q01 (1.4.22); FILE MERGED
+ 2003/08/18 12:53:30 hr 1.4.22.1: #i18350#: join changes from CWS ooo11rc3
+
+2003-06-12 06:56 vg
+
+ * winnt/microsft/vpp40/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:27 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:56 vg
+
+ * winnt/borland/bcc50/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:26 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:56 vg
+
+ * win95/borland/bcc50/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:25 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:56 vg
+
+ * unix/xenix/pwd/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:24 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:55 vg
+
+ * unix/: sysvr4/public.h, xenix/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:23 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:55 vg
+
+ * unix/sysvr3/pwd/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:22 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:54 vg
+
+ * unix/sysvr3/: public.h, gnu/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:21 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:54 vg
+
+ * unix/sysvr1/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:20 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:54 vg
+
+ * unix/solaris/gnu/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:19 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:54 vg
+
+ * unix/coherent/: ver40/public.h, ver42/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:18 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:54 vg
+
+ * unix/bsdarm32/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:17 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:53 vg
+
+ * unix/bsd43/vf/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:16 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:53 vg
+
+ * unix/bsd43/uw/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:15 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:53 vg
+
+ * unix/: 386ix/public.h, bsd43/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:14 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:53 vg
+
+ * tos/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:13 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:52 vg
+
+ * qssl/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:12 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:52 vg
+
+ * os2/ibm/icc3/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:11 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:52 vg
+
+ * os2/ibm/icc/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:10 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:52 vg
+
+ * msdos/zortech/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:09 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:52 vg
+
+ * msdos/microsft/msc60/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:08 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:51 vg
+
+ * msdos/microsft/msc51/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:07 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:51 vg
+
+ * msdos/borland/tcc20/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:06 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:51 vg
+
+ * msdos/borland/bcc50/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:05 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:51 vg
+
+ * msdos/borland/bcc45/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:04 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:51 vg
+
+ * msdos/borland/bcc40/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:03 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:50 vg
+
+ * msdos/borland/bcc30/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:02 mh 1.3.8.1: join: from beta2
+
+2003-06-12 06:50 vg
+
+ * mac/public.h:
+
+ INTEGRATION: CWS mh11rc (1.3.8); FILE MERGED
+ 2003/06/06 09:59:01 mh 1.3.8.1: join: from beta2
+
+2003-03-25 09:02 hr
+
+ * Makefile.am, Makefile.in, NEWS, aclocal.m4, autogen.sh,
+ config.h.in, configure, configure.in, dag.c, dmake.c,
+ dmakeroot.h.in, expand.c, extern.h, function.c, infer.c,
+ itypes.h, make.c, makefile.mk, parse.c, posix.h, quit.c,
+ rulparse.c, stdmacs.h, tempnam.c, mac/main.c, mac/public.h,
+ msdos/Makefile.am, msdos/Makefile.in,
+ msdos/borland/bcc30/public.h, msdos/borland/bcc40/public.h,
+ msdos/borland/bcc45/public.h, msdos/borland/bcc50/public.h,
+ msdos/borland/tcc20/public.h, msdos/microsft/msc51/public.h,
+ msdos/microsft/msc60/public.h, msdos/zortech/public.h,
+ os2/ibm/icc/public.h, os2/ibm/icc3/public.h, qssl/public.h,
+ startup/Makefile.am, startup/Makefile.in,
+ startup/unix/Makefile.in, startup/unix/cygwin/Makefile.in,
+ startup/unix/linux/Makefile.in, startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in,
+ startup/unix/sysvr4/Makefile.in, startup/winnt/Makefile.am,
+ startup/winnt/Makefile.in, startup/winnt/mingw/Makefile.am,
+ startup/winnt/mingw/Makefile.in, startup/winnt/mingw/macros.mk,
+ startup/winnt/msvc6/Makefile.am, startup/winnt/msvc6/Makefile.in,
+ startup/winnt/msvc6/macros.mk, tos/public.h, unix/Makefile.in,
+ unix/arlib.c, unix/dcache.c, unix/rmprq.c, unix/ruletab.c,
+ unix/runargv.c, unix/386ix/public.h, unix/bsd43/public.h,
+ unix/bsd43/uw/public.h, unix/bsd43/vf/public.h,
+ unix/bsdarm32/public.h, unix/coherent/ver40/public.h,
+ unix/coherent/ver42/public.h, unix/cygwin/public.h,
+ unix/linux/gnu/public.h, unix/macosx/gnu/public.h,
+ unix/solaris/gnu/public.h, unix/sysvr1/public.h,
+ unix/sysvr3/public.h, unix/sysvr3/gnu/public.h,
+ unix/sysvr3/pwd/public.h, unix/sysvr4/public.h,
+ unix/xenix/public.h, unix/xenix/pwd/public.h, win95/Makefile.am,
+ win95/Makefile.in, win95/borland/bcc50/public.h,
+ win95/microsft/Makefile.am, win95/microsft/Makefile.in,
+ win95/microsft/config.h, win95/microsft/ruletab.c,
+ win95/microsft/vpp40/mk.bat, win95/microsft/vpp40/obj.rsp,
+ win95/microsft/vpp40/public.h, winnt/borland/bcc50/public.h,
+ winnt/microsft/vpp40/public.h, winnt/mingw/public.h,
+ winnt/mingw/sysintf.h, winnt/msvc6/public.h,
+ winnt/msvc6/sysintf.h:
+
+ MWS_SRX644: migrate branch mws_srx644 -> HEAD
+
+2003-01-13 09:27 waratah
+
+ * mac/main.c, mac/public.h, msdos/borland/bcc30/public.h,
+ msdos/borland/bcc40/public.h, msdos/borland/bcc45/public.h,
+ msdos/borland/bcc50/public.h, msdos/borland/tcc20/public.h,
+ msdos/microsft/msc51/public.h, msdos/microsft/msc60/public.h,
+ msdos/zortech/public.h, os2/ibm/icc/public.h,
+ os2/ibm/icc3/public.h, qssl/public.h, tos/public.h,
+ unix/386ix/public.h, unix/bsd43/public.h, unix/bsd43/uw/public.h,
+ unix/bsd43/vf/public.h, unix/bsdarm32/public.h,
+ unix/coherent/ver40/public.h, unix/coherent/ver42/public.h,
+ unix/cygwin/public.h, unix/solaris/public.h,
+ unix/solaris/gnu/public.h, unix/sysvr1/public.h,
+ unix/sysvr3/public.h, unix/sysvr3/gnu/public.h,
+ unix/sysvr3/pwd/public.h, unix/sysvr4/public.h,
+ unix/xenix/public.h, unix/xenix/pwd/public.h,
+ win95/borland/bcc50/public.h, win95/microsft/vpp40/public.h,
+ winnt/borland/bcc50/public.h, winnt/microsft/vpp40/public.h:
+
+ dmake: Remove the incorrect definition of main to void
+
+2003-01-04 08:08 waratah
+
+ * unix/macosx/gnu/public.h:
+
+ Remove main definition, it is wrong and it is failing compile on the mac platform
+
+2003-01-04 08:02 waratah
+
+ * unix/runargv.c:
+
+ Implement a test around wait so it is not included when the platform does not define it
+
+2003-01-04 07:53 waratah
+
+ * config.h.in, configure, configure.in:
+
+ Implement a test for wait.h, failing build on mac under gcc
+
+2002-10-15 08:27 waratah
+
+ * config.guess:
+
+ dmake: Implement the latest config.guess, not working on ppc64
+
+2002-10-11 09:42 waratah
+
+ * Makefile.in, config.h.in, configure, configure.in, dag.c,
+ dmake.c, expand.c, extern.h, function.c, getinp.c, infer.c,
+ make.c, parse.c, quit.c, rulparse.c, sysintf.c, unix/arlib.c,
+ unix/dcache.c, unix/rmprq.c, unix/runargv.c,
+ unix/linux/gnu/public.h:
+
+ dmake: Implement fix for Lost child problem. Correct some checks for functions (assumed present) and also fix up all gcc warnings using -Wall.
+
+2002-10-08 05:21 waratah
+
+ * win95/microsft/config.h:
+
+ dmake: Volker 4nt patches
+
+2002-10-07 09:40 waratah
+
+ * startup/unix/cygwin/: Makefile.am, Makefile.in, macros.mk:
+
+ dmake: Add the cygwin configure files
+
+2002-10-07 09:36 waratah
+
+ * extern.h:
+
+ dmake: Correct some undefined functions in some modules
+
+2002-10-07 09:34 waratah
+
+ * configure:
+
+ dmake: Additional header checks for better source control, add cygwin support, GNU hurd support
+
+2002-10-07 09:33 waratah
+
+ * config.h.in:
+
+ dmake: Additional header checks for better source control
+
+2002-10-07 08:09 waratah
+
+ * configure.in:
+
+ dmake: Add gnu hurd and some additional header checks, and the cygwin makefiles
+
+2002-10-04 10:34 waratah
+
+ * configure:
+
+ dmake: Patches for the osf1 operating system
+
+2002-10-04 10:14 waratah
+
+ * startup/unix/sysvr4/Makefile.in:
+
+ dmake: Add osf1 support
+
+2002-10-04 10:01 haggai
+
+ * startup/unix/sysvr4/Makefile.am, configure.in:
+
+ Fix build for OSF1. Approved by Ken.
+
+2002-10-04 09:31 waratah
+
+ * Makefile.in, aclocal.m4, config.h.in, configure, configure.in,
+ extern.h, function.c, startup/Makefile.in,
+ startup/unix/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in, unix/Makefile.in:
+
+ Dmake: Convert the configure to a better configure process without individual conf.h files for every platform
+
+2002-10-03 08:59 waratah
+
+ * configure, configure.in, depcomp:
+
+ dmake: remove cygwin makefile temporarily and implement depcomp
+
+2002-10-03 08:29 waratah
+
+ * Makefile.in, aclocal.m4, configure, configure.in, stdmacs.h,
+ man/dmake.tf, startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/linux/Makefile.in, startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in, unix/Makefile.in:
+
+ dmake: This is a reworked version of the configure process, without automake and aclocal
+
+2002-10-02 09:42 waratah
+
+ * Makefile.am, Makefile.in, aclocal.m4, autogen.sh, config.h.in,
+ configure, configure.in, startup/Makefile.in,
+ startup/unix/Makefile.in, startup/unix/linux/Makefile.in,
+ startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in, unix/Makefile.am,
+ unix/Makefile.in:
+
+ dmake: Allow the whole configure process to work, not needs update to bootstrap to activate
+
+2002-10-01 11:08 waratah
+
+ * Makefile.in, startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/linux/Makefile.in, startup/unix/macosx/Makefile.in,
+ startup/unix/solaris/Makefile.in, unix/Makefile.in:
+
+ dmake: Add all the automake files, premade so developers do not require automake installed
+
+2002-07-11 04:53 mh
+
+ * Makefile.am, configure.in, extern.h, rulparse.c,
+ startup/unix/Makefile.am, startup/unix/macosx/Makefile.am,
+ unix/Makefile.am, unix/tempnam.c:
+
+ join: from OOO_STABLE_1
+
+2002-07-11 04:44 mh
+
+ * autogen.sh:
+
+ join: from OOO_STABLE_1
+
+2002-04-10 11:40 hjs
+
+ * rulparse.c:
+
+ don't search INCLUDEDIRS if filename of include starts at fs-root
+
+2002-04-09 13:21 mh
+
+ * configure.in:
+
+ fixed typo for FreeBSD
+
+2002-04-09 13:10 hjs
+
+ * Makefile.am, configure.in:
+
+ cygwin support
+
+2002-03-26 09:23 mh
+
+ * configure.in:
+
+ add: cygwin
+
+2002-03-26 09:22 mh
+
+ * unix/cygwin/public.h:
+
+ add for cygwin
+
+2001-10-16 08:11 mh
+
+ * configure.in:
+
+ add: FreeBSD
+
+2001-10-16 08:10 mh
+
+ * autogen.sh:
+
+ fix: for non writable aclocal.m4 and missing README
+
+2001-08-20 05:57 mh
+
+ * configure.in:
+
+ del: AC_CONFIG_HEADERS
+
+2001-06-14 13:31 mh
+
+ * configure.in:
+
+ don't check C++
+
+2001-06-13 09:34 mh
+
+ * Makefile.am, configure.in, unix/Makefile.am:
+
+ add: OS_VERSION to differ the Unix's
+
+2001-06-13 09:13 mh
+
+ * startup/unix/solaris/Makefile.am:
+
+ add: startup/unix/solaris/
+
+2001-05-29 18:43 pluby
+
+ * unix/runargv.c:
+
+ Added forceful exit to avoid infinite loop that sometimes occurs when there is a fatal error.
+
+2001-05-07 08:47 mh
+
+ * unix/runargv.c:
+
+ add: CYGWIN changes
+
+2001-05-04 06:47 mh
+
+ * Makefile.am, aclocal.m4, config.h.in, configure:
+
+ chg: comments
+
+2001-04-23 08:41 mh
+
+ * unix/Makefile.in, startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/linux/Makefile.in:
+
+ del:
+
+2001-04-23 08:24 mh
+
+ * Makefile.in:
+
+ del:
+
+2001-04-23 08:22 mh
+
+ * Makefile.in:
+
+ del
+
+2001-04-23 08:10 mh
+
+ * configure.in:
+
+ add: PACKAGE
+
+2001-04-23 07:06 mh
+
+ * unix/Makefile.am:
+
+ add: Makefile.am
+
+2001-04-23 07:01 mh
+
+ * aclocal.m4:
+
+ add: acloacl.m4
+
+2001-04-23 06:50 mh
+
+ * unix/Makefile.in, startup/Makefile.in, startup/unix/Makefile.in,
+ startup/unix/linux/Makefile.in:
+
+ add: Makefile.in
+
+2001-04-23 06:50 mh
+
+ * Makefile.in:
+
+ add Makefile.in
+
+2001-04-20 10:24 mh
+
+ * startup/: Makefile.am, unix/Makefile.am, unix/linux/Makefile.am:
+
+ add: Makefile.am
+
+2001-04-20 10:23 mh
+
+ * unix/ruletab.c:
+
+ use installation directory from configure for DMAKEROOT, DMAKEROOT can still be overridden by environment
+
+2001-04-20 10:21 mh
+
+ * extern.h:
+
+ avoid clash with autoconf config.h
+
+2001-04-20 10:15 mh
+
+ * AUTHORS, COPYING, INSTALL, Makefile.am, NEWS, acinclude.m4,
+ autogen.sh, config.guess, config.h.in, config.sub, configure,
+ configure.in, dmakeroot.h.in, install-sh, missing, mkinstalldirs,
+ stamp-h:
+
+ preparation for autoconf and automake for dmake
+
+2001-02-22 22:44 pluby
+
+ * unix/macosx/: tempnam.c, gnu/make.sh:
+
+ Correct Mac OS X "tempnam" bug
+
+2001-02-19 11:08 hjs
+
+ * sysintf.c:
+
+ remove useless part of change
+
+2001-02-13 07:43 hjs
+
+ * sysintf.c:
+
+ fixed left tmpfiles when building group targets
+
+2000-11-01 07:27 hjs
+
+ * unix/runargv.c:
+
+ FreeBSD patch
+
+2000-10-20 07:12 hjs
+
+ * getinp.c:
+
+ has an extraneous ; after the function closure
+
+2000-09-22 11:33 hr
+
+ * dag.c, dmake.c, dmake.h, expand.c, extern.h, function.c,
+ getinp.c, imacs.c, infer.c, itypes.h, make.c, makefile.mk,
+ parse.c, posix.h, quit.c, rulparse.c, stdmacs.h, sysintf.c,
+ tempnam.c, mac/main.c, mac/public.h, man/dmake.nc, man/dmake.tf,
+ man/readme, msdos/borland/bcc30/public.h,
+ msdos/borland/bcc40/public.h, msdos/borland/bcc45/public.h,
+ msdos/borland/bcc50/public.h, msdos/borland/tcc20/public.h,
+ msdos/microsft/msc51/public.h, msdos/microsft/msc60/public.h,
+ msdos/zortech/public.h, os2/ibm/icc/public.h,
+ os2/ibm/icc3/public.h, qssl/public.h, readme/intro.txt,
+ readme/read1st.txt, tos/public.h, unix/arlib.c, unix/dcache.c,
+ unix/rmprq.c, unix/ruletab.c, unix/runargv.c,
+ unix/386ix/public.h, unix/bsd43/public.h, unix/bsd43/uw/public.h,
+ unix/bsd43/vf/public.h, unix/bsdarm32/public.h,
+ unix/coherent/ver40/public.h, unix/coherent/ver42/public.h,
+ unix/linux/gnu/make.sh, unix/linux/gnu/public.h,
+ unix/macosx/gnu/make.sh, unix/macosx/gnu/public.h,
+ unix/solaris/public.h, unix/solaris/gnu/public.h,
+ unix/sysvr1/public.h, unix/sysvr3/public.h,
+ unix/sysvr3/gnu/public.h, unix/sysvr3/pwd/public.h,
+ unix/sysvr4/public.h, unix/xenix/public.h,
+ unix/xenix/pwd/public.h, win95/borland/bcc50/public.h,
+ win95/microsft/config.h, win95/microsft/ruletab.c,
+ win95/microsft/vpp40/mk.bat, win95/microsft/vpp40/obj.rsp,
+ win95/microsft/vpp40/public.h, winnt/borland/bcc50/public.h,
+ winnt/microsft/vpp40/public.h:
+
+ Initial revision
+
+2000-09-22 11:33 hr
+
+ * alloc.h, db.h, dmdump.c, dmstring.c, dstdarg.h, hash.c,
+ macparse.c, make.bat, make.cmd, path.c, percent.c, rcsclean.awk,
+ stat.c, state.c, struct.h, vextern.h, dbug/dbug.mk, dbug/getwd.c,
+ dbug/readme, dbug/dbug/dbug.c, dbug/dbug/dbug.h,
+ dbug/dbug/dbug.uue, dbug/dbug/readme, dbug/malloc/_changes,
+ dbug/malloc/_readme, dbug/malloc/calloc.c, dbug/malloc/debug.h,
+ dbug/malloc/dump.c, dbug/malloc/free.c, dbug/malloc/m_init.c,
+ dbug/malloc/m_perror.c, dbug/malloc/makefile,
+ dbug/malloc/malloc.3, dbug/malloc/malloc.c, dbug/malloc/malloc.h,
+ dbug/malloc/mallopt.c, dbug/malloc/memory.c,
+ dbug/malloc/mlc_chk.c, dbug/malloc/mlc_chn.c,
+ dbug/malloc/patchlev, dbug/malloc/realloc.c,
+ dbug/malloc/string.c, dbug/malloc/testmem.c,
+ dbug/malloc/testmlc.c, dbug/malloc/tostring.c,
+ dbug/malloc/tostring.h, mac/arlib.c, mac/make_mac.sh,
+ mac/bogus.c, mac/config.mk, mac/dirbrk.c, mac/directry.c,
+ mac/dompwmak, mac/environ.c, mac/eold.c, mac/make.sh,
+ mac/rmprq.c, mac/ruletab.c, mac/startup.h, mac/sysintf.h,
+ mac/template.mk, mac/tempnam.c, mac/tomacfil.c, msdos/arlib.c,
+ msdos/config.mk, msdos/dchdir.c, msdos/dirbrk.c, msdos/dirent.h,
+ msdos/dirlib.c, msdos/dosdta.h, msdos/dstrlwr.c, msdos/exec.asm,
+ msdos/exec.h, msdos/exec.uue, msdos/find.c, msdos/rmprq.c,
+ msdos/ruletab.c, msdos/runargv.c, msdos/spawn.c, msdos/startup.h,
+ msdos/switchar.c, msdos/sysintf.h, msdos/tee.c,
+ msdos/borland/config.mk, msdos/borland/tempnam.c,
+ msdos/borland/utime.c, msdos/borland/bcc30/config.h,
+ msdos/borland/bcc30/config.mk, msdos/borland/bcc30/lib.rsp,
+ msdos/borland/bcc30/libswp.rsp, msdos/borland/bcc30/mkswp.bat,
+ msdos/borland/bcc30/obj.rsp, msdos/borland/bcc30/objswp.rsp,
+ msdos/borland/bcc30/template.mk, msdos/borland/bcc40/config.h,
+ msdos/borland/bcc40/config.mk, msdos/borland/bcc40/lib.rsp,
+ msdos/borland/bcc40/libswp.rsp, msdos/borland/bcc40/mkswp.bat,
+ msdos/borland/bcc40/obj.rsp, msdos/borland/bcc40/objswp.rsp,
+ msdos/borland/bcc40/template.mk, msdos/borland/bcc45/config.h,
+ msdos/borland/bcc45/config.mk, msdos/borland/bcc45/lib.rsp,
+ msdos/borland/bcc45/libswp.rsp, msdos/borland/bcc45/mkswp.bat,
+ msdos/borland/bcc45/obj.rsp, msdos/borland/bcc45/objswp.rsp,
+ msdos/borland/bcc45/template.mk, msdos/borland/bcc50/config.h,
+ msdos/borland/bcc50/config.mk, msdos/borland/bcc50/lib.rsp,
+ msdos/borland/bcc50/libswp.rsp, msdos/borland/bcc50/mkswp.bat,
+ msdos/borland/bcc50/obj.rsp, msdos/borland/bcc50/objswp.rsp,
+ msdos/borland/bcc50/template.mk, msdos/borland/tcc20/config.h,
+ msdos/borland/tcc20/config.mk, msdos/borland/tcc20/libswp.rsp,
+ msdos/borland/tcc20/mkswp.bat, msdos/borland/tcc20/objswp.rsp,
+ msdos/borland/tcc20/template.mk, msdos/microsft/config.h,
+ msdos/microsft/config.mk, msdos/microsft/optoff.h,
+ msdos/microsft/tempnam.c, msdos/microsft/msc51/config.mk,
+ msdos/microsft/msc51/lib.rsp, msdos/microsft/msc51/libswp.rsp,
+ msdos/microsft/msc51/mk.bat, msdos/microsft/msc51/mkswp.bat,
+ msdos/microsft/msc51/obj.rsp, msdos/microsft/msc51/objswp.rsp,
+ msdos/microsft/msc51/template.mk, msdos/microsft/msc60/config.mk,
+ msdos/microsft/msc60/lib.rsp, msdos/microsft/msc60/libswp.rsp,
+ msdos/microsft/msc60/mk.bat, msdos/microsft/msc60/mkswp.bat,
+ msdos/microsft/msc60/obj.rsp, msdos/microsft/msc60/objswp.rsp,
+ msdos/microsft/msc60/template.mk, msdos/zortech/config.h,
+ msdos/zortech/config.mk, msdos/zortech/environ.c,
+ msdos/zortech/lib.rsp, msdos/zortech/libswp.rsp,
+ msdos/zortech/mkswp.bat, msdos/zortech/obj.rsp,
+ msdos/zortech/objswp.rsp, msdos/zortech/startup.mk,
+ msdos/zortech/tempnam.c, os2/config.mk, os2/dchdir.c,
+ os2/dirent.h, os2/ruletab.c, os2/startup.h, os2/switchar.c,
+ os2/sysintf.h, os2/ibm/config.h, os2/ibm/config.mk,
+ os2/ibm/tempnam.c, os2/ibm/icc/config.mk, os2/ibm/icc/lib.rsp,
+ os2/ibm/icc/mk.cmd, os2/ibm/icc/obj.rsp, os2/ibm/icc/template.mk,
+ os2/ibm/icc3/config.mk, os2/ibm/icc3/lib.rsp,
+ os2/ibm/icc3/mk.cmd, os2/ibm/icc3/obj.rsp,
+ os2/ibm/icc3/template.mk, qssl/config.mk, qssl/make.sh,
+ qssl/ruletab.c, qssl/runargv.c, qssl/setup, qssl/startup.h,
+ qssl/stdlib.h, qssl/sysintf.h, qssl/template.mk, qssl/tempnam.c,
+ qssl/time.h, readme/license.txt, readme/release.txt,
+ readme/public/install.txt, readme/public/mac.txt,
+ readme/public/msdos.txt, readme/public/os2.txt,
+ readme/public/qssl-qnx.txt, readme/public/srcorg.txt,
+ readme/public/tos.txt, readme/public/unix.txt,
+ startup/startup.mk, startup/summary, startup/template.mk,
+ startup/mac/macros.mk, startup/msdos/macros.mk,
+ startup/msdos/recipes.mk, startup/msdos/borland/macros.mk,
+ startup/msdos/borland/bcc30/macros.mk,
+ startup/msdos/borland/bcc40/macros.mk,
+ startup/msdos/borland/bcc45/macros.mk,
+ startup/msdos/borland/bcc50/macros.mk,
+ startup/msdos/borland/bcc50.32/macros.mk,
+ startup/msdos/borland/tcc20/macros.mk,
+ startup/msdos/microsft/macros.mk,
+ startup/msdos/zortech/macros.mk, startup/os2/macros.mk,
+ startup/os2/ibm/macros.mk, startup/qssl/macros.mk,
+ startup/qssl/recipes.mk, startup/qssl/qnx/macros.mk,
+ startup/qssl/qnx/recipes.mk, startup/templates/mac/template.mk,
+ startup/templates/msdos/borland/bcc30/template.mk,
+ startup/templates/msdos/borland/bcc40/template.mk,
+ startup/templates/msdos/borland/bcc45/template.mk,
+ startup/templates/msdos/borland/bcc50/template.mk,
+ startup/templates/msdos/borland/tcc20/template.mk,
+ startup/templates/msdos/microsft/msc51/template.mk,
+ startup/templates/msdos/microsft/msc60/template.mk,
+ startup/templates/os2/ibm/icc/template.mk,
+ startup/templates/qssl/template.mk,
+ startup/templates/tos/template.mk,
+ startup/templates/unix/386ix/template.mk,
+ startup/templates/unix/bsd43/template.mk,
+ startup/templates/unix/bsd43/uw/template.mk,
+ startup/templates/unix/bsd43/vf/template.mk,
+ startup/templates/unix/coherent/ver40/template.mk,
+ startup/templates/unix/coherent/ver42/template.mk,
+ startup/templates/unix/linux/gnu/template.mk,
+ startup/templates/unix/solaris/template.mk,
+ startup/templates/unix/solaris/gnu/template.mk,
+ startup/templates/unix/sysvr1/template.mk,
+ startup/templates/unix/sysvr3/template.mk,
+ startup/templates/unix/sysvr3/pwd/template.mk,
+ startup/templates/unix/sysvr4/template.mk,
+ startup/templates/unix/xenix/template.mk,
+ startup/templates/unix/xenix/pwd/template.mk,
+ startup/templates/win95/borland/bcc50/template.mk,
+ startup/templates/win95/microsft/vpp40/template.mk,
+ startup/templates/winnt/borland/bcc50/template.mk,
+ startup/templates/winnt/microsft/vpp40/template.mk,
+ startup/tos/macros.mk, startup/unix/macros.mk,
+ startup/unix/recipes.mk, startup/unix/386ix/macros.mk,
+ startup/unix/bsd43/macros.mk, startup/unix/bsd43/recipes.mk,
+ startup/unix/coherent/macros.mk,
+ startup/unix/coherent/recipes.mk, startup/unix/linux/macros.mk,
+ startup/unix/linux/gnu/macros.mk, startup/unix/macosx/macros.mk,
+ startup/unix/macosx/gnu/macros.mk,
+ startup/unix/solaris/macros.mk, startup/unix/sysvr1/macros.mk,
+ startup/unix/sysvr3/macros.mk, startup/unix/sysvr3/gnu/macros.mk,
+ startup/unix/sysvr4/macros.mk, startup/unix/xenix/macros.mk,
+ startup/win95/macros.mk, startup/win95/recipes.mk,
+ startup/win95/borland/macros.mk,
+ startup/win95/microsft/macros.mk, startup/winnt/macros.mk,
+ startup/winnt/recipes.mk, startup/winnt/borland/macros.mk,
+ startup/winnt/microsft/macros.mk, tos/config.mk, tos/make.sh,
+ tos/putenv.c, tos/ruletab.c, tos/startup.h, tos/sysintf.h,
+ tos/template.mk, tos/tempnam.c, unix/config.mk, unix/dirbrk.c,
+ unix/startup.h, unix/sysintf.h, unix/386ix/ar.h,
+ unix/386ix/config.mk, unix/386ix/make.sh, unix/386ix/stdlib.h,
+ unix/386ix/template.mk, unix/386ix/time.h, unix/bsd43/config.mk,
+ unix/bsd43/dirent.h, unix/bsd43/limits.h, unix/bsd43/make.sh,
+ unix/bsd43/template.mk, unix/bsd43/putenv.c,
+ unix/bsd43/setvbuf.c, unix/bsd43/stdlib.h, unix/bsd43/string.h,
+ unix/bsd43/tempnam.c, unix/bsd43/utime.c,
+ unix/bsd43/uw/config.mk, unix/bsd43/uw/make.sh,
+ unix/bsd43/uw/template.mk, unix/bsd43/vf/config.mk,
+ unix/bsd43/vf/ctype.h, unix/bsd43/vf/make.sh,
+ unix/bsd43/vf/memcpy.c, unix/bsd43/vf/template.mk,
+ unix/bsd43/vf/vfprintf.c, unix/bsdarm32/config.mk,
+ unix/bsdarm32/dirent.h, unix/bsdarm32/limits.h,
+ unix/bsdarm32/make.sh, unix/bsdarm32/putenv.c,
+ unix/bsdarm32/stdlib.h, unix/bsdarm32/string.h,
+ unix/bsdarm32/template.mk, unix/bsdarm32/tempnam.c,
+ unix/bsdarm32/utime.c, unix/coherent/config.mk,
+ unix/coherent/stdlib.h, unix/coherent/time.h,
+ unix/coherent/ver40/config.mk, unix/coherent/ver40/getcwd.c,
+ unix/coherent/ver40/make.sh, unix/coherent/ver40/template.mk,
+ unix/coherent/ver40/vfprintf.c, unix/coherent/ver42/config.mk,
+ unix/coherent/ver42/template.mk, unix/coherent/ver42/make.sh,
+ unix/linux/config.mk, unix/linux/gnu/config.mk,
+ unix/linux/gnu/template.mk, unix/macosx/config.mk,
+ unix/macosx/gnu/config.mk, unix/macosx/gnu/template.mk,
+ unix/solaris/config.mk, unix/solaris/getcwd.c,
+ unix/solaris/make.sh, unix/solaris/template.mk,
+ unix/solaris/tempnam.c, unix/solaris/gnu/config.mk,
+ unix/solaris/gnu/make.sh, unix/solaris/gnu/template.mk,
+ unix/sysvr1/config.mk, unix/sysvr1/make.sh, unix/sysvr1/putenv.c,
+ unix/sysvr1/stdlib.h, unix/sysvr1/template.mk,
+ unix/sysvr1/time.h, unix/sysvr1/vfprintf.c,
+ unix/sysvr3/config.mk, unix/sysvr3/make.sh, unix/sysvr3/stdlib.h,
+ unix/sysvr3/template.mk, unix/sysvr3/time.h,
+ unix/sysvr3/pwd/config.mk, unix/sysvr3/pwd/template.mk,
+ unix/sysvr3/pwd/getcwd.c, unix/sysvr3/pwd/make.sh,
+ unix/sysvr4/config.mk, unix/sysvr4/make.sh,
+ unix/sysvr4/template.mk, unix/xenix/config.mk,
+ unix/xenix/make.sh, unix/xenix/stdlib.h, unix/xenix/template.mk,
+ unix/xenix/time.h, unix/xenix/pwd/config.mk,
+ unix/xenix/pwd/getcwd.c, unix/xenix/pwd/make.sh,
+ unix/xenix/pwd/template.mk, win95/config.mk, win95/dchdir.c,
+ win95/startup.h, win95/switchar.c, win95/borland/config.mk,
+ win95/borland/ruletab.c, win95/borland/sysintf.h,
+ win95/borland/tempnam.c, win95/borland/bcc50/config.h,
+ win95/borland/bcc50/config.mk, win95/borland/bcc50/lib.rsp,
+ win95/borland/bcc50/mk.bat, win95/borland/bcc50/obj.rsp,
+ win95/borland/bcc50/template.mk, win95/microsft/config.mk,
+ win95/microsft/optoff.h, win95/microsft/sysintf.h,
+ win95/microsft/tempnam.c, win95/microsft/vpp40/config.mk,
+ win95/microsft/vpp40/lib.rsp, win95/microsft/vpp40/runargv.c,
+ win95/microsft/vpp40/template.mk, win95/microsft/vpp40/tempnam.c,
+ winnt/config.mk, winnt/dchdir.c, winnt/startup.h,
+ winnt/borland/config.mk, winnt/borland/ruletab.c,
+ winnt/borland/sysintf.h, winnt/borland/tempnam.c,
+ winnt/borland/bcc50/config.h, winnt/borland/bcc50/config.mk,
+ winnt/borland/bcc50/lib.rsp, winnt/borland/bcc50/mk.bat,
+ winnt/borland/bcc50/mk.cmd, winnt/borland/bcc50/obj.rsp,
+ winnt/borland/bcc50/template.mk, winnt/microsft/config.h,
+ winnt/microsft/config.mk, winnt/microsft/optoff.h,
+ winnt/microsft/ruletab.c, winnt/microsft/sysintf.h,
+ winnt/microsft/tempnam.c, winnt/microsft/vpp40/config.mk,
+ winnt/microsft/vpp40/lib.rsp, winnt/microsft/vpp40/mk.bat,
+ winnt/microsft/vpp40/mk.cmd, winnt/microsft/vpp40/obj.rsp,
+ winnt/microsft/vpp40/runargv.c, winnt/microsft/vpp40/template.mk,
+ winnt/microsft/vpp40/tempnam.c:
+
+ initial import
+
diff --git a/dmake/INSTALL b/dmake/INSTALL
new file mode 100755
index 000000000000..d28a9368453d
--- /dev/null
+++ b/dmake/INSTALL
@@ -0,0 +1,3 @@
+All installation and configuration information has been moved to the
+readme directory, please refer to the files found there for more
+information.
diff --git a/dmake/Makefile.am b/dmake/Makefile.am
new file mode 100755
index 000000000000..801ee2967c47
--- /dev/null
+++ b/dmake/Makefile.am
@@ -0,0 +1,64 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+AUTOMAKE_OPTIONS = foreign subdir-objects 1.9
+
+
+bin_PROGRAMS = dmake
+dmake_SOURCES = \
+ infer.c make.c stat.c expand.c dmstring.c hash.c dag.c dmake.c\
+ path.c imacs.c sysintf.c parse.c getinp.c quit.c state.c\
+ dmdump.c macparse.c rulparse.c percent.c function.c
+
+# set the include path found by configure
+INCLUDES = -I$(top_srcdir) -I$(top_builddir) \
+ -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@ -I$(top_srcdir)/@OS_TYPE@
+
+if DBUG
+dmake_SOURCES += dbug/dbug/dbug.c
+endif
+
+if OSTYPEUNIX
+dmake_SOURCES += unix/arlib.c unix/dcache.c unix/dirbrk.c unix/rmprq.c\
+ unix/ruletab.c unix/runargv.c unix/tempnam.c
+INCLUDES += -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@/gnu \
+ -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@ \
+ -I$(top_srcdir)/@OS_TYPE@
+endif
+
+if OSTYPEWIN32
+dmake_SOURCES += win95/dchdir.c win95/switchar.c \
+ msdos/dstrlwr.c msdos/arlib.c \
+ msdos/dirbrk.c unix/runargv.c \
+ unix/rmprq.c \
+ win95/microsft/ruletab.c
+INCLUDES += -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@ -I$(top_srcdir)/@OS_TYPE@
+endif
+
+SUBDIRS = startup tests
+
+EXTRA_DIST = NEWS ChangeLog
diff --git a/dmake/Makefile.in b/dmake/Makefile.in
new file mode 100755
index 000000000000..c25cc18ef247
--- /dev/null
+++ b/dmake/Makefile.in
@@ -0,0 +1,869 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+bin_PROGRAMS = dmake$(EXEEXT)
+@DBUG_TRUE@am__append_1 = dbug/dbug/dbug.c
+@OSTYPEUNIX_TRUE@am__append_2 = unix/arlib.c unix/dcache.c unix/dirbrk.c unix/rmprq.c\
+@OSTYPEUNIX_TRUE@ unix/ruletab.c unix/runargv.c unix/tempnam.c
+
+@OSTYPEUNIX_TRUE@am__append_3 = -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@/gnu \
+@OSTYPEUNIX_TRUE@ -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@ \
+@OSTYPEUNIX_TRUE@ -I$(top_srcdir)/@OS_TYPE@
+
+@OSTYPEWIN32_TRUE@am__append_4 = win95/dchdir.c win95/switchar.c \
+@OSTYPEWIN32_TRUE@ msdos/dstrlwr.c msdos/arlib.c \
+@OSTYPEWIN32_TRUE@ msdos/dirbrk.c unix/runargv.c \
+@OSTYPEWIN32_TRUE@ unix/rmprq.c \
+@OSTYPEWIN32_TRUE@ win95/microsft/ruletab.c
+
+@OSTYPEWIN32_TRUE@am__append_5 = -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@ -I$(top_srcdir)/@OS_TYPE@
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/dmakeroot.h.in $(top_srcdir)/configure AUTHORS \
+ COPYING ChangeLog INSTALL NEWS compile config.guess config.sub \
+ depcomp install-sh missing mkinstalldirs
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = dmakeroot.h
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__dmake_SOURCES_DIST = infer.c make.c stat.c expand.c dmstring.c \
+ hash.c dag.c dmake.c path.c imacs.c sysintf.c parse.c getinp.c \
+ quit.c state.c dmdump.c macparse.c rulparse.c percent.c \
+ function.c dbug/dbug/dbug.c unix/arlib.c unix/dcache.c \
+ unix/dirbrk.c unix/rmprq.c unix/ruletab.c unix/runargv.c \
+ unix/tempnam.c win95/dchdir.c win95/switchar.c msdos/dstrlwr.c \
+ msdos/arlib.c msdos/dirbrk.c win95/microsft/ruletab.c
+am__dirstamp = $(am__leading_dot)dirstamp
+@DBUG_TRUE@am__objects_1 = dbug/dbug/dbug.$(OBJEXT)
+@OSTYPEUNIX_TRUE@am__objects_2 = unix/arlib.$(OBJEXT) \
+@OSTYPEUNIX_TRUE@ unix/dcache.$(OBJEXT) unix/dirbrk.$(OBJEXT) \
+@OSTYPEUNIX_TRUE@ unix/rmprq.$(OBJEXT) unix/ruletab.$(OBJEXT) \
+@OSTYPEUNIX_TRUE@ unix/runargv.$(OBJEXT) unix/tempnam.$(OBJEXT)
+@OSTYPEWIN32_TRUE@am__objects_3 = win95/dchdir.$(OBJEXT) \
+@OSTYPEWIN32_TRUE@ win95/switchar.$(OBJEXT) \
+@OSTYPEWIN32_TRUE@ msdos/dstrlwr.$(OBJEXT) \
+@OSTYPEWIN32_TRUE@ msdos/arlib.$(OBJEXT) msdos/dirbrk.$(OBJEXT) \
+@OSTYPEWIN32_TRUE@ unix/runargv.$(OBJEXT) unix/rmprq.$(OBJEXT) \
+@OSTYPEWIN32_TRUE@ win95/microsft/ruletab.$(OBJEXT)
+am_dmake_OBJECTS = infer.$(OBJEXT) make.$(OBJEXT) stat.$(OBJEXT) \
+ expand.$(OBJEXT) dmstring.$(OBJEXT) hash.$(OBJEXT) \
+ dag.$(OBJEXT) dmake.$(OBJEXT) path.$(OBJEXT) imacs.$(OBJEXT) \
+ sysintf.$(OBJEXT) parse.$(OBJEXT) getinp.$(OBJEXT) \
+ quit.$(OBJEXT) state.$(OBJEXT) dmdump.$(OBJEXT) \
+ macparse.$(OBJEXT) rulparse.$(OBJEXT) percent.$(OBJEXT) \
+ function.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
+ $(am__objects_3)
+dmake_OBJECTS = $(am_dmake_OBJECTS)
+dmake_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(dmake_SOURCES)
+DIST_SOURCES = $(am__dmake_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = foreign subdir-objects 1.9
+dmake_SOURCES = infer.c make.c stat.c expand.c dmstring.c hash.c dag.c \
+ dmake.c path.c imacs.c sysintf.c parse.c getinp.c quit.c \
+ state.c dmdump.c macparse.c rulparse.c percent.c function.c \
+ $(am__append_1) $(am__append_2) $(am__append_4)
+
+# set the include path found by configure
+INCLUDES = -I$(top_srcdir) -I$(top_builddir) \
+ -I$(top_srcdir)/@OS_TYPE@/@OS_VERSION@ \
+ -I$(top_srcdir)/@OS_TYPE@ $(am__append_3) $(am__append_5)
+SUBDIRS = startup tests
+EXTRA_DIST = NEWS ChangeLog
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+dmakeroot.h: $(top_builddir)/config.status $(srcdir)/dmakeroot.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+dbug/dbug/$(am__dirstamp):
+ @$(mkdir_p) dbug/dbug
+ @: > dbug/dbug/$(am__dirstamp)
+dbug/dbug/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) dbug/dbug/$(DEPDIR)
+ @: > dbug/dbug/$(DEPDIR)/$(am__dirstamp)
+dbug/dbug/dbug.$(OBJEXT): dbug/dbug/$(am__dirstamp) \
+ dbug/dbug/$(DEPDIR)/$(am__dirstamp)
+unix/$(am__dirstamp):
+ @$(mkdir_p) unix
+ @: > unix/$(am__dirstamp)
+unix/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) unix/$(DEPDIR)
+ @: > unix/$(DEPDIR)/$(am__dirstamp)
+unix/arlib.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+unix/dcache.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+unix/dirbrk.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+unix/rmprq.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+unix/ruletab.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+unix/runargv.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+unix/tempnam.$(OBJEXT): unix/$(am__dirstamp) \
+ unix/$(DEPDIR)/$(am__dirstamp)
+win95/$(am__dirstamp):
+ @$(mkdir_p) win95
+ @: > win95/$(am__dirstamp)
+win95/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) win95/$(DEPDIR)
+ @: > win95/$(DEPDIR)/$(am__dirstamp)
+win95/dchdir.$(OBJEXT): win95/$(am__dirstamp) \
+ win95/$(DEPDIR)/$(am__dirstamp)
+win95/switchar.$(OBJEXT): win95/$(am__dirstamp) \
+ win95/$(DEPDIR)/$(am__dirstamp)
+msdos/$(am__dirstamp):
+ @$(mkdir_p) msdos
+ @: > msdos/$(am__dirstamp)
+msdos/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) msdos/$(DEPDIR)
+ @: > msdos/$(DEPDIR)/$(am__dirstamp)
+msdos/dstrlwr.$(OBJEXT): msdos/$(am__dirstamp) \
+ msdos/$(DEPDIR)/$(am__dirstamp)
+msdos/arlib.$(OBJEXT): msdos/$(am__dirstamp) \
+ msdos/$(DEPDIR)/$(am__dirstamp)
+msdos/dirbrk.$(OBJEXT): msdos/$(am__dirstamp) \
+ msdos/$(DEPDIR)/$(am__dirstamp)
+win95/microsft/$(am__dirstamp):
+ @$(mkdir_p) win95/microsft
+ @: > win95/microsft/$(am__dirstamp)
+win95/microsft/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) win95/microsft/$(DEPDIR)
+ @: > win95/microsft/$(DEPDIR)/$(am__dirstamp)
+win95/microsft/ruletab.$(OBJEXT): win95/microsft/$(am__dirstamp) \
+ win95/microsft/$(DEPDIR)/$(am__dirstamp)
+dmake$(EXEEXT): $(dmake_OBJECTS) $(dmake_DEPENDENCIES)
+ @rm -f dmake$(EXEEXT)
+ $(LINK) $(dmake_LDFLAGS) $(dmake_OBJECTS) $(dmake_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f dbug/dbug/dbug.$(OBJEXT)
+ -rm -f msdos/arlib.$(OBJEXT)
+ -rm -f msdos/dirbrk.$(OBJEXT)
+ -rm -f msdos/dstrlwr.$(OBJEXT)
+ -rm -f unix/arlib.$(OBJEXT)
+ -rm -f unix/dcache.$(OBJEXT)
+ -rm -f unix/dirbrk.$(OBJEXT)
+ -rm -f unix/rmprq.$(OBJEXT)
+ -rm -f unix/ruletab.$(OBJEXT)
+ -rm -f unix/runargv.$(OBJEXT)
+ -rm -f unix/tempnam.$(OBJEXT)
+ -rm -f win95/dchdir.$(OBJEXT)
+ -rm -f win95/microsft/ruletab.$(OBJEXT)
+ -rm -f win95/switchar.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dag.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmake.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmdump.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmstring.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expand.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/function.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getinp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imacs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macparse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/make.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/percent.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rulparse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@dbug/dbug/$(DEPDIR)/dbug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@msdos/$(DEPDIR)/arlib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@msdos/$(DEPDIR)/dirbrk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@msdos/$(DEPDIR)/dstrlwr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/arlib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/dcache.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/dirbrk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/rmprq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/ruletab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/runargv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/tempnam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@win95/$(DEPDIR)/dchdir.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@win95/$(DEPDIR)/switchar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@win95/microsft/$(DEPDIR)/ruletab.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`; \
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkdir_p) $(distdir)/. $(distdir)/startup
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -rm -f dbug/dbug/$(DEPDIR)/$(am__dirstamp)
+ -rm -f dbug/dbug/$(am__dirstamp)
+ -rm -f msdos/$(DEPDIR)/$(am__dirstamp)
+ -rm -f msdos/$(am__dirstamp)
+ -rm -f unix/$(DEPDIR)/$(am__dirstamp)
+ -rm -f unix/$(am__dirstamp)
+ -rm -f win95/$(DEPDIR)/$(am__dirstamp)
+ -rm -f win95/$(am__dirstamp)
+ -rm -f win95/microsft/$(DEPDIR)/$(am__dirstamp)
+ -rm -f win95/microsft/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR) dbug/dbug/$(DEPDIR) msdos/$(DEPDIR) unix/$(DEPDIR) win95/$(DEPDIR) win95/microsft/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR) dbug/dbug/$(DEPDIR) msdos/$(DEPDIR) unix/$(DEPDIR) win95/$(DEPDIR) win95/microsft/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-am clean clean-binPROGRAMS clean-generic clean-recursive \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-recursive distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/NEWS b/dmake/NEWS
new file mode 100755
index 000000000000..bff5353be7bc
--- /dev/null
+++ b/dmake/NEWS
@@ -0,0 +1,316 @@
+News file for the dmake version that is hosted on the OpenOffice.org
+cvs. #i<number># denote issues tracked by the OpenOffice.org issue tracking
+system, see <http://qa.openoffice.org/issue_handling/project_issues.html>.
+
+Version 4.12
+============
+
+Volker Quetschke (vq@openoffice.org)
+#i83540# Add parallel building mode, see the MULTI PROCESSING section in
+the dmake man page, for native W32 dmake (MSVC 6, and newer and MinGW)
+versions.
+
+Version 4.11
+============
+
+Yuri Dario (ydario@openoffice.org)
+#i81855, CWS os2port01# Port dmake to OS/2.
+
+Volker Quetschke (vq@openoffice.org)
+#i81252# Add a new control macro SHELLCMDQUOTE that can be used to add
+additional characters before and after the command string if the recipe is
+executed using a shell. This macro is used to avoid problems with quoting
+when using cmd.exe or command.com.
+
+Volker Quetschke (vq@openoffice.org)
+#i81296, i64572# Improve dependency handling of prerequisites.
+
+Volker Quetschke (vq@openoffice.org)
+#i80687, i66751# Allow the use of .PHONY for %-targets.
+
+Volker Quetschke (vq@openoffice.org)
+#i80010, i80009# Fix handling of quoted filenames for :1 :b :d :e :f
+and :i macro expansions.
+
+Volker Quetschke (vq@openoffice.org)
+#i78776# Add a new function macro $(normpath[,para] data) and a new macro
+extension to normalise the given data or macro content. The normalization
+is done element-wise (whitespace separated) on the given data. Quotes can
+be used to normalize filenames that contain whitespace characters.
+On cygwin the result honors the setting of .WINPATH to determine the output
+format. If the optional parameter para is given for the function macro its
+expanded value is used to override the .WINPATH setting for the output.
+
+Version 4.10 (skipped)
+======================
+
+This number was skipped to avoid confusion with Version 4.1, patch level 0
+which identified itself as "Version 4.10, PL 0".
+
+Version 4.9
+===========
+
+Volker Quetschke (vq@openoffice.org)
+#i74700# Add a new special macro OOODMAKEMODE that is used to toggle
+OOo build specific behavior. If OOODMAKEMODE is set (i.e. it begins with y)
+a possible leading ./ of a path will no longer be removed during target
+normalization.
+
+
+Version 4.8
+===========
+
+Volker Quetschke (vq@openoffice.org)
+#i73499# Add new .WINPATH attribute to generate Windows style paths (with
+regular slashes) instead of the default cygwin style (POSIX) paths for
+dmake's dynamic macros.
+
+This attribute is specific for cygwin dmake executables and non-cygwin
+environments ignore this attribute. This feature can be used to create DOS
+style path parameters for native W32 programs from dynamic macros.
+
+The windows style paths use regular slashes ('/') instead of the usual
+windows backslash ('\') as directory separator to avoid quoting problems
+(It still is a cygwin dmake feature!) and cygwin as well as native windows
+programs should have no problems using this (c:/foo/bar) path
+representation.
+
+The affected macros are $@, $*, $>, $?, $<, $&, $^ and $(PWD), $(MAKEDIR)
+and $(TMD).
+
+Examples:
+ Content of $(PWD) without .WINPATH (default): /cygdrive/c/temp
+
+ Content of $(PWD) with .WINPATH set: c:/temp
+
+
+Version 4.7
+===========
+
+Volker Quetschke (vq@openoffice.org)
+#i71422# Add @@ as a new recipe line property. This new property is a
+stronger version of the already existing @ recipe property. The recipe
+line and the output (stdout and stderr) of the executed recipe are suppressed
+and *NOT* shown on the terminal.
+Note: Previously the second @ sign was ignored, that means that using this
+new feature doesn't break backwards compatibility but the command output
+is naturally not suppressed in older versions.
+
+Volker Quetschke (vq@openoffice.org)
+#i70210# Dmake now works correctly with empty dynamic prerequisites.
+
+Volker Quetschke (vq@openoffice.org)
+#i70168# Improve dmakes handling of literal $ characters in target and
+prerequisite filenames. This was not working before and is working now
+but the use of literal $ characters in filenames is still strongly
+discouraged. See the man page for details.
+
+Volker Quetschke (vq@openoffice.org)
+#i69742# Normalize the pathnames of targets and prerequisites to the shortest
+(or most natural, see below for the cygwin case) representation.
+Now "./foo", "bar/../foo" and foo are recognized as the same file.
+
+For cygwin this allows the use of target and prerequisite names with DOS
+like pathnames with drive letters (with / and \ as possible path seperators)
+and cygwin POSIX pathnames. As the internal format uses cygwin's natural
+POSIX representation runtime macros will result in POSIX paths.
+
+Version 4.6
+===========
+
+Volker Quetschke (vq@openoffice.org)
+#i67589# Implement the internal dmake commands noop and echo. These commands
+were already existing for the native Windows version but only partially
+documented.
+
+Volker Quetschke (vq@openoffice.org)
+#i67166# Issue a warning when a previously unset macro (i.e. assumed to be
+empty) is used and later set to a different value.
+
+Volker Quetschke (vq@openoffice.org)
+#i66567# Issue a warning when .SUFFIXES is used. This special target had no
+special meaning (anymore?) and was always (at least since version 4.2)
+ignored.
+
+Volker Quetschke (vq@openoffice.org)
+#i67025# Fix a bug that was introduced in dmake 4.5 and led dmake to falsely
+issue an error if a %-target was defined with the .SILENT attribute and dmake
+was started with the -vr (included in -v) verbose flag.
+
+Version 4.5
+===========
+
+Volker Quetschke (vq@openoffice.org)
+#i66385# Fix the handling of .<suffix> targets. Always treat these targets
+as meta targets regardless of the AUGMAKE (-A) status. Previously this was
+enabled when the AUGMAKE was *not* set to 'yes' or the -A switch was given.
+
+#i66083# We now stop with an error if AUGMAKE meta targets and regular
+targets are used in one rule definition. As the syntax of these target
+definitions is slightly different this hints to an error in the makefile,
+most probably a misspelled attribute or special target.
+
+#i48087#, #i64869# The parsing of %-target definitions was fixed and
+enhanced. Prior to dmake 4.5 only one %-target per target-definition worked
+reliably, now this works well, but to help projects that still use older
+versions a warning was added.
+
+It's not very nice to issue a warning for something that works now but
+didn't before. This was only done to aid development and will probably
+be removed in future versions.
+
+There was, and still is, that for a bug in dmake for %-targets with more
+than one (not indirect) prerequisite only the first prerequisite is used.
+This will be fixed in future versions but until this happens we issue a
+warning that prerequisites are ignored.
+
+#i65122# The :| rule operator was handled differently from what the man
+page said. The man page was adapted to reflect reality. Changing dmakes
+behavior to match the man page would have introduced a lot of compatibility
+issues.
+
+Version 4.4
+===========
+
+2006/02/03 Volker Quetschke (vq@openoffice.org)
+#i61170# Fix the TMD macro. Up to now the TMD macro appended a directory
+separator if it ended in "..", but most of the time it was not set correctly
+at all and/or without a trailing slash.
+Note: If your application relies on TMD please check the dmake manual page
+for its definition and fix your makefiles if needed.
+
+2006/02/01 Volker Quetschke (vq@openoffice.org)
+#i60948# Add -m option family to generate timing information for targets
+and/or recipes.
+
+2005/09/19 Volker Quetschke (vq@openoffice.org)
+#i53148# Fix $(shell ...) macro picking up the output of earlier
+recipe lines in parallel builds.
+#i54766# Ensure that all previous recipe lines to a recipe
+line containing a $(shell ...) macro have finished before executing
+the macro in parallel builds.
+
+2005/06/01 Volker Quetschke (vq@openoffice.org)
+#i39248# Add a testsuite to test some dmake features (only for autotools
+builds). Start the tests with "make check".
+
+2005/04/21 Volker Quetschke (vq@openoffice.org)
+#i47851# Increase the version number to 4.4-cvs and slightly rearrange the
+output of "dmake -V".
+Remove the hard-coded (in autotools builds) OS macro. It had the wrong value
+to be usable with the startup/*.mk and is not mentioned in the man page.
+Clean up configure.in and friends.
+
+2005/04/20 Volker Quetschke (vq@openoffice.org)
+#i43310# Fix percent (%) rules to recognize prerequisites that are defined
+with the multiple target rule operator (::).
+This implicitly fixes the similar problem for .<suffix>.<suffix> targets.
+
+2005/04/16 Volker Quetschke (vq@openoffice.org)
+#i46987# Fix the documentation of the $(mktmp ...) function macro. This is
+not necessarily a new feature as the macro works this way since dmake was
+imported into the OpenOffice.org cvs but mentioning it here might help users
+of dmake upgrading from very old versions.
+
+Add the "map escape codes" $(...:m) macro expansion that allows to expand
+escape codes in macros. It can also be used to reproduce the former (pre
+OpenOffice.org cvs) $(mktmp ...) behavior.
+
+2005/04/10 Volker Quetschke (vq@openoffice.org)
+#i43252# Introduce the macro ABSMAKECMD that's value for a native Windows
+dmake executable (compiled with MS Visual C++ or MinGW) is the absolute
+filename and NULL for other operating systems or dmake build with other
+compilers.
+If DMAKEROOT is not changed and only for native Windows dmake versions the
+value of DMAKEROOT now defaults to "$(ABSMAKECMD:d)startup".
+This allows to use the startup files from the startup directory from the
+same location where the dmake.exe is located.
+
+2005/04/08 Steve Hay (shay@openoffice.org)
+#i43241# Fix build problems with VC++ (in non-OOo environment) and fix
+the dmake makefiles so that dmake can rebuild itself (VC++ only).
+
+2005/03/14 Volker Quetschke (vq@openoffice.org)
+#i44959# Fix problems when a continued line is followed by an empty
+or comment line.
+
+2005/03/13 Volker Quetschke (vq@openoffice.org)
+#i37053# Fix function macro problems with continued lines.
+
+2004/11/23 Volker Quetschke (vq@openoffice.org)
+#i37491# Predefine dmake macro containing one space (SPACECHAR).
+
+2004/11/21 Volker Quetschke (vq@openoffice.org)
+#i36027# Improve function macro parameter parsing.
+
+Version 4.3
+===========
+
+2004/10/07 Volker Quetschke (vq@openoffice.org)
+#i34746# Fix timestamp of phony targets with prerequisites.
+
+2004/07/11 Volker Quetschke (vq@openoffice.org)
+#i31255# Add verbose recipe echoing option (-vr).
+
+2004/07/06 Volker Quetschke (vq@openoffice.org)
+#i30779# Fix to allow dmake to echo recipe lines when inference is used
+to create files that are to be read by .INCLUDE.
+
+2004/04/01 Michael Meeks (mmeeks@openoffice.org)
+#i27319#, #i27981# Don't handle environment variables that begin with a
+'!', they are used by Cygwin internally and confuse dmake.
+
+2004/01/09 Dan Williams (fa@openoffice.org)
+#i17992# Allows the nesting of expressions and a much more complex syntax
+for dmake. It is now possible to nest expressions with () and any
+combination of || and &&.
+Example:
+.IF (("$(OS)"=="MACOSX"&&"$(COM)"=="GCC")||"$(OS)"=="LINUX") && "$(GUIBASE)"=="unx"
+...
+.ENDIF
+
+2003/10/19 Ken Foskey (waratah@openoffice.org)
+#i20504# Correct processing of .LIBRARY targets.
+
+2003/10/08 Chris Halls (haggai@openoffice.org)
+#i7800# Fix tempnam security problem.
+
+2003/03/08 Volker Quetschke (vq@openoffice.org)
+#i10910# Use the build-in tempnam function for MS VC6.
+
+2003/03/05 Volker Quetschke (vq@openoffice.org)
+#i11861# Switch to newer autotools autoconf 2.5x and automake 1.5 and
+add MinGW and MSVC to the configure buildable targets.
+
+2002/10/11 Ken Foskey (waratah@openoffice.org)
+Fix the "lost a child" problem. (Part II)
+
+2002/10/04 Ken Foskey (waratah@openoffice.org)
+Rework the configure process.
+
+2002/04/10 Hans-Joachim Lankenau (hjs@openoffice.org)
+Don't search INCLUDEDIRS if the filename to be included starts at fs-root.
+
+2001/05/29 Patrick Luby (pluby@openoffice.org)
+Added forceful exit to avoid infinite loop that sometimes occurs when
+there is a fatal error. Lost a child problem. (Part I)
+
+Version 4.2
+===========
+(Note, the dmake -V output was not changed and still said
+"Version 4.10, PL 0". This probably should have been 4.1)
+
+2001/04/20 Martin Hollmichel (mh@openoffice.org)
+First autoconfiscation of dmake.
+
+2001/02/13 Hans-Joachim Lankenau (hjs@openoffice.org)
+Fix for leaving tmpfiles when building group targets.
+
+2000/09/22 Jens-Heiner Rechtien (hr@openoffice.org)
+Initial import of dmake into OpenOffice.org cvs
+
+before 2000/09/22 ?
+Add smaller/greater arithmetic for .IF conditions.
+
+1999/03/18 Hans-Joachim Lankenau (hjs@openoffice.org)
+Implement boolean expression "or".
diff --git a/dmake/acinclude.m4 b/dmake/acinclude.m4
new file mode 100755
index 000000000000..6b7e9291c5f9
--- /dev/null
+++ b/dmake/acinclude.m4
@@ -0,0 +1,3 @@
+## -*- autoconf -*-
+
+dnl Currently no local macros are needed.
diff --git a/dmake/aclocal.m4 b/dmake/aclocal.m4
new file mode 100755
index 000000000000..00176eea12b8
--- /dev/null
+++ b/dmake/aclocal.m4
@@ -0,0 +1,908 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([acinclude.m4])
diff --git a/dmake/alloc.h b/dmake/alloc.h
new file mode 100644
index 000000000000..876284de06a8
--- /dev/null
+++ b/dmake/alloc.h
@@ -0,0 +1,59 @@
+/* RCS $Id: alloc.h,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $
+--
+-- SYNOPSIS
+-- Macros for allocating memory.
+--
+-- DESCRIPTION
+-- A somewhat nicer interface to malloc and calloc.
+-- Here we standardise the calling convention with a common macro
+-- interface.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef ALLOC_h
+#define ALLOC_h
+
+/* DO NOT CHANGE these! These are the definitions that the make source
+ * uses for allocating memory. They must be defined for make to compile
+ * properly.
+ */
+
+/* This is the only place that we define size_t now. This should be more
+ * than enough! */
+#if __STDC__
+#else
+# if !defined(_TYPES_) && !defined(M_XENIX) && !defined(atarist) && !defined(_MPW) && !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(__size_t) && !defined(_WIN32)
+# if defined(MSDOS) || defined(__MSDOS__)
+# undef size_t
+ typedef unsigned size_t;
+# else
+ typedef long size_t;
+# endif
+# endif
+#endif
+
+#define usizeof(t) (size_t)sizeof(t)
+
+#define FREE(p) free((char*)(p))
+#define MALLOC(n, t) (t*) malloc((unsigned int)(n)*usizeof(t))
+#define CALLOC(n, t) (t*) calloc((unsigned int)(n), usizeof(t))
+
+#define TALLOC(p, n, t) if ((p = CALLOC(n, t)) == (t*)0) {No_ram();}
+
+#endif
+
diff --git a/dmake/autogen.sh b/dmake/autogen.sh
new file mode 100755
index 000000000000..9a803486cad4
--- /dev/null
+++ b/dmake/autogen.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+PROJECT=dmake
+TEST_TYPE=-f
+FILE=make.c
+
+DIE=0
+
+# cvs may leave some files unwritable
+(chmod -Rf u+rw $srcdir) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have owner permissions for all files and subdirectories"
+ echo "in $srcdir"
+ DIE=1
+}
+
+(autoconf --version ) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile $PROJECT."
+ DIE=1
+}
+
+(automake --version ) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have automake installed to compile $PROJECT."
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+test $TEST_TYPE $FILE || {
+ echo "You must run this script in the top-level $PROJECT directory"
+ exit 1
+}
+
+if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+# needed when autotools version changed
+aclocal
+
+# After the first run of autoconf a configure file exists.
+# 'configure --enable-maintainer-mode' will start all other needed autotool helpers.
+autoconf
+
+#automake -a -c -f
+
+cd $ORIGDIR
+
+$srcdir/configure --enable-maintainer-mode --prefix=/usr/local "$@"
+
+echo
+echo "Now execute GNU make to compile $PROJECT."
diff --git a/dmake/compile b/dmake/compile
new file mode 100755
index 000000000000..1b1d23216958
--- /dev/null
+++ b/dmake/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/dmake/config.guess b/dmake/config.guess
new file mode 100755
index 000000000000..917bbc50f36a
--- /dev/null
+++ b/dmake/config.guess
@@ -0,0 +1,1463 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-07-08'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ *86) UNAME_PROCESSOR=i686 ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/dmake/config.h.in b/dmake/config.h.in
new file mode 100644
index 000000000000..c8aa63a861b9
--- /dev/null
+++ b/dmake/config.h.in
@@ -0,0 +1,184 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Build info string */
+#undef BUILDINFO
+
+/* Assume case insensitive file system. */
+#undef CASE_INSENSITIVE_FS
+
+/* Enables the use of spawn instead of fork/exec if it is supported. */
+#undef ENABLE_SPAWN
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `getwd' function. */
+#undef HAVE_GETWD
+
+/* Define to 1 if the system has the type `int16'. */
+#undef HAVE_INT16
+
+/* Define to 1 if the system has the type `int32'. */
+#undef HAVE_INT32
+
+/* Define to 1 if the system has the type `int8'. */
+#undef HAVE_INT8
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the `settz' function. */
+#undef HAVE_SETTZ
+
+/* Define to 1 if you have the `setvbuf' function. */
+#undef HAVE_SETVBUF
+
+/* Define to 1 if you have the <spawn.h> header file. */
+#undef HAVE_SPAWN_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlwr' function. */
+#undef HAVE_STRLWR
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the `tempnam' function. */
+#undef HAVE_TEMPNAM
+
+/* Define to 1 if you have the `tzset' function. */
+#undef HAVE_TZSET
+
+/* Define to 1 if the system has the type `uint16'. */
+#undef HAVE_UINT16
+
+/* Define to 1 if the system has the type `uint32'. */
+#undef HAVE_UINT32
+
+/* Define to 1 if the system has the type `uint8'. */
+#undef HAVE_UINT8
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
+#undef HAVE_UTIME_NULL
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/dmake/config.sub b/dmake/config.sub
new file mode 100755
index 000000000000..1c366dfde9ab
--- /dev/null
+++ b/dmake/config.sub
@@ -0,0 +1,1579 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-07-08'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | ms1 \
+ | msp430 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m32c)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | ms1-* \
+ | msp430-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ m32c-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16c)
+ basic_machine=cr16c-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/dmake/configure b/dmake/configure
new file mode 100755
index 000000000000..f8a1bd822914
--- /dev/null
+++ b/dmake/configure
@@ -0,0 +1,9000 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for dmake 4.12.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='dmake'
+PACKAGE_TARNAME='dmake'
+PACKAGE_VERSION='4.12'
+PACKAGE_STRING='dmake 4.12'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="man/dmake.tf"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+MAINTAINER_MODE_TRUE
+MAINTAINER_MODE_FALSE
+MAINT
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CPP
+LN_S
+RANLIB
+OSTYPEUNIX_TRUE
+OSTYPEUNIX_FALSE
+OSTYPEWIN32_TRUE
+OSTYPEWIN32_FALSE
+OS_TYPE
+OS_VERSION
+DBUG_TRUE
+DBUG_FALSE
+DMAKEROOT_H_LINE1
+GREP
+EGREP
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures dmake 4.12 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/dmake]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of dmake 4.12:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-dbug: Enable build with dbug macros.
+
+ --enable-spawn: Enables the use of spawn instead of fork/exec
+ if it is supported.
+
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" || continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+dmake configure 4.12
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by dmake $as_me 4.12, which was
+generated by GNU Autoconf 2.61. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+ac_header_list="$ac_header_list utime.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+BUILDINFO="$build"
+
+
+am__api_version="1.9"
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm -f conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ SET_MAKE=
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='dmake'
+ VERSION='4.12'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+ xno)
+ { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+ { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+else
+ { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+fi
+set dummy $CC; ac_cc=`echo $2 |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ test -f conftest2.$ac_objext && { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ test -f conftest2.$ac_objext && { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# Check whether --enable-dbug was given.
+if test "${enable_dbug+set}" = set; then
+ enableval=$enable_dbug;
+fi
+
+
+# Check whether --enable-spawn was given.
+if test "${enable_spawn+set}" = set; then
+ enableval=$enable_spawn;
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ SET_MAKE=
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+
+{ echo "$as_me:$LINENO: checking the operating system" >&5
+echo $ECHO_N "checking the operating system... $ECHO_C" >&6; }
+
+_os=`uname`
+
+if test `echo $_os | $AWK -F_ '{ print $1 }'` = "CYGWIN"; then
+ if test "$GCC" = "yes"; then
+ if test `$CC -dumpmachine | $AWK -F- '{ print $3 }'` = "mingw32"; then
+ _os="MINGW"
+ else
+ _os="CYGWIN"
+ fi
+ else
+ _os="MSVC6"
+ fi
+fi
+
+
+## At the moment all except mingw builds are OS_TYPE unix
+OS_TYPE=unix
+
+## The following allows like systems to share settings this is not meant to
+## Imply that these OS are the same thing.
+case "$_os" in
+ "OS/2")
+ OS_VERSION=os2
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "SunOS")
+ OS_VERSION=solaris
+ ;;
+ Linux|GNU|GNU/*)
+ OS_VERSION=linux
+ ;;
+ "CYGWIN")
+ OS_VERSION=cygwin
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "MINGW")
+ OS_VERSION=mingw
+ OS_TYPE=winnt
+ BUILDINFO="Windows / MinGW"
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "MSVC6")
+ OS_VERSION=msvc6
+ OS_TYPE=winnt
+ BUILDINFO="Windows / MS Visual C++"
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "Darwin")
+ OS_VERSION=macosx
+# MacOSX is not garuanteed to be case insensitive, assume it's case
+# sensitive, see issue 73661 for details.
+ ;;
+ "FreeBSD")
+ OS_VERSION=linux
+ ;;
+ "OSF1")
+ OS_VERSION=sysvr4
+ ;;
+ "NetBSD")
+ OS_VERSION=linux
+ ;;
+ "IRIX")
+ OS_VERSION=sysvr4
+ ;;
+ "IRIX64")
+ OS_VERSION=sysvr4
+ ;;
+ "AIX")
+ OS_VERSION=sysvr4
+ ;;
+ "OpenBSD")
+ OS_VERSION=linux
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: $_os operating system is not suitable to build dmake!" >&5
+echo "$as_me: error: $_os operating system is not suitable to build dmake!" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+{ echo "$as_me:$LINENO: result: checked ($_os)" >&5
+echo "${ECHO_T}checked ($_os)" >&6; }
+
+
+
+if test x$OS_TYPE = xunix; then
+ OSTYPEUNIX_TRUE=
+ OSTYPEUNIX_FALSE='#'
+else
+ OSTYPEUNIX_TRUE='#'
+ OSTYPEUNIX_FALSE=
+fi
+
+
+
+if test x$OS_TYPE = xwinnt; then
+ OSTYPEWIN32_TRUE=
+ OSTYPEWIN32_FALSE='#'
+else
+ OSTYPEWIN32_TRUE='#'
+ OSTYPEWIN32_FALSE=
+fi
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILDINFO "$BUILDINFO"
+_ACEOF
+
+
+if test x$CASE_INSENSITIVE_FS = xtrue; then
+
+cat >>confdefs.h <<\_ACEOF
+#define CASE_INSENSITIVE_FS 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether to do a build with dbug macros" >&5
+echo $ECHO_N "checking whether to do a build with dbug macros... $ECHO_C" >&6; }
+if test -n "$enable_dbug" && test "$enable_dbug" != "no"; then
+ DBUG="1"
+ CPPFLAGS="$CPPFLAGS -DDBUG=1 -I\$(top_srcdir)/dbug/dbug"
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ DBUG=""
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+if test -n "$DBUG"; then
+ DBUG_TRUE=
+ DBUG_FALSE='#'
+else
+ DBUG_TRUE='#'
+ DBUG_FALSE=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if spawn shall be used" >&5
+echo $ECHO_N "checking if spawn shall be used... $ECHO_C" >&6; }
+if test -n "$enable_spawn" && test "$enable_spawn" != "no"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_SPAWN 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+eval dmakerootprefix="$datarootdir"
+# $datadir is ${prefix}/share if not overridden
+test "x$dmakerootprefix" != "x${dmakerootprefix##NONE}" && dmakerootprefix=${ac_default_prefix}/share
+
+if test x$OS_TYPE = xunix; then
+DMAKEROOT_H_LINE1='"DMAKEROOT := '${dmakerootprefix}'/startup",'
+fi
+
+
+ac_config_files="$ac_config_files dmakeroot.h Makefile startup/config.mk startup/Makefile startup/unix/Makefile startup/unix/linux/Makefile startup/unix/solaris/Makefile startup/unix/macosx/Makefile startup/unix/sysvr4/Makefile startup/unix/cygwin/Makefile startup/unix/os2/Makefile startup/winnt/Makefile startup/winnt/mingw/Makefile startup/winnt/msvc6/Makefile tests/Makefile"
+
+
+
+#AM_PROG_LIBTOOL
+
+
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_opendir=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_opendir+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+ :
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_opendir=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_opendir+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+ :
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ # Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_GREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ # Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_EGREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in fcntl.h limits.h strings.h sys/types.h sys/stat.h unistd.h errno.h utime.h spawn.h wait.h sys/wait.h sys/time.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef off_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_off_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_off_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
+if test $ac_cv_type_off_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef size_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_size_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for int8" >&5
+echo $ECHO_N "checking for int8... $ECHO_C" >&6; }
+if test "${ac_cv_type_int8+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef int8 ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_int8=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int8=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int8" >&5
+echo "${ECHO_T}$ac_cv_type_int8" >&6; }
+if test $ac_cv_type_int8 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT8 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking for uint8" >&5
+echo $ECHO_N "checking for uint8... $ECHO_C" >&6; }
+if test "${ac_cv_type_uint8+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef uint8 ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_uint8=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uint8=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uint8" >&5
+echo "${ECHO_T}$ac_cv_type_uint8" >&6; }
+if test $ac_cv_type_uint8 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT8 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking for int16" >&5
+echo $ECHO_N "checking for int16... $ECHO_C" >&6; }
+if test "${ac_cv_type_int16+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef int16 ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_int16=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int16=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int16" >&5
+echo "${ECHO_T}$ac_cv_type_int16" >&6; }
+if test $ac_cv_type_int16 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT16 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking for uint16" >&5
+echo $ECHO_N "checking for uint16... $ECHO_C" >&6; }
+if test "${ac_cv_type_uint16+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef uint16 ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_uint16=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uint16=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uint16" >&5
+echo "${ECHO_T}$ac_cv_type_uint16" >&6; }
+if test $ac_cv_type_uint16 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT16 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking for int32" >&5
+echo $ECHO_N "checking for int32... $ECHO_C" >&6; }
+if test "${ac_cv_type_int32+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef int32 ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_int32=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int32=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int32" >&5
+echo "${ECHO_T}$ac_cv_type_int32" >&6; }
+if test $ac_cv_type_int32 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT32 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking for uint32" >&5
+echo $ECHO_N "checking for uint32... $ECHO_C" >&6; }
+if test "${ac_cv_type_uint32+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef uint32 ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_uint32=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uint32=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uint32" >&5
+echo "${ECHO_T}$ac_cv_type_uint32" >&6; }
+if test $ac_cv_type_uint32 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT32 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for short" >&5
+echo $ECHO_N "checking for short... $ECHO_C" >&6; }
+if test "${ac_cv_type_short+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef short ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_short=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_short=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
+echo "${ECHO_T}$ac_cv_type_short" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of short" >&5
+echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_short=$ac_lo;;
+'') if test "$ac_cv_type_short" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_short=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef short ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_short=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_short" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef int ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_int=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') if test "$ac_cv_type_int" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_int=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_int=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_int" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+{ echo "$as_me:$LINENO: checking for working memcmp" >&5
+echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }
+if test "${ac_cv_func_memcmp_working+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_working=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = '\100', c1 = '\200', c2 = '\201';
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ return 1;
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ return 1;
+ }
+ return 0;
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_memcmp_working=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; }
+test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+ *" memcmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
+esac
+
+
+{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_signal=int
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_signal=void
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+
+
+
+for ac_header in $ac_header_list
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether utime accepts a null argument" >&5
+echo $ECHO_N "checking whether utime accepts a null argument... $ECHO_C" >&6; }
+if test "${ac_cv_func_utime_null+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ rm -f conftest.data; >conftest.data
+# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
+if test "$cross_compiling" = yes; then
+ ac_cv_func_utime_null=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ #ifdef HAVE_UTIME_H
+ # include <utime.h>
+ #endif
+int
+main ()
+{
+struct stat s, t;
+ return ! (stat ("conftest.data", &s) == 0
+ && utime ("conftest.data", 0) == 0
+ && stat ("conftest.data", &t) == 0
+ && t.st_mtime >= s.st_mtime
+ && t.st_mtime - s.st_mtime < 120);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_utime_null=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_utime_null=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_utime_null" >&5
+echo "${ECHO_T}$ac_cv_func_utime_null" >&6; }
+if test $ac_cv_func_utime_null = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UTIME_NULL 1
+_ACEOF
+
+fi
+rm -f conftest.data
+
+
+for ac_func in vprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+{ echo "$as_me:$LINENO: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6; }
+if test "${ac_cv_func__doprnt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define _doprnt innocuous__doprnt
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef _doprnt
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char _doprnt ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub__doprnt || defined __stub____doprnt
+choke me
+#endif
+
+int
+main ()
+{
+return _doprnt ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func__doprnt=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func__doprnt=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6; }
+if test $ac_cv_func__doprnt = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DOPRNT 1
+_ACEOF
+
+fi
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in getcwd getwd strerror setvbuf tzset settz mkstemp tempnam gettimeofday
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+# Usefull, but special to newlib/MSVC
+
+for ac_func in strlwr
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${OSTYPEUNIX_TRUE}" && test -z "${OSTYPEUNIX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"OSTYPEUNIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OSTYPEUNIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${OSTYPEWIN32_TRUE}" && test -z "${OSTYPEWIN32_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"OSTYPEWIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OSTYPEWIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${DBUG_TRUE}" && test -z "${DBUG_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"DBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"DBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by dmake $as_me 4.12, which was
+generated by GNU Autoconf 2.61. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+dmake config.status 4.12
+configured by $0, generated by GNU Autoconf 2.61,
+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ CONFIG_SHELL=$SHELL
+ export CONFIG_SHELL
+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "dmakeroot.h") CONFIG_FILES="$CONFIG_FILES dmakeroot.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "startup/config.mk") CONFIG_FILES="$CONFIG_FILES startup/config.mk" ;;
+ "startup/Makefile") CONFIG_FILES="$CONFIG_FILES startup/Makefile" ;;
+ "startup/unix/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/Makefile" ;;
+ "startup/unix/linux/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/linux/Makefile" ;;
+ "startup/unix/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/solaris/Makefile" ;;
+ "startup/unix/macosx/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/macosx/Makefile" ;;
+ "startup/unix/sysvr4/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/sysvr4/Makefile" ;;
+ "startup/unix/cygwin/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/cygwin/Makefile" ;;
+ "startup/unix/os2/Makefile") CONFIG_FILES="$CONFIG_FILES startup/unix/os2/Makefile" ;;
+ "startup/winnt/Makefile") CONFIG_FILES="$CONFIG_FILES startup/winnt/Makefile" ;;
+ "startup/winnt/mingw/Makefile") CONFIG_FILES="$CONFIG_FILES startup/winnt/mingw/Makefile" ;;
+ "startup/winnt/msvc6/Makefile") CONFIG_FILES="$CONFIG_FILES startup/winnt/msvc6/Makefile" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CPP!$CPP$ac_delim
+LN_S!$LN_S$ac_delim
+RANLIB!$RANLIB$ac_delim
+OSTYPEUNIX_TRUE!$OSTYPEUNIX_TRUE$ac_delim
+OSTYPEUNIX_FALSE!$OSTYPEUNIX_FALSE$ac_delim
+OSTYPEWIN32_TRUE!$OSTYPEWIN32_TRUE$ac_delim
+OSTYPEWIN32_FALSE!$OSTYPEWIN32_FALSE$ac_delim
+OS_TYPE!$OS_TYPE$ac_delim
+OS_VERSION!$OS_VERSION$ac_delim
+DBUG_TRUE!$DBUG_TRUE$ac_delim
+DBUG_FALSE!$DBUG_FALSE$ac_delim
+DMAKEROOT_H_LINE1!$DMAKEROOT_H_LINE1$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$ac_file_inputs $ac_f"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input="Generated from "`IFS=:
+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out"; rm -f "$tmp/out";;
+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+ esac
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status. If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless. But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
+ac_dB='\\)[ (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+ sed -n '
+ t rset
+ :rset
+ s/^[ ]*#[ ]*define[ ][ ]*//
+ t ok
+ d
+ :ok
+ s/[\\&,]/\\&/g
+ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+ ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[ #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+ # Write a here document:
+ cat >>$CONFIG_STATUS <<_ACEOF
+ # First, check the format of the line:
+ cat >"\$tmp/defines.sed" <<\\CEOF
+/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
+/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
+b
+:def
+_ACEOF
+ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+ grep . conftest.tail >/dev/null || break
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+ if test x"$ac_file" != x-; then
+ echo "/* $configure_input */" >"$tmp/config.h"
+ cat "$ac_result" >>"$tmp/config.h"
+ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f $ac_file
+ mv "$tmp/config.h" $ac_file
+ fi
+ else
+ echo "/* $configure_input */"
+ cat "$ac_result"
+ fi
+ rm -f "$tmp/out12"
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+
+ esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
diff --git a/dmake/configure.in b/dmake/configure.in
new file mode 100755
index 000000000000..498c7b2372de
--- /dev/null
+++ b/dmake/configure.in
@@ -0,0 +1,220 @@
+
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.59)
+
+dnl Set the package version
+dnl Don't forget to update the PACKAGE, VERSION and BUILDINFO macros in
+dnl dmake/win95/microsft/config.h to keep the native Microsoft C++
+dnl compiler build happy.
+AC_INIT(dmake, 4.12)
+AC_CANONICAL_BUILD
+BUILDINFO="$build"
+
+AC_CONFIG_SRCDIR(man/dmake.tf)
+AM_INIT_AUTOMAKE
+
+AM_MAINTAINER_MODE
+dnl Use this instead of AC_PROG_.. version
+AM_PROG_CC_C_O
+
+AC_CONFIG_HEADER(config.h)
+
+dnl Extra parameters
+AC_ARG_ENABLE(dbug,
+[ --enable-dbug: Enable build with dbug macros.
+],,)
+
+AC_ARG_ENABLE(spawn,
+[ --enable-spawn: Enables the use of spawn instead of fork/exec
+ if it is supported.
+],,)
+dnl Checks for programs.
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+
+dnl Checks for utilities.
+AC_PROG_AWK
+
+dnl Checks for OS
+AC_MSG_CHECKING([the operating system])
+
+_os=`uname`
+
+if test `echo $_os | $AWK -F_ '{ print $1 }'` = "CYGWIN"; then
+ if test "$GCC" = "yes"; then
+ if test `$CC -dumpmachine | $AWK -F- '{ print $3 }'` = "mingw32"; then
+ _os="MINGW"
+ else
+ _os="CYGWIN"
+ fi
+ else
+ _os="MSVC6"
+ fi
+fi
+
+
+## At the moment all except mingw builds are OS_TYPE unix
+OS_TYPE=unix
+
+## The following allows like systems to share settings this is not meant to
+## Imply that these OS are the same thing.
+case "$_os" in
+ "OS/2")
+ OS_VERSION=os2
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "SunOS")
+ OS_VERSION=solaris
+ ;;
+ Linux|GNU|GNU/*)
+ OS_VERSION=linux
+ ;;
+ "CYGWIN")
+ OS_VERSION=cygwin
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "MINGW")
+ OS_VERSION=mingw
+ OS_TYPE=winnt
+ BUILDINFO="Windows / MinGW"
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "MSVC6")
+ OS_VERSION=msvc6
+ OS_TYPE=winnt
+ BUILDINFO="Windows / MS Visual C++"
+ CASE_INSENSITIVE_FS=true
+ ;;
+ "Darwin")
+ OS_VERSION=macosx
+# MacOSX is not garuanteed to be case insensitive, assume it's case
+# sensitive, see issue 73661 for details.
+ ;;
+ "FreeBSD")
+ OS_VERSION=linux
+ ;;
+ "OSF1")
+ OS_VERSION=sysvr4
+ ;;
+ "NetBSD")
+ OS_VERSION=linux
+ ;;
+ "IRIX")
+ OS_VERSION=sysvr4
+ ;;
+ "IRIX64")
+ OS_VERSION=sysvr4
+ ;;
+ "AIX")
+ OS_VERSION=sysvr4
+ ;;
+ "OpenBSD")
+ OS_VERSION=linux
+ ;;
+ *)
+ AC_MSG_ERROR([$_os operating system is not suitable to build dmake!])
+ ;;
+esac
+
+AC_MSG_RESULT([checked ($_os)])
+
+dnl Set OS dependent settings
+AM_CONDITIONAL(OSTYPEUNIX, test x$OS_TYPE = xunix)
+AM_CONDITIONAL(OSTYPEWIN32, test x$OS_TYPE = xwinnt)
+
+AC_SUBST(OS_TYPE)
+AC_SUBST(OS_VERSION)
+AC_DEFINE_UNQUOTED(BUILDINFO, "$BUILDINFO", [Build info string])
+
+if test x$CASE_INSENSITIVE_FS = xtrue; then
+dnl Mac OSX with HFS+ and Windows FS are case insensitive (although case
+dnl preserving).
+AC_DEFINE(CASE_INSENSITIVE_FS, 1, [Assume case insensitive file system.])
+fi
+
+dnl =============================================
+dnl Enable dbug
+dnl =============================================
+AC_MSG_CHECKING([whether to do a build with dbug macros])
+if test -n "$enable_dbug" && test "$enable_dbug" != "no"; then
+ DBUG="1"
+ CPPFLAGS="$CPPFLAGS -DDBUG=1 -I\$(top_srcdir)/dbug/dbug"
+ AC_MSG_RESULT([yes])
+else
+ DBUG=""
+ AC_MSG_RESULT([no])
+fi
+AM_CONDITIONAL(DBUG, test -n "$DBUG")
+
+dnl =============================================
+dnl Enable spawn
+dnl =============================================
+AC_MSG_CHECKING([if spawn shall be used])
+if test -n "$enable_spawn" && test "$enable_spawn" != "no"; then
+ AC_DEFINE(ENABLE_SPAWN, 1, [Enables the use of spawn instead of fork/exec if it is supported.])
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+dnl Predefine the DMAKEROOT macro for unix targets.
+eval dmakerootprefix="$datarootdir"
+# $datadir is ${prefix}/share if not overridden
+test "x$dmakerootprefix" != "x${dmakerootprefix##NONE}" && dmakerootprefix=${ac_default_prefix}/share
+
+if test x$OS_TYPE = xunix; then
+DMAKEROOT_H_LINE1='"DMAKEROOT := '${dmakerootprefix}'/startup",'
+fi
+AC_SUBST(DMAKEROOT_H_LINE1)
+
+dnl List (all possible) *.in files
+AC_CONFIG_FILES(dmakeroot.h Makefile startup/config.mk \
+ startup/Makefile startup/unix/Makefile \
+ startup/unix/linux/Makefile startup/unix/solaris/Makefile \
+ startup/unix/macosx/Makefile startup/unix/sysvr4/Makefile \
+ startup/unix/cygwin/Makefile \
+ startup/unix/os2/Makefile \
+ startup/winnt/Makefile startup/winnt/mingw/Makefile \
+ startup/winnt/msvc6/Makefile \
+ tests/Makefile)
+
+dnl Checks for libraries.
+
+dnl Initialize libtool
+#AM_PROG_LIBTOOL
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/types.h sys/stat.h unistd.h errno.h utime.h spawn.h wait.h sys/wait.h sys/time.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES(int8)
+AC_CHECK_TYPES(uint8)
+AC_CHECK_TYPES(int16)
+AC_CHECK_TYPES(uint16)
+AC_CHECK_TYPES(int32)
+AC_CHECK_TYPES(uint32)
+AC_HEADER_TIME
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+
+dnl Checks for library functions.
+AC_FUNC_MEMCMP
+AC_TYPE_SIGNAL
+AC_FUNC_UTIME_NULL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(getcwd getwd strerror setvbuf tzset settz mkstemp tempnam gettimeofday)
+# Usefull, but special to newlib/MSVC
+AC_CHECK_FUNCS(strlwr)
+
+dnl *** output to disk ***
+AC_OUTPUT
+
diff --git a/dmake/dag.c b/dmake/dag.c
new file mode 100644
index 000000000000..c10c12c18f1e
--- /dev/null
+++ b/dmake/dag.c
@@ -0,0 +1,697 @@
+/* $RCSfile: dag.c,v $
+-- $Revision: 1.12 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:27:48 $
+--
+-- SYNOPSIS
+-- Routines to construct the internal dag.
+--
+-- DESCRIPTION
+-- This file contains all the routines that are responsible for
+-- defining and manipulating all objects used by the make facility.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+
+static void
+set_macro_value(hp)/*
+=====================
+ Set the macro according to its type. In addition to the string value
+ in hp->ht_value a macro can stores a value casted with its type.
+*/
+HASHPTR hp;
+{
+ switch( hp->ht_flag & M_VAR_MASK ) /* only one var type per var */
+ {
+ case M_VAR_STRING:
+ *hp->MV_SVAR = hp->ht_value;
+ /* Add special treatment for PWD/MAKEDIR for .WINPATH. */
+ if( hp->MV_SVAR == &Pwd_macval ) {
+ if( Pwd )
+ FREE(Pwd);
+ Pwd = hp->ht_value;
+ /* Use the "DOSified" path for the macro. */
+ *hp->MV_SVAR = hp->ht_value = DmStrDup(DO_WINPATH(hp->ht_value));
+ DB_PRINT( "smv", ("PWD: %s/%s", Pwd_macval, Pwd) );
+ } else if( hp->MV_SVAR == &Makedir_macval ) {
+ if( Makedir )
+ FREE(Makedir);
+ Makedir = hp->ht_value;
+ /* Use the "DOSified" path for the macro. */
+ *hp->MV_SVAR = hp->ht_value = DmStrDup(DO_WINPATH(hp->ht_value));
+ DB_PRINT( "smv", ("MAKEDIR: %s/%s", Makedir_macval, Makedir) );
+ }
+ /* No special treatment for TMD needed. */
+ break;
+
+ case M_VAR_CHAR:
+ *hp->MV_CVAR = (hp->ht_value == NIL(char)) ? '\0':*hp->ht_value;
+ break;
+
+ case M_VAR_INT: {
+ int tvalue;
+ if( hp->MV_IVAR == NIL(int) ) break; /* first time */
+
+ tvalue = atoi(hp->ht_value);
+ if( hp->MV_IVAR == &Buffer_size ) {
+ /* If Buffer_size (MAXLINELENGTH) is modified then make sure
+ * you change the size of the real buffer as well. As the
+ * value will at least be BUFSIZ this might lead to the
+ * situation that the (string) value of MAXLINELENGTH is
+ * smaller than the integer value. */
+ tvalue = (tvalue < (BUFSIZ-2)) ? BUFSIZ : tvalue+2;
+ if( Buffer_size == tvalue ) break;
+ if( Buffer ) FREE(Buffer);
+ if((Buffer=MALLOC(tvalue, char)) == NIL(char)) No_ram();
+ *Buffer = '\0';
+ }
+ *hp->MV_IVAR = tvalue;
+
+ if( hp->MV_IVAR == &Max_proc || hp->MV_IVAR == &Max_proclmt ) {
+ if( tvalue < 1 )
+ Fatal( "Process limit value must be > 1" );
+
+#if defined(USE_CREATEPROCESS)
+ if( Max_proclmt > MAXIMUM_WAIT_OBJECTS )
+ Fatal( "Specified maximum # of processes (MAXPROCESSLIMIT)"
+ " exceeds OS limit of [%d].", MAXIMUM_WAIT_OBJECTS );
+#endif
+
+ if( Max_proc > Max_proclmt )
+ Fatal( "Specified # of processes exceeds limit of [%d]",
+ Max_proclmt );
+
+ /* Don't change MAXPROCESS value if .SEQUENTIAL is set. */
+ if( (Glob_attr & A_SEQ) && (Max_proc != 1) ) {
+ Warning( "Macro MAXPROCESS set to 1 because .SEQUENTIAL is set." );
+ Max_proc = 1;
+ if( hp->ht_value != NIL(char) ) FREE(hp->ht_value);
+ hp->ht_value = DmStrDup( "1" );
+ }
+ }
+ } break;
+
+ case M_VAR_BIT:
+ /* Bit variables are set to 1 if ht_value is not NULL and 0
+ * otherwise */
+
+ if( hp->ht_value == NIL(char) )
+ *hp->MV_BVAR &= ~hp->MV_MASK;
+ else {
+ *hp->MV_BVAR |= hp->MV_MASK;
+ /* If we're setting .SEQUENTIAL set MAXPROCESS=1. */
+ if( (hp->MV_MASK & A_SEQ) && (Max_proc != 1) )
+ Def_macro( "MAXPROCESS", "1", M_MULTI|M_EXPANDED);
+ }
+
+#if defined(__CYGWIN__)
+ /* Global .WINPATH change. Only needed for cygwin. */
+ if(hp->MV_MASK & A_WINPATH) {
+ UseWinpath = ((Glob_attr&A_WINPATH) != 0);
+ /* Change MAKEDIR, PWD according to .WINPATH. During
+ * makefile evaluation this cannot change TMD (it is "."
+ * and later TMD is set in Make() according to the
+ * .WINPATH attribute. */
+ Def_macro( "MAKEDIR", Makedir, M_FORCE | M_EXPANDED );
+ Def_macro( "PWD", Pwd, M_FORCE | M_EXPANDED );
+ }
+#endif
+ break;
+ }
+}
+
+
+PUBLIC HASHPTR
+Get_name( name, tab, define )/*
+===============================
+ Look to see if the name is defined, if it is then return
+ a pointer to its node, if not return NIL(HASH).
+ If define is TRUE and the name is not found it will be added. */
+
+char *name; /* name we are looking for */
+HASHPTR *tab; /* the hash table to look in */
+int define; /* TRUE => add to table */
+{
+ register HASHPTR hp;
+ register char *p;
+ uint16 hv;
+ uint32 hash_key;
+
+ DB_ENTER( "Get_name" );
+ DB_PRINT( "name", ("Looking for %s", name) );
+
+ hp = Search_table( tab, name, &hv, &hash_key );
+
+ if( hp == NIL(HASH) && define ) {
+ /* Check to make sure that CELL name contains only printable chars */
+ for( p=name; *p; p++ )
+ if( !isprint(*p) && !iswhite(*p) && *p != '\n' )
+ Fatal( "Name contains non-printable character [0x%02x]", *p );
+
+ TALLOC( hp, 1, HASH ); /* allocate a cell and add it in */
+
+ hp->ht_name = DmStrDup( name );
+ hp->ht_hash = hash_key;
+ hp->ht_next = tab[ hv ];
+ tab[ hv ] = hp;
+
+ DB_PRINT( "name", ("Adding %s", name) );
+ }
+
+ DB_PRINT( "name",("Returning: [%s,%lu]",
+ (hp == NIL(HASH)) ? "":hp->ht_name, hv) );
+ DB_RETURN( hp );
+}
+
+
+PUBLIC HASHPTR
+Search_table( tab, name, phv, phkey )
+HASHPTR *tab;
+char *name;
+uint16 *phv;
+uint32 *phkey;
+{
+ HASHPTR hp;
+
+ *phv = Hash( name, phkey );
+
+ for( hp = tab[ *phv ]; hp != NIL(HASH); hp = hp->ht_next )
+ if( hp->ht_hash == *phkey
+ && !strcmp(hp->ht_name, name) )
+ break;
+
+ return( hp );
+}
+
+
+PUBLIC HASHPTR
+Push_macro(hp)/*
+================
+ This function pushes hp into the hash of all macros. If a previous
+ instance of the macro exists it is hidden by the new one. If one
+ existed before the new instance inherits some values from the preexisting
+ macro (see below for details).
+*/
+HASHPTR hp;
+{
+ HASHPTR cur,prev;
+ uint16 hv;
+ uint32 key;
+
+ hv = Hash(hp->ht_name, &key);
+
+ /* Search for an existing instance of hp->ht_name, if found cur will point
+ * to it. */
+ for(prev=NIL(HASH),cur=Macs[hv]; cur!=NIL(HASH); prev=cur,cur=cur->ht_next)
+ if( cur->ht_hash == key
+ && !strcmp(cur->ht_name, hp->ht_name) )
+ break;
+
+ if (cur == NIL(HASH) || prev == NIL(HASH)) {
+ /* If no match or was found or the first element of Macs[hv] was
+ * the match insert hp at the beginning. */
+ hp->ht_next = Macs[hv];
+ Macs[hv] = hp;
+ }
+ else {
+ /* otherwise insert hp in the chain. */
+ hp->ht_next = prev->ht_next;
+ prev->ht_next = hp;
+ }
+
+ /* Inherit some parts of the former instance. Copying cur->var to hp->var
+ * copies the old value. Keeping the M_VAR_MASK (variable type) makes sure
+ * the type stays the same keeping M_PRECIOUS assures that the old values
+ * cannot be overridden if it is/was set. */
+ if (cur) {
+ memcpy((void *)&hp->var, (void *)&cur->var, sizeof(hp->var));
+ hp->ht_flag |= ((M_VAR_MASK|M_PRECIOUS) & cur->ht_flag);
+ }
+
+ return(hp);
+}
+
+
+PUBLIC HASHPTR
+Pop_macro(hp)/*
+================
+ This function pops (removes) hp from the hash of all macros. If a previous
+ instance of the macro existed it becomes accessible again.
+*/
+
+HASHPTR hp;
+{
+ HASHPTR cur,prev;
+ uint16 hv;
+ uint32 key;
+
+ hv = Hash(hp->ht_name, &key);
+
+ /* Try to find hp. */
+ for(prev=NIL(HASH),cur=Macs[hv]; cur != NIL(HASH);prev=cur,cur=cur->ht_next)
+ if (cur == hp)
+ break;
+
+ /* If cur == NIL macros was not found. */
+ if (cur == NIL(HASH))
+ return(NIL(HASH));
+
+ /* Remove hp from the linked list. */
+ if (prev)
+ prev->ht_next = cur->ht_next;
+ else
+ Macs[hv] = cur->ht_next;
+
+ /* Look for a previous (older) instance of hp->ht_name. */
+ for(cur=cur->ht_next; cur != NIL(HASH); cur=cur->ht_next)
+ if( cur->ht_hash == key
+ && !strcmp(cur->ht_name, hp->ht_name) )
+ break;
+
+ /* If one was found we restore the typecast values. */
+ if (cur)
+ set_macro_value(cur);
+
+ hp->ht_next = NIL(HASH);
+ return(hp);
+}
+
+
+
+PUBLIC HASHPTR
+Def_macro( name, value, flags )/*
+=================================
+ This routine is used to define a macro, and it's value. A copy of
+ the content of value is stored and not the pointer to the value.
+ The flags indicates if it is a permanent macro or if it's value
+ can be redefined. A flags of M_PRECIOUS means it is a precious
+ macro and cannot be further redefined unless M_FORCE is used.
+ If the flags flag contains the M_MULTI bit it means that the macro
+ can be redefined multiple times and no warning of the redefinitions
+ should be issued.
+ Once a macro's VAR flags are set they are preserved through all future
+ macro definitions.
+
+ Macro definitions that have one of the variable bits set are treated
+ specially. In each case the hash table entry var field points at the
+ global variable that can be set by assigning to the macro.
+
+ bit valued global vars must be computed when the macro value is changed.
+ char valued global vars must have the first char of ht_value copied to
+ them. string valued global vars have the same value as ht_value and should
+ just have the new value of ht_value copied to them. */
+
+char *name; /* macro name to define */
+char *value; /* macro value to set */
+int flags; /* initial ht_flags */
+{
+ register HASHPTR hp;
+ register char *p, *q;
+
+ DB_ENTER( "Def_macro" );
+ DB_PRINT( "mac", ("Defining macro %s = %s, %x", name, value, flags) );
+
+ /* check to see if name is in the table, if so then just overwrite
+ the previous definition. Otherwise allocate a new node, and
+ stuff it in the hash table, at the front of any linked list */
+
+ if( Readenv ) flags |= M_LITERAL|M_EXPANDED;
+
+ hp = Get_name( name, Macs, TRUE );
+
+ if ((flags & M_PUSH) && hp->ht_name != NIL(char)) {
+ HASHPTR thp=hp;
+ TALLOC(hp,1,HASH);
+ hp->ht_name = DmStrDup(thp->ht_name);
+ hp->ht_hash = thp->ht_hash;
+ Push_macro(hp);
+ flags |= hp->ht_flag;
+ }
+ flags &= ~M_PUSH;
+
+ if( (hp->ht_flag & M_PRECIOUS) && !(flags & M_FORCE) ) {
+ if (Verbose & V_WARNALL)
+ Warning( "Macro `%s' cannot be redefined", name );
+ DB_RETURN( hp );
+ }
+
+ /* Make sure we don't export macros whose names contain legal macro
+ * assignment operators, since we can't do proper quoting in the
+ * environment. */
+ if( *DmStrPbrk(name, "*+:=") != '\0' ) flags |= M_NOEXPORT;
+
+ if( hp->ht_value != NIL(char) ) FREE( hp->ht_value );
+
+ if( (hp->ht_flag & M_USED) && !((flags | hp->ht_flag) & M_MULTI) )
+ Warning( "Macro `%s' redefined after use", name );
+
+ /* If an empty string ("") is given set ht_value to NIL(char) */
+ if( (value != NIL(char)) && (*value) ) {
+
+ if( !(flags & M_LITERAL) ) {
+ q = DmStrDup(value);
+ /* strip out any \<nl> combinations where \ is the current
+ * CONTINUATION char */
+ for(p=q; (p=strchr(p,CONTINUATION_CHAR))!=NIL(char); )
+ if( p[1] == '\n' ) {
+ size_t len = strlen(p+2)+1;
+ memmove ( p, p+2, len );
+ }
+ else
+ p++;
+
+ p = DmStrSpn(q ," \t"); /* Strip white space before ... */
+ if( p != q ) {
+ size_t len = strlen(p)+1;
+ memmove( q, p, len );
+ p = q;
+ }
+
+ if( *p ) { /* ... and after the value. */
+ for(q=p+strlen(p)-1; ((*q == ' ')||(*q == '\t')); q--);
+ *++q = '\0';
+ }
+ flags &= ~M_LITERAL;
+ }
+ else
+ p = DmStrDup( value ); /* take string literally */
+
+ if( !*p ) { /* check if result is "" */
+ FREE( p );
+ p = NIL(char);
+ flags |= M_EXPANDED;
+ }
+ else if( *DmStrPbrk( p, "${}" ) == '\0' )
+ flags |= M_EXPANDED;
+
+ hp->ht_value = p;
+ }
+ else {
+ hp->ht_value = NIL(char);
+ flags |= M_EXPANDED;
+ }
+
+ /* Assign the hash table flag less the M_MULTI flag, it is used only
+ * to silence the warning. But carry it over if it was previously
+ * defined in ht_flag, as this is a permanent M_MULTI variable. Keep
+ * the M_PRECIOUS flag and strip the M_INIT flag. */
+
+ hp->ht_flag = ((flags & ~(M_MULTI|M_FORCE)) |
+ (hp->ht_flag & (M_VAR_MASK|M_MULTI|M_PRECIOUS))) & ~M_INIT;
+
+ /* Check for macro variables and make the necessary adjustment in the
+ * corresponding global variables */
+
+ if( hp->ht_flag & M_VAR_MASK ) {
+ if( !(flags & M_EXPANDED) )
+ Error( "Macro variable '%s' must be assigned with :=", name );
+ else
+ set_macro_value(hp);
+ }
+
+ DB_RETURN( hp );
+}
+
+
+
+PUBLIC CELLPTR
+Def_cell( name )/*
+==================
+ Check if a cell for "name" already exists, if not create a new cell.
+ The value of name is normalized before checking/creating the cell to
+ avoid creating multiple cells for the same target file.
+ The function returns a pointer to the cell. */
+char *name;
+{
+ register HASHPTR hp;
+ register CELLPTR cp;
+ register CELLPTR lib;
+ char *member;
+ char *end;
+
+ DB_ENTER( "Def_cell" );
+
+ /* Check to see if the cell is a member of the form lib(member) or
+ * lib((symbol)) and handle the cases appropriately.
+ * What we do is we look at the target, if it is of the above two
+ * forms we get the lib, and add the member/symbol to the list of
+ * prerequisites for the library. If this is a symbol name def'n
+ * we additionally add the attribute A_SYMBOL, so that stat can
+ * try to do the right thing. */
+
+ if( ((member = strchr(name, '(')) != NIL(char)) &&
+ ((end = strrchr(member, ')')) != NIL(char)) &&
+ (member > name) && (member[-1] != '$') &&
+ (end > member+1) && (end[1] == '\0') )
+ {
+ *member++ = *end = '\0';
+
+ if( (*member == '(') && (member[strlen(member)-1] == ')') ) {
+ member[ strlen(member)-1 ] = '\0';
+ cp = Def_cell( member+1 );
+ cp->ce_attr |= A_SYMBOL;
+ }
+ else
+ cp = Def_cell( member );
+
+ lib = Def_cell( name );
+
+ Add_prerequisite( lib, cp, FALSE, FALSE );
+ lib->ce_attr |= A_LIBRARY | A_COMPOSITE;
+
+ if( !Def_targets ) cp = lib;
+ }
+ else {
+ /* Normalize the name. */
+ DB_PRINT( "path", ("Normalizing [%s]", name) );
+
+ /* The normalizing function returns a pointer to a static buffer. */
+ name = normalize_path(name);
+
+ hp = Get_name( name, Defs, TRUE );/* get the name from hash table */
+
+ if( hp->CP_OWNR == NIL(CELL) ) /* was it previously defined */
+ { /* NO, so define a new cell */
+ DB_PRINT( "cell", ("Defining cell [%s]", name) );
+
+ TALLOC( cp, 1, CELL );
+ hp->CP_OWNR = cp;
+ cp->ce_name = hp;
+ cp->ce_fname = hp->ht_name;
+ cp->ce_all.cl_prq = cp;
+ }
+ else /* YES, so return the old cell */
+ {
+ DB_PRINT( "cell", ("Getting cell [%s]", hp->ht_name) );
+ cp = hp->CP_OWNR;
+ }
+ }
+
+ DB_RETURN( cp );
+}
+
+
+
+
+PUBLIC LINKPTR
+Add_prerequisite( cell, prq, head, force )/*
+============================================
+ Add a dependency node to the dag. It adds it to the prerequisites,
+ if any, of the cell and makes certain they are in linear order.
+ If head == 1, then add to head of the prerequisite list, else
+ add to tail. */
+CELLPTR cell;
+CELLPTR prq;
+int head;
+int force;
+{
+ register LINKPTR lp, tlp;
+
+ DB_ENTER( "Add_prerequisite" );
+ DB_PRINT( "cell", ("Defining prerequisite %s", prq->CE_NAME) );
+
+ if( (prq->ce_flag & (F_MAGIC | F_PERCENT)) && !force )
+ Fatal( "Special target [%s] cannot be a prerequisite",
+ prq->CE_NAME );
+
+ if( cell->ce_prq == NIL(LINK) ) { /* it's the first one */
+ TALLOC( lp, 1, LINK );
+ lp->cl_prq = prq;
+ cell->ce_prq = lp;
+ }
+ else { /* search the list, checking for duplicates */
+ for( lp = cell->ce_prq;
+ (lp->cl_next != NIL(LINK)) && (lp->cl_prq != prq);
+ lp = lp->cl_next );
+
+ /* If the prq is not found and we are at the last prq in the list,
+ * allocate a new prq and place it into the list, insert it at the
+ * head if head == 1, else we add it to the end. */
+
+ if( lp->cl_prq != prq ) {
+ TALLOC( tlp, 1, LINK );
+ tlp->cl_prq = prq;
+
+ if( head ) {
+ tlp->cl_next = cell->ce_prq;
+ cell->ce_prq = tlp;
+ }
+ else
+ lp->cl_next = tlp;
+
+ lp = tlp;
+ }
+ }
+
+ DB_RETURN( lp );
+}
+
+
+
+PUBLIC void
+Clear_prerequisites( cell )/*
+=============================
+ Clear out the list of prerequisites, freeing all of the LINK nodes,
+ and setting the list to NULL */
+CELLPTR cell;
+{
+ LINKPTR lp, tlp;
+
+ DB_ENTER( "Clear_prerequisites" );
+ DB_PRINT( "cell", ("Nuking prerequisites") );
+
+ if( cell == NIL(CELL) ) { DB_VOID_RETURN; }
+
+ for( lp=cell->ce_prq; lp != NIL(LINK); lp=tlp ) {
+ tlp=lp->cl_next;
+ FREE( lp );
+ }
+
+ cell->ce_prq = NIL(LINK);
+
+ DB_VOID_RETURN;
+}
+
+
+PUBLIC int
+Test_circle( cp, fail )/*
+=========================
+ Actually run through the graph */
+CELLPTR cp;
+int fail;
+{
+ register LINKPTR lp;
+ int res = 0;
+
+ DB_ENTER( "Test_circle" );
+ DB_PRINT( "tc", ("checking [%s]", cp->CE_NAME) );
+
+ if( cp->ce_flag & F_MARK ) {
+ if( fail )
+ Fatal("Detected circular dependency in graph at [%s]", cp->CE_NAME);
+ else
+ DB_RETURN( 1 );
+ }
+
+ cp->ce_flag |= F_MARK;
+ for( lp = cp->ce_prq; !res && lp != NIL(LINK); lp = lp->cl_next )
+ res = Test_circle( lp->cl_prq, fail );
+ cp->ce_flag ^= F_MARK;
+
+ DB_RETURN( res );
+}
+
+
+
+PUBLIC STRINGPTR
+Def_recipe( rcp, sp, white_too, no_check )/*
+=============================================
+ Take the recipe (rcp) and add it to the list of recipes pointed to by
+ sp (sp points to the last element). If white_too == TRUE add the recipe
+ even if it contains only white space or an empty string.
+ Return a pointer to the new recipe (or sp if it was discarded).
+ If no_check is true then don't look for -@ at the start of the recipe
+ line. */
+char *rcp;
+STRINGPTR sp;
+int white_too;
+int no_check;
+{
+ register STRINGPTR nsp;
+ register char *rp;
+
+ DB_ENTER( "Def_recipe" );
+ DB_PRINT( "rul", ("Defining recipe %s", rcp) );
+
+ if( !white_too ) rcp = DmStrSpn( rcp, " \t" );
+ if( (rcp == NIL(char)) || (*rcp == 0 && !white_too) )
+ DB_RETURN( sp ); /* return last recipe when new recipe not added */
+
+ rp = no_check ? rcp : DmStrSpn( rcp, " \t@-+%" );
+
+ TALLOC(nsp, 1, STRING);
+ nsp->st_string = DmStrDup( rp );
+
+ if( sp != NIL(STRING) ) sp->st_next = nsp;
+ nsp->st_next = NIL(STRING);
+
+ if( !no_check ) nsp->st_attr |= Rcp_attribute( rcp );
+
+ DB_RETURN( nsp );
+}
+
+
+PUBLIC t_attr
+Rcp_attribute( rp )/*
+======================
+ Look at the recipe and return the set of attributes that it defines. */
+char *rp;
+{
+ t_attr flag = A_DEFAULT;
+ int done = FALSE;
+ int atcount = 0;
+
+ while( !done )
+ switch( *rp++ )
+ {
+ case '@' : ++atcount; break;
+ case '-' : flag |= A_IGNORE; break;
+ case '+' : flag |= A_SHELL; break;
+ case '%' :
+#if defined(MSDOS)
+ /* Ignore % in the non-MSDOS case. */
+ flag |= A_SWAP;
+#endif
+ break;
+
+ case ' ' :
+ case '\t': break;
+
+ default: done = TRUE; break;
+ }
+
+ if( !(Verbose & V_FORCEECHO) && atcount-- ) {
+ flag |= A_SILENT;
+ /* hide output if more than one @ are encountered. */
+ if( atcount )
+ flag |= A_MUTE;
+ }
+
+ return(flag);
+}
diff --git a/dmake/db.h b/dmake/db.h
new file mode 100644
index 000000000000..a640dfaee7a4
--- /dev/null
+++ b/dmake/db.h
@@ -0,0 +1,66 @@
+/* RCS $Id: db.h,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $
+--
+-- SYNOPSIS
+-- Front end to DBUG macros.
+--
+-- DESCRIPTION
+-- This is a front end to Fred Fish's DBUG macros. The intent was
+-- to provide an interface so that if you don't have the DBUG code
+-- you can still compile dmake, by undefining DBUG, if you do have
+-- the code then you can use Fred Fish's DBUG package. Originally
+-- the DBUG stuff was copyrighted, it is now in the public domain
+-- so the need for this is not as apparent.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef DB_h
+#define DB_h
+
+#ifdef DBUG
+
+# include "dbug.h"
+
+# define DB_ENTER(a1) DBUG_ENTER(a1)
+# define DB_RETURN(a1) DBUG_RETURN(a1)
+# define DB_VOID_RETURN DBUG_VOID_RETURN
+# define DB_EXECUTE(keyword, a1) DBUG_EXECUTE(keyword,a1)
+# define DB_PRINT(keyword,arglist) DBUG_PRINT(keyword,arglist)
+# define DB_PUSH(a1) DBUG_PUSH(a1)
+# define DB_POP() DBUG_POP()
+# define DB_PROCESS(a1) DBUG_PROCESS(a1)
+# define DB_FILE(file) DBUG_FILE(file)
+# define DB_SETJMP DBUG_SETJMP
+# define DB_LONGJMP DBUG_LONGJMP
+
+#else
+
+# define DB_ENTER(a1)
+# define DB_RETURN(a1) return (a1)
+# define DB_VOID_RETURN return
+# define DB_EXECUTE(keyword, a1)
+# define DB_PRINT(keyword,arglist)
+# define DB_PUSH(a1)
+# define DB_POP()
+# define DB_PROCESS(a1)
+# define DB_FILE(file)
+# define DB_SETJMP setjmp
+# define DB_LONGJMP longjmp
+
+#endif
+#endif
+
diff --git a/dmake/dbug/dbug.mk b/dmake/dbug/dbug.mk
new file mode 100644
index 000000000000..09aa82d7f37d
--- /dev/null
+++ b/dmake/dbug/dbug.mk
@@ -0,0 +1,66 @@
+# Set the proper macros based on whether we are making the debugging version
+# or not. The valid parameters to this file are:
+#
+# DEBUG=1 ==> enable the making of the DBUG version
+# DBMALLOC=1 ==> enable DBUG version with extensive MALLOC checking
+#
+# DB_CFLAGS ==> CFLAGS is set to this value at the end if DEBUG=1
+# DB_LDFLAGS ==> LDFLAGS is set to this at the end if DEBUG=1
+# DB_LDLIBS ==> LDLIBS is set to this at end if DEBUG=1
+#
+# The non debug versions of the above three macros are:
+#
+# NDB_CFLAGS
+# NDB_LDFLAGS
+# NDB_LDLIBS
+#
+# One of the set of three should have values set appropriately prior to
+# sourcing this file.
+
+.IF $(DEBUG)
+ DBUG_SRC += dbug.c
+ DB_CFLAGS += -Idbug/dbug
+
+ .SETDIR=dbug/dbug : $(DBUG_SRC)
+
+ # If DBMALLOC is requested (ie non-NULL) then include the sources for
+ # compilation. BSD 4.3 needs the getwd.c source compiled in due to a bug
+ # in the clib getwd routine.
+ .IF $(DBMALLOC)
+ # Serious bug in bsd43 getwd.c would free a string and then use its
+ # value. The DBMALLOC code clears a string when it is free'd so the
+ # value was no longer valid and the returned path for the current
+ # directory was now completely wrong.
+ .IF $(OSRELEASE) == bsd43
+ GETWD_SRC += getwd.c
+ .SETDIR=dbug : $(GETWD_SRC)
+ .END
+
+ MLC_SRC += malloc.c free.c realloc.c calloc.c string.c\
+ mlc_chk.c mlc_chn.c memory.c tostring.c m_perror.c\
+ m_init.c mallopt.c dump.c
+
+ .SETDIR=dbug/malloc : $(MLC_SRC)
+
+ DB_CFLAGS += -Idbug/malloc
+ .END
+
+ SRC += $(DBUG_SRC) $(MLC_SRC) $(GETWD_SRC)
+ HDR += db.h
+
+ LDFLAGS += $(DB_LDFLAGS)
+ LDLIBS += $(DB_LDLIBS)
+
+ __.SILENT !:= $(.SILENT)
+ .SILENT !:= yes
+ TARGET := db$(TARGET)
+ OBJDIR := $(OBJDIR).dbg
+ .SILENT !:= $(__.SILENT)
+
+ CFLAGS += $(DB_CFLAGS)
+ .KEEP_STATE := _dbstate.mk
+.ELSE
+ CFLAGS += $(NDB_CFLAGS)
+ LDFLAGS += $(NDB_LDFLAGS)
+ LDLIBS += $(NDB_LDLIBS)
+.END
diff --git a/dmake/dbug/dbug/dbug.c b/dmake/dbug/dbug/dbug.c
new file mode 100644
index 000000000000..c212161f6cac
--- /dev/null
+++ b/dmake/dbug/dbug/dbug.c
@@ -0,0 +1,1806 @@
+/******************************************************************************
+ * *
+ * N O T I C E *
+ * *
+ * Copyright Abandoned, 1987, Fred Fish *
+ * *
+ * *
+ * This previously copyrighted work has been placed into the public *
+ * domain by the author and may be freely used for any purpose, *
+ * private or commercial. *
+ * *
+ * Because of the number of inquiries I was receiving about the use *
+ * of this product in commercially developed works I have decided to *
+ * simply make it public domain to further its unrestricted use. I *
+ * specifically would be most happy to see this material become a *
+ * part of the standard Unix distributions by AT&T and the Berkeley *
+ * Computer Science Research Group, and a standard part of the GNU *
+ * system from the Free Software Foundation. *
+ * *
+ * I would appreciate it, as a courtesy, if this notice is left in *
+ * all copies and derivative works. Thank you. *
+ * *
+ * The author makes no warranty of any kind with respect to this *
+ * product and explicitly disclaims any implied warranties of mer- *
+ * chantability or fitness for any particular purpose. *
+ * *
+ ******************************************************************************
+ */
+
+
+/*
+ * FILE
+ *
+ * dbug.c runtime support routines for dbug package
+ *
+ * SCCS
+ *
+ * @(#)dbug.c 1.19 9/5/87
+ *
+ * DESCRIPTION
+ *
+ * These are the runtime support routines for the dbug package.
+ * The dbug package has two main components; the user include
+ * file containing various macro definitions, and the runtime
+ * support routines which are called from the macro expansions.
+ *
+ * Externally visible functions in the runtime support module
+ * use the naming convention pattern "_db_xx...xx_", thus
+ * they are unlikely to collide with user defined function names.
+ *
+ * AUTHOR(S)
+ *
+ * Fred Fish (base code)
+ * (Currently at Motorola Computer Division, Tempe, Az.)
+ * hao!noao!mcdsun!fnf
+ * (602) 438-3614
+ *
+ * Binayak Banerjee (profiling enhancements)
+ * seismo!bpa!sjuvax!bbanerje
+ */
+
+
+#include <stdio.h>
+#ifdef amiga
+#define AMIGA
+#endif
+
+#ifdef AMIGA
+#define HZ (50) /* Probably in some header somewhere */
+#endif
+
+/*
+ * Manifest constants that should not require any changes.
+ */
+
+#define FALSE 0 /* Boolean FALSE */
+#define TRUE 1 /* Boolean TRUE */
+#define EOS '\000' /* End Of String marker */
+
+/*
+ * Manifest constants which may be "tuned" if desired.
+ */
+
+#define PRINTBUF 1024 /* Print buffer size */
+#define INDENT 4 /* Indentation per trace level */
+#define MAXDEPTH 200 /* Maximum trace depth default */
+
+/*
+ * The following flags are used to determine which
+ * capabilities the user has enabled with the state
+ * push macro.
+ */
+
+#define TRACE_ON 000001 /* Trace enabled */
+#define DEBUG_ON 000002 /* Debug enabled */
+#define FILE_ON 000004 /* File name print enabled */
+#define LINE_ON 000010 /* Line number print enabled */
+#define DEPTH_ON 000020 /* Function nest level print enabled */
+#define PROCESS_ON 000040 /* Process name print enabled */
+#define NUMBER_ON 000100 /* Number each line of output */
+#define PROFILE_ON 000200 /* Print out profiling code */
+
+#define TRACING (stack -> flags & TRACE_ON)
+#define DEBUGGING (stack -> flags & DEBUG_ON)
+#define PROFILING (stack -> flags & PROFILE_ON)
+#define STREQ(a,b) (strcmp(a,b) == 0)
+
+/*
+ * Typedefs to make things more obvious.
+ */
+
+#define VOID void /* Can't use typedef for most compilers */
+typedef int BOOLEAN;
+
+/*
+ * Make it easy to change storage classes if necessary.
+ */
+
+#define LOCAL static /* Names not needed by outside world */
+#define IMPORT extern /* Names defined externally */
+#define EXPORT /* Allocated here, available globally */
+#define AUTO auto /* Names to be allocated on stack */
+#define REGISTER register /* Names to be placed in registers */
+
+/*
+ * The following define is for the variable arguments kluge, see
+ * the comments in _db_doprnt_().
+ *
+ * Also note that the longer this list, the less prone to failing
+ * on long argument lists, but the more stuff that must be moved
+ * around for each call to the runtime support routines. The
+ * length may really be critical if the machine convention is
+ * to pass arguments in registers.
+ *
+ * Note that the default define allows up to 16 integral arguments,
+ * or 8 floating point arguments (doubles), on most machines.
+ *
+ * Someday this may be replaced with true varargs support, when
+ * ANSI C has had time to take root.
+ */
+
+#define ARGLIST a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15
+
+/*
+ * The default file for profiling. Could also add another flag
+ * (G?) which allowed the user to specify this.
+ */
+
+#define PROF_FILE "dbugmon.out"
+
+/*
+ * Variables which are available externally but should only
+ * be accessed via the macro package facilities.
+ */
+
+EXPORT FILE *_db_fp_ = (FILE *)0; /* Output stream, default is set to
+ * stderr later */
+EXPORT FILE *_db_pfp_ = (FILE *)0; /* Profile stream, 'dbugmon.out' */
+EXPORT char *_db_process_ = "dbug"; /* Pointer to process name; argv[0] */
+EXPORT BOOLEAN _db_on_ = FALSE; /* TRUE if debugging currently on */
+EXPORT BOOLEAN _db_pon_ = FALSE; /* TRUE if debugging currently on */
+
+/*
+ * Externally supplied functions.
+ */
+
+/*
+ * The user may specify a list of functions to trace or
+ * debug. These lists are kept in a linear linked list,
+ * a very simple implementation.
+ */
+
+struct link {
+ char *string; /* Pointer to link's contents */
+ struct link *next_link; /* Pointer to the next link */
+};
+
+
+/*
+ * Debugging states can be pushed or popped off of a
+ * stack which is implemented as a linked list. Note
+ * that the head of the list is the current state and the
+ * stack is pushed by adding a new state to the head of the
+ * list or popped by removing the first link.
+ */
+
+struct state {
+ int flags; /* Current state flags */
+ int maxdepth; /* Current maximum trace depth */
+ unsigned int delay; /* Delay after each output line */
+ int level; /* Current function nesting level */
+ FILE *out_file; /* Current output stream */
+ FILE *prof_file; /* Current profiling stream */
+ struct link *functions; /* List of functions */
+ struct link *p_functions; /* List of profiled functions */
+ struct link *keywords; /* List of debug keywords */
+ struct link *processes; /* List of process names */
+ struct state *next_state; /* Next state in the list */
+};
+
+LOCAL struct state *stack = NULL; /* Linked list of stacked states */
+
+/*
+ * Local variables not seen by user.
+ */
+
+LOCAL int lineno = 0; /* Current debugger output line number */
+LOCAL char *func = "?func"; /* Name of current user function */
+LOCAL char *file = "?file"; /* Name of current user file */
+LOCAL BOOLEAN init_done = FALSE;/* Set to TRUE when initialization done */
+
+/*#if unix || AMIGA || M_I86*/
+LOCAL int jmplevel; /* Remember nesting level at setjmp () */
+LOCAL char *jmpfunc; /* Remember current function for setjmp */
+LOCAL char *jmpfile; /* Remember current file for setjmp */
+/*#endif*/
+
+LOCAL struct link *ListParse ();/* Parse a debug command string */
+LOCAL char *StrDup (); /* Make a fresh copy of a string */
+LOCAL VOID OpenFile (); /* Open debug output stream */
+LOCAL VOID OpenProfile (); /* Open profile output stream */
+LOCAL VOID CloseFile (); /* Close debug output stream */
+LOCAL VOID PushState (); /* Push current debug state */
+LOCAL VOID ChangeOwner (); /* Change file owner and group */
+LOCAL BOOLEAN DoTrace (); /* Test for tracing enabled */
+LOCAL BOOLEAN Writable (); /* Test to see if file is writable */
+LOCAL unsigned long Clock (); /* Return current user time (ms) */
+LOCAL char *DbugMalloc (); /* Allocate memory for runtime support */
+LOCAL char *BaseName (); /* Remove leading pathname components */
+LOCAL VOID DoPrefix (); /* Print debugger line prefix */
+LOCAL VOID FreeList (); /* Free memory from linked list */
+LOCAL VOID Indent (); /* Indent line to specified indent */
+LOCAL int DelayArg (int value); /* Convert D flag argument */
+LOCAL BOOLEAN DoProfile (); /* Check if profiling is enabled */
+
+ /* Supplied in Sys V runtime environ */
+LOCAL char *strtok (); /* Break string into tokens */
+LOCAL char *strrchr (); /* Find last occurance of char */
+
+/*
+ * The following local variables are used to hold the state information
+ * between the call to _db_pargs_() and _db_doprnt_(), during
+ * expansion of the DBUG_PRINT macro. This is the only macro
+ * that currently uses these variables. The DBUG_PRINT macro
+ * and the new _db_doprnt_() routine replace the older DBUG_N macros
+ * and their corresponding runtime support routine _db_printf_().
+ *
+ * These variables are currently used only by _db_pargs_() and
+ * _db_doprnt_().
+ */
+
+LOCAL int u_line = 0; /* User source code line number */
+LOCAL char *u_keyword = "?"; /* Keyword for current macro */
+
+/*
+ * Miscellaneous printf format strings.
+ */
+
+#define ERR_MISSING_RETURN "%s: missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"%s\"\n"
+#define ERR_OPEN "%s: can't open debug output stream \"%s\": "
+#define ERR_CLOSE "%s: can't close debug file: "
+#define ERR_ABORT "%s: debugger aborting because %s\n"
+#define ERR_CHOWN "%s: can't change owner/group of \"%s\": "
+#define ERR_PRINTF "%s: obsolete object file for '%s', please recompile!\n"
+
+/*
+ * Macros and defines for testing file accessibility under UNIX.
+ */
+
+#ifdef unix
+# define A_EXISTS 00 /* Test for file existance */
+# define A_EXECUTE 01 /* Test for execute permission */
+# define A_WRITE 02 /* Test for write access */
+# define A_READ 03 /* Test for read access */
+# define EXISTS(pathname) (access (pathname, A_EXISTS) == 0)
+# define WRITABLE(pathname) (access (pathname, A_WRITE) == 0)
+#else
+# define EXISTS(pathname) (FALSE) /* Assume no existance */
+#endif
+
+/*
+ * Translate some calls among different systems.
+ */
+
+#ifdef unix
+# define XDelay sleep
+IMPORT unsigned int sleep (); /* Pause for given number of seconds */
+#endif
+
+#ifdef AMIGA
+IMPORT int XDelay (); /* Pause for given number of ticks */
+#endif
+
+
+/*
+ * FUNCTION
+ *
+ * _db_push_ push current debugger state and set up new one
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_push_ (control)
+ * char *control;
+ *
+ * DESCRIPTION
+ *
+ * Given pointer to a debug control string in "control", pushes
+ * the current debug state, parses the control string, and sets
+ * up a new debug state.
+ *
+ * The only attribute of the new state inherited from the previous
+ * state is the current function nesting level. This can be
+ * overridden by using the "r" flag in the control string.
+ *
+ * The debug control string is a sequence of colon separated fields
+ * as follows:
+ *
+ * <field_1>:<field_2>:...:<field_N>
+ *
+ * Each field consists of a mandatory flag character followed by
+ * an optional "," and comma separated list of modifiers:
+ *
+ * flag[,modifier,modifier,...,modifier]
+ *
+ * The currently recognized flag characters are:
+ *
+ * d Enable output from DBUG_<N> macros for
+ * for the current state. May be followed
+ * by a list of keywords which selects output
+ * only for the DBUG macros with that keyword.
+ * A null list of keywords implies output for
+ * all macros.
+ *
+ * D Delay after each debugger output line.
+ * The argument is the number of tenths of seconds
+ * to delay, subject to machine capabilities.
+ * I.E. -#D,20 is delay two seconds.
+ *
+ * f Limit debugging and/or tracing, and profiling to the
+ * list of named functions. Note that a null list will
+ * disable all functions. The appropriate "d" or "t"
+ * flags must still be given, this flag only limits their
+ * actions if they are enabled.
+ *
+ * F Identify the source file name for each
+ * line of debug or trace output.
+ *
+ * g Enable profiling. Create a file called 'dbugmon.out'
+ * containing information that can be used to profile
+ * the program. May be followed by a list of keywords
+ * that select profiling only for the functions in that
+ * list. A null list implies that all functions are
+ * considered.
+ *
+ * L Identify the source file line number for
+ * each line of debug or trace output.
+ *
+ * n Print the current function nesting depth for
+ * each line of debug or trace output.
+ *
+ * N Number each line of dbug output.
+ *
+ * p Limit debugger actions to specified processes.
+ * A process must be identified with the
+ * DBUG_PROCESS macro and match one in the list
+ * for debugger actions to occur.
+ *
+ * P Print the current process name for each
+ * line of debug or trace output.
+ *
+ * r When pushing a new state, do not inherit
+ * the previous state's function nesting level.
+ * Useful when the output is to start at the
+ * left margin.
+ *
+ * t Enable function call/exit trace lines.
+ * May be followed by a list (containing only
+ * one modifier) giving a numeric maximum
+ * trace level, beyond which no output will
+ * occur for either debugging or tracing
+ * macros. The default is a compile time
+ * option.
+ *
+ * Some examples of debug control strings which might appear
+ * on a shell command line (the "-#" is typically used to
+ * introduce a control string to an application program) are:
+ *
+ * -#d:t
+ * -#d:f,main,subr1:F:L:t,20
+ * -#d,input,output,files:n
+ *
+ * For convenience, any leading "-#" is stripped off.
+ *
+ */
+
+
+VOID _db_push_ (control)
+char *control;
+{
+ REGISTER char *scan;
+ REGISTER struct link *temp;
+
+ if (!_db_fp_)
+ _db_fp_ = stderr; /* Output stream, default stderr */
+
+ if (control && *control == '-') {
+ if (*++control == '#') {
+ control++;
+ }
+ }
+ control = StrDup (control);
+ PushState ();
+ scan = strtok (control, ":");
+ for (; scan != NULL; scan = strtok ((char *)NULL, ":")) {
+ switch (*scan++) {
+ case 'd':
+ _db_on_ = TRUE;
+ stack -> flags |= DEBUG_ON;
+ if (*scan++ == ',') {
+ stack -> keywords = ListParse (scan);
+ }
+ break;
+ case 'D':
+ stack -> delay = 0;
+ if (*scan++ == ',') {
+ temp = ListParse (scan);
+ stack -> delay = DelayArg (atoi (temp -> string));
+ FreeList (temp);
+ }
+ break;
+ case 'f':
+ if (*scan++ == ',') {
+ stack -> functions = ListParse (scan);
+ }
+ break;
+ case 'F':
+ stack -> flags |= FILE_ON;
+ break;
+ case 'g':
+ _db_pon_ = TRUE;
+ OpenProfile(PROF_FILE);
+ stack -> flags |= PROFILE_ON;
+ if (*scan++ == ',') {
+ stack -> p_functions = ListParse (scan);
+ }
+ break;
+ case 'L':
+ stack -> flags |= LINE_ON;
+ break;
+ case 'n':
+ stack -> flags |= DEPTH_ON;
+ break;
+ case 'N':
+ stack -> flags |= NUMBER_ON;
+ break;
+ case 'o':
+ if (*scan++ == ',') {
+ temp = ListParse (scan);
+ OpenFile (temp -> string);
+ FreeList (temp);
+ } else {
+ OpenFile ("-");
+ }
+ break;
+ case 'p':
+ if (*scan++ == ',') {
+ stack -> processes = ListParse (scan);
+ }
+ break;
+ case 'P':
+ stack -> flags |= PROCESS_ON;
+ break;
+ case 'r':
+ stack -> level = 0;
+ break;
+ case 't':
+ stack -> flags |= TRACE_ON;
+ if (*scan++ == ',') {
+ temp = ListParse (scan);
+ stack -> maxdepth = atoi (temp -> string);
+ FreeList (temp);
+ }
+ break;
+ }
+ }
+ free (control);
+}
+
+
+
+/*
+ * FUNCTION
+ *
+ * _db_pop_ pop the debug stack
+ *
+ * DESCRIPTION
+ *
+ * Pops the debug stack, returning the debug state to its
+ * condition prior to the most recent _db_push_ invocation.
+ * Note that the pop will fail if it would remove the last
+ * valid state from the stack. This prevents user errors
+ * in the push/pop sequence from screwing up the debugger.
+ * Maybe there should be some kind of warning printed if the
+ * user tries to pop too many states.
+ *
+ */
+
+VOID _db_pop_ ()
+{
+ REGISTER struct state *discard;
+
+ discard = stack;
+ if (discard != NULL && discard -> next_state != NULL) {
+ stack = discard -> next_state;
+ _db_fp_ = stack -> out_file;
+ _db_pfp_ = stack -> prof_file;
+ if (discard -> keywords != NULL) {
+ FreeList (discard -> keywords);
+ }
+ if (discard -> functions != NULL) {
+ FreeList (discard -> functions);
+ }
+ if (discard -> processes != NULL) {
+ FreeList (discard -> processes);
+ }
+ if (discard -> p_functions != NULL) {
+ FreeList (discard -> p_functions);
+ }
+ CloseFile (discard -> out_file);
+ CloseFile (discard -> prof_file);
+ free ((char *) discard);
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_enter_ process entry point to user function
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_enter_ (_func_, _file_, _line_, _sfunc_, _sfile_, _slevel_)
+ * char *_func_; points to current function name
+ * char *_file_; points to current file name
+ * int _line_; called from source line number
+ * char **_sfunc_; save previous _func_
+ * char **_sfile_; save previous _file_
+ * int *_slevel_; save previous nesting level
+ *
+ * DESCRIPTION
+ *
+ * Called at the beginning of each user function to tell
+ * the debugger that a new function has been entered.
+ * Note that the pointers to the previous user function
+ * name and previous user file name are stored on the
+ * caller's stack (this is why the ENTER macro must be
+ * the first "executable" code in a function, since it
+ * allocates these storage locations). The previous nesting
+ * level is also stored on the callers stack for internal
+ * self consistency checks.
+ *
+ * Also prints a trace line if tracing is enabled and
+ * increments the current function nesting depth.
+ *
+ * Note that this mechanism allows the debugger to know
+ * what the current user function is at all times, without
+ * maintaining an internal stack for the function names.
+ *
+ */
+
+VOID _db_enter_ (_func_, _file_, _line_, _sfunc_, _sfile_, _slevel_)
+char *_func_;
+char *_file_;
+int _line_;
+char **_sfunc_;
+char **_sfile_;
+int *_slevel_;
+{
+ if (!init_done) {
+ _db_push_ ("");
+ }
+ *_sfunc_ = func;
+ *_sfile_ = file;
+ func = _func_;
+ file = BaseName (_file_);
+ stack -> level++;
+ *_slevel_ = stack -> level;
+ if (DoProfile ()) {
+ (VOID) fprintf (_db_pfp_, "%s\tE\t%ld\n",func, Clock());
+ (VOID) fflush (_db_pfp_);
+ }
+ if (DoTrace ()) {
+ DoPrefix (_line_);
+ Indent (stack -> level);
+ (VOID) fprintf (_db_fp_, ">%s\n", func);
+ (VOID) fflush (_db_fp_);
+ (VOID) XDelay (stack -> delay);
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_return_ process exit from user function
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_return_ (_line_, _sfunc_, _sfile_, _slevel_)
+ * int _line_; current source line number
+ * char **_sfunc_; where previous _func_ is to be retrieved
+ * char **_sfile_; where previous _file_ is to be retrieved
+ * int *_slevel_; where previous level was stashed
+ *
+ * DESCRIPTION
+ *
+ * Called just before user function executes an explicit or implicit
+ * return. Prints a trace line if trace is enabled, decrements
+ * the current nesting level, and restores the current function and
+ * file names from the defunct function's stack.
+ *
+ */
+
+VOID _db_return_ (_line_, _sfunc_, _sfile_, _slevel_)
+int _line_;
+char **_sfunc_;
+char **_sfile_;
+int *_slevel_;
+{
+ if (!init_done) {
+ _db_push_ ("");
+ }
+ if (stack -> level != *_slevel_ && (TRACING || DEBUGGING || PROFILING)) {
+ (VOID) fprintf (_db_fp_, ERR_MISSING_RETURN, _db_process_, func);
+ (VOID) XDelay (stack -> delay);
+ } else if (DoProfile ()) {
+ (VOID) fprintf (_db_pfp_, "%s\tX\t%ld\n", func, Clock());
+ (VOID) XDelay (stack -> delay);
+ } else if (DoTrace ()) {
+ DoPrefix (_line_);
+ Indent (stack -> level);
+ (VOID) fprintf (_db_fp_, "<%s\n", func);
+ (VOID) XDelay (stack -> delay);
+ }
+ (VOID) fflush (_db_fp_);
+ stack -> level = *_slevel_ - 1;
+ func = *_sfunc_;
+ file = *_sfile_;
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_pargs_ log arguments for subsequent use by _db_doprnt_()
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_pargs_ (_line_, keyword)
+ * int _line_;
+ * char *keyword;
+ *
+ * DESCRIPTION
+ *
+ * The new universal printing macro DBUG_PRINT, which replaces
+ * all forms of the DBUG_N macros, needs two calls to runtime
+ * support routines. The first, this function, remembers arguments
+ * that are used by the subsequent call to _db_doprnt_().
+*
+ */
+
+VOID _db_pargs_ (_line_, keyword)
+int _line_;
+char *keyword;
+{
+ u_line = _line_;
+ u_keyword = keyword;
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_doprnt_ handle print of debug lines
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_doprnt_ (format, ARGLIST)
+ * char *format;
+ * long ARGLIST;
+ *
+ * DESCRIPTION
+ *
+ * When invoked via one of the DBUG macros, tests the current keyword
+ * set by calling _db_pargs_() to see if that macro has been selected
+ * for processing via the debugger control string, and if so, handles
+ * printing of the arguments via the format string. The line number
+ * of the DBUG macro in the source is found in u_line.
+ *
+ * Note that the format string SHOULD NOT include a terminating
+ * newline, this is supplied automatically.
+ *
+ * NOTES
+ *
+ * This runtime support routine replaces the older _db_printf_()
+ * routine which is temporarily kept around for compatibility.
+ *
+ * The rather ugly argument declaration is to handle some
+ * magic with respect to the number of arguments passed
+ * via the DBUG macros. The current maximum is 3 arguments
+ * (not including the keyword and format strings).
+ *
+ * The new <varargs.h> facility is not yet common enough to
+ * convert to it quite yet...
+ *
+ */
+
+/*VARARGS1*/
+VOID _db_doprnt_ (format, ARGLIST)
+char *format;
+long ARGLIST;
+{
+ if (_db_keyword_ (u_keyword)) {
+ DoPrefix (u_line);
+ if (TRACING) {
+ Indent (stack -> level + 1);
+ } else {
+ (VOID) fprintf (_db_fp_, "%s: ", func);
+ }
+ (VOID) fprintf (_db_fp_, "%s: ", u_keyword);
+ (VOID) fprintf (_db_fp_, format, ARGLIST);
+ (VOID) fprintf (_db_fp_, "\n");
+ (VOID) fflush (_db_fp_);
+ (VOID) XDelay (stack -> delay);
+ }
+}
+
+/*
+ * The following routine is kept around temporarily for compatibility
+ * with older objects that were compiled with the DBUG_N macro form
+ * of the print routine. It will print a warning message on first
+ * usage. It will go away in subsequent releases...
+ */
+
+/*VARARGS3*/
+VOID _db_printf_ (_line_, keyword, format, ARGLIST)
+int _line_;
+char *keyword, *format;
+long ARGLIST;
+{
+ static BOOLEAN firsttime = TRUE;
+
+ if (firsttime) {
+ (VOID) fprintf (stderr, ERR_PRINTF, _db_process_, file);
+ firsttime = FALSE;
+ }
+ _db_pargs_ (_line_, keyword);
+ _db_doprnt_ (format, ARGLIST);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * ListParse parse list of modifiers in debug control string
+ *
+ * SYNOPSIS
+ *
+ * LOCAL struct link *ListParse (ctlp)
+ * char *ctlp;
+ *
+ * DESCRIPTION
+ *
+ * Given pointer to a comma separated list of strings in "cltp",
+ * parses the list, building a list and returning a pointer to it.
+ * The original comma separated list is destroyed in the process of
+ * building the linked list, thus it had better be a duplicate
+ * if it is important.
+ *
+ * Note that since each link is added at the head of the list,
+ * the final list will be in "reverse order", which is not
+ * significant for our usage here.
+ *
+ */
+
+LOCAL struct link *ListParse (ctlp)
+char *ctlp;
+{
+ REGISTER char *start;
+ REGISTER struct link *new;
+ REGISTER struct link *head;
+
+ head = NULL;
+ while (*ctlp != EOS) {
+ start = ctlp;
+ while (*ctlp != EOS && *ctlp != ',') {
+ ctlp++;
+ }
+ if (*ctlp == ',') {
+ *ctlp++ = EOS;
+ }
+ new = (struct link *) DbugMalloc (sizeof (struct link));
+ new -> string = StrDup (start);
+ new -> next_link = head;
+ head = new;
+ }
+ return (head);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * InList test a given string for member of a given list
+ *
+ * SYNOPSIS
+ *
+ * LOCAL BOOLEAN InList (linkp, cp)
+ * struct link *linkp;
+ * char *cp;
+ *
+ * DESCRIPTION
+ *
+ * Tests the string pointed to by "cp" to determine if it is in
+ * the list pointed to by "linkp". Linkp points to the first
+ * link in the list. If linkp is NULL then the string is treated
+ * as if it is in the list (I.E all strings are in the null list).
+ * This may seem rather strange at first but leads to the desired
+ * operation if no list is given. The net effect is that all
+ * strings will be accepted when there is no list, and when there
+ * is a list, only those strings in the list will be accepted.
+ *
+ */
+
+LOCAL BOOLEAN InList (linkp, cp)
+struct link *linkp;
+char *cp;
+{
+ REGISTER struct link *scan;
+ REGISTER BOOLEAN accept;
+
+ if (linkp == NULL) {
+ accept = TRUE;
+ } else {
+ accept = FALSE;
+ for (scan = linkp; scan != NULL; scan = scan -> next_link) {
+ if (STREQ (scan -> string, cp)) {
+ accept = TRUE;
+ break;
+ }
+ }
+ }
+ return (accept);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * PushState push current state onto stack and set up new one
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID PushState ()
+ *
+ * DESCRIPTION
+ *
+ * Pushes the current state on the state stack, and initializes
+ * a new state. The only parameter inherited from the previous
+ * state is the function nesting level. This action can be
+ * inhibited if desired, via the "r" flag.
+ *
+ * The state stack is a linked list of states, with the new
+ * state added at the head. This allows the stack to grow
+ * to the limits of memory if necessary.
+ *
+ */
+
+LOCAL VOID PushState ()
+{
+ REGISTER struct state *new;
+
+ new = (struct state *) DbugMalloc (sizeof (struct state));
+ new -> flags = 0;
+ new -> delay = 0;
+ new -> maxdepth = MAXDEPTH;
+ if (stack != NULL) {
+ new -> level = stack -> level;
+ } else {
+ new -> level = 0;
+ }
+ new -> out_file = stderr;
+ new -> functions = NULL;
+ new -> p_functions = NULL;
+ new -> keywords = NULL;
+ new -> processes = NULL;
+ new -> next_state = stack;
+ stack = new;
+ init_done = TRUE;
+}
+
+
+/*
+ * FUNCTION
+ *
+ * DoTrace check to see if tracing is current enabled
+ *
+ * SYNOPSIS
+ *
+ * LOCAL BOOLEAN DoTrace ()
+ *
+ * DESCRIPTION
+ *
+ * Checks to see if tracing is enabled based on whether the
+ * user has specified tracing, the maximum trace depth has
+ * not yet been reached, the current function is selected,
+ * and the current process is selected. Returns TRUE if
+ * tracing is enabled, FALSE otherwise.
+ *
+ */
+
+LOCAL BOOLEAN DoTrace ()
+{
+ REGISTER BOOLEAN trace;
+
+ trace = FALSE;
+ if (TRACING) {
+ if (stack -> level <= stack -> maxdepth) {
+ if (InList (stack -> functions, func)) {
+ if (InList (stack -> processes, _db_process_)) {
+ trace = TRUE;
+ }
+ }
+ }
+ }
+ return (trace);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * DoProfile check to see if profiling is current enabled
+ *
+ * SYNOPSIS
+ *
+ * LOCAL BOOLEAN DoProfile ()
+ *
+ * DESCRIPTION
+ *
+ * Checks to see if profiling is enabled based on whether the
+ * user has specified profiling, the maximum trace depth has
+ * not yet been reached, the current function is selected,
+ * and the current process is selected. Returns TRUE if
+ * profiling is enabled, FALSE otherwise.
+ *
+ */
+
+LOCAL BOOLEAN DoProfile ()
+{
+ REGISTER BOOLEAN profile;
+
+ profile = FALSE;
+ if (PROFILING) {
+ if (stack -> level <= stack -> maxdepth) {
+ if (InList (stack -> p_functions, func)) {
+ if (InList (stack -> processes, _db_process_)) {
+ profile = TRUE;
+ }
+ }
+ }
+ }
+ return (profile);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_keyword_ test keyword for member of keyword list
+ *
+ * SYNOPSIS
+ *
+ * BOOLEAN _db_keyword_ (keyword)
+ * char *keyword;
+ *
+ * DESCRIPTION
+ *
+ * Test a keyword to determine if it is in the currently active
+ * keyword list. As with the function list, a keyword is accepted
+ * if the list is null, otherwise it must match one of the list
+ * members. When debugging is not on, no keywords are accepted.
+ * After the maximum trace level is exceeded, no keywords are
+ * accepted (this behavior subject to change). Additionally,
+ * the current function and process must be accepted based on
+ * their respective lists.
+ *
+ * Returns TRUE if keyword accepted, FALSE otherwise.
+ *
+ */
+
+BOOLEAN _db_keyword_ (keyword)
+char *keyword;
+{
+ REGISTER BOOLEAN accept;
+
+ if (!init_done) {
+ _db_push_ ("");
+ }
+ accept = FALSE;
+ if (DEBUGGING) {
+ if (stack -> level <= stack -> maxdepth) {
+ if (InList (stack -> functions, func)) {
+ if (InList (stack -> keywords, keyword)) {
+ if (InList (stack -> processes, _db_process_)) {
+ accept = TRUE;
+ }
+ }
+ }
+ }
+ }
+ return (accept);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * Indent indent a line to the given indentation level
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID Indent (indent)
+ * int indent;
+ *
+ * DESCRIPTION
+ *
+ * Indent a line to the given level. Note that this is
+ * a simple minded but portable implementation.
+ * There are better ways.
+ *
+ * Also, the indent must be scaled by the compile time option
+ * of character positions per nesting level.
+ *
+ */
+
+LOCAL VOID Indent (indent)
+int indent;
+{
+ REGISTER int count;
+ AUTO char buffer[PRINTBUF];
+
+ indent *= INDENT;
+ for (count = 0; (count < (indent - INDENT)) && (count < (PRINTBUF - 1)); count++) {
+ if ((count % INDENT) == 0) {
+ buffer[count] = '|';
+ } else {
+ buffer[count] = ' ';
+ }
+ }
+ buffer[count] = EOS;
+ (VOID) fprintf (_db_fp_, buffer);
+ (VOID) fflush (_db_fp_);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * FreeList free all memory associated with a linked list
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID FreeList (linkp)
+ * struct link *linkp;
+ *
+ * DESCRIPTION
+ *
+ * Given pointer to the head of a linked list, frees all
+ * memory held by the list and the members of the list.
+ *
+ */
+
+LOCAL VOID FreeList (linkp)
+struct link *linkp;
+{
+ REGISTER struct link *old;
+
+ while (linkp != NULL) {
+ old = linkp;
+ linkp = linkp -> next_link;
+ if (old -> string != NULL) {
+ free (old -> string);
+ }
+ free ((char *) old);
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * StrDup make a duplicate of a string in new memory
+ *
+ * SYNOPSIS
+ *
+ * LOCAL char *StrDup (string)
+ * char *string;
+ *
+ * DESCRIPTION
+ *
+ * Given pointer to a string, allocates sufficient memory to make
+ * a duplicate copy, and copies the string to the newly allocated
+ * memory. Failure to allocated sufficient memory is immediately
+ * fatal.
+ *
+ */
+
+
+LOCAL char *StrDup (string)
+char *string;
+{
+ REGISTER char *new;
+
+ new = DbugMalloc (strlen (string) + 1);
+ (VOID) strcpy (new, string);
+ return (new);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * DoPrefix print debugger line prefix prior to indentation
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID DoPrefix (_line_)
+ * int _line_;
+ *
+ * DESCRIPTION
+ *
+ * Print prefix common to all debugger output lines, prior to
+ * doing indentation if necessary. Print such information as
+ * current process name, current source file name and line number,
+ * and current function nesting depth.
+ *
+ */
+
+
+LOCAL VOID DoPrefix (_line_)
+int _line_;
+{
+ lineno++;
+ if (stack -> flags & NUMBER_ON) {
+ (VOID) fprintf (_db_fp_, "%5d: ", lineno);
+ }
+ if (stack -> flags & PROCESS_ON) {
+ (VOID) fprintf (_db_fp_, "%s: ", _db_process_);
+ }
+ if (stack -> flags & FILE_ON) {
+ (VOID) fprintf (_db_fp_, "%14s: ", file);
+ }
+ if (stack -> flags & LINE_ON) {
+ (VOID) fprintf (_db_fp_, "%5d: ", _line_);
+ }
+ if (stack -> flags & DEPTH_ON) {
+ (VOID) fprintf (_db_fp_, "%4d: ", stack -> level);
+ }
+ (VOID) fflush (_db_fp_);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * OpenFile open new output stream for debugger output
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID OpenFile (name)
+ * char *name;
+ *
+ * DESCRIPTION
+ *
+ * Given name of a new file (or "-" for stdout) opens the file
+ * and sets the output stream to the new file.
+ *
+ */
+
+LOCAL VOID OpenFile (name)
+char *name;
+{
+ REGISTER FILE *fp;
+ REGISTER BOOLEAN newfile;
+
+ if (name != NULL) {
+ if (strcmp (name, "-") == 0) {
+ _db_fp_ = stdout;
+ stack -> out_file = _db_fp_;
+ } else {
+ if (!Writable (name)) {
+ (VOID) fprintf (_db_fp_, ERR_OPEN, _db_process_, name);
+ perror ("");
+ (VOID) fflush (_db_fp_);
+ (VOID) XDelay (stack -> delay);
+ } else {
+ if (EXISTS (name)) {
+ newfile = FALSE;
+ } else {
+ newfile = TRUE;
+ }
+ fp = fopen (name, "a");
+ if (fp == NULL) {
+ (VOID) fprintf (_db_fp_, ERR_OPEN, _db_process_, name);
+ perror ("");
+ (VOID) fflush (_db_fp_);
+ (VOID) XDelay (stack -> delay);
+ } else {
+ _db_fp_ = fp;
+ stack -> out_file = fp;
+ if (newfile) {
+ ChangeOwner (name);
+ }
+ }
+ }
+ }
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * OpenProfile open new output stream for profiler output
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID OpenProfile (name)
+ * char *name;
+ *
+ * DESCRIPTION
+ *
+ * Given name of a new file, opens the file
+ * and sets the profiler output stream to the new file.
+ *
+ * It is currently unclear whether the prefered behavior is
+ * to truncate any existing file, or simply append to it.
+ * The latter behavior would be desirable for collecting
+ * accumulated runtime history over a number of separate
+ * runs. It might take some changes to the analyzer program
+ * though, and the notes that Binayak sent with the profiling
+ * diffs indicated that append was the normal mode, but this
+ * does not appear to agree with the actual code. I haven't
+ * investigated at this time [fnf; 24-Jul-87].
+ */
+
+LOCAL VOID OpenProfile (name)
+char *name;
+{
+ REGISTER FILE *fp;
+ REGISTER BOOLEAN newfile;
+
+ if (name != NULL) {
+ if (!Writable (name)) {
+ (VOID) fprintf (_db_fp_, ERR_OPEN, _db_process_, name);
+ perror ("");
+ (VOID) fflush (_db_fp_);
+ (VOID) XDelay (stack -> delay);
+ } else {
+ if (EXISTS (name)) {
+ newfile = FALSE;
+ } else {
+ newfile = TRUE;
+ }
+ fp = fopen (name, "w");
+ if (fp == NULL) {
+ (VOID) fprintf (_db_fp_, ERR_OPEN, _db_process_, name);
+ perror ("");
+ (VOID) fflush (_db_fp_);
+ (VOID) XDelay (stack -> delay);
+ } else {
+ _db_pfp_ = fp;
+ stack -> prof_file = fp;
+ if (newfile) {
+ ChangeOwner (name);
+ }
+ }
+ }
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * CloseFile close the debug output stream
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID CloseFile (fp)
+ * FILE *fp;
+ *
+ * DESCRIPTION
+ *
+ * Closes the debug output stream unless it is standard output
+ * or standard error.
+ *
+ */
+
+LOCAL VOID CloseFile (fp)
+FILE *fp;
+{
+ if (fp != stderr && fp != stdout) {
+ if (fclose (fp) == EOF) {
+ (VOID) fprintf (stderr, ERR_CLOSE, _db_process_);
+ perror ("");
+ (VOID) fflush (stderr);
+ (VOID) XDelay (stack -> delay);
+ }
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * DbugExit print error message and exit
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID DbugExit (why)
+ * char *why;
+ *
+ * DESCRIPTION
+ *
+ * Prints error message using current process name, the reason for
+ * aborting (typically out of memory), and exits with status 1.
+ * This should probably be changed to use a status code
+ * defined in the user's debugger include file.
+ *
+ */
+
+LOCAL VOID DbugExit (why)
+char *why;
+{
+ (VOID) fprintf (stderr, ERR_ABORT, _db_process_, why);
+ (VOID) fflush (stderr);
+ (VOID) XDelay (stack -> delay);
+ exit (1);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * DbugMalloc allocate memory for debugger runtime support
+ *
+ * SYNOPSIS
+ *
+ * LOCAL char *DbugMalloc (size)
+ * int size;
+ *
+ * DESCRIPTION
+ *
+ * Allocate more memory for debugger runtime support functions.
+ * Failure to to allocate the requested number of bytes is
+ * immediately fatal to the current process. This may be
+ * rather unfriendly behavior. It might be better to simply
+ * print a warning message, freeze the current debugger state,
+ * and continue execution.
+ *
+ */
+
+LOCAL char *DbugMalloc (size)
+int size;
+{
+ register char *new;
+
+ new = malloc ( size );
+ if (new == NULL) {
+ DbugExit ("out of memory");
+ }
+ return (new);
+}
+
+
+/*
+ * This function may be eliminated when strtok is available
+ * in the runtime environment (missing from BSD4.1).
+ */
+
+LOCAL char *strtok (s1, s2)
+char *s1, *s2;
+{
+ static char *end = NULL;
+ REGISTER char *rtnval;
+
+ rtnval = NULL;
+ if (s2 != NULL) {
+ if (s1 != NULL) {
+ end = s1;
+ rtnval = strtok ((char *) NULL, s2);
+ } else if (end != NULL) {
+ if (*end != EOS) {
+ rtnval = end;
+ while (*end != *s2 && *end != EOS) {end++;}
+ if (*end != EOS) {
+ *end++ = EOS;
+ }
+ }
+ }
+ }
+ return (rtnval);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * BaseName strip leading pathname components from name
+ *
+ * SYNOPSIS
+ *
+ * LOCAL char *BaseName (pathname)
+ * char *pathname;
+ *
+ * DESCRIPTION
+ *
+ * Given pointer to a complete pathname, locates the base file
+ * name at the end of the pathname and returns a pointer to
+ * it.
+ *
+ */
+
+LOCAL char *BaseName (pathname)
+char *pathname;
+{
+ register char *base;
+
+ base = strrchr (pathname, '/');
+ if (base++ == NULL) {
+ base = pathname;
+ }
+ return (base);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * Writable test to see if a pathname is writable/creatable
+ *
+ * SYNOPSIS
+ *
+ * LOCAL BOOLEAN Writable (pathname)
+ * char *pathname;
+ *
+ * DESCRIPTION
+ *
+ * Because the debugger might be linked in with a program that
+ * runs with the set-uid-bit (suid) set, we have to be careful
+ * about opening a user named file for debug output. This consists
+ * of checking the file for write access with the real user id,
+ * or checking the directory where the file will be created.
+ *
+ * Returns TRUE if the user would normally be allowed write or
+ * create access to the named file. Returns FALSE otherwise.
+ *
+ */
+
+LOCAL BOOLEAN Writable (pathname)
+char *pathname;
+{
+ REGISTER BOOLEAN granted;
+#ifdef unix
+ REGISTER char *lastslash;
+#endif
+
+#ifndef unix
+ granted = TRUE;
+#else
+ granted = FALSE;
+ if (EXISTS (pathname)) {
+ if (WRITABLE (pathname)) {
+ granted = TRUE;
+ }
+ } else {
+ lastslash = strrchr (pathname, '/');
+ if (lastslash != NULL) {
+ *lastslash = EOS;
+ } else {
+ pathname = ".";
+ }
+ if (WRITABLE (pathname)) {
+ granted = TRUE;
+ }
+ if (lastslash != NULL) {
+ *lastslash = '/';
+ }
+ }
+#endif
+ return (granted);
+}
+
+
+/*
+ * This function may be eliminated when strrchr is available
+ * in the runtime environment (missing from BSD4.1).
+ * Alternately, you can use rindex() on BSD systems.
+ */
+
+LOCAL char *strrchr (s, c)
+char *s;
+char c;
+{
+ REGISTER char *scan;
+
+ for (scan = s; *scan != EOS; scan++) {;}
+ while (scan > s && *--scan != c) {;}
+ if (*scan != c) {
+ scan = NULL;
+ }
+ return (scan);
+}
+
+
+/*
+ * FUNCTION
+ *
+ * ChangeOwner change owner to real user for suid programs
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID ChangeOwner (pathname)
+ *
+ * DESCRIPTION
+ *
+ * For unix systems, change the owner of the newly created debug
+ * file to the real owner. This is strictly for the benefit of
+ * programs that are running with the set-user-id bit set.
+ *
+ * Note that at this point, the fact that pathname represents
+ * a newly created file has already been established. If the
+ * program that the debugger is linked to is not running with
+ * the suid bit set, then this operation is redundant (but
+ * harmless).
+ *
+ */
+
+LOCAL VOID ChangeOwner (pathname)
+char *pathname;
+{
+#ifdef unix
+ if (chown (pathname, getuid (), getgid ()) == -1) {
+ (VOID) fprintf (stderr, ERR_CHOWN, _db_process_, pathname);
+ perror ("");
+ (VOID) fflush (stderr);
+ (VOID) XDelay (stack -> delay);
+ }
+#endif
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_setjmp_ save debugger environment
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_setjmp_ ()
+ *
+ * DESCRIPTION
+ *
+ * Invoked as part of the user's DBUG_SETJMP macro to save
+ * the debugger environment in parallel with saving the user's
+ * environment.
+ *
+ */
+
+VOID _db_setjmp_ ()
+{
+ jmplevel = stack -> level;
+ jmpfunc = func;
+ jmpfile = file;
+}
+
+
+/*
+ * FUNCTION
+ *
+ * _db_longjmp_ restore previously saved debugger environment
+ *
+ * SYNOPSIS
+ *
+ * VOID _db_longjmp_ ()
+ *
+ * DESCRIPTION
+ *
+ * Invoked as part of the user's DBUG_LONGJMP macro to restore
+ * the debugger environment in parallel with restoring the user's
+ * previously saved environment.
+ *
+ */
+
+VOID _db_longjmp_ ()
+{
+ stack -> level = jmplevel;
+ if (jmpfunc) {
+ func = jmpfunc;
+ }
+ if (jmpfile) {
+ file = jmpfile;
+ }
+}
+
+
+/*
+ * FUNCTION
+ *
+ * DelayArg convert D flag argument to appropriate value
+ *
+ * SYNOPSIS
+ *
+ * LOCAL int DelayArg (value)
+ * int value;
+ *
+ * DESCRIPTION
+ *
+ * Converts delay argument, given in tenths of a second, to the
+ * appropriate numerical argument used by the system to delay
+ * that that many tenths of a second. For example, on the
+ * AMIGA, there is a system call "Delay()" which takes an
+ * argument in ticks (50 per second). On unix, the sleep
+ * command takes seconds. Thus a value of "10", for one
+ * second of delay, gets converted to 50 on the amiga, and 1
+ * on unix. Other systems will need to use a timing loop.
+ *
+ */
+
+LOCAL int DelayArg (value)
+int value;
+{
+ int delayarg = 0;
+
+#ifdef unix
+ delayarg = value / 10; /* Delay is in seconds for sleep () */
+#endif
+#ifdef AMIGA
+ delayarg = (HZ * value) / 10; /* Delay in ticks for XDelay () */
+#endif
+ return (delayarg);
+}
+
+
+/*
+ * A dummy delay stub for systems that do not support delays.
+ * With a little work, this can be turned into a timing loop.
+ */
+
+#ifndef unix
+#ifndef AMIGA
+XDelay ()
+{
+}
+#endif
+#endif
+
+
+/*
+ * FUNCTION
+ *
+ * perror perror simulation for systems that don't have it
+ *
+ * SYNOPSIS
+ *
+ * LOCAL VOID perror (s)
+ * char *s;
+ *
+ * DESCRIPTION
+ *
+ * Perror produces a message on the standard error stream which
+ * provides more information about the library or system error
+ * just encountered. The argument string s is printed, followed
+ * by a ':', a blank, and then a message and a newline.
+ *
+ * An undocumented feature of the unix perror is that if the string
+ * 's' is a null string (NOT a NULL pointer!), then the ':' and
+ * blank are not printed.
+ *
+ * This version just complains about an "unknown system error".
+ *
+ */
+
+#if !unix && !(AMIGA || LATTICE || __TURBOC__ )
+LOCAL VOID perror (s)
+#if __STDC__
+const char *s;
+#else
+char *s;
+#endif
+{
+ if (s && *s != EOS) {
+ (VOID) fprintf (stderr, "%s: ", s);
+ }
+ (VOID) fprintf (stderr, "<unknown system error>\n");
+}
+#endif /* !unix && !(AMIGA && LATTICE) */
+
+/*
+ * Here we need the definitions of the clock routine. Add your
+ * own for whatever system that you have.
+ */
+
+#if unix
+
+# include <sys/param.h>
+# if !defined(Solaris) && (BSD4_3 || sun)
+
+/*
+ * Definition of the Clock() routine for 4.3 BSD.
+ */
+
+#include <sys/time.h>
+#include <sys/resource.h>
+
+
+/*
+ * Returns the user time in milliseconds used by this process so
+ * far.
+ */
+
+LOCAL unsigned long Clock ()
+{
+ struct rusage ru;
+
+ (VOID) getrusage (RUSAGE_SELF, &ru);
+ return ((ru.ru_utime.tv_sec * 1000) + (ru.ru_utime.tv_usec / 1000));
+}
+
+#else
+
+LOCAL unsigned long Clock ()
+{
+ return (0);
+}
+
+# endif
+
+#else
+
+#if AMIGA
+
+struct DateStamp { /* Yes, this is a hack, but doing it right */
+ long ds_Days; /* is incredibly ugly without splitting this */
+ long ds_Minute; /* off into a separate file */
+ long ds_Tick;
+};
+
+static int first_clock = TRUE;
+static struct DateStamp begin;
+static struct DateStamp elapsed;
+
+LOCAL unsigned long Clock ()
+{
+ register struct DateStamp *now;
+ register unsigned long millisec = 0;
+ extern VOID *AllocMem ();
+
+ now = (struct DateStamp *) AllocMem ((long) sizeof (struct DateStamp), 0L);
+ if (now != NULL) {
+ if (first_clock == TRUE) {
+ first_clock = FALSE;
+ (VOID) DateStamp (now);
+ begin = *now;
+ }
+ (VOID) DateStamp (now);
+ millisec = 24 * 3600 * (1000 / HZ) * (now -> ds_Days - begin.ds_Days);
+ millisec += 60 * (1000 / HZ) * (now -> ds_Minute - begin.ds_Minute);
+ millisec += (1000 / HZ) * (now -> ds_Tick - begin.ds_Tick);
+ (VOID) FreeMem (now, (long) sizeof (struct DateStamp));
+ }
+ return (millisec);
+}
+
+#else
+
+LOCAL unsigned long Clock ()
+{
+ return (0);
+}
+
+#endif /* AMIGA */
+
+#endif /* unix */
+
+#ifdef AMIGA
+XDelay(x)
+int x;
+{
+ if (x) Delay(x); /* fix Delay bug in AmigaDOS */
+}
+#endif
+
diff --git a/dmake/dbug/dbug/dbug.h b/dmake/dbug/dbug/dbug.h
new file mode 100644
index 000000000000..0f171e0d349f
--- /dev/null
+++ b/dmake/dbug/dbug/dbug.h
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * *
+ * N O T I C E *
+ * *
+ * Copyright Abandoned, 1987, Fred Fish *
+ * *
+ * *
+ * This previously copyrighted work has been placed into the public *
+ * domain by the author and may be freely used for any purpose, *
+ * private or commercial. *
+ * *
+ * Because of the number of inquiries I was receiving about the use *
+ * of this product in commercially developed works I have decided to *
+ * simply make it public domain to further its unrestricted use. I *
+ * specifically would be most happy to see this material become a *
+ * part of the standard Unix distributions by AT&T and the Berkeley *
+ * Computer Science Research Group, and a standard part of the GNU *
+ * system from the Free Software Foundation. *
+ * *
+ * I would appreciate it, as a courtesy, if this notice is left in *
+ * all copies and derivative works. Thank you. *
+ * *
+ * The author makes no warranty of any kind with respect to this *
+ * product and explicitly disclaims any implied warranties of mer- *
+ * chantability or fitness for any particular purpose. *
+ * *
+ ******************************************************************************
+ */
+
+
+/*
+ * FILE
+ *
+ * dbug.h user include file for programs using the dbug package
+ *
+ * SYNOPSIS
+ *
+ * #include <local/dbug.h>
+ *
+ * SCCS ID
+ *
+ * @(#)dbug.h 1.11 9/5/87
+ *
+ * DESCRIPTION
+ *
+ * Programs which use the dbug package must include this file.
+ * It contains the appropriate macros to call support routines
+ * in the dbug runtime library.
+ *
+ * To disable compilation of the macro expansions define the
+ * preprocessor symbol "DBUG_OFF". This will result in null
+ * macros expansions so that the resulting code will be smaller
+ * and faster. (The difference may be smaller than you think
+ * so this step is recommended only when absolutely necessary).
+ * In general, tradeoffs between space and efficiency are
+ * decided in favor of efficiency since space is seldom a
+ * problem on the new machines).
+ *
+ * All externally visible symbol names follow the pattern
+ * "_db_xxx..xx_" to minimize the possibility of a dbug package
+ * symbol colliding with a user defined symbol.
+ *
+ * The DBUG_<N> style macros are obsolete and should not be used
+ * in new code. Macros to map them to instances of DBUG_PRINT
+ * are provided for compatibility with older code. They may go
+ * away completely in subsequent releases.
+ *
+ * AUTHOR
+ *
+ * Fred Fish
+ * (Currently employed by Motorola Computer Division, Tempe, Az.)
+ * hao!noao!mcdsun!fnf
+ * (602) 438-3614
+ *
+ */
+
+
+/*
+ * Internally used dbug variables which must be global.
+ */
+
+#ifndef DBUG_OFF
+ extern int _db_on_; /* TRUE if debug currently enabled */
+ extern FILE *_db_fp_; /* Current debug output stream */
+ extern char *_db_process_; /* Name of current process */
+ extern int _db_keyword_ (); /* Accept/reject keyword */
+ extern void _db_push_ (); /* Push state, set up new state */
+ extern void _db_pop_ (); /* Pop previous debug state */
+ extern void _db_enter_ (); /* New user function entered */
+ extern void _db_return_ (); /* User function return */
+ extern void _db_pargs_ (); /* Remember args for line */
+ extern void _db_doprnt_ (); /* Print debug output */
+ extern void _db_setjmp_ (); /* Save debugger environment */
+ extern void _db_longjmp_ (); /* Restore debugger environment */
+# endif
+
+
+/*
+ * These macros provide a user interface into functions in the
+ * dbug runtime support library. They isolate users from changes
+ * in the MACROS and/or runtime support.
+ *
+ * The symbols "__LINE__" and "__FILE__" are expanded by the
+ * preprocessor to the current source file line number and file
+ * name respectively.
+ *
+ * WARNING --- Because the DBUG_ENTER macro allocates space on
+ * the user function's stack, it must precede any executable
+ * statements in the user function.
+ *
+ */
+
+# ifdef DBUG_OFF
+# define DBUG_ENTER(a1)
+# define DBUG_MALLOC(a1)
+# define DBUG_RETURN(a1) return(a1)
+# define DBUG_VOID_RETURN return
+# define DBUG_EXECUTE(keyword,a1)
+# define DBUG_PRINT(keyword,arglist)
+# define DBUG_2(keyword,format) /* Obsolete */
+# define DBUG_3(keyword,format,a1) /* Obsolete */
+# define DBUG_4(keyword,format,a1,a2) /* Obsolete */
+# define DBUG_5(keyword,format,a1,a2,a3) /* Obsolete */
+# define DBUG_PUSH(a1)
+# define DBUG_POP()
+# define DBUG_PROCESS(a1)
+# define DBUG_FILE (stderr)
+# define DBUG_SETJMP setjmp
+# define DBUG_LONGJMP longjmp
+# else
+# define DBUG_ENTER(a) \
+ auto char *_db_func_, *_db_file_; \
+ int _db_level_; \
+ _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_)
+# define DBUG_MALLOC(a) \
+ auto char *_db_func_, *_db_file_; \
+ int _db_level_; \
+ malloc_init();\
+ _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_)
+# define DBUG_LEAVE \
+ (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
+# define DBUG_RETURN(a1) return (DBUG_LEAVE, (a1))
+/* define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} Alternate form */
+# define DBUG_VOID_RETURN DBUG_LEAVE; return
+# define DBUG_EXECUTE(keyword,a1) \
+ {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
+# define DBUG_PRINT(keyword,arglist) \
+ {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
+# define DBUG_2(keyword,format) \
+ DBUG_PRINT(keyword,(format)) /* Obsolete */
+# define DBUG_3(keyword,format,a1) \
+ DBUG_PRINT(keyword,(format,a1)) /* Obsolete */
+# define DBUG_4(keyword,format,a1,a2) \
+ DBUG_PRINT(keyword,(format,a1,a2)) /* Obsolete */
+# define DBUG_5(keyword,format,a1,a2,a3) \
+ DBUG_PRINT(keyword,(format,a1,a2,a3)) /* Obsolete */
+# define DBUG_PUSH(a1) _db_push_ (a1)
+# define DBUG_POP() _db_pop_ ()
+# define DBUG_PROCESS(a1) (_db_process_ = a1)
+# define DBUG_FILE (_db_fp_)
+# define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
+# define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
+# endif
+
diff --git a/dmake/dbug/dbug/dbug.txt b/dmake/dbug/dbug/dbug.txt
new file mode 100755
index 000000000000..ec032f61ebff
--- /dev/null
+++ b/dmake/dbug/dbug/dbug.txt
@@ -0,0 +1,1452 @@
+
+
+
+
+
+
+ D B U G
+
+ C Program Debugging Package
+
+ by
+ Fred Fish
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 1 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ INTRODUCTION
+
+
+ Almost every program development environment worthy of
+ the name provides some sort of debugging facility. Usually
+ this takes the form of a program which is capable of
+ controlling execution of other programs and examining the
+ internal state of other executing programs. These types of
+ programs will be referred to as external debuggers since the
+ debugger is not part of the executing program. Examples of
+ this type of debugger include the adb and sdb debuggers
+ provided with the UNIX1 operating system.
+
+
+ One of the problems associated with developing programs
+ in an environment with good external debuggers is that
+ developed programs tend to have little or no internal
+ instrumentation. This is usually not a problem for the
+ developer since he is, or at least should be, intimately
+ familiar with the internal organization, data structures,
+ and control flow of the program being debugged. It is a
+ serious problem for maintenance programmers, who are
+ unlikely to have such familiarity with the program being
+ maintained, modified, or ported to another environment. It
+ is also a problem, even for the developer, when the program
+ is moved to an environment with a primitive or unfamiliar
+ debugger, or even no debugger.
+
+
+ On the other hand, dbug is an example of an internal
+ debugger. Because it requires internal instrumentation of a
+ program, and its usage does not depend on any special
+ capabilities of the execution environment, it is always
+ available and will execute in any environment that the
+ program itself will execute in. In addition, since it is a
+ complete package with a specific user interface, all
+ programs which use it will be provided with similar
+ debugging capabilities. This is in sharp contrast to other
+ forms of internal instrumentation where each developer has
+ their own, usually less capable, form of internal debugger.
+ In summary, because dbug is an internal debugger it provides
+ consistency across operating environments, and because it is
+ available to all developers it provides consistency across
+ all programs in the same environment.
+
+
+ The dbug package imposes only a slight speed penalty on
+ executing programs, typically much less than 10 percent, and
+ a modest size penalty, typically 10 to 20 percent. By
+ defining a specific C preprocessor symbol both of these can
+ be reduced to zero with no changes required to the source
+
+ ____________________
+
+ 1. UNIX is a trademark of AT&T Bell Laboratories.
+
+ - 2 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ code.
+
+
+ The following list is a quick summary of the
+ capabilities of the dbug package. Each capability can be
+ individually enabled or disabled at the time a program is
+ invoked by specifying the appropriate command line
+ arguments.
+
+ o Execution trace showing function level control
+ flow in a semi-graphically manner using
+ indentation to indicate nesting depth.
+
+ o Output the values of all, or any subset of, key
+ internal variables.
+
+ o Limit actions to a specific set of named
+ functions.
+
+ o Limit function trace to a specified nesting depth.
+
+ o Label each output line with source file name and
+ line number.
+
+ o Label each output line with name of current
+ process.
+
+ o Push or pop internal debugging state to allow
+ execution with built in debugging defaults.
+
+ o Redirect the debug output stream to standard
+ output (stdout) or a named file. The default
+ output stream is standard error (stderr). The
+ redirection mechanism is completely independent of
+ normal command line redirection to avoid output
+ conflicts.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 3 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ PRIMITIVE DEBUGGING TECHNIQUES
+
+
+ Internal instrumentation is already a familiar concept
+ to most programmers, since it is usually the first debugging
+ technique learned. Typically, "print statements" are
+ inserted in the source code at interesting points, the code
+ is recompiled and executed, and the resulting output is
+ examined in an attempt to determine where the problem is.
+
+ The procedure is iterative, with each iteration yielding
+ more and more output, and hopefully the source of the
+ problem is discovered before the output becomes too large to
+ deal with or previously inserted statements need to be
+ removed. Figure 1 is an example of this type of primitive
+ debugging technique.
+
+
+
+ #include <stdio.h>
+
+ main (argc, argv)
+ int argc;
+ char *argv[];
+ {
+ printf ("argv[0] = %d\n", argv[0]);
+ /*
+ * Rest of program
+ */
+ printf ("== done ==\n");
+ }
+
+
+ Figure 1
+ Primitive Debugging Technique
+
+
+
+
+
+ Eventually, and usually after at least several
+ iterations, the problem will be found and corrected. At
+ this point, the newly inserted print statements must be
+ dealt with. One obvious solution is to simply delete them
+ all. Beginners usually do this a few times until they have
+ to repeat the entire process every time a new bug pops up.
+ The second most obvious solution is to somehow disable the
+ output, either through the source code comment facility,
+ creation of a debug variable to be switched on or off, or by
+ using the C preprocessor. Figure 2 is an example of all
+ three techniques.
+
+
+
+
+
+ - 4 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ #include <stdio.h>
+
+ int debug = 0;
+
+ main (argc, argv)
+ int argc;
+ char *argv[];
+ {
+ /* printf ("argv = %x\n", argv) */
+ if (debug) printf ("argv[0] = %d\n", argv[0]);
+ /*
+ * Rest of program
+ */
+ #ifdef DEBUG
+ printf ("== done ==\n");
+ #endif
+ }
+
+
+ Figure 2
+ Debug Disable Techniques
+
+
+
+
+
+ Each technique has its advantages and disadvantages
+ with respect to dynamic vs static activation, source code
+ overhead, recompilation requirements, ease of use, program
+ readability, etc. Overuse of the preprocessor solution
+ quickly leads to problems with source code readability and
+ maintainability when multiple #ifdef symbols are to be
+ defined or undefined based on specific types of debug
+ desired. The source code can be made slightly more readable
+ by suitable indentation of the #ifdef arguments to match the
+ indentation of the code, but not all C preprocessors allow
+ this. The only requirement for the standard UNIX C
+ preprocessor is for the '#' character to appear in the first
+ column, but even this seems like an arbitrary and
+ unreasonable restriction. Figure 3 is an example of this
+ usage.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 5 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ #include <stdio.h>
+
+ main (argc, argv)
+ int argc;
+ char *argv[];
+ {
+ # ifdef DEBUG
+ printf ("argv[0] = %d\n", argv[0]);
+ # endif
+ /*
+ * Rest of program
+ */
+ # ifdef DEBUG
+ printf ("== done ==\n");
+ # endif
+ }
+
+
+ Figure 3
+ More Readable Preprocessor Usage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 6 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ FUNCTION TRACE EXAMPLE
+
+
+ We will start off learning about the capabilities of
+ the dbug package by using a simple minded program which
+ computes the factorial of a number. In order to better
+ demonstrate the function trace mechanism, this program is
+ implemented recursively. Figure 4 is the main function for
+ this factorial program.
+
+
+
+ #include <stdio.h>
+ /* User programs should use <local/dbug.h> */
+ #include "dbug.h"
+
+ int main (argc, argv)
+ int argc;
+ char *argv[];
+ {
+ register int result, ix;
+ extern int factorial (), atoi ();
+
+ DBUG_ENTER ("main");
+ DBUG_PROCESS (argv[0]);
+ for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) {
+ switch (argv[ix][1]) {
+ case '#':
+ DBUG_PUSH (&(argv[ix][2]));
+ break;
+ }
+ }
+ for (; ix < argc; ix++) {
+ DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix]));
+ result = factorial (atoi (argv[ix]));
+ printf ("%d\n", result);
+ }
+ DBUG_RETURN (0);
+ }
+
+
+ Figure 4
+ Factorial Program Mainline
+
+
+
+
+
+ The main function is responsible for processing any
+ command line option arguments and then computing and
+ printing the factorial of each non-option argument.
+
+ First of all, notice that all of the debugger functions
+ are implemented via preprocessor macros. This does not
+
+
+ - 7 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ detract from the readability of the code and makes disabling
+ all debug compilation trivial (a single preprocessor symbol,
+ DBUG_OFF, forces the macro expansions to be null).
+
+ Also notice the inclusion of the header file dbug.h
+ from the local header file directory. (The version included
+ here is the test version in the dbug source distribution
+ directory). This file contains all the definitions for the
+ debugger macros, which all have the form DBUG_XX...XX.
+
+
+ The DBUG_ENTER macro informs that debugger that we have
+ entered the function named main. It must be the very first
+ "executable" line in a function, after all declarations and
+ before any other executable line. The DBUG_PROCESS macro is
+ generally used only once per program to inform the debugger
+ what name the program was invoked with. The DBUG_PUSH macro
+ modifies the current debugger state by saving the previous
+ state and setting a new state based on the control string
+ passed as its argument. The DBUG_PRINT macro is used to
+ print the values of each argument for which a factorial is
+ to be computed. The DBUG_RETURN macro tells the debugger
+ that the end of the current function has been reached and
+ returns a value to the calling function. All of these
+ macros will be fully explained in subsequent sections.
+
+ To use the debugger, the factorial program is invoked
+ with a command line of the form:
+
+ factorial -#d:t 1 2 3
+
+ The main function recognizes the "-#d:t" string as a
+ debugger control string, and passes the debugger arguments
+ ("d:t") to the dbug runtime support routines via the
+ DBUG_PUSH macro. This particular string enables output from
+ the DBUG_PRINT macro with the 'd' flag and enables function
+ tracing with the 't' flag. The factorial function is then
+ called three times, with the arguments "1", "2", and "3".
+ Note that the DBUG_PRINT takes exactly two arguments, with
+ the second argument (a format string and list of printable
+ values) enclosed in parenthesis.
+
+ Debug control strings consist of a header, the "-#",
+ followed by a colon separated list of debugger arguments.
+ Each debugger argument is a single character flag followed
+ by an optional comma separated list of arguments specific to
+ the given flag. Some examples are:
+
+ -#d:t:o
+ -#d,in,out:f,main:F:L
+
+ Note that previously enabled debugger actions can be
+ disabled by the control string "-#".
+
+
+
+ - 8 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ The definition of the factorial function, symbolized as
+ "N!", is given by:
+
+ N! = N * N-1 * ... 2 * 1
+
+ Figure 5 is the factorial function which implements this
+ algorithm recursively. Note that this is not necessarily
+ the best way to do factorials and error conditions are
+ ignored completely.
+
+
+
+ #include <stdio.h>
+ /* User programs should use <local/dbug.h> */
+ #include "dbug.h"
+
+ int factorial (value)
+ register int value;
+ {
+ DBUG_ENTER ("factorial");
+ DBUG_PRINT ("find", ("find %d factorial", value));
+ if (value > 1) {
+ value *= factorial (value - 1);
+ }
+ DBUG_PRINT ("result", ("result is %d", value));
+ DBUG_RETURN (value);
+ }
+
+
+ Figure 5
+ Factorial Function
+
+
+
+
+
+ One advantage (some may not consider it so) to using
+ the dbug package is that it strongly encourages fully
+ structured coding with only one entry and one exit point in
+ each function. Multiple exit points, such as early returns
+ to escape a loop, may be used, but each such point requires
+ the use of an appropriate DBUG_RETURN or DBUG_VOID_RETURN
+ macro.
+
+
+ To build the factorial program on a UNIX system,
+ compile and link with the command:
+
+ cc -o factorial main.c factorial.c -ldbug
+
+ The "-ldbug" argument tells the loader to link in the
+ runtime support modules for the dbug package. Executing the
+ factorial program with a command of the form:
+
+
+
+ - 9 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ factorial 1 2 3 4 5
+
+ generates the output shown in figure 6.
+
+
+
+ 1
+ 2
+ 6
+ 24
+ 120
+ Figure 6
+ factorial 1 2 3 4 5
+
+
+
+
+
+ Function level tracing is enabled by passing the
+ debugger the 't' flag in the debug control string. Figure 7
+ is the output resulting from the command
+ "factorial -#t:o 3 2".
+
+
+
+ | >factorial
+ | | >factorial
+ | | <factorial
+ | <factorial
+ 2
+ | >factorial
+ | | >factorial
+ | | | >factorial
+ | | | <factorial
+ | | <factorial
+ | <factorial
+ 6
+ <main
+
+
+ Figure 7
+ factorial -#t:o 3 2
+
+
+
+
+
+ Each entry to or return from a function is indicated by
+ '>' for the entry point and '<' for the exit point,
+ connected by vertical bars to allow matching points to be
+ easily found when separated by large distances.
+
+
+ This trace output indicates that there was an initial
+
+
+ - 10 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ call to factorial from main (to compute 2!), followed by a
+ single recursive call to factorial to compute 1!. The main
+ program then output the result for 2! and called the
+ factorial function again with the second argument, 3.
+ Factorial called itself recursively to compute 2! and 1!,
+ then returned control to main, which output the value for 3!
+ and exited.
+
+
+ Note that there is no matching entry point "main>" for
+ the return point "<main" because at the time the DBUG_ENTER
+ macro was reached in main, tracing was not enabled yet. It
+ was only after the macro DBUG_PUSH was executing that
+ tracing became enabled. This implies that the argument list
+ should be processed as early as possible since all code
+ preceding the first call to DBUG_PUSH is essentially
+ invisible to dbug (this can be worked around by inserting a
+ temporary DBUG_PUSH(argv[1]) immediately after the
+ DBUG_ENTER("main") macro.
+
+
+ One last note, the trace output normally comes out on
+ the standard error. Since the factorial program prints its
+ result on the standard output, there is the possibility of
+ the output on the terminal being scrambled if the two
+ streams are not synchronized. Thus the debugger is told to
+ write its output on the standard output instead, via the 'o'
+ flag character. Note that no 'o' implies the default
+ (standard error), a 'o' with no arguments means standard
+ output, and a 'o' with an argument means used the named
+ file. I.E, "factorial -#t:o,logfile 3 2" would write the
+ trace output in "logfile". Because of UNIX implementation
+ details, programs usually run faster when writing to stdout
+ rather than stderr, though this is not a prime consideration
+ in this example.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 11 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ USE OF DBUG_PRINT MACRO
+
+
+ The mechanism used to produce "printf" style output is
+ the DBUG_PRINT macro.
+
+
+ To allow selection of output from specific macros, the
+ first argument to every DBUG_PRINT macro is a dbug keyword.
+ When this keyword appears in the argument list of the 'd'
+ flag in a debug control string, as in
+ "-#d,keyword1,keyword2,...:t", output from the corresponding
+ macro is enabled. The default when there is no 'd' flag in
+ the control string is to enable output from all DBUG_PRINT
+ macros.
+
+
+ Typically, a program will be run once, with no keywords
+ specified, to determine what keywords are significant for
+ the current problem (the keywords are printed in the macro
+ output line). Then the program will be run again, with the
+ desired keywords, to examine only specific areas of
+ interest.
+
+
+ The second argument to a DBUG_PRINT macro is a standard
+ printf style format string and one or more arguments to
+ print, all enclosed in parenthesis so that they collectively
+ become a single macro argument. This is how variable
+ numbers of printf arguments are supported. Also note that
+ no explicit newline is required at the end of the format
+ string. As a matter of style, two or three small DBUG_PRINT
+ macros are preferable to a single macro with a huge format
+ string. Figure 8 shows the output for default tracing and
+ debug.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 12 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ | args: argv[2] = 3
+ | >factorial
+ | | find: find 3 factorial
+ | | >factorial
+ | | | find: find 2 factorial
+ | | | >factorial
+ | | | | find: find 1 factorial
+ | | | | result: result is 1
+ | | | <factorial
+ | | | result: result is 2
+ | | <factorial
+ | | result: result is 6
+ | <factorial
+ 6
+ <main
+
+
+ Figure 8
+ factorial -#d:t:o 3
+
+
+
+
+
+ The output from the DBUG_PRINT macro is indented to
+ match the trace output for the function in which the macro
+ occurs. When debugging is enabled, but not trace, the
+ output starts at the left margin, without indentation.
+
+
+ To demonstrate selection of specific macros for output,
+ figure 9 shows the result when the factorial program is
+ invoked with the debug control string "-#d,result:o".
+
+
+
+ factorial: result: result is 1
+ factorial: result: result is 2
+ factorial: result: result is 6
+ factorial: result: result is 24
+ 24
+ Figure 9
+ factorial -#d,result:o 4
+
+
+
+
+
+ It is sometimes desirable to restrict debugging and
+ trace actions to a specific function or list of functions.
+ This is accomplished with the 'f' flag character in the
+ debug control string. Figure 10 is the output of the
+ factorial program when run with the control string
+ "-#d:f,factorial:F:L:o". The 'F' flag enables printing of
+
+
+ - 13 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ the source file name and the 'L' flag enables printing of
+ the source file line number.
+
+
+
+ factorial.c: 9: factorial: find: find 3 factorial
+ factorial.c: 9: factorial: find: find 2 factorial
+ factorial.c: 9: factorial: find: find 1 factorial
+ factorial.c: 13: factorial: result: result is 1
+ factorial.c: 13: factorial: result: result is 2
+ factorial.c: 13: factorial: result: result is 6
+ 6
+
+
+ Figure 10
+ factorial -#d:f,factorial:F:L:o 3
+
+
+
+
+
+ The output in figure 10 shows that the "find" macro is
+ in file "factorial.c" at source line 8 and the "result"
+ macro is in the same file at source line 12.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 14 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ SUMMARY OF MACROS
+
+
+ This section summarizes the usage of all currently
+ defined macros in the dbug package. The macros definitions
+ are found in the user include file dbug.h from the standard
+ include directory.
+
+
+
+ DBUG_ENTER Used to tell the runtime support module
+ the name of the function being entered.
+ The argument must be of type "pointer to
+ character". The DBUG_ENTER macro must
+ precede all executable lines in the
+ function just entered, and must come
+ after all local declarations. Each
+ DBUG_ENTER macro must have a matching
+ DBUG_RETURN or DBUG_VOID_RETURN macro at
+ the function exit points. DBUG_ENTER
+ macros used without a matching
+ DBUG_RETURN or DBUG_VOID_RETURN macro
+ will cause warning messages from the
+ dbug package runtime support module.
+
+ EX: DBUG_ENTER ("main");
+
+ DBUG_RETURN Used at each exit point of a function
+ containing a DBUG_ENTER macro at the
+ entry point. The argument is the value
+ to return. Functions which return no
+ value (void) should use the
+ DBUG_VOID_RETURN macro. It is an error
+ to have a DBUG_RETURN or
+ DBUG_VOID_RETURN macro in a function
+ which has no matching DBUG_ENTER macro,
+ and the compiler will complain if the
+ macros are actually used (expanded).
+
+ EX: DBUG_RETURN (value);
+ EX: DBUG_VOID_RETURN;
+
+ DBUG_PROCESS Used to name the current process being
+ executed. A typical argument for this
+ macro is "argv[0]", though it will be
+ perfectly happy with any other string.
+
+ EX: DBUG_PROCESS (argv[0]);
+
+ DBUG_PUSH Sets a new debugger state by pushing the
+ current dbug state onto an internal
+ stack and setting up the new state using
+ the debug control string passed as the
+ macro argument. The most common usage
+
+
+ - 15 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ is to set the state specified by a debug
+ control string retrieved from the
+ argument list. Note that the leading
+ "-#" in a debug control string specified
+ as a command line argument must not be
+ passed as part of the macro argument.
+ The proper usage is to pass a pointer to
+ the first character after the "-#"
+ string.
+
+ EX: DBUG_PUSH ((argv[i][2]));
+ EX: DBUG_PUSH ("d:t");
+ EX: DBUG_PUSH ("");
+
+ DBUG_POP Restores the previous debugger state by
+ popping the state stack. Attempting to
+ pop more states than pushed will be
+ ignored and no warning will be given.
+ The DBUG_POP macro has no arguments.
+
+ EX: DBUG_POP ();
+
+ DBUG_FILE The DBUG_FILE macro is used to do
+ explicit I/O on the debug output stream.
+ It is used in the same manner as the
+ symbols "stdout" and "stderr" in the
+ standard I/O package.
+
+ EX: fprintf (DBUG_FILE, "Doing my own
+ I/O!\n");
+
+ DBUG_EXECUTE The DBUG_EXECUTE macro is used to
+ execute any arbitrary C code. The first
+ argument is the debug keyword, used to
+ trigger execution of the code specified
+ as the second argument. This macro must
+ be used cautiously because, like the
+ DBUG_PRINT macro, it is automatically
+ selected by default whenever the 'd'
+ flag has no argument list (I.E., a
+ "-#d:t" control string).
+
+ EX: DBUG_EXECUTE ("abort", abort ());
+
+ DBUG_N These macros, where N is in the range
+ 2-5, are currently obsolete and will be
+ removed in a future release. Use the
+ new DBUG_PRINT macro.
+
+ DBUG_PRINT Used to do printing via the "fprintf"
+ library function on the current debug
+ stream, DBUG_FILE. The first argument
+ is a debug keyword, the second is a
+ format string and the corresponding
+
+
+ - 16 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ argument list. Note that the format
+ string and argument list are all one
+ macro argument and must be enclosed in
+ parenthesis.
+
+ EX: DBUG_PRINT ("eof", ("end of file found"));
+ EX: DBUG_PRINT ("type", ("type is %x",
+ type));
+ EX: DBUG_PRINT ("stp", ("%x -> %s", stp,
+ stp -> name));
+
+ DBUG_SETJMP Used in place of the setjmp() function
+ to first save the current debugger state
+ and then execute the standard setjmp
+ call. This allows to the debugger to
+ restore it's state when the DBUG_LONGJMP
+ macro is used to invoke the standard
+ longjmp() call. Currently all instances
+ of DBUG_SETJMP must occur within the
+ same function and at the same function
+ nesting level.
+
+ EX: DBUG_SETJMP (env);
+
+ DBUG_LONGJMP Used in place of the longjmp() function
+ to first restore the previous debugger
+ state at the time of the last
+ DBUG_SETJMP and then execute the
+ standard longjmp() call. Note that
+ currently all DBUG_LONGJMP macros
+ restore the state at the time of the
+ last DBUG_SETJMP. It would be possible
+ to maintain separate DBUG_SETJMP and
+ DBUG_LONGJMP pairs by having the
+ debugger runtime support module use the
+ first argument to differentiate the
+ pairs.
+
+ EX: DBUG_LONGJMP (env,val);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 17 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ DEBUG CONTROL STRING
+
+
+ The debug control string is used to set the state of
+ the debugger via the DBUG_PUSH macro. This section
+ summarizes the currently available debugger options and the
+ flag characters which enable or disable them. Argument
+ lists enclosed in '[' and ']' are optional.
+
+
+ d[,keywords] Enable output from macros with
+ specified keywords. A null list of
+ keywords implies that all keywords are
+ selected.
+
+ D[,time] Delay for specified time after each
+ output line, to let output drain.
+ Time is given in tenths of a second
+ (value of 10 is one second). Default
+ is zero.
+
+ f[,functions] Limit debugger actions to the
+ specified list of functions. A null
+ list of functions implies that all
+ functions are selected.
+
+ F Mark each debugger output line with
+ the name of the source file containing
+ the macro causing the output.
+
+ L Mark each debugger output line with
+ the source file line number of the
+ macro causing the output.
+
+ n Mark each debugger output line with
+ the current function nesting depth.
+
+ N Sequentially number each debugger
+ output line starting at 1. This is
+ useful for reference purposes when
+ debugger output is interspersed with
+ program output.
+
+ o[,file] Redirect the debugger output stream to
+ the specified file. The default
+ output stream is stderr. A null
+ argument list causes output to be
+ redirected to stdout.
+
+ p[,processes] Limit debugger actions to the
+ specified processes. A null list
+ implies all processes. This is useful
+ for processes which run child
+ processes. Note that each debugger
+
+
+ - 18 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ output line can be marked with the
+ name of the current process via the
+ 'P' flag. The process name must match
+ the argument passed to the
+ DBUG_PROCESS macro.
+
+ P Mark each debugger output line with
+ the name of the current process. Most
+ useful when used with a process which
+ runs child processes that are also
+ being debugged. Note that the parent
+ process must arrange for the debugger
+ control string to be passed to the
+ child processes.
+
+ r Used in conjunction with the DBUG_PUSH
+ macro to reset the current indentation
+ level back to zero. Most useful with
+ DBUG_PUSH macros used to temporarily
+ alter the debugger state.
+
+ t[,N] Enable function control flow tracing.
+ The maximum nesting depth is specified
+ by N, and defaults to 200.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 19 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ HINTS AND MISCELLANEOUS
+
+
+ One of the most useful capabilities of the dbug package
+ is to compare the executions of a given program in two
+ different environments. This is typically done by executing
+ the program in the environment where it behaves properly and
+ saving the debugger output in a reference file. The program
+ is then run with identical inputs in the environment where
+ it misbehaves and the output is again captured in a
+ reference file. The two reference files can then be
+ differentially compared to determine exactly where execution
+ of the two processes diverges.
+
+
+ A related usage is regression testing where the
+ execution of a current version is compared against
+ executions of previous versions. This is most useful when
+ there are only minor changes.
+
+
+ It is not difficult to modify an existing compiler to
+ implement some of the functionality of the dbug package
+ automatically, without source code changes to the program
+ being debugged. In fact, such changes were implemented in a
+ version of the Portable C Compiler by the author in less
+ than a day. However, it is strongly encouraged that all
+ newly developed code continue to use the debugger macros for
+ the portability reasons noted earlier. The modified
+ compiler should be used only for testing existing programs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 20 -
+
+
+
+
+
+ DBUG User Manual October 29, 1986
+
+
+
+ CAVEATS
+
+
+ The dbug package works best with programs which have
+ "line oriented" output, such as text processors, general
+ purpose utilities, etc. It can be interfaced with screen
+ oriented programs such as visual editors by redefining the
+ appropriate macros to call special functions for displaying
+ the debugger results. Of course, this caveat is not
+ applicable if the debugger output is simply dumped into a
+ file for post-execution examination.
+
+
+ Programs which use memory allocation functions other
+ than malloc will usually have problems using the standard
+ dbug package. The most common problem is multiply allocated
+ memory.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 21 -
+
+
+
+
+
+
+
+
+ D B U G
+ C Program Debugging Package
+
+ by
+ Fred Fish
+
+
+
+ ABSTRACT
+
+
+ This document introduces dbug, a macro based C debugging
+ package which has proven to be a very flexible and useful
+ tool for debugging, testing, and porting C programs.
+
+
+ All of the features of the dbug package can be enabled
+ or disabled dynamically at execution time. This means that
+ production programs will run normally when debugging is not
+ enabled, and eliminates the need to maintain two separate
+ versions of a program.
+
+
+ Many of the things easily accomplished with
+ conventional debugging tools, such as symbolic debuggers,
+ are difficult or impossible with this package, and vice
+ versa. Thus the dbug package should not be thought of as a
+ replacement or substitute for other debugging tools, but
+ simply as a useful addition to the program development and
+ maintenance environment.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 22 -
+
+
diff --git a/dmake/dbug/dbug/dbug.uue b/dmake/dbug/dbug/dbug.uue
new file mode 100644
index 000000000000..da8743b7e128
--- /dev/null
+++ b/dmake/dbug/dbug/dbug.uue
@@ -0,0 +1,368 @@
+begin 650 dbug.Z
+M'YV,"@*"&$BPH,&#" T2 2$$1!401P0FG&AP" @H<MZ<D1.F#0@B9<34.7,F
+MC9LS%\.,61/F3!F)%&/*!"$F#\R9. <:D5.&# @C:>:@"4@481($1Y,Z0;"T
+M*14$3Z-*03"UZA,$5[,20;"U:Q4$7\,.03"V;%2H4),B19H5*]:F3)D6C1F$
+M39LW<^B *&.GC)P\(.!DW-@1!!F^9=B\@=.FC!N]CNVDR>BF\6,0=][(H8,&
+M,(@W9A0@Y%QFH)N.I06_D7QX#H@Y;QJ_UJP7M.&0(TN>!&%&91HV:>CD<3&P
+MRIPZ8=BPL3D:35 0=,*L*>.:]$ SFCU^-C,PS$#5A+7?<3X&S<#G(,:$@1-&
+M#)O2VT4?'//F<4;E)E'NQ5-F3!TZ:=0WD&V?D29'8(-QU(9K8;CA4QEX=&12
+M?M"A\1)")M'AUVELO!:=AML5:.&!$/;W'X7@*3@'<2!08>$<I0D'!W4#AH90
+MBAVY=L=O'8I1&D]F^,633W2\ 4(8KD&HH1P<WB8227ZY-H=)8\1HH7P&'?:D
+M2P<^Y\8;>K&W68C6E>@?@+OAV :+1438!ASON19?<^C)"!^!6N;FUWENC,%&
+M'8<-9%T8"!!J*!D((*JH& @PZNB1#KZ&P!R33JIHHHDZVFBC3NHIQQQ8%J0:
+M:SUA%IQYUH4%%EAP-:564E@@$.NL&^ 0 P*WYKI!#I_-R!&:*,V11UYEK#D7
+M14^X49IMUJGF7K$,S@';&&F$H:%/.W)V6U^*P8%B@CF&2I!)W;DQ4&23U6>9
+M7J9J"\(9;[SATWY+-MDIE)^"\!QGUHH[T&'<+E:JFG)J&"ET1H* 1AA]#00<
+M'72\-^"!('S)9[W)^:NO&WG)4<>ZU@;H!HLM.B<G>G4<E]QRIH'9'8)O/.L1
+M=@>2IC' B0E\X)1]EF:AOG.P\-F!UCI<!I+L"O5&'6S,ZZ/0&P/8AK6),7=0
+M;VW\5BW%V9I7(7P9;IC<T&<TF(8>(=<G-!G6>M=Q'6/040=/06O<H$_TV?=&
+MAV8H=@>9/ZM)4QD4WNL2&20GP2YZ86@,HQP!IDR0L^]IQYMF TT=]FD]?P=N
+M&XU]"O5X"8?!D\9UN '<="P7J3##I1U7'F\2 F=Z<)YU+>C/,(<WD(_Y::SY
+M8V&8U!/4=Y&1AAEI'#]T8+25ZGJ#8(ZXEQN24;8NBXIK_%QRL!T)L\Q"(V8N
+MS5]OF[.O0H_G6/J]*^B]G'?U-:_KD%Z?O;J.Z:6[=X))0]8 U##,I0YK6C/=
+MS7"#+Z%ASGP5,U*>\.6"8TTD6>FKWIX6YB"A?2%1'Q3#!^OP091\SUP0Z@B<
+M[L2=_$5-;&Q8X);\PB(A]"<,*2M-<$# DSC483(T"AN3QF:2MX$,0 *R3>-N
+M]#FAW4U?=)!3REH"'S*\@4819-=A9G0P 4'*,W.8$;4RAA#UL$<,6@,0%@ED
+MG?V8"(GFTE^Z*M,_J.WP>VRX0QB&93<[%(\-[9'8$W>DG'/QYTQ@BV.#/(,N
+M[?5O=T7[FL8$!T48L8$[A.R0F?ZCPY$-) GF"@,9E ='H?&L2E $VI$T1I\W
+MO0=$@5$)2UPR$-V)[S5B7%X:QC"0'%),B+VI$M2.I)Q)?DY.F"&/UW)X'G9E
+M\G?P&54:#C,O6TXI:X"4@PQS0R$SMB>-S5O10%STG'*:2RBF@T-ZZD,'CN0%
+M80,RD 4)\H5ZVO.>-RE(#(A3!2<D 0NJ]$X[15DLTZTA1$&@@@FHP)#$=(@)
+M[=&,M303S@H216,YD4D+0! #$+3@HA=%"!&$4(4C..1Q(&A"@Y#3H8S&Y EQ
+MB]F>9) #H<4@!SBP04BOEAW7V$:(32IB.S_6O[29RWT\V8M*O(:S;NWI=:!J
+M#N$H]H8[N$%H*6,IR^+D&F\^2V@T\\A/'P-#P]%08Z!\S<>F]A>A^4@]S/P@
+M&4(XPA(&U%Q '=L$N91*:;:&E?69$K'Z!!B59$1:O?)+R';32/X])FB0\LE;
+M<0BC5 :ECW\,9(R,M#+U.35?._0K%O,F6(.-P3.&Q4M4#])9@FTL?7- C1P=
+M^1B+8K0@+BJ-7.F* !(B "7L60D5]?4FO-"H/BQS&W#.@ :]A+$, W-,<H3S
+M&3=H;)/ BE^.A":C7:X,,&V FWFX6J$&<10&@?%+E1[C1 ?9#03)HXYSSY8:
+MZ;)!.%#KKGJ4XYD8H!>>()#!?WVU7CJ03 A6RU(9F.>&PKDME\SCI44$4P;5
+M5$E:F!-6&\2P-YI4#W#4*8UZK(L0'_&P)W"3GI'TX!<CZ<YBY6F02US3PQ\.
+M25 ):R-LYE8EP![&MC+)[77VYK?" >>=JKRE#W=YT($<!W2F\TR(=G>A^:SG
+MFP\+9XVH/)#=-JJNOXVE<%W"IJ6FY\IH?!A@1CPX[SDH#:S1*F"D^RR?8$YY
+ML:WSD?1B':G!QSO:U<YE,82]-TQG7C21\G.I988\% Y^1X*#:@)(M8&T<FH'
+M XZR[":',Q#UL1;-B9':]$:108<CJ'P-&JI:.#.D+FZF!L%[N&5I=M[GM@GI
+M6U4+0JZ7.;E8:6@!8>! GN\2!-/*HA@(4A8\EYKD,,2#(SR?[5T0*2LO%-HB
+M9T*-$R,]X3]P^$_Z_/BGXW)G90XDFAO 6 <QP(A=H(':=!*,D[QVR(^0T^R*
+M\DD1(S%!@#L\$JP#BV-?+UJ7O/PUNZ9<,=20 =<(<76?X+AOB!?$WP#7B\0'
+M;JZ!HG)ZN.R/+DMU[>QJ&PW<GHF_VY,8I<YN:70(MUXT71K=[5@.J&2>Q!HN
+MF\A:W" TK]C'?"2'E,MDY3YJZ=%F]QEPBUO6QJOEJ4PCVRG[1PX\><S/1961
+M"U=<U!=)F7DP!X?%7*RLABM<7BH-X)55=>L$P:ZI=2>2W^B%7'O-]H)Q>-^O
+M=QL$4N@)$./&Y7L-R.E):^?1M(._M3O(= ]W*<QE/A 4Y,6*_TG!Q'Q]FL;,
+M2^=E8)&0#],;IM$![H>/N;@[MO@D.YYM<IB7D# ' LO3X3!83P')<HOZ$RN/
+M)QR';W\X&!2//*>5*]00RYY=8<= NS8VRNB7Y#"U#EWZB4$?TN"EW78[O&&:
+MJ9=Y[_/6MUU&T;;S=*E& ^Q1D*;_(R0UJ7'VI%(WL%3]R(HIT0-<4X[B5*?O
+M!P4((( $6!54016O@A1-@ +V( )F 1G$14/: 4(0($66 0(@($:^!%<T8%$
+MH($9F(%"@ C6(*J$A9'@ IN((KJ((J^("MPA0MN((M@A91 8(:6!9D019(
+M@ ]^(,QZ$]KD111@ !%>(0G"!8XF(%3@ !-^(3O9Q"@A#$=(E0><T2FAD<\
+M(4J%13O8M#6UUC-P<'JC821W\4YJ$CJ0=4HZ='>ND57&9AW,\REZD7<GH3$:
+M4AX-YD/P\1ZFHRR(@UMYX"W[M1S#) (!=!EKIR'K,@<B0!"F4V4&441^<2U\
+M EM+@W,B)B^E431")%\H\GV/Q5T_0Q^',3\GAGR_42I/A%W.$UF%1S>F5SB3
+M]W2#=A IE#6 ^%KF92V,.(;P=!A+HHLU-R)6DAH9(3- 8W0$(606AF))54Y+
+M$C)],3I3YW)>$QR*Q7V.EAC*<X<(<1=)!8OPI1EW@GA0\T0*(S"NQE^%=W.H
+MQ"Q7PD0Q4SFJA&?TT1<WYB,T<XQ-IWIZ\5:Q02-%8B391$M%LD!CTRY>0WL4
+M)AE+,P<LLS&/8XD>0C6-:!K0121&XB,:PQ/UTQ,L A2>EE0==4+[H4(2(X_[
+M,H@LY#D9!V>26!!VB!)YB 9[6 >AMU,Y,0)4\B>!P@.7%R N@ 8^P&\Q,3RU
+M9SIG, 9.U&EVD *]ER%'TFECL /CMS 'H@),:0=;T 58Z5)[T'M<ER'<@0(B
+MT)5; -= (] (E0 9<X 8B\)1GX)5LF0)AB7\@\ (J0)8%H0(#$7CO9!MJ
+M I@$H0(O@)@(8I:U)P(]\)96I"QNV0-S*0)ZV7M]$(5\B1 D.3>E$0.,61 8
+M$9,- Q);0B%4,'PY^1(@)1-%T!>/(6?I>#!PZ(Y'8@9+ HD+YX=(]AJ(P1$Q
+MA"'32''YQ3N44RQ25TB#<SFIXQ-/1!]8UQ_7PB)!0(8'P1G/47890HJEH2QW
+M,)&4N!FETIB7<9&,V#_TDS+LXI$(<1C3)77;1A#)LBQB )&2 QM_(FW[8B37
+M!"> <1BO=(QM8#?*44-EH!O)]H8JXXY65"'?PQME\#=^]H:/\1M?XQD+TQ=X
+MF# \,2.15"87FE3/B%C!"1A^)C[@21,C 3UP\(9P4$$((60PDC<^<8:U<9^1
+M(R5[<R("TI^ST1BK]C>&$12:164:4XMT #6$8R"[DQ$CX34ZEHFH9(J;"#J/
+M%$QIE <LP$I;*&U*9'CX5BW/ D\F-@?94AZEDD0' AIFD&Z)ACH\HQ]M9!$(
+M4F%=1QVP470$\9E))0-WE9*NM"SG5DS-P1,QPIIIP(<5AY2=>1 ;-0/MYWX:
+M,U(E=5+TMU(+^:@% 5-%LG\T95/_YWXNY9-] I2E(92W1Y1&Z:@30943Y)8@
+M -8V7M*B0),Z915>9=2Z6R7D:M[F1,QMI5J"9:]-Y:=Z9?F20=GF990*:LE
+M@ >7:9=1"0**R9C+4WL3I'F)R*R/J99L":UR29?4NI9=D)G)^I>/*IB )U\A
+M<ICKNIBENCRD]Q%%$'^,V:W-&IF&41^E$9F7B:X9-0+.MSR:R9F<VJ=I4)*E
+M(0.CJ1 ,]!%&6J:KJ8>+JI.@\IHQ401F=I.M"57-)">BY$?$,V/E,B]X-K(-
+M$ATSIC&V1#=BQ"[X0P9YT'F[! )V("4?<K,J04!&94I4NHFGB!"KX1<6(DI"
+M WRQX2V )&TU!D2-6#Y(0JB]!"-0 Z\'L85LDV:XPZ1T, 8D\P3ZR$Q3UD84
+M5J)[.AO[*3(:LV0KL55'0P;5823)N2 ,.1L\)K3PH;58ACLG*SS%0SPFT;?4
+ME4SO U^SN$(#,0((P+B.FP8( +F2:P8(0+F6>RF*4@8(H+F<:[F56[E.E@<;
+MMC<B.XZNXYX'07K&8V<4\YP+MKJ_,[7SXD4'%V&"XI)R@B<,M$!3,B2B]S/P
+MJ+=G9BXF-C6!(I$+VUPL(XX_$K>:I3$UH5;!<:3,%VVF)H^EX;B-V[B2&[F1
+MZ[F7BRF9N[GDNV"?:[F[^FE1!$]3\[6H,H\'4;T[ZT5L5(J<Z%;B]B5ZT5D3
+M]J%YBF'YXG9W@(<FLWN\@UR>\;0@^4B70S$Z%AV/%WO%L2IA$80/."NR(BL$
+M,03&A*=OX'68\QSH8QTG, (GD!Y:V;-[,CV2=C1=TG$_,X=Y 5A_T@97]3M/
+M!T$0*B<P BT.DP;3 8EQ5)5H-%!_(<21=Q"ILX6P<1IE>F(=8WXB0S)^"A^2
+MBI*YJ+@LN5H&,45D1JD:F[ )L5$T,*FD>A"6*G\H57_W)\8#X:DR=2"AZG\Y
+M=<8]^9. DJI#^09%>92V&KA+:974VJL9197 FI6F8ZW%&JPX@:P#.RYF4*\?
+MB*^=J:_?"I7F*J[3NJMX>:Z,/!,C$'=O%GWXYY>CR:Z$"7V!=LKR^LCG$<D+
+M9J^4S)>6C);\.IG_:IET*; ]*<K*0\HXL9FNZL95# (S\+!-8([M*DI'BA$>
+M#,('8AQ4!,;47,UV[,8&L5$U8,9A7!!IC*D'PL:;*L9P#*K]=U-U_'Y&@ #K
+MW,Y)V$]QT10Z:!8VF!9#R!9ND15!6(,1:(!5$00( - "/<]DL81% (&C<&S
+M(M !'= -R( ,2( #.(!,@ 5?=$&C; #<04UQR,7.29N*FLNW&"[$5%/UT9>
+M!4YK!,P$T49>)D*]95=B-DOP$;W+-J<O\Y\2HXO4%&C)M$M#449+RTG5$<,]
+M2U%C$Z9"MV$T1!!I-32X5W"# S%^L4!WP3$#!4MMM''<YW&ET1@QUF!ST :D
+MN)V? S3>,ZCK4BK -S=3PBW#H1,+"YH@4,;[\C-*R=6Q1C,$+,)'G6\=HB;H
+M-Z^GFL<@H*K*P\>MZE+*.G\'XEI*PS0^P4P\H!C[]0)D\"1];*VM?,>%'2@B
+MD-DC490B,,SA",BX*LB<3,@Y8<A6^<DR,:R*C,G&*I:,R1,E02POK!>R>%]"
+MDP9X -LYH20;$C6T$U. 77LIX$1%D@;*7:N=F<9?4 1.0 5%( 6/.3R8*=PX
+M(=U0( 5/, 1%, 53$,AW::Z\K'[H@P+ +:LQL /Z@@>'O:N\9 (FP,E; -Q=
+MD,G\>@(M< +P#=PKL *:Y\B<BJ;!,3NI?=[ZO04Q<*X@8.!NK!Z55<(GH ,/
+M2Q'>7053@ 2U9P(+[I4-+@/GFM[8_#M;N ;<[5*;V9DMSI?K'>#RS0/T+>,#
+M7N 9#G\E]07?G035?<EGX(A"@Y9J&9=M^98E(.3Q7:[ZG0(FSI>]K1=O&4Q%
+MDMRXVMSF+>)X4.(KGE&U+ )QN<E1_N0Y\>+X)]U24 144 52X 2U!P-D3A'"
+MG.,44<PT0.=&\-?5TB$8H1$*DE*!2W/7G!!"U@8(8.B(;BB%4BC=*[EN@ "/
+M'NF\\6K\*2<P&UAI\,3H S->YV#K!EA0=C!01YF]PGU,J;XB>S"D$4?(=R*[
+MX7-,E"$4(H=ZGM3<L73F\25NT *+(6VGOCT\>>($L5$VP,W!3A#?[-B ;G_C
+MG+#E/%/G/*H:_1.349B%R@9"H[^[9"5%TUG8:U8'HM>!Q6E@H];]4YZ2 6AG
+M^[]I"U^I)4[C9#+]2B/ZNT >IW$9X1'6P;=<2UW?;J6P.#73X1HIZQ[-QEJ%
+M%*NJV+2FUDYPMN=+^1KY(3'K_L%ZFF&BRV'87JD>R!4E2((D^,XSJ((?5/((
+M\ 5MD17MS,[LO/+M#%::<6'I,S5CD!'[P1X<(S)SVYSVIQRZ9]H@4!?AH^T?
+M]S-X/"5)U$)M=+11S1NK^"_BFRF;XBAUT%M6/Q*_E?5GX ((P/5>CP8( /9B
+MKS%FD._I8]ECP_1[ GI%"GQ5'M>U)V3ZB/1X]=D]H3'&J$I]YJYSGX5QU$:B
+MK1_!^R]!X? B 4<WLWV:D0>ZUXSRSO9Y$QU%1$P=8AVJVV 4U\"2])X,Q%<T
+M?UCMHTR4_SH-(X?9P8%=X?$@;X(4#!8C?P0F7_(*+2NSCP5>W_5=?_M>K_M=
+M7_NU#V0Q(62IWQ4?S_HG^/JQ?_(&'801"!4&[<]4X>XU;R0F$59%731[M<(+
+MXS\^ SO7158WEC[B;BZ=5RJ(?NB'KNB&TNB1&^F0#NG<HQ?A]4XF9AWZ"!@R
+MC)T&(0+8I5F/&'3DXAWC[T2ZN2>==1A^8CI&E>I);!#\J,R+)")[TO]E2G._
+M6QK#K_K%+_(NN(+)S^,378 ':!7YC!4$+=XAJ(%/Z(1.^(1.Z(32;_.W:! N
+MD6S&ED-VICJ 41^HY"L^[3K5?_J W_E5C1#C433EGSZ"HT>N81+>=V@,^;NE
+M,?RJ7_PB[X(KF/P\/M$$^,Y/Z(1.^(,^Z(/2GQ'"(R\C5]0B-C=95X>=OR>+
+M6!K1&UN2\>IFRQ/XR<4%L8A_=C#OEETJ.J'H61IB(+O5E3Z1?Q\> CG@>!#L
+M(2VLZ!K!P2"=IKZ_6QK#K_K%+_(NN(+)S^,378 '6!4P&,],T?P,)?TVGV0Y
+M=#]O8$Q4"3_DAK$A@NOINRZ:/QY +3Y4CM15R,4%<;I7*G,B&>^E,?RJ7_PB
+M[X(KF/Q? /UI'H(:V/QKWOIL?H!5L<^?GV,.53"\D_W:U!PARCO.MV76<759
+MIW&4;FH+XQH^\CY;J*;0Z5X(P1-RPR0,@K/)H9, AM(KTVJ4/L4$41<M5;\A
+M!KC3KR,>;6+MR#(0 B>!6RKD<ASN5@9\J(C4J?/,.*-&PDR6W_E^X9W'7>40
+M3TGH81+>=V@N.W7><7V1$G3?'E883N=4CM0=T@(C0 8ZH!<=!:C'K#%"!E_H
+MG^B+OO[>Z^CO+^F3/G&QIK1GT& L5C"\(P(M, )DH -T\(@> CFOCB3=L4WX
+M$H;MU&$> CDGT5X^P1[20I _D_U$TVFHKC%H208Z0 >8*=4N#4)?%M-AQD.I
+MDZ)J)6FT,1!0BB98E.Y(*E(=/U*K'_*M7U(NN(+)S^,338#O_(1.Z(0_Z(,^
+M*/T9\;O;:3H XA_9Y"&0PUA.'"?_2'EE'QL$7!K#K_K%+_(NN(+)S^,378 '
+M6!4P&,],T?P,]?DN-G4D3 8GW#<M 8MT%B?70>EL.QJH5CBV1,)T<,)]TQ*_
+M6QI4CM1\0^E96-2.P4HK(SUH@*C0(4#4T3Y3-RB=ANH@( (Q4)<#(0(R4)<G
+M.Q B, ,B(*,'X01@ A_\(K,_X]U2X.,,%1T#GY)QTSH(0 <(0 <(0 =W@ !W
+M@ !W@ "9@0!O@ !O@ "<U6FHWCZG0L"QTQ_U 9V=IKX1'U9%$\4E'2E'!F\M
+MU*W/BQ#DAK&:YQA^8EP^02YBTC\O$A3,*%(1&_GWX2&0<Q)=A>G6?DMJ+P?'
+M"1\BT (C4)=D3V1559XV#6CTH1CG5&&F0S4^<62JG/U$TVFH+J,'P;&SD_U$
+MTVGJ&U 2?Q(2,ZPJ3#%]TQ)#IAQ5=?<E5ECFTNLB,S;7!YQB0C4^<62J_.OJ
+M&7*,=K,)*57O(I/G TA;/Q!3,)""ND(,PA,8WLW"[E$@< /&_G[)OL::VE)N
+M_.QR'.WI#/0XT0(C0 8Z0 <Z\ 9TW@(C0 8L8!(L ',Z\*;#HP-&H -,@)1.
+M ";PP2_L\I [.I%T]AXHV_E/U;,Z;VGF!4V)GV?O(5DH:K]ZTR%1O!LBT (C
+M( + 3Q&C][J8?[W<0>O(#?'C;TH9OS?T!9U<7! BX 0A4)>J5!*RF6@8GN-.
+M$ *RZN:"Z00MT%&"Z0(N0!R *IBBJ3'%O,UW71I4CM0M-?ZU)/K$M4(9N<,&
+M"B^0PQG:T=:?(I/+03). ";PP2]\)N]>XC+*XG6WLQP$7!H^\DYZA*()\Z#'
+M7>5[GNJRAW6T9Z/!H?/=<3H8<@;35RK(-Z#+,=@#B\=!N<=]W'N-C5*0O6J2
+M?=.IBO9L@-F:;92<W7NFZB>&'=J:C0:E/9670>5(W2$H0&XZR=HX@=N%OR=4
+M26XZV>4((>$N)=W4;=W8C994CM1LL-V,Z=U2X.,,A98,1@9U^9@,YA-Q>=Q5
+MON=UB;/)H9-.WN4QD:TH0&XZ"0(^P%$X+L;DII/6.N6UWB$H0&XZZ5$<%><S
+M8>;JY]U2X.,,A9917I>/&>6J%)=UB;/)H9-.WN4Q@>9JSN9NC@+DII-Q/A%S
+M+NP'4<PU0.<%D>?(#?%&0.ELV\T)49]'0@8DR[*E87D#Z>Z H;_KE/-1'7"P
+MH7D QFS@F)V\\])@IA_!1=/G43#;WTQ.UD[U<083Z1CT,3=4Y!KMN!R.,U1Q
+M YIX(R\4HCL(7%VET3]'_$3^NA^A)8J+0V*X:&:3/G%3/!!-D+@2 R&A)8I1
+M9$KB=21)8CHLPQ-RPR1<7!"N0QUFU(FR%B]P(#13 Q@FED-D@+^086:R8Q[<
+M>9X*3!T$#!]D2R"]*&D906D@,ORJ7_PB[X(KF/Q? /UI'H(:V/QKWOIL?H!5
+ML<^8,_RJ7_PB[X(KF/Q?8($56($ICQ4/./Q<D?Q? /UI'H(:V/QKWOIL?H!5
+M$82 ._WH1^=C# (X8.SOE^QKK*DMY<;/+L?1GLY 3P4=^4--4WA4CM0M14E>
+M!&CO;,'W_$\9/"NA2RQD#>I,VXF1HFD'I3O6<7T.@N&H-P:\Q.O'7>40/SPN
+MP$M4CM1LX *\U )-\R1(*60BT )-\R2/^.L,K'QL4#"\HQ@$Y< )HVE-UFLV
+M@Q ><Z&R<1R21AOE2 9,0R,C_#,O#6; )4M4Q":'Y.HV";\&0>5('=AG_3_K
+M%.IVQAVF3WT83N?'7>40WU& *JEE7 -(Z1+)1C5%O2R(IVI55?=.S[ @8 .#
+MG5&BZ5(.ZU(ZY5(R<.<N%0,"-NV<6LPZ)>S'7>40WU& *JEE7 .#[IF4'FNS
+MUG*GYANOCAYT]AY.XQGL(2V%8S.</T,U\S,G0 <GW#<M\5J6'[&1?Q\> CDG
+M,9)SG50W@(KPHZ0#$>6M9O;P<WT'(P)4CM0=\E$(,0)TH -&(JDR( +H9\V4
+M*NS9# *\\E&4*E+Q!\[+WL9N_.QR'.WI?.PRP0<$X0-4CM3#F5%\0!!\0! ^
+M0.5(/9P9Q0<$P0<$P0-4CM3#F5%\0! \0.5(/9P9Y; NQ0<$X0-4CM3#F5%\
+M0!!\0! ^0.5(/9P9Q0<$P0<$P0<$X0-4CM3#F5%\0!!\0!!\0! \0.5(/9P9
+MQ0<$P0<$P0-4CM3#F5%\0! \0.5(/9P9I5,NQ0/#,^V<6LPW0.<%0>5(W2$M
+M, )TH -&(JD.V\T)P;&STS]'[#J8PQ-RPR2\8?;>,?ZJ1&WJ88DUH3$GX ,G
+MK/GPTS]'##U428XGP ,GK/GP R&A)8I+"EANH"QQ4RK1JX\ LE\T83H[+\#N
+M[KZ%PYV/)=6H:Q!',R4L@QW/:;CG5&&F0S62!1@'61IX!L$7!OP404[5@6K+
+M@G@;HSSJH2'7SV=YKT>ISB?!L>>LU%D 1N5(S3=F?ZNNT^H@(@,AL-R7HQQ5
+M52K1NT0',:<2T]:?(I-G5DBN0^5(7?E&TNH@$@,A\+OP,3S&Y.>%\35QI*2Q
+M2!VF-V04(P,A<+*6MC+2 [\&0>5(W5+CWQUETVNVI&/]41_S\NMU-! S(*,'
+MD>?(#?%GIASE&1R6U$)M_2DRV3I&TNH@(@,A (LQ$ )=*E7FPA-RPR2E$OGW
+MP;Z!&_I _8^49__)H9.:/P,A8#>1 B':B#C3[@1@PNU\EO=>8H;64AX4TC]'
+MS)V7(0+#XP./V, $O+=E(#=, CU4*0(\H-V# U>5531])D#^./RJ7_PB[X(K
+MF/S3'8(:R/SU;-TAJ('0+P6 ._V8@20GME2E0B[#PUVH1B%ZY!KZ>SV:Y1-Y
+M4 8&YM3Z7Q!ZE+NJ@UJZ^51M]/D),_RJ7_PB[X(KF/P\/M$$^,Y/Z(1.^(,^
+MZ(.UA"2&5&J[P2_Z7Q >1R&3)1MT]AZ!6#+EY$I:QB]\]C.__DA'IO\%$=E-
+M TV>8_'24IY(<BZF,Y%( CW2DND2PX:C;Z4=7"7?2*>\D_^6UED -ORJ7_PB
+M[X(KF/P\/M$$^,Y/Z(1.^(,^Z(/G@4QZVC][OAQN)AE3\L2N@[E2KRDB<?6]
+M=09:'V8HH)U=95XFEAER<&A5N321$KWCF5U+E)W%4G8<<<0#,?RJ7_PB[X(K
+MF/P\/M$$^,Y/Z(1.^(,^Z(,H@ H@ H@ "XNNB&(@<(( <(( <(T&E:_UMV
+M@ !V@ !V@ !>B0!;@ !;@ .CBNX@BM=@ !=@ !=@ #GB@ I@ I@ ":=QY8
+MJCQ4,Y'=H9M/A:0BU?$CM?HAW_HEY8(KF/S3'8(:R/SU;-TAJ('0+P4H@ H
+M@ H@ !HB0 B@ B@ B</Z)ONCK[[V._OZ1+@((( ((( ((@)D(D ((D ((
+MH'F?S\?=+.P>=5[&_G[)OL::VE)N_.QR'.WI#/3U*6M(DT5EX)VGIA++@G@1
+M1'W&UDIK]'3U0<#P\7J0MQ=8IQDL,@54XH]4CM2!?=;=ZAK!P<4%$>75!5L0
+M#'MVAHY?$XU%'4VJE>E;6B,$?(X .2!_SSO#.+@M!3RO/@<UWQ%ZIB_<T6>9
+MX3B*ER-5^9TN(RQ]@@:405^!6#*28_F=OR?]V30XYK*0 R+!X5.(5UVP!<&P
+M9V>(1Y$:@K0X6RWI<P)O< )D#T@H,:PJS*<#X01@ A_\PBX6 P(G\ 8G3%QP
+MHF7P0WI\I_\%87MW WGG@G6:L=R^=@)O<,)W:S&_KI["UR Z>S>0EZ3H"(O>
+M<0)O<,+_HTB=IKZ9<S0<4[7EV4;EG\0& 7J)XP)% #4B0.5(W2$M, )TH -O
+MP **<09L+ZDR\(B8L31-@QF0 R(V,QJHMBR(]UHBH!AG 'HB@*!P55D$\LX6
+M?,__E,&S<A[F;KWU8>]_!%F!QJ!RQD.I0SNZ;;A'!3G9Y3J7!W,?:2W6PR_G
+M='M"0HI+PUP[K$KZ*SX!)!ND-4W;R+:$ML."ND+H9\W6;,W'+NP;%0,=]5&4
+M*E+Q!\[+WL9N_.QR'.WIC)3O_(1.Z(0&#0(ICQ4NS\ZH[X'%'_*M7U(NN(+)
+MS^,378 '6!4P&,],T?P,]= -R- #O8-E ?W@G<]8,>V%/GQF,]8WK6(P0P8I
+M!@*("#F/80:/F!=YL)*(=QY<7!#6,?RJ7_PB[X(KF/P\/M$%>(!5 8/QS!3-
+MSU"?S\?33@6<I1R[9DG4>;W<H:2\8?:U>[.?CQ?'.9,$D?_=T6GJ"T\GBOH>
+M6/PAW_HEY8(KF/P\/M$%>(!5 8/QS!3-SU"?3_T, @(O#68H,6^9$7LR>A!7
+M8"$P_!SSEAD2O!X@"EHPW(F=IKY0AV3U"Q\G0 8G0/: I!^7"(DT&;$$$?GW
+M01!1?!+#A"3C,L0B\%$(,0)DP +SEAFQ%P,L,&^9$7LRP (NX (NH -T4)?_
+M2'EE'QN%)YV7_F;@>!"?GS#/06?O$8@E4QJDQW?^8R$P[!<ZY!H6<P)D<,)]
+MTQ(;0\";J#<=$L6[ :1TMI*(QQMF/_JH[X'%'_*M7U(NN(+)S^,378 '6!4P
+M&,],T?Q4 +C3WZA!-HC>Q5].Y-//9&(>8R[U(4QW:S'SEAFQQ\4%4;O-0P;Y
+ME3#"Z!?$6$O;#P+SEAFQQR!)-25GT& 1MK(-3, B-C=9%R;):(\H8!WSEAFQ
+MQR D"CEDY1.]UD:?_P9)BG@_K"R-7S+OTRQG_4PFYC&A5#8FT3Y39S.<W[OE
+M.6^9$7N0!6"Y&'75-9&U>[/=P<0$ 1INMB3R!?P40:/]41_0V6GJ"T_>,?RJ
+M7_PB[X(KF/P\/M$%>(!5 8/QS!3-SU"?3_T,<I$1G,0&8<D>D@<[%U:1%,6O
+MKH[^^CS,F[X9F9"QSEZC[QA^8EP^02YBTC\O\ASAPR]\9B%K1F34*9/+ ;W]
+M,9 &-_'P\?FETVGJ:\#H@1Y#BK.W\[P(87],G2^&"3F/<6Z=ANI5&3MU(&G1
+M$XA!SP;ADT7PP2_Z7Q 6<_/ 02WL IY!EV0*S(I\]C/.!V(-W+Z.X_ G89T,
+MXNY4W:;<D1=Y\![<E1G/PQF(^AK5UR'#K_K%+_(NN(+)S^,378 '6!4P&,],
+MT?Q4 +C37[K1!"2*5:8@-Z<[G5IWZQUH,!*E$5;]@A!1?!(C.==)A0.J5E5%
+MO2R(I_FDQW<RBVJ>GL0*IMG63,W"GLT<!:@?1:DB%7_@O.QM[,;/+L?1GL['
+M+A-\ (F=-@<Z@-\D+JO'[%)\0! ^0.5(/9P9Q0<$P0<$P6!DH -.'RF22N5(
+M/9P9Q0<$P0<$X0-4CM3#F5%\0!!\0!!\0! ,1@8ZX/21 JA4CM3#F5%\0!!\
+M0!!\0! ^0.5(/9P9Q0<$P0<$P0<$P0<$P6!DH -.'RD=1>5(/9P9Q0<$P0<$
+MP0<$P0<$$>4Z ,6FITJBZ5)\0!!\0!!\0! \0.5(/9P9Q0<$P0<$P0<$$>4Z
+M ,6FITH.ZU)\0!!\0! \0.5(/9P9Q0<$P0<$$>4Z ,6FITHZY5)\0! \0.5(
+M/9P9I5,NQ0/#,^V<6LPX0.<%0>5(W2$M, )DH -TH -&<LS=3.@_HZ2\8?;6
+M,?RJ7_PB[X(KF/P\/M$%>(!5 8/QS!3-SU#2;_-))K_EF9"G[;Z%Y]7_2'DC
+M',.4[O<_/3O6\?EOD*1C<'7P?@468BXU>1YR0F?O0090<_@M([.H5@;'.9,$
+MH:0?O;Y%8QWOH9ONWFDFT3ZG G,;\WQ&!?P400425"R!E=6QDQC4>;W<4;LW
+M^_EXH?E*VJ41-]?CR"NJ5E4%PSM17DL6 L.E0>5('=AG?8N36&B'=K>6'[&1
+M?Q\> CF[(0(M, )DP )1K@-O( *#G5%4CM1LH -0;'HZ ,6FITJBZ5)4CM1L
+MH -0;'HZ ,6FITH.ZU)4CM1LH -0;'HZ ,6FITHZY5)4CM1LH -0;'HZ ,6F
+MITHR<.<N)0-W#O2<6LPY0.?'7>40WP(C0 8L$.4Z8"1W3JG"GLT<):D?1:DB
+M%7_@O.QM[,;/+L?1GLY KSBJ!!N-4:&WT;M'"F!TX_"$EW:O?C=XB&I_QG$%
+MPUDAQV@W._[/<V2J//[[-J/R_CUC@'Q'9B'8,G5M= )F<,*\ 4CZ,:PJ_$M_
+M#[\*]B1AV$X=YB&0<Q)4/-?CZ%_G43 'C'@@1O:U'MAG;;AQY#%Q9$LH;6L=
+MYB&0\^HB\%$(,0)DH -O2N5(S08Z8 0ZP 0Z\ 8B\+NE<0)&<,)]TQ+7HV_+
+M2B'8ZSA!Z_024_ZP2,),<,)]TQ+7HV\P>:&O7K\S21"#S_9!9W],773'GA-4
+MCM1LX )CH ,&D0,Z<-Q5ON<ZX/0.H@-.'RF22N5(/9SX1^5(S08N, 8Z8! Y
+MH /'7>5[K@-.[R ZX/21 JA4CM3#B7]4CM1LX )CH ,&D0,Z<-Q5ON<ZX/0.
+MH@-.'RD=1>5(/9SX1^5(S08N, 8ZH$\SH /'7>5[K@-0;'HZ ,6FITJB">.U
+MS@8N, 8ZH$\SH /'7>5[K@-0;'HZ ,6FITH."^.US@8N, 8ZH$\SH /'7>5[
+MK@-0;'HZ ,6FITHZY5( 2.<34<S^];!4CM0=T@(C0 8Z\*94CM1LH -&H -,
+MH -&<LS=3.@_HZ2OQ3P,>UZJ5E77SV<_(P(,1@:/^/D)<XN3&$=L#P(B0.5(
+MS08N, :/N&=.%K0_3)DX (O6(0)17MJG/?VJ1"[6$5NRP?9%,_A!%P,R@'[6
+M7,W"GLT<5<8?1:DB%7_@O.QM[,;/+L?1GLY(^81.Z(3O_- -^- -R- "#?U2
+MD 4(D 4(D 4(D 4@D/)8X?+LG%(0W8 ,/= [6!;0#][YC!5/Z(1...WD)"74
+M:6I/QE;T53"\X\4O.?KI,3=9%S'T1A"77YZ?CQ>O91TO#6; )4M4]+M?_>ZW
+MP6#!H?/D[IR10B[6X4L;XR>&S?:8*_6:(A)7WUMGH/6_Q?M%&?9A'_:\8?8/
+M?#>0YV9^8MB_1YV+/]C='7_37=W771PPPI'0X5#IXS$7*AO'(6FTD3GRPC0S
+MR:EM5/X@-ND39VK PUC@+Y)T7C*=V&GJB[CT3[5V @*(*(J[F9#8/*PJ+ <B
+M8,#P(=W4;=W8_?EFR)YT?J=5$BBC[T9G<J2CCD6]9C/8//X#H0;L>2[@_XKJ
+M./]ZT4HSR:EAH)M/U5FR]L$+>1A^8CI&!>\#P;'E0><Z#OO4;=W8+?TVC[A(
+MMJ&=Z.[N>_!BC.9JSN9NCCG2;05/D 1$\ 5ION9M+OTVWR_8O-64'FL0$G#<
+M"6H#(=W4;=U20.?2?U@$D4.(UC4P5Q" ECG64AX'+\9HKN9L[N;/H^.P;P5/
+MD 1$\ 5ION9MGCFI1>>F4DAP55F8\8>%TQC20D5R4O:Q@:38_-)@!ERR-%P>
+M<Z&R<1R21AOE2 9,LY-TCM!8H ,Z#OO4;=W8C9;:G9E;A^9JSN9NCJG0"1EF
+M!B&A)8KPUD* -OYTODZ"2]+Z 6C23=W6C=W2;_-[MOENW#]'S)VU%>^=V&GJ
+MJ_>\0VXZ2>< QA-RPR143.DZ7TNBSQ-RPR011.<XFQPZ61 HX'W3I'D$$=E-
+M4Q!DV]+P*\;2;05/D 1$\ 5ION9MGCFI%?^!.GO:A,WX0Q ;"A^0J!#Q]P5I
+MON9M;A":0><Z#OM6\ 1)0 1?D.9KWN:9DUJ7>$OC3^<_/3L+XQH6T[[E02'2
+M3=W6C=W2GQ%=BLWJB-)+NXI<X]'(!TCDDJTV@\V?CQ=5V8EQ(V<W72HH "$X
+M3TT_3^<(C04ZH..PG^9KWN:U1VXZ&>?X5P18H ,Z#OM6\ 1)0 1?D.9KWN;0
+M+1/>#=[B3=[% 2,<R7/^>'59QRYH"TT'+\:N&(@#$02W2XAC\^M9BCG:R<4)
+M^_G4[QK.>MYL69<5LC3,U4S+V5*H*\:^$B1QPS(+(VF \3_K)B)[$L4GP8R/
+M6@18H ,Z#OO?'=[C7=XACM[0G1,;WN$#,05EL+[>L:+9OS,?4AK1&VY",>OP
+M*\97EW5:%/69/?6-4O557_58?P9:[V0?<B>/43IQ9&_'+NP;%0/;_%&4*E+Q
+M!\[+WL9N_.QR'.WI#/0YL78K 8OOEEUUH$[6L:*+6!K,!HYN#/@1NTYZTR%1
+MG"9( B/06=0SR:F?SUF=IKZ_^]5XP2Z7YD5>/).<"J3O!EL?$CL0UCR2U843
+M1.?KI#<M%<6O?F(.CQB(5O:QT=+P*\:_SL!'9F $X01@ A_\PF<_XX??> 9T
+M#@(BT (C\(CDXAT*;VL=%L6[4;O-D\1BC"2^=GV1$G2__DCSKQ?N'^EO@ !O
+M@ !O@ !@@@!T@ !T@ !.9.<RA[2PHJN(2:J##^?7SJ=IKXRZL;.F!&^<M/#
+M!:3L@5@ )(J[F9#8O-75SB[#JL(4H_Z% KZ52P<(0 <(0 <(H"'EN[ER@ !R
+M@ !R@ .S#L@( (M, *EC<U1?!+,^*A%@ 4ZH..P#P4<[N$H$.+YO=\D[N1=
+M[E)%@ 4ZH..P#P4<[N%H208Z0 ?;3><(C04ZH..P#P4<[N%HN=U KQ#QQ^-/
+M 6#*5_F6-3(R!<["N[H6=/TQJEE)VF%8QV+&#O1L1+62=5ODET)B<UEIT[,
+MZV0?@D7\$D?A)A3E^4QMALT+.WWEJ8X6@QE_2"'/9&(E(9LRZL;"'W\\_@10
+M(/TVOS"N83&_KI[,^*A%@ 4ZH..P#P5/ 7/#?3>'']?8 1)P 0'73+P(=U&
+MD 1,<-#2;_-)ED/WDS#]2N<W#QS4HA=)\ )/4%WI$ZM*ZB%;:"S8K#BJE$,^
+M02XZ5G7(]E1(@J38K&$:+R<B<'DP]XCD* *7)R2/^%HV@\VO!WD@D 0O\ 0S
+M347,^*A%@ 4ZP!NU+-U&D 1,4 1"(P)$((KZT0925E4DYL9)\ )/$ )P#MTR
+M(=U%@ 5%, 158-WQ#A_270184 1#4 76G3FI=1[(E$.(EI#8[(I?1,3!P1%'
+M;!%6^KNED?]TGK[KHO<_$ZOSEAFQ!S4Y=#]O0.>GMK!\Y49G<KW<81T 7[O-
+MD\1BC"2PU1_U 9V=IKZ_^QR?;X;L2>?->=/E"5=(E#(3.5DY!#6K<XQTKN.P
+MW^,__OEO8$>+([+_$1LA4XCT=N")09WE:=.DQW?.9"'*HH]<=@)D< )TSAN
+MA!(+XQH6\^N/=&3L@@))X )%X +I.! B\%'8/ )DH -T\(B1?Q\> CDG\?-T
+MCM!8H ,Z#OM%@ 5%, 158-W?RF&;49='PF%C@@).#MWJ)]UN7C(A)OV@;[A)
+MY>;HT6MMQ!$G,9.<*@,M4 /IF%17EW41 Q@QHY]E "*#Y-&H*\8@6;0^02[>
+MX6IR,XX\X9NA1Q#SAZ38O*+>+04^SE"?S\?'+NP;%0/%_E&4*E+Q!\[+WL9N
+M_.QR'.WI#/3('G\\+@4^SE"8RI']NJR%D^Z%)P)FH*^EC<W (08<<<23/G&Q
+MYD76<7595X>[B\VLUQ%"(]U&D 1,4 2_"Q_YWQV=IKYTGF2 %JL@,&^9$7O'
+M"1\U6A\^\3UTWL#MZV0._^KJV$;K-)UA5!_?> 9TGK[K\L-Y03). ";PP2\R
+M&\/9T2_8',4E'2F_SL!'QBZ1V!W,Z:]T+OTVG[[K<K+PA?Z(7O557_4I4RF4
+MDA<(0 <(0 <($)"EX1A^8EP^81)T'DM91QJ"Q8R/6@18H ,Z#OL]_N-H60:@
+M49>/Z7PAPO;8\9R8&>?X5P18H ,Z#OL]_N-H:2=U^9AVHDK16I=T#ATNZ>1=
+M[E)%@ 4ZH..PW^,_CI9Y 0=U^9C1ZE$^ )=*GA=PT*78G!?JU (^P'-EX.30
+M/1/2/05JK@1- 7% 2,^02YPHA)4JV-E0 =J\"8HH'F3/G%LB\VND_^O 3OI
+M<W595X>=OR>+.).<^D2K;DAO!!\/?#>0IW!J\"9T?F8'ZOB,HQQ553!&8OF=
+MO\)O0.=07.5M> (Z6VGN \.E(=U,\ 1.< 1*T 100.?2;_-)ED/WDS FX7U!
+M;!VO!WET+FOU<09J\"8HH'F%R")#,#=9%S&%54A"U2 71N=3)MU3H.9*T 10
+MD#GL.2!C<'7RZ1PP/),'+EOC#XM%HV-5-_YT7C&@N!NSEAC,^*A%@ 4ZH..P
+M/P5JK@1- 6U%QF9^7/2S01/X 1'H 1- 7% 2,^02YPHA)4:QV*<1)J\"8H
+MH'F3/G%LB\WXD_\#03=5[H\/N:/@3N?H^6<+UT;0(4#PP7!M)&M(0^<Z#OM3
+MH.9*T 10@,0M;2%#[(HM#;]B_'J0YS#U<09J\"8HH'EG=J $X01@ A_EI?\)
+M>W59%S%2-OH#(=U,\ 1.< 1*T 10<&SO3N=07.7^N(B=*+.\DZ)E"[]B#$A(
+M)MU3H.9*T 10$/^8L31-TYQE)RV9_AYT#F##(_EQ!"-BPG;2/05JK@1- 5_
+MB\W2S01/X 1'H 1- 634SSY\CM2MJ&/9C/8G/T'XC$7*AO'(6FT48YDP#2E
+M0;8V@\WY#XF=IKY2_<M!DG4 PG8V@\WL4>W,^*A%@ 4ZH..PSP1/X 1'H 1-
+M 6U%QDL0&Z96<W"GLT<=0/&_G[)OL::VE)N_.QR'.WIC)3#SQ4&7?PAW_HE
+MY8(T2-!#D/)O$<],T?Q4 /W@G<]8<=$6;=$@\(1.Z(3-3P70+P4P&,\RZ((K
+M..VC%[&1?Q\> CF[\1PYQ)' *;.\LX@L1,#P >X$D>Z%-_RJ7_PB[X(KF/P\
+M/M$$^,Y/Z(1.^(,^Z(.9DUH&C!XUBO@(\61L15]%+6)SDW414UA^]!M'FOUM
+M.H8Z3XXV$W& I!_#JL+Y\M-,1V<[1WL%+S&DL28#$02=IKX:<V3KZQA^8EP^
+M02XGL 4G_$0GT 4G'(FE+C+) ?PX009;P +SEAFQ-P=M601.O'/_2'G78?:9
+M\^X$T35T3A"UVSSS,F^9$7OP'O2FP30=<F301^<$,6^9$7NN(4!PHF7\LK^%
+M-&^9$7L,<CK";DG4*9) GQ!$L 4LX&=M"1* A/\9!F'-<S\"]&>Z^52X3N<$
+MH:0_K"SYE3"O%'Y/1P8<81(R>N)4($ ZY!HE(9NO93"<D;LM!&@U6A])C,TH
+M0&XZN67^I4K^"IPVVO@?L7>F1^?CXAHLEA',2!%FL 4L,/YST);_-D $D?W*
+MUK,ZW]()@Z3"7KO-,R]'!F_<,?[P'@1"9Z@G?F2J/.D3I_/GX4I:5E[LLC)T
+M3A#CSR!)94G4*9) GQ-& .AR<%"X#N[A]W1!QY!TWM(_4_X@AK>:Z/02$_F!
+M>_#8;!V?;R1PA=/6H:3,^*A, .AR<%"X#N[A]W1!QY!TWM*\,_A.OW-!M]3[
+MA[UT?FRI=6;,MAO6H:3,^*CFHE)R<%"X#N[A]W1!QY!TWM*E.#=9IW&4;FHE
+MIW=CB') GQ-N/@5EP(<7:FQ+O7_G8F;_TOE5+>Q*^L.DOG:;X6!ZL4_Q7DY<
+M[,8YU(Y#1C% XA>.D6KA)@=E!R-RXCXD=N+93U6(=QZN(43/]2FETC5T/CEG
+MK:3,*&I;P *@UY:!]WO4F3[9WZ:(YR%;J.]O0.<MS3LAQVC-@VB@9\!5M'>F
+M1^<$H:1.IGB%X7JW)R0D$P0$T?/#>>*_SL!'QBYP!2.YBWA2C;K8K'UNKV(>
+M@GD&!O23LP4L@+;4T9;_-D $D?W*UK,ZW]()@Z3"7KO-@VAH2QTD$P2FP30M
+M=62G-^V/NE$Q@ /&_G[)OL::VE)N_.QR'.WI#/3.YDI:UEKL3AV_6TX,NF!,
+M0^<$L>F>8_'2@D4_S70\E#H$41Z_D<38C+;4P2). ";PP2_L@NO_TOE5+>Q*
+M^L.DSF;-Z>YR<&AW:S/"7OX@EAYSDW7L@K8#D>Y(*NPG 4GW#<M\;O(:/&(
+M5?Z(^T[M6QYTWM*\TQV=IKZB@B0P@F@ AJ3"/ORJ7_PB[X(KF/P\/M$%>(!6
+MD<]80=#B'8(:^(1.Z(1/Z(1.*/T9P8R/"@6 +@<'A>O@'GY/%W0,2><M_3/E
+M#V+I,3=9%R;LSB+)/,/"GD/M:+CFDD/8,G4 Q.ZUI$QT3A >PS&6YAQ-XSD6
+M+RU8Q"_L$HG$!!MT3A# LQO9'X@@X 1@PNU\AIR1J'7"CK:9PYY5R1$G41HC
+M_#/9KTW"'OGWX2&0LQOX8V*Q)"WEB3\V(^SE\1L^@;;4P8R/&LTPXA/DDC=J
+M0.ES-W76,?RJ7_PB[X(KF/P\/M$$^,Y/Z(1.^(,^Z(-T?FRI!4]T4P9\5HIS
+MDW5WYR!%A?C"/FLM)P:R!$\LEA$LDLSOE$/M*)]!?>+#K_K%+_(NN(+)S^,3
+M38#O_(1.Z(0_Z(,^F#GO7K4J!AW%4G8< 3G+0>>0>%_:7QK9OS,?LI,/2P=;
+MP ).T)9%X,02,_[KI#=\XS>"@FKY(:,G7NAA@ <"]#$5 XJ[<7*J5+O-D\38
+M'+U.T%X^07I\M[ZN(V P@'[6;,U _Z@;=5/&_G[)OL::VE)N_.QR'.WIC)0_
+MZ(,^"(/QS!3-3P5/Z(1.&/0-+=!!./Q<D5(0[8#WG 1/Z(1.2-#B'8(:>-$6
+M;=$7;=$6S= "'80&G?)8\<Y/Z(1...WU"6+E^$XYU(YG=D8J[5/<81TO#6;
+M)4O3C"$%DS#(%XF%)W<$-V7>41*RZ=/D0@>9D?AF$"19!QG8,T>-^+OE5!V#
+MZ%T.ZJ^)YD9G<O &T2QG32XBNC]T=!E(U8:#LZ$T,FE^D5SNA1"Q)1F[8?F=
+MOR=*RHLG%B19EW.K^+O(Z.<=@8I?$T<><U13-TW]XUU5Z 8RYQKD(J+[0T>7
+M@50S.2[LDC5SX",;BD7JV$9*>AXB6S:]9D9R$_Z]MD19NV!^X1BI!GH&#!]T
+MD!D# 21^X1BI!GIRPF9?$T>HFR7+$R19!R#&AGR1R)&W,8Q1ET)QPS)(51IR
+M5Q])RAU]EAF<KJ<THCSZ.&/ 3Q%!,! \T;3EZ<5@8^D)2C=T+RB@^.I(!1^;
+MCXN'Y*-#3""WE!YSDW7LTO=>A![(%XGSTA*!.\,((7<$9Y@\@9^NT?>!];OE
+MY!HX6K4+QC2U9"$DEIUY'XG5M;PF@3EA/6/ 3Q&*HTKZ6Z1F$&&FQ[[RLCR%
+MA4)X4/B%L_!/E9 88N[G"1L]5[_P,?[)X;<@!@(O#6; )4O3C! X5"3MZUW\
+MU3ZG G-XJXGK%"AA;;( 9K:? [V$LQO9'X@@D%94;DKBA<(R1B-WX!<Z9.YD
+MY1/DLD0'T?=)GSY00!M':A%#L+2K>" VW48XQ!FTUVM<1<#F=4ML _<@@ 15
+M%9QVY(8>0AEGP#*.01]S0T5$LOV4KS'@R3)-)3!XPXGK=*'VMUDW[8_9?R"?
+MCQ<-3,#P 3V;0;A2QL0$ET7EZ<+ T=3Q#A_),W));! +OR>1W33-F4-VICKX
+MCSD:@FV,A0>%_RU^GB/H9\W5+.S9'&#H]5&4*E+Q!\[+WL9N_.QR'.WIC)0$
+M/00,+= 66($5:- ,+=#-3P5/Z(1...U"]M)@!ERR-%R9(0=KX!H^\DZVY%H_
+MS70;.I,$(0)!1U'G3@:/^(\R!S6RXS5((BA*PND7+SKOXAB*-9P'$6YR4':5
+M=2)91AWE\[7Q/[S-^4)R$$SE:4TU#UTD=A 4=>[SXEIJ-3M(@K-!<7^"5^6N
+M$;U#\KHD;9/P:Q#K,6GY!B*?CQ?P5(@A-T9\0^DZK_E%&D: Y&C@F)V\D_T4
+M$^7P#@)/T$+TX=9E<)SHH1Y]$4GH4>\(L1YPXEUEFJV6W_E[HJ2JI-.>008?
+M,R/SDB&E0_9/CSYEEQ<M('<"DHN#"T? 3Q%]'AXZ(OK,U!CBB%K*\<%&=1V4
+MKO/Q-"($;%[PA?Z)ONB&P@8(P 8(P 8(H!P(P 8(P 8(H!@(\ 8(\ 8(\,$(
+M, 8(, 8(D'#/=--R1OK(6(\^S&R[81VO!WD:\])@!ERR1$6_^]5XH1>7)B!U
+6JTKA=5]I *"4_\%4D\0&T1CB.!Q$ 1VO
+
+end
diff --git a/dmake/dbug/dbug/example1.c b/dmake/dbug/dbug/example1.c
new file mode 100755
index 000000000000..805b0a202872
--- /dev/null
+++ b/dmake/dbug/dbug/example1.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+main (argc, argv)
+int argc;
+char *argv[];
+{
+ printf ("argv[0] = %d\n", argv[0]);
+ /*
+ * Rest of program
+ */
+ printf ("== done ==\n");
+}
diff --git a/dmake/dbug/dbug/example2.c b/dmake/dbug/dbug/example2.c
new file mode 100755
index 000000000000..66ee43c0ec84
--- /dev/null
+++ b/dmake/dbug/dbug/example2.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+int debug = 0;
+
+main (argc, argv)
+int argc;
+char *argv[];
+{
+ /* printf ("argv = %x\n", argv) */
+ if (debug) printf ("argv[0] = %d\n", argv[0]);
+ /*
+ * Rest of program
+ */
+#ifdef DEBUG
+ printf ("== done ==\n");
+#endif
+}
diff --git a/dmake/dbug/dbug/example3.c b/dmake/dbug/dbug/example3.c
new file mode 100755
index 000000000000..0eeb75e7f377
--- /dev/null
+++ b/dmake/dbug/dbug/example3.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+main (argc, argv)
+int argc;
+char *argv[];
+{
+# ifdef DEBUG
+ printf ("argv[0] = %d\n", argv[0]);
+# endif
+ /*
+ * Rest of program
+ */
+# ifdef DEBUG
+ printf ("== done ==\n");
+# endif
+}
diff --git a/dmake/dbug/dbug/factorial.c b/dmake/dbug/dbug/factorial.c
new file mode 100755
index 000000000000..42a4d848014e
--- /dev/null
+++ b/dmake/dbug/dbug/factorial.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+/* User programs should use <local/dbug.h> */
+#include "dbug.h"
+
+int factorial (value)
+ register int value;
+{
+ DBUG_ENTER ("factorial");
+ DBUG_PRINT ("find", ("find %d factorial", value));
+ if (value > 1) {
+ value *= factorial (value - 1);
+ }
+ DBUG_PRINT ("result", ("result is %d", value));
+ DBUG_RETURN (value);
+}
diff --git a/dmake/dbug/dbug/main.c b/dmake/dbug/dbug/main.c
new file mode 100755
index 000000000000..d7c4267d4767
--- /dev/null
+++ b/dmake/dbug/dbug/main.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+/* User programs should use <local/dbug.h> */
+#include "dbug.h"
+
+int main (argc, argv)
+ int argc;
+ char *argv[];
+{
+ register int result, ix;
+ extern int factorial (), atoi ();
+
+ DBUG_ENTER ("main");
+ DBUG_PROCESS (argv[0]);
+ for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) {
+ switch (argv[ix][1]) {
+ case '#':
+ DBUG_PUSH (&(argv[ix][2]));
+ break;
+ }
+ }
+ for (; ix < argc; ix++) {
+ DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix]));
+ result = factorial (atoi (argv[ix]));
+ printf ("%d\n", result);
+ }
+ DBUG_RETURN (0);
+}
diff --git a/dmake/dbug/dbug/makeman.sh b/dmake/dbug/dbug/makeman.sh
new file mode 100755
index 000000000000..b2aca44b8f9f
--- /dev/null
+++ b/dmake/dbug/dbug/makeman.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+gcc -o factorial main.c factorial.c dbug.c
+
+for i in example?.c main.c factorial.c ;
+do
+ sed -e 's!\\!\\\\!g' $i > ${i/\.c/\.r}
+done
+
+./factorial 1 2 3 4 5 | cat > output1.r
+./factorial -\#t:o 2 3 | cat > output2.r
+./factorial -\#d:t:o 3 | cat > output3.r
+./factorial -\#d,result:o 4 | cat > output4.r
+./factorial -\#d:f,factorial:F:L:o 3 | cat >output5.r
+
+#nroff -mm user.r > user.t
+#groff -mm user.r > user.ps
+groff -mm -rcR=0 -Tlatin1 -P -bcu user.r > dbug.txt
diff --git a/dmake/dbug/dbug/readme b/dmake/dbug/dbug/readme
new file mode 100644
index 000000000000..8d7c2ed6ab13
--- /dev/null
+++ b/dmake/dbug/dbug/readme
@@ -0,0 +1,52 @@
+This directory contains DBUG the "C Program Debugging Package" by Fred Fish.
+
+/******************************************************************************
+ * *
+ * N O T I C E *
+ * *
+ * Copyright Abandoned, 1987, Fred Fish *
+ * *
+ * *
+ * This previously copyrighted work has been placed into the public *
+ * domain by the author and may be freely used for any purpose, *
+ * private or commercial. *
+ * *
+ * Because of the number of inquiries I was receiving about the use *
+ * of this product in commercially developed works I have decided to *
+ * simply make it public domain to further its unrestricted use. I *
+ * specifically would be most happy to see this material become a *
+ * part of the standard Unix distributions by AT&T and the Berkeley *
+ * Computer Science Research Group, and a standard part of the GNU *
+ * system from the Free Software Foundation. *
+ * *
+ * I would appreciate it, as a courtesy, if this notice is left in *
+ * all copies and derivative works. Thank you. *
+ * *
+ * The author makes no warranty of any kind with respect to this *
+ * product and explicitly disclaims any implied warranties of mer- *
+ * chantability or fitness for any particular purpose. *
+ * *
+ ******************************************************************************
+ */
+
+The original package is no longer mainained, but copies can found here
+ <http://sourceforge.net/projects/dbug/>
+or in the dbug directory of the MySQL 4.0 (and older)
+ <http://dev.mysql.com/downloads/>
+sources.
+
+The files found here are:
+
+ dbug.c - runtime support routines for dbug package
+ dbug.h - user include file for programs using the dbug package
+ user.r - nroff source for the manual page.
+ dbug.txt - a typeset version of the manual page containing no control
+ characters. Generated with makeman.sh:
+ Copy it as dbug.1 into a directory in your search path for
+ man pages to be able to view it with the man command.
+ makeman.sh - helper script to generate the documentation
+ example1.c - Additional/demo sources for the documentation.
+ example2.c
+ example3.c
+ main.c
+ factorial.c
diff --git a/dmake/dbug/dbug/user.r b/dmake/dbug/dbug/user.r
new file mode 100755
index 000000000000..1d58d28a8800
--- /dev/null
+++ b/dmake/dbug/dbug/user.r
@@ -0,0 +1,938 @@
+.\" @(#)user.r 1.13 10/29/86
+.\"
+.\" DBUG (Macro Debugger Package) nroff source
+.\"
+.\" nroff -mm user.r >user.t
+.\"
+.\" ===================================================
+.\"
+.\" === Some sort of black magic, but I forget...
+.tr ~
+.\" === Hyphenation control (1 = on)
+.\".nr Hy 1
+.\" === Force all first level headings to start on new page
+.nr Ej 1
+.\" === Set for breaks after headings for levels 1-3
+.nr Hb 3
+.\" === Set for space after headings for levels 1-3
+.nr Hs 3
+.\" === Set standard indent for one/half inch
+.nr Si 10
+.\" === Set page header - set date to source date
+.\".PH "/DBUG User Manual//\*(DT/"
+.PH "/DBUG User Manual//October 29, 1986"
+.\" === Set page footer
+.PF "// - % - //"
+.\" === Set page offset
+.\".po 0.60i
+.\" === Set line length
+.\".ll 6.5i
+.TL
+D B U G
+.P 0
+C Program Debugging Package
+.P 0
+by
+.AU "Fred Fish"
+.AF ""
+.SA 1
+.\" === All paragraphs indented.
+.nr Pt 1
+.AS 1
+This document introduces
+.I dbug ,
+a macro based C debugging
+package which has proven to be a very flexible and useful tool
+for debugging, testing, and porting C programs.
+
+.P
+All of the features of the
+.I dbug
+package can be enabled or disabled dynamically at execution time.
+This means that production programs will run normally when
+debugging is not enabled, and eliminates the need to maintain two
+separate versions of a program.
+
+.P
+Many of the things easily accomplished with conventional debugging
+tools, such as symbolic debuggers, are difficult or impossible with this
+package, and vice versa.
+Thus the
+.I dbug
+package should
+.I not
+be thought of as a replacement or substitute for
+other debugging tools, but simply as a useful
+.I addition
+to the
+program development and maintenance environment.
+
+.AE
+.MT 4
+.SK
+.B
+INTRODUCTION
+.R
+
+.P
+Almost every program development environment worthy of the name
+provides some sort of debugging facility.
+Usually this takes the form of a program which is capable of
+controlling execution of other programs and examining the internal
+state of other executing programs.
+These types of programs will be referred to as external debuggers
+since the debugger is not part of the executing program.
+Examples of this type of debugger include the
+.B adb
+and
+.B sdb
+debuggers provided with the
+.B UNIX\*F
+.FS
+UNIX is a trademark of AT&T Bell Laboratories.
+.FE
+operating system.
+
+.P
+One of the problems associated with developing programs in an environment
+with good external debuggers is that developed programs tend to have
+little or no internal instrumentation.
+This is usually not a problem for the developer since he is,
+or at least should be, intimately familiar with the internal organization,
+data structures, and control flow of the program being debugged.
+It is a serious problem for maintenance programmers, who
+are unlikely to have such familiarity with the program being
+maintained, modified, or ported to another environment.
+It is also a problem, even for the developer, when the program is
+moved to an environment with a primitive or unfamiliar debugger,
+or even no debugger.
+
+.P
+On the other hand,
+.I dbug
+is an example of an internal debugger.
+Because it requires internal instrumentation of a program,
+and its usage does not depend on any special capabilities of
+the execution environment, it is always available and will
+execute in any environment that the program itself will
+execute in.
+In addition, since it is a complete package with a specific
+user interface, all programs which use it will be provided
+with similar debugging capabilities.
+This is in sharp contrast to other forms of internal instrumentation
+where each developer has their own, usually less capable, form
+of internal debugger.
+In summary,
+because
+.I dbug
+is an internal debugger it provides consistency across operating
+environments,
+and because it is available to all developers it provides
+consistency across all programs in the same environment.
+
+.P
+The
+.I dbug
+package imposes only a slight speed penalty on executing
+programs, typically much less than 10 percent, and a modest size
+penalty, typically 10 to 20 percent.
+By defining a specific C preprocessor symbol both of these
+can be reduced to zero with no changes required to the
+source code.
+
+.P
+The following list is a quick summary of the capabilities
+of the
+.I dbug
+package.
+Each capability can be individually enabled or disabled
+at the time a program is invoked by specifying the appropriate
+command line arguments.
+.SP 1
+.ML o 1i
+.LI
+Execution trace showing function level control flow in a
+semi-graphically manner using indentation to indicate nesting
+depth.
+.LI
+Output the values of all, or any subset of, key internal variables.
+.LI
+Limit actions to a specific set of named functions.
+.LI
+Limit function trace to a specified nesting depth.
+.LI
+Label each output line with source file name and line number.
+.LI
+Label each output line with name of current process.
+.LI
+Push or pop internal debugging state to allow execution with
+built in debugging defaults.
+.LI
+Redirect the debug output stream to standard output (stdout)
+or a named file.
+The default output stream is standard error (stderr).
+The redirection mechanism is completely independent of
+normal command line redirection to avoid output conflicts.
+.LE
+
+.SK
+.B
+PRIMITIVE DEBUGGING TECHNIQUES
+.R
+
+.P
+Internal instrumentation is already a familiar concept
+to most programmers, since it is usually the first debugging
+technique learned.
+Typically, "print\ statements" are inserted in the source
+code at interesting points, the code is recompiled and executed,
+and the resulting output is examined in an attempt to determine
+where the problem is.
+
+The procedure is iterative, with each iteration yielding more
+and more output, and hopefully the source of the problem is
+discovered before the output becomes too large to deal with
+or previously inserted statements need to be removed.
+Figure 1 is an example of this type of primitive debugging
+technique.
+.DS I N
+.SP 2
+.so example1.r
+.SP 2
+.ll -5
+.ce
+Figure 1
+.ce
+Primitive Debugging Technique
+.ll +5
+.SP 2
+.DE
+
+.P
+Eventually, and usually after at least several iterations, the
+problem will be found and corrected.
+At this point, the newly inserted print statements must be
+dealt with.
+One obvious solution is to simply delete them all.
+Beginners usually do this a few times until they have to
+repeat the entire process every time a new bug pops up.
+The second most obvious solution is to somehow disable
+the output, either through the source code comment facility,
+creation of a debug variable to be switched on or off, or by using the
+C preprocessor.
+Figure 2 is an example of all three techniques.
+.DS I N
+.SP 2
+.so example2.r
+.SP 2
+.ll -5
+.ce
+Figure 2
+.ce
+Debug Disable Techniques
+.ll +5
+.SP 2
+.DE
+
+.P
+Each technique has its advantages and disadvantages with respect
+to dynamic vs static activation, source code overhead, recompilation
+requirements, ease of use, program readability, etc.
+Overuse of the preprocessor solution quickly leads to problems with
+source code readability and maintainability when multiple
+.B #ifdef
+symbols are to be defined or undefined based on specific types
+of debug desired.
+The source code can be made slightly more readable by suitable indentation
+of the
+.B #ifdef
+arguments to match the indentation of the code, but
+not all C preprocessors allow this.
+The only requirement for the standard
+.B UNIX
+C preprocessor is for the '#' character to appear
+in the first column, but even this seems
+like an arbitrary and unreasonable restriction.
+Figure 3 is an example of this usage.
+.DS I N
+.SP 2
+.so example3.r
+.SP 2
+.ll -5
+.ce
+Figure 3
+.ce
+More Readable Preprocessor Usage
+.ll +5
+.SP 2
+.DE
+
+.SK
+.B
+FUNCTION TRACE EXAMPLE
+.R
+
+.P
+We will start off learning about the capabilities of the
+.I dbug
+package by using a simple minded program which computes the
+factorial of a number.
+In order to better demonstrate the function trace mechanism, this
+program is implemented recursively.
+Figure 4 is the main function for this factorial program.
+.DS I N
+.SP 2
+.so main.r
+.SP 2
+.ll -5
+.ce
+Figure 4
+.ce
+Factorial Program Mainline
+.ll +5
+.SP 2
+.DE
+
+.P
+The
+.B main
+function is responsible for processing any command line
+option arguments and then computing and printing the factorial of
+each non-option argument.
+.P
+First of all, notice that all of the debugger functions are implemented
+via preprocessor macros.
+This does not detract from the readability of the code and makes disabling
+all debug compilation trivial (a single preprocessor symbol,
+.B DBUG_OFF ,
+forces the macro expansions to be null).
+.P
+Also notice the inclusion of the header file
+.B dbug.h
+from the local header file directory.
+(The version included here is the test version in the dbug source
+distribution directory).
+This file contains all the definitions for the debugger macros, which
+all have the form
+.B DBUG_XX...XX .
+
+.P
+The
+.B DBUG_ENTER
+macro informs that debugger that we have entered the
+function named
+.B main .
+It must be the very first "executable" line in a function, after
+all declarations and before any other executable line.
+The
+.B DBUG_PROCESS
+macro is generally used only once per program to
+inform the debugger what name the program was invoked with.
+The
+.B DBUG_PUSH
+macro modifies the current debugger state by
+saving the previous state and setting a new state based on the
+control string passed as its argument.
+The
+.B DBUG_PRINT
+macro is used to print the values of each argument
+for which a factorial is to be computed.
+The
+.B DBUG_RETURN
+macro tells the debugger that the end of the current
+function has been reached and returns a value to the calling
+function.
+All of these macros will be fully explained in subsequent sections.
+.P
+To use the debugger, the factorial program is invoked with a command
+line of the form:
+.DS CB N
+factorial -#d:t 1 2 3
+.DE
+The
+.B main
+function recognizes the "-#d:t" string as a debugger control
+string, and passes the debugger arguments ("d:t") to the
+.I dbug
+runtime support routines via the
+.B DBUG_PUSH
+macro.
+This particular string enables output from the
+.B DBUG_PRINT
+macro with the 'd' flag and enables function tracing with the 't' flag.
+The factorial function is then called three times, with the arguments
+"1", "2", and "3".
+Note that the DBUG_PRINT takes exactly
+.B two
+arguments, with the second argument (a format string and list
+of printable values) enclosed in parenthesis.
+.P
+Debug control strings consist of a header, the "-#", followed
+by a colon separated list of debugger arguments.
+Each debugger argument is a single character flag followed
+by an optional comma separated list of arguments specific
+to the given flag.
+Some examples are:
+.DS CB N
+-#d:t:o
+-#d,in,out:f,main:F:L
+.DE
+Note that previously enabled debugger actions can be disabled by the
+control string "-#".
+
+.P
+The definition of the factorial function, symbolized as "N!", is
+given by:
+.DS CB N
+N! = N * N-1 * ... 2 * 1
+.DE
+Figure 5 is the factorial function which implements this algorithm
+recursively.
+Note that this is not necessarily the best way to do factorials
+and error conditions are ignored completely.
+.DS I N
+.SP 2
+.so factorial.r
+.SP 2
+.ll -5
+.ce
+Figure 5
+.ce
+Factorial Function
+.ll +5
+.SP 2
+.DE
+
+.P
+One advantage (some may not consider it so) to using the
+.I dbug
+package is that it strongly encourages fully structured coding
+with only one entry and one exit point in each function.
+Multiple exit points, such as early returns to escape a loop,
+may be used, but each such point requires the use of an
+appropriate
+.B DBUG_RETURN
+or
+.B DBUG_VOID_RETURN
+macro.
+
+.P
+To build the factorial program on a
+.B UNIX
+system, compile and
+link with the command:
+.DS CB N
+cc -o factorial main.c factorial.c -ldbug
+.DE
+The "-ldbug" argument tells the loader to link in the
+runtime support modules for the
+.I dbug
+package.
+Executing the factorial program with a command of the form:
+.DS CB N
+factorial 1 2 3 4 5
+.DE
+generates the output shown in figure 6.
+.DS I N
+.SP 2
+.so output1.r
+.SP 2
+.ll -5
+.ce
+Figure 6
+.ce
+factorial 1 2 3 4 5
+.ll +5
+.SP 2
+.DE
+
+.P
+Function level tracing is enabled by passing the debugger
+the 't' flag in the debug control string.
+Figure 7 is the output resulting from the command
+"factorial\ -#t:o\ 3\ 2".
+.DS I N
+.SP 2
+.so output2.r
+.SP 2
+.ll -5
+.ce
+Figure 7
+.ce
+factorial -#t:o 3 2
+.ll +5
+.SP 2
+.DE
+
+.P
+Each entry to or return from a function is indicated by '>' for the
+entry point and '<' for the exit point, connected by
+vertical bars to allow matching points to be easily found
+when separated by large distances.
+
+.P
+This trace output indicates that there was an initial call
+to factorial from main (to compute 2!), followed by
+a single recursive call to factorial to compute 1!.
+The main program then output the result for 2! and called the
+factorial function again with the second argument, 3.
+Factorial called itself recursively to compute 2! and 1!, then
+returned control to main, which output the value for 3! and exited.
+
+.P
+Note that there is no matching entry point "main>" for the
+return point "<main" because at the time the
+.B DBUG_ENTER
+macro was reached in main, tracing was not enabled yet.
+It was only after the macro
+.B DBUG_PUSH
+was executing that tracing became enabled.
+This implies that the argument list should be processed as early as
+possible since all code preceding the first call to
+.B DBUG_PUSH
+is
+essentially invisible to
+.B dbug
+(this can be worked around by
+inserting a temporary
+.B DBUG_PUSH(argv[1])
+immediately after the
+.B DBUG_ENTER("main")
+macro.
+
+.P
+One last note,
+the trace output normally comes out on the standard error.
+Since the factorial program prints its result on the standard
+output, there is the possibility of the output on the terminal
+being scrambled if the two streams are not synchronized.
+Thus the debugger is told to write its output on the standard
+output instead, via the 'o' flag character.
+Note that no 'o' implies the default (standard error), a 'o'
+with no arguments means standard output, and a 'o'
+with an argument means used the named file.
+I.E, "factorial\ -#t:o,logfile\ 3\ 2" would write the trace
+output in "logfile".
+Because of
+.B UNIX
+implementation details, programs usually run
+faster when writing to stdout rather than stderr, though this
+is not a prime consideration in this example.
+
+.SK
+.B
+USE OF DBUG_PRINT MACRO
+.R
+
+.P
+The mechanism used to produce "printf" style output is the
+.B DBUG_PRINT
+macro.
+
+.P
+To allow selection of output from specific macros, the first argument
+to every
+.B DBUG_PRINT
+macro is a
+.I dbug
+keyword.
+When this keyword appears in the argument list of the 'd' flag in
+a debug control string, as in "-#d,keyword1,keyword2,...:t",
+output from the corresponding macro is enabled.
+The default when there is no 'd' flag in the control string is to
+enable output from all
+.B DBUG_PRINT
+macros.
+
+.P
+Typically, a program will be run once, with no keywords specified,
+to determine what keywords are significant for the current problem
+(the keywords are printed in the macro output line).
+Then the program will be run again, with the desired keywords,
+to examine only specific areas of interest.
+
+.P
+The second argument to a
+.B DBUG_PRINT
+macro is a standard printf style
+format string and one or more arguments to print, all
+enclosed in parenthesis so that they collectively become a single macro
+argument.
+This is how variable numbers of printf arguments are supported.
+Also note that no explicit newline is required at the end of the format string.
+As a matter of style, two or three small
+.B DBUG_PRINT
+macros are preferable
+to a single macro with a huge format string.
+Figure 8 shows the output for default tracing and debug.
+.DS I N
+.SP 2
+.so output3.r
+.SP 2
+.ll -5
+.ce
+Figure 8
+.ce
+factorial -#d:t:o 3
+.ll +5
+.SP 2
+.DE
+
+.P
+The output from the
+.B DBUG_PRINT
+macro is indented to match the trace output
+for the function in which the macro occurs.
+When debugging is enabled, but not trace, the output starts at the left
+margin, without indentation.
+
+.P
+To demonstrate selection of specific macros for output, figure
+9 shows the result when the factorial program is invoked with
+the debug control string "-#d,result:o".
+.DS I N
+.SP 2
+.so output4.r
+.SP 2
+.ll -5
+.ce
+Figure 9
+.ce
+factorial -#d,result:o 4
+.ll +5
+.SP 2
+.DE
+
+.P
+It is sometimes desirable to restrict debugging and trace actions
+to a specific function or list of functions.
+This is accomplished with the 'f' flag character in the debug
+control string.
+Figure 10 is the output of the factorial program when run with the
+control string "-#d:f,factorial:F:L:o".
+The 'F' flag enables printing of the source file name and the 'L'
+flag enables printing of the source file line number.
+.DS I N
+.SP 2
+.so output5.r
+.SP 2
+.ll -5
+.ce
+Figure 10
+.ce
+factorial -#d:f,factorial:F:L:o 3
+.ll +5
+.SP 2
+.DE
+
+.P
+The output in figure 10 shows that the "find" macro is in file
+"factorial.c" at source line 8 and the "result" macro is in the same
+file at source line 12.
+
+.SK
+.B
+SUMMARY OF MACROS
+.R
+
+.P
+This section summarizes the usage of all currently defined macros
+in the
+.I dbug
+package.
+The macros definitions are found in the user include file
+.B dbug.h
+from the standard include directory.
+
+.SP 2
+.BL 20
+.LI DBUG_ENTER\
+Used to tell the runtime support module the name of the function
+being entered.
+The argument must be of type "pointer to character".
+The
+DBUG_ENTER
+macro must precede all executable lines in the
+function just entered, and must come after all local declarations.
+Each
+DBUG_ENTER
+macro must have a matching
+DBUG_RETURN
+or
+DBUG_VOID_RETURN
+macro
+at the function exit points.
+DBUG_ENTER
+macros used without a matching
+DBUG_RETURN
+or
+DBUG_VOID_RETURN
+macro
+will cause warning messages from the
+.I dbug
+package runtime support module.
+.SP 1
+EX:\ DBUG_ENTER\ ("main");
+.SP 1
+.LI DBUG_RETURN\
+Used at each exit point of a function containing a
+DBUG_ENTER
+macro
+at the entry point.
+The argument is the value to return.
+Functions which return no value (void) should use the
+DBUG_VOID_RETURN
+macro.
+It
+is an error to have a
+DBUG_RETURN
+or
+DBUG_VOID_RETURN
+macro in a function
+which has no matching
+DBUG_ENTER
+macro, and the compiler will complain
+if the macros are actually used (expanded).
+.SP 1
+EX:\ DBUG_RETURN\ (value);
+.br
+EX:\ DBUG_VOID_RETURN;
+.SP 1
+.LI DBUG_PROCESS\
+Used to name the current process being executed.
+A typical argument for this macro is "argv[0]", though
+it will be perfectly happy with any other string.
+.SP 1
+EX:\ DBUG_PROCESS\ (argv[0]);
+.SP 1
+.LI DBUG_PUSH\
+Sets a new debugger state by pushing the current
+.B dbug
+state onto an
+internal stack and setting up the new state using the debug control
+string passed as the macro argument.
+The most common usage is to set the state specified by a debug
+control string retrieved from the argument list.
+Note that the leading "-#" in a debug control string specified
+as a command line argument must
+.B not
+be passed as part of the macro argument.
+The proper usage is to pass a pointer to the first character
+.B after
+the "-#" string.
+.SP 1
+EX:\ DBUG_PUSH\ (\&(argv[i][2]));
+.br
+EX:\ DBUG_PUSH\ ("d:t");
+.br
+EX:\ DBUG_PUSH\ ("");
+.SP 1
+.LI DBUG_POP\
+Restores the previous debugger state by popping the state stack.
+Attempting to pop more states than pushed will be ignored and no
+warning will be given.
+The
+DBUG_POP
+macro has no arguments.
+.SP 1
+EX:\ DBUG_POP\ ();
+.SP 1
+.LI DBUG_FILE\
+The
+DBUG_FILE
+macro is used to do explicit I/O on the debug output
+stream.
+It is used in the same manner as the symbols "stdout" and "stderr"
+in the standard I/O package.
+.SP 1
+EX:\ fprintf\ (DBUG_FILE,\ "Doing my own I/O!\\n");
+.SP 1
+.LI DBUG_EXECUTE\
+The DBUG_EXECUTE macro is used to execute any arbitrary C code.
+The first argument is the debug keyword, used to trigger execution
+of the code specified as the second argument.
+This macro must be used cautiously because, like the
+DBUG_PRINT
+macro,
+it is automatically selected by default whenever the 'd' flag has
+no argument list (I.E., a "-#d:t" control string).
+.SP 1
+EX:\ DBUG_EXECUTE\ ("abort",\ abort\ ());
+.SP 1
+.LI DBUG_N\
+These macros, where N is in the range 2-5, are currently obsolete
+and will be removed in a future release.
+Use the new DBUG_PRINT macro.
+.LI DBUG_PRINT\
+Used to do printing via the "fprintf" library function on the
+current debug stream,
+DBUG_FILE.
+The first argument is a debug keyword, the second is a format string
+and the corresponding argument list.
+Note that the format string and argument list are all one macro argument
+and
+.B must
+be enclosed in parenthesis.
+.SP 1
+EX:\ DBUG_PRINT\ ("eof",\ ("end\ of\ file\ found"));
+.br
+EX:\ DBUG_PRINT\ ("type",\ ("type\ is\ %x", type));
+.br
+EX:\ DBUG_PRINT\ ("stp",\ ("%x\ ->\ %s", stp, stp\ ->\ name));
+.LI DBUG_SETJMP\
+Used in place of the setjmp() function to first save the current
+debugger state and then execute the standard setjmp call.
+This allows to the debugger to restore it's state when the
+DBUG_LONGJMP macro is used to invoke the standard longjmp() call.
+Currently all instances of DBUG_SETJMP must occur within the
+same function and at the same function nesting level.
+.SP 1
+EX:\ DBUG_SETJMP\ (env);
+.LI DBUG_LONGJMP\
+Used in place of the longjmp() function to first restore the
+previous debugger state at the time of the last DBUG_SETJMP
+and then execute the standard longjmp() call.
+Note that currently all DBUG_LONGJMP macros restore the state
+at the time of the last DBUG_SETJMP.
+It would be possible to maintain separate DBUG_SETJMP and DBUG_LONGJMP
+pairs by having the debugger runtime support module use the first
+argument to differentiate the pairs.
+.SP 1
+EX:\ DBUG_LONGJMP\ (env,val);
+.LE
+
+.SK
+.B
+DEBUG CONTROL STRING
+.R
+
+.P
+The debug control string is used to set the state of the debugger
+via the
+.B DBUG_PUSH
+macro.
+This section summarizes the currently available debugger options
+and the flag characters which enable or disable them.
+Argument lists enclosed in '[' and ']' are optional.
+.SP 2
+.BL 22
+.LI d[,keywords]
+Enable output from macros with specified keywords.
+A null list of keywords implies that all keywords are selected.
+.LI D[,time]
+Delay for specified time after each output line, to let output drain.
+Time is given in tenths of a second (value of 10 is one second).
+Default is zero.
+.LI f[,functions]
+Limit debugger actions to the specified list of functions.
+A null list of functions implies that all functions are selected.
+.LI F
+Mark each debugger output line with the name of the source file
+containing the macro causing the output.
+.LI L
+Mark each debugger output line with the source file line number of
+the macro causing the output.
+.LI n
+Mark each debugger output line with the current function nesting depth.
+.LI N
+Sequentially number each debugger output line starting at 1.
+This is useful for reference purposes when debugger output is
+interspersed with program output.
+.LI o[,file]
+Redirect the debugger output stream to the specified file.
+The default output stream is stderr.
+A null argument list causes output to be redirected to stdout.
+.LI p[,processes]
+Limit debugger actions to the specified processes.
+A null list implies all processes.
+This is useful for processes which run child processes.
+Note that each debugger output line can be marked with the name of
+the current process via the 'P' flag.
+The process name must match the argument passed to the
+.B DBUG_PROCESS
+macro.
+.LI P
+Mark each debugger output line with the name of the current process.
+Most useful when used with a process which runs child processes that
+are also being debugged.
+Note that the parent process must arrange for the debugger control
+string to be passed to the child processes.
+.LI r
+Used in conjunction with the
+.B DBUG_PUSH
+macro to reset the current
+indentation level back to zero.
+Most useful with
+.B DBUG_PUSH
+macros used to temporarily alter the
+debugger state.
+.LI t[,N]
+Enable function control flow tracing.
+The maximum nesting depth is specified by N, and defaults to
+200.
+.LE
+.SK
+.B
+HINTS AND MISCELLANEOUS
+.R
+
+.P
+One of the most useful capabilities of the
+.I dbug
+package is to compare the executions of a given program in two
+different environments.
+This is typically done by executing the program in the environment
+where it behaves properly and saving the debugger output in a
+reference file.
+The program is then run with identical inputs in the environment where
+it misbehaves and the output is again captured in a reference file.
+The two reference files can then be differentially compared to
+determine exactly where execution of the two processes diverges.
+
+.P
+A related usage is regression testing where the execution of a current
+version is compared against executions of previous versions.
+This is most useful when there are only minor changes.
+
+.P
+It is not difficult to modify an existing compiler to implement
+some of the functionality of the
+.I dbug
+package automatically, without source code changes to the
+program being debugged.
+In fact, such changes were implemented in a version of the
+Portable C Compiler by the author in less than a day.
+However, it is strongly encouraged that all newly
+developed code continue to use the debugger macros
+for the portability reasons noted earlier.
+The modified compiler should be used only for testing existing
+programs.
+
+.SK
+.B
+CAVEATS
+.R
+
+.P
+The
+.I dbug
+package works best with programs which have "line\ oriented"
+output, such as text processors, general purpose utilities, etc.
+It can be interfaced with screen oriented programs such as
+visual editors by redefining the appropriate macros to call
+special functions for displaying the debugger results.
+Of course, this caveat is not applicable if the debugger output
+is simply dumped into a file for post-execution examination.
+
+.P
+Programs which use memory allocation functions other than
+.B malloc
+will usually have problems using the standard
+.I dbug
+package.
+The most common problem is multiply allocated memory.
+.SP 2
+.\" .DE nroff dident like this. davida 900108
+.CS
+
+
diff --git a/dmake/dbug/getwd.c b/dmake/dbug/getwd.c
new file mode 100644
index 000000000000..56e1a03ab7ca
--- /dev/null
+++ b/dmake/dbug/getwd.c
@@ -0,0 +1,6 @@
+char *
+getwd(pathname)
+char *pathname;
+{
+ return("delete this code if your getwd.c works correctly");
+}
diff --git a/dmake/dbug/malloc/_changes b/dmake/dbug/malloc/_changes
new file mode 100644
index 000000000000..888a47a8dfb5
--- /dev/null
+++ b/dmake/dbug/malloc/_changes
@@ -0,0 +1,9 @@
+I made the following changes to the malloc package as found in
+comp.sources.unix:
+
+ 1. created this file _changes.
+ 2. moved README to _readme (facilitates transfer to DOS and back to
+ unix)
+ 3. renamed testmalloc.c, malloc_chk.c, and malloc_chn.c to testmlc.c,
+ mlc_chk.c, and mlc_chn.c respectively. Again DOS has trouble with
+ long basenames in filenames.
diff --git a/dmake/dbug/malloc/_readme b/dmake/dbug/malloc/_readme
new file mode 100644
index 000000000000..b78b1fd6bbcd
--- /dev/null
+++ b/dmake/dbug/malloc/_readme
@@ -0,0 +1,133 @@
+# (c) Copyright 1990 Conor P. Cahill. (uunet!virtech!cpcahil)
+# You may copy, distribute, and use this software as long as this
+# copyright statement is not removed.
+
+This package is a collection of routines which are a drop-in replacement
+for the malloc(3), memory(3), string(3), and bstring(3) library functions.
+
+The purpose of these programs is to aid the development and/or debugging
+of programs using these functions by providing a high level of consistancy
+checking whenever a malloc pointer is used. Due to this increased
+level of consistancy checking, these functions have a considerably larger
+overhead than the standard functions, but the extra checking should be
+well worth it in a development environment.
+
+To use these functions all you need to do is compile the library and
+include it on your loader command line. You do not need to recompile
+your code, only a relink is necessary.
+
+Features of this library:
+
+ 1. The malloced area returned from each call to malloc is filled with
+ non-null bytes. This should catch any use of uninitialized malloc
+ area. The fill pattern for malloced area is 0x01.
+
+ 2. When free is called numerous validity checks are made on the
+ pointer it is passed. In addition, the data in the malloc block
+ beyound the size requested on the initial malloc is checked to
+ verify that it is still filled with the original fill characters.
+
+ This is usefull for catching things like:
+
+ ptr = malloc(5);
+ ptr[5] = '\0';
+
+ /*
+ * You should not that this will be caught when it is
+ * freed not when it is done
+ */
+
+ And finally, the freed block is filled with a different fill pattern
+ so that you can easily determine if you are still using free'd space.
+ The fill pattern for free'd areas is 0x02.
+
+ This is usefull for catching things like:
+
+ ptr = malloc(20);
+
+ bptr = ptr+10;
+
+ /* do something usefule with bptr */
+
+ free(ptr);
+
+ /*
+ * now try to do something useful with bptr, it should
+ * be trashed enough that it would cause real problems
+ * and when you went to debug the problem it would be
+ * filled with 0x02's and you would then know to look
+ * for something free'ing what bptr points to.
+ */
+
+
+ 3. Whenever a bstring(3)/string(3)/memory(3) function is called, it's
+ parameters are checked as follows:
+
+ If they point somewhere in the malloc arena
+ If the operation goes beyond requested malloc space
+ call malloc_warning()
+
+ This is usefull for catching things like:
+
+ ptr = malloc(5);
+ strcpy(ptr,"abcde");
+
+
+ 4. Malloc_warning() and malloc_fatal() are used when an error condition
+ is detected. If the error is severe, malloc_fatal is called.
+ Malloc_warning is used otherwise. The decision about what is fatal
+ and what is a warning was made somewhat arbitrarily.
+
+ Warning messages include:
+
+ Calling free with a bad pointer
+ Calling a bstring/string/memory (3) function which will go beyond
+ the end of a malloc block (Note that the library function is
+ not modified to refuse the operation. If malloc warnings are
+ in the default IGNORE case, the operation will continue and
+ at some point cause a real problem).
+
+ Fatal errors are:
+
+ Detectable corruption to the malloc chain.
+
+
+ 5. The operations to perform when an error is detected are specified at
+ run time by the use of environment variables.
+
+ MALLOC_WARN - specifies the warning error message handling
+ MALLOC_FATAL - specifies the fatal error handling
+
+
+ When one of these error conditions occur you will get an error
+ message and the handler will execute based upon what setting
+ is in the environment variables. Currently understood settings
+ are as follows:
+
+ 0 - continue operations
+ 1 - drop core and exit
+ 2 - just exit
+ 3 - drop core, but continue executing. Core files will
+ be placed into core.[PID].[counter] i.e: core.00123.001
+ 128 - dump malloc chain and continue
+ 129 - dump malloc chain, dump core, and exit
+ 130 - dump malloc chain, exit
+ 131 - dump malloc chain, dump core, continue processing
+
+
+ There is an additional environment variable MALLOC_ERRFILE which
+ is used to indicate the name of the file for error message output.
+
+ For example, to set up the session to generate a core file for
+ every malloc warning, to drop core and exit on a malloc fatal, and
+ to log all messages to the file "malloc_log" do the following:
+
+ MALLOC_WARN=131
+ MALLOC_FATAL=1
+ MALLOC_ERRFILE=malloc_log
+
+ export MALLOC_WARN MALLOC_FATAL MALLOC_ERRFILE
+
+ 6. The function malloc_dump() is available to dump the malloc chain whenever
+ you might want. It's only argument is a file descriptor to use to write
+ the data. Review the code if you need to know what data is printed.
diff --git a/dmake/dbug/malloc/calloc.c b/dmake/dbug/malloc/calloc.c
new file mode 100644
index 000000000000..1469b200cbf2
--- /dev/null
+++ b/dmake/dbug/malloc/calloc.c
@@ -0,0 +1,49 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+
+/*
+ * Function: calloc()
+ *
+ * Purpose: to allocate and nullify a data area
+ *
+ * Arguments: nelem - number of elements
+ * elsize - size of each element
+ *
+ * Returns: NULL - if malloc fails
+ * or pointer to allocated space
+ *
+ * Narrative: determine size of area to malloc
+ * malloc area.
+ * if malloc succeeds
+ * fill area with nulls
+ * return ptr to malloc'd region
+ */
+#ifndef lint
+static char rcs_header[] = "$Id: calloc.c,v 1.2 2006-07-25 10:07:11 rt Exp $";
+#endif
+
+char *
+calloc(nelem,elsize)
+ unsigned int nelem;
+ unsigned int elsize;
+{
+ char * malloc();
+ char * memset();
+ char * ptr;
+ unsigned int size;
+
+ size = elsize * nelem;
+
+ if( (ptr = malloc(size)) != NULL)
+ {
+ (void) memset(ptr,'\0',(int)size);
+ }
+
+ return(ptr);
+}
+
+
diff --git a/dmake/dbug/malloc/debug.h b/dmake/dbug/malloc/debug.h
new file mode 100644
index 000000000000..069d1dc77639
--- /dev/null
+++ b/dmake/dbug/malloc/debug.h
@@ -0,0 +1,99 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+/************************************************************************/
+/* */
+/* this include sets up some macro functions which can be used while */
+/* debugging the program, and then left in the code, but turned of by */
+/* just not defining "DEBUG". This way your production version of */
+/* the program will not be filled with bunches of debugging junk */
+/* */
+/************************************************************************/
+/*
+ * $Id: debug.h,v 1.2 2006-07-25 10:07:24 rt Exp $
+ */
+
+#ifdef DEBUG
+
+#if DEBUG == 1 /* if default level */
+#undef DEBUG
+#define DEBUG 100 /* use level 100 */
+#endif
+
+#include <stdio.h>
+
+#define DEBUG0(val,str)\
+ {\
+ if( DEBUG > val ) \
+ fprintf(stderr,"%s(%d): %s\n",\
+ __FILE__,__LINE__,str);\
+ }
+#define DEBUG1(val,str,a1)\
+ {\
+ char _debugbuf[100];\
+ if( DEBUG > val )\
+ {\
+ sprintf(_debugbuf,str,a1);\
+ fprintf(stderr,"%s(%d): %s\n",\
+ __FILE__,__LINE__,_debugbuf);\
+ }\
+ }
+
+#define DEBUG2(val,str,a1,a2)\
+ {\
+ char _debugbuf[100];\
+ if( DEBUG > val )\
+ {\
+ sprintf(_debugbuf,str,a1,a2);\
+ fprintf(stderr,"%s(%d): %s\n",\
+ __FILE__,__LINE__,_debugbuf);\
+ }\
+ }
+
+#define DEBUG3(val,str,a1,a2,a3)\
+ {\
+ char _debugbuf[100];\
+ if( DEBUG > val )\
+ {\
+ sprintf(_debugbuf,str,a1,a2,a3);\
+ fprintf(stderr,"%s(%d): %s\n",\
+ __FILE__,__LINE__,_debugbuf);\
+ }\
+ }
+
+#define DEBUG4(val,str,a1,a2,a3,a4)\
+ {\
+ char _debugbuf[100];\
+ if( DEBUG > val )\
+ {\
+ sprintf(_debugbuf,str,a1,a2,a3,a4);\
+ fprintf(stderr,"%s(%d): %s\n",\
+ __FILE__,__LINE__,_debugbuf);\
+ }\
+ }
+
+#define DEBUG5(val,str,a1,a2,a3,a4,a5)\
+ {\
+ char _debugbuf[100];\
+ if( DEBUG > val )\
+ {\
+ sprintf(_debugbuf,str,a1,a2,a3,a4,a5);\
+ fprintf(stderr,"%s(%d): %s\n",\
+ __FILE__,__LINE__,_debugbuf);\
+ }\
+ }
+
+#else
+
+#define DEBUG0(val,s)
+#define DEBUG1(val,s,a1)
+#define DEBUG2(val,s,a1,a2)
+#define DEBUG3(val,s,a1,a2,a3)
+#define DEBUG4(val,s,a1,a2,a3,a4)
+#define DEBUG5(val,s,a1,a2,a3,a4,a5)
+
+#endif /* DEBUG */
+
+
diff --git a/dmake/dbug/malloc/dump.c b/dmake/dbug/malloc/dump.c
new file mode 100644
index 000000000000..70c8ac30c2d8
--- /dev/null
+++ b/dmake/dbug/malloc/dump.c
@@ -0,0 +1,103 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include "malloc.h"
+#include "tostring.h"
+
+/*
+ * Function: malloc_dump()
+ *
+ * Purpose: to dump a printed copy of the malloc chain and
+ * associated data elements
+ *
+ * Arguments: fd - file descriptor to write data to
+ *
+ * Returns: nothing of any use
+ *
+ * Narrative: Just print out all the junk
+ *
+ * Notes: This function is implemented using low level calls because
+ * of the likelyhood that the malloc tree is damaged when it
+ * is called. (Lots of things in the c library use malloc and
+ * we don't want to get into a catch-22).
+ *
+ */
+
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: dump.c,v 1.2 2006-07-25 10:07:38 rt Exp $";
+#endif
+
+
+#define ERRSTR "I/O Error on malloc dump file descriptor\n"
+
+#define WRITEOUT(fd,str,len) if( write(fd,str,(unsigned)len) != len ) \
+ { \
+ (void) write(2,ERRSTR,\
+ (unsigned)strlen(ERRSTR));\
+ exit(120); \
+ }
+
+void
+malloc_dump(fd)
+ int fd;
+{
+ char buffer[512];
+ void exit();
+ int i;
+ extern char * malloc_data_end;
+ extern char * malloc_data_start;
+ extern struct mlist * malloc_end;
+ extern struct mlist malloc_start;
+ struct mlist * ptr;
+
+ WRITEOUT(fd,"MALLOC CHAIN:\n",14);
+ WRITEOUT(fd,"-------------------- START ----------------\n",44);
+
+ for(i=0; i < 80; i++)
+ {
+ buffer[i] = ' ';
+ }
+
+ for(ptr = &malloc_start; ptr; ptr = ptr->next)
+ {
+ (void) tostring(buffer, (int)ptr, 8, B_HEX, '0');
+ (void) tostring(buffer+9, (int)ptr->next, 8, B_HEX, '0');
+ (void) tostring(buffer+18, (int)ptr->prev, 8, B_HEX, '0');
+ (void) tostring(buffer+27, (int)ptr->flag, 10, B_HEX, '0');
+ (void) tostring(buffer+38, (int)ptr->s.size, 8, B_DEC, ' ');
+ (void) tostring(buffer+47, (int)ptr->s.size, 8, B_HEX, '0');
+ (void) tostring(buffer+57, (int)ptr->data, 8, B_HEX, '0');
+ buffer[46] = '(';
+ buffer[55] = ')';
+ buffer[65] = '\n';
+ WRITEOUT(fd,buffer,66);
+ }
+ WRITEOUT(fd,"-------------------- DONE -----------------\n",44);
+
+ WRITEOUT(fd,"Malloc start: ",19);
+ (void) tostring(buffer, (int) &malloc_start, 8, B_HEX, '0');
+ buffer[8] = '\n';
+ WRITEOUT(fd,buffer,9);
+
+ WRITEOUT(fd,"Malloc end: ", 19);
+ (void) tostring(buffer, (int) malloc_end, 8, B_HEX, '0');
+ buffer[8] = '\n';
+ WRITEOUT(fd,buffer,9);
+
+ WRITEOUT(fd,"Malloc data start: ", 19);
+ (void) tostring(buffer, (int) malloc_data_start, 8, B_HEX, '0');
+ buffer[8] = '\n';
+ WRITEOUT(fd,buffer,9);
+
+ WRITEOUT(fd,"Malloc data end: ", 19);
+ (void) tostring(buffer, (int) malloc_data_end, 8, B_HEX, '0');
+ buffer[8] = '\n';
+ WRITEOUT(fd,buffer,9);
+
+} /* malloc_dump(... */
+
+
diff --git a/dmake/dbug/malloc/free.c b/dmake/dbug/malloc/free.c
new file mode 100644
index 000000000000..a8fc3ca259b6
--- /dev/null
+++ b/dmake/dbug/malloc/free.c
@@ -0,0 +1,150 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include "malloc.h"
+#include "debug.h"
+
+/*
+ * Function: free()
+ *
+ * Purpose: to deallocate malloced data
+ *
+ * Arguments: ptr - pointer to data area to deallocate
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative:
+ * verify pointer is within malloc region
+ * get mlist pointer from passed address
+ * verify magic number
+ * verify inuse flag
+ * verify pointer connections with surrounding segments
+ * turn off inuse flag
+ * verify no data overrun into non-malloced area at end of segment
+ * IF possible join segment with next segment
+ * IF possible join segment with previous segment
+ * Clear all data in segment (to make sure it isn't reused)
+ *
+ */
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: free.c,v 1.2 2006-07-25 10:07:53 rt Exp $";
+#endif
+
+void
+free(cptr)
+ char * cptr;
+{
+ char * func = "free";
+ int i;
+ extern int malloc_checking;
+ extern struct mlist * malloc_end;
+ extern int malloc_errno;
+ extern char * malloc_data_end;
+ extern char * malloc_data_start;
+ void malloc_join();
+ void malloc_memset();
+ struct mlist * oldptr;
+ struct mlist * ptr;
+
+ /*
+ * IF malloc chain checking is on, go do it.
+ */
+ if( malloc_checking )
+ {
+ (void) malloc_chain_check(1);
+ }
+
+ /*
+ * verify that cptr is within the malloc region...
+ */
+ if( cptr < malloc_data_start || cptr > malloc_data_end )
+ {
+ malloc_errno = M_CODE_BAD_PTR;
+ malloc_warning(func);
+ return;
+ }
+
+ /*
+ * convert pointer to mlist struct pointer. To do this we must
+ * move the pointer backwards the correct number of bytes...
+ */
+
+ ptr = (struct mlist *) (cptr - M_SIZE);
+
+ if( (ptr->flag&M_MAGIC) != M_MAGIC )
+ {
+ malloc_errno = M_CODE_BAD_MAGIC;
+ malloc_warning(func);
+ return;
+ }
+
+ if( ! (ptr->flag & M_INUSE) )
+ {
+ malloc_errno = M_CODE_NOT_INUSE;
+ malloc_warning(func);
+ return;
+ }
+
+ if( (ptr->prev && (ptr->prev->next != ptr) ) ||
+ (ptr->next && (ptr->next->prev != ptr) ) ||
+ ((ptr->next == NULL) && (ptr->prev == NULL)) )
+ {
+ malloc_errno = M_CODE_BAD_CONNECT;
+ malloc_warning(func);
+ return;
+ }
+
+ ptr->flag &= ~M_INUSE;
+
+ /*
+ * verify that the user did not overrun the requested number of bytes.
+ */
+ for(i=ptr->r_size; i < ptr->s.size; i++)
+ {
+ if( ptr->data[i] != M_FILL )
+ {
+ malloc_errno = M_CODE_OVERRUN;
+ malloc_warning(func);
+ break;
+ }
+ }
+
+ DEBUG3(10,"pointers: prev: 0x%.7x, ptr: 0x%.7x, next: 0x%.7x",
+ ptr->prev, ptr, ptr->next);
+
+ DEBUG3(10,"size: prev: %9d, ptr: %9d, next: %9d",
+ ptr->prev->s.size, ptr->s.size, ptr->next->s.size);
+
+ DEBUG3(10,"flags: prev: 0x%.7x, ptr: 0x%.7x, next: 0x%.7x",
+ ptr->prev->flag, ptr->flag, ptr->next->flag);
+
+ /*
+ * check to see if this block can be combined with the next and/or
+ * previous block. Since it may be joined with the previous block
+ * we will save a pointer to the previous block and test to verify
+ * if it is joined (it's next ptr will no longer point to ptr).
+ */
+ malloc_join(ptr,ptr->next,0,0);
+
+ oldptr = ptr->prev;
+
+ malloc_join(ptr->prev, ptr,0,0);
+
+ if( oldptr->next != ptr )
+ {
+ DEBUG0(10,"Oldptr was changed");
+ ptr = oldptr;
+ }
+
+ /*
+ * fill this block with '\02's to ensure that nobody is using a
+ * pointer to already freed data...
+ */
+ malloc_memset(ptr->data,M_FREE_FILL,(int)ptr->s.size);
+
+}
+
diff --git a/dmake/dbug/malloc/m_init.c b/dmake/dbug/malloc/m_init.c
new file mode 100644
index 000000000000..d4fdc0788f4b
--- /dev/null
+++ b/dmake/dbug/malloc/m_init.c
@@ -0,0 +1,79 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include "malloc.h"
+
+/*
+ * Function: malloc_init()
+ *
+ * Purpose: to initialize the pointers and variables use by the
+ * malloc() debugging library
+ *
+ * Arguments: none
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative: Just initialize all the needed variables. Use mallopt
+ * to set options taken from the environment.
+ *
+ */
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: m_init.c,v 1.2 2006-07-25 10:08:07 rt Exp $";
+#endif
+
+void
+malloc_init()
+{
+ char * cptr;
+ char * getenv();
+ union malloptarg m;
+ extern char * malloc_data_end;
+ extern char * malloc_data_start;
+ extern struct mlist * malloc_end;
+ extern struct mlist malloc_start;
+ char * sbrk();
+
+ /*
+ * If already initialized...
+ */
+ if( malloc_data_start != (char *) 0)
+ {
+ return;
+ }
+
+
+ malloc_data_start = sbrk(0);
+ malloc_data_end = malloc_data_start;
+ malloc_start.s.size = 0;
+ malloc_end = &malloc_start;
+
+ if( (cptr=getenv("MALLOC_WARN")) != NULL )
+ {
+ m.i = atoi(cptr);
+ (void) mallopt(MALLOC_WARN,m);
+ }
+
+ if( (cptr=getenv("MALLOC_FATAL")) != NULL)
+ {
+ m.i = atoi(cptr);
+ (void) mallopt(MALLOC_FATAL,m);
+ }
+
+ if( (cptr=getenv("MALLOC_CKCHAIN")) != NULL)
+ {
+ m.i = atoi(cptr);
+ (void) mallopt(MALLOC_CKCHAIN,m);
+ }
+
+ if( (cptr=getenv("MALLOC_ERRFILE")) != NULL)
+ {
+ m.str = cptr;
+ (void) mallopt(MALLOC_ERRFILE,m);
+ }
+
+}
+
diff --git a/dmake/dbug/malloc/m_perror.c b/dmake/dbug/malloc/m_perror.c
new file mode 100644
index 000000000000..b5620182ac4e
--- /dev/null
+++ b/dmake/dbug/malloc/m_perror.c
@@ -0,0 +1,73 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+
+#ifndef lint
+static
+char rcsid[] = "$Id: m_perror.c,v 1.2 2006-07-25 10:08:21 rt Exp $";
+#endif
+
+/*
+ * malloc errno error strings...
+ */
+
+char *malloc_err_strings[] =
+{
+ "No errors",
+ "Malloc chain is corrupted, pointers out of order",
+ "Malloc chain is corrupted, end before end pointer",
+ "Pointer is not within malloc area",
+ "Malloc region does not have valid magic number in header",
+ "Pointers between this segment and ajoining segments are invalid",
+ "Data has overrun beyond requested number of bytes",
+ "Data in free'd area has been modified",
+ "Data are is not in use (can't be freed or realloced)",
+ "Unable to get additional memory from the system",
+ "Pointer within malloc region, but outside of malloc data bounds",
+ (char *) 0
+};
+
+/*
+ * Function: malloc_perror()
+ *
+ * Purpose: to print malloc_errno error message
+ *
+ * Arguments: str - string to print with error message
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative:
+ */
+void
+malloc_perror(str)
+ char * str;
+{
+ extern int malloc_errno;
+ register char * s;
+ register char * t;
+
+ if( str && *str)
+ {
+ for(s=str; *s; s++)
+ {
+ /* do nothing */;
+ }
+
+ (void) write(2,str,(unsigned)(s-str));
+ (void) write(2,": ",(unsigned)2);
+ }
+
+ t = malloc_err_strings[malloc_errno];
+
+ for(s=t; *s; s++)
+ {
+ /* do nothing */;
+ }
+
+ (void) write(2,t,(unsigned)(s-t));
+
+ (void) write(2,"\n",(unsigned)1);
+}
+
diff --git a/dmake/dbug/malloc/makefile b/dmake/dbug/malloc/makefile
new file mode 100644
index 000000000000..88395c7b8f6c
--- /dev/null
+++ b/dmake/dbug/malloc/makefile
@@ -0,0 +1,77 @@
+#
+# (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+# You may copy, distribute, and use this software as long as this
+# copyright statement is not removed.
+#
+#
+# This is the Makefile for the malloc debugging library
+#
+# $Id: makefile,v 1.1.1.1 2000-09-22 15:33:26 hr Exp $
+#
+CC=cc
+# for System V systems use this CFLAGS
+#CFLAGS=-g -DSYS5
+# else for BSD use:
+#CFLAGS=-g
+LINT=lint
+SHARCMD=shar -o mallocshar -l50 -x -a -n Malloclib
+SHELL=/bin/sh
+
+LIB=libmalloc.a
+
+SRCS= malloc.c \
+ free.c \
+ realloc.c \
+ calloc.c \
+ string.c \
+ mlc_chk.c \
+ mlc_chn.c \
+ memory.c \
+ tostring.c \
+ m_perror.c \
+ m_init.c \
+ mallopt.c \
+ dump.c
+
+OBJS= malloc.o \
+ free.o \
+ realloc.o \
+ calloc.o \
+ string.o \
+ mlc_chk.o \
+ mlc_chn.o \
+ memory.o \
+ tostring.o \
+ m_perror.o \
+ m_init.o \
+ mallopt.o \
+ dump.o
+
+TESTS=testmlc testmem
+
+all: $(LIB) $(TESTS)
+
+clean:
+ rm -f $(TESTS) pgm $(LIB) *.o *.ln
+
+sharfile:
+ $(SHARCMD) Makefile README patchlevel *.[ch3]
+
+$(LIB): $(OBJS)
+ ar ru $(LIB) $(OBJS)
+ -if test -s /bin/ranlib; then /bin/ranlib $(LIB); else exit 0; fi
+ -if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(LIB); else exit 0; fi
+
+testmlc: $(LIB) testmlc.o
+ $(CC) -o $@ testmlc.o $(LIB)
+
+testmem: $(LIB) testmem.o
+ $(CC) -o $@ testmem.o $(LIB)
+
+lint:
+ $(LINT) $(CFLAGS) $(SRCS) testmlc.c testmem.c
+
+
+$(OBJS): malloc.h
+
+tostring.o malloc.o dump.o: tostring.h
diff --git a/dmake/dbug/malloc/malloc.3 b/dmake/dbug/malloc/malloc.3
new file mode 100644
index 000000000000..f5e1d2dc0dab
--- /dev/null
+++ b/dmake/dbug/malloc/malloc.3
@@ -0,0 +1,223 @@
+.TH MALLOC 3 "" "" "1.0"
+.ds ]T
+.\"/*
+.\" * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+.\" * You may copy, distribute, and use this software as long as this
+.\" * copyright statement is not removed.
+.\" */
+.\" $Id: malloc.3,v 1.1.1.1 2000-09-22 15:33:26 hr Exp $
+.SH NAME
+malloc \t- debugging malloc library
+.SH SYNOPSIS
+.ft B
+.nf
+#include <malloc.h>
+
+char * calloc(nelem,elsize);
+void free(ptr);
+char * malloc(size);
+int malloc_chain_check(flag);
+void malloc_dump(fd);
+int mallopt(cmd,val)
+char * realloc(ptr,size);
+
+int cmd,fd,flag;
+unsigned elsize,nelem,size;
+char * ptr;
+union malloptarg val;
+
+.fi
+.ft R
+.SH DESCRIPTION
+This malloc library is a replacement for the standard library to be used
+during software development/debugging. See the standard malloc(3) pages
+for more information on the use of the following functions:
+.nf
+.in +.5i
+calloc(), free(), malloc(), realloc()
+.in -.5i
+.fi
+.sp
+This library differs from the standard malloc library in the
+following ways:
+.P
+1. Each malloc segment contains a magic number so that free can
+verify that the pointer passed points to a valid malloc segment.
+.P
+2. Each malloc segment is filled with a non-zero pattern so that code that
+depends upon malloc segments being null will fail.
+.P
+3. The size of each segment will be at least 1 byte larger than requested
+and the extra bytes will be filled with a non-zero pattern. When free is
+called, it will verify that you did not go beyond the number of bytes
+you asked for.
+.P
+4. When a segment is freed, it will be filled with a different non-zero pattern
+to ensure that the program doesn't depend upon the use of already freed data.
+.P
+5. Whenever any of the string or memory functions (str*, b*, mem*) are
+called with a pointer that is within the malloc arena, the operation is
+checked to verify that it does not overrun the malloced segment. A failure
+of this check is considered a "warning level error" (described later) and
+is handled accordingly.
+.P
+7. Run time checking can include verification of the malloc chain at each
+and every call to one of the malloc functions or manually by calling the
+malloc_chain_check function.
+.P
+6. When a problem is found, the action taken is specified at runtime by
+environment variables or at compile time by the use of the mallopt()
+function.
+.P
+There are two arbitrary levels of errors, warning and fatal, that this
+library will detect. They are broken down as follows:
+.P
+.nf
+.in +.25i
+Warning messages include:
+.sp
+.in +.5i
+.ti -.25i
+Calling free with a bad pointer
+.br
+.ti -.25i
+Calling a bstring/string/memory (3) function which will go beyond
+the end of a malloc block. Note that the library function is
+not modified to refuse the operation.
+.sp
+.in -.5i
+Fatal errors are:
+.in +.5i
+.ti -.25i
+Detectable corruption to the malloc chain.
+.in -.5i
+.in -.25i
+.P
+The error handling for each level (warning or fatal) are specified using
+environment variables or mallopt(). The coding for the error handling is
+as follows:
+.sp
+.nf
+.in +.5i
+.ti -.25i
+ 0 - continue operations
+.ti -.25i
+ 1 - drop core and exit
+.ti -.25i
+ 2 - just exit
+.ti -.25i
+ 3 - drop core, but continue executing. Core files will
+be placed into core.[PID].[counter] i.e: core.00123.001
+.ti -.25i
+128 - dump malloc chain and continue
+.ti -.25i
+129 - dump malloc chain, dump core, and exit
+.ti -.25i
+130 - dump malloc chain, exit
+.ti -.25i
+131 - dump malloc chain, dump core, continue processing
+.in -.5i
+.P
+In addition error messages can be placed into an error file.
+.P
+\fBmalloc_opt\fP() is used to set the malloc debugging options. The
+following options can be set:
+.br
+.sp
+.in +.5i
+MALLOC_WARN - set the error handling for warning level errors. \fBval.i\fP is
+an integer that can contain any one of the following values:
+.sp
+.in +.5i
+M_HANDLE_IGNORE - ignore error
+.br
+M_HANDLE_ABORT - drop core and exit
+.br
+M_HANDLE_EXIT - just exit (no core drop)
+.br
+M_HANDLE_CORE - drop core, but keep on going
+.br
+.in -.5i
+.sp
+In addition, M_HANDLE_DUMP may be or'd in to cause a dump of the current
+malloc chain.
+.br
+.sp
+MALLOC_FATAL - set the error handling for fatal level errors. \fBval.i\fP is
+equivalent to \fBval.i\fP for MALLOC_WARN.
+.br
+.sp
+MALLOC_ERRFILE - set the destination for malloc error messages. \fBval.str\fP
+is a pointer to a character string containing the name of the file to be used
+for error messages.
+.br
+.sp
+MALLOC_CKCHAIN - set the malloc chain checking flag. If \fBval.i\fP is
+non-zero, chain checking at every call to malloc is turned on.
+.br
+.sp
+For example, to set up the session to generate a core file for
+every malloc warning, to drop core and exit on a malloc fatal, and
+to log all messages to the file "malloc_log" do the following:
+.sp
+.nf
+.in +.5i
+#include <malloc.h>
+malloc_opt(MALLOC_WARN,131);
+malloc_opt(MALLOC_FATAL,1);
+malloc_opt(MALLOC_ERRFILE,"malloc_log");
+.in -.5i
+.fi
+.in -.5i
+.sp
+\fBmalloc_opt\fP() can be used to set/alter the debugging options at any
+time.
+.P
+\fBmalloc_dump\fP() will dump a table of the malloc arena showing all
+allocated/freed segments and the first few bytes of data in each segment.
+\fBfd\fP is the file descriptor to write the data to.
+.P
+\fBmalloc_chain_check\fP() will check the status of the malloc arena.
+If \fBflag\fP is non-zero, an error found in the chain will cause a
+fatal error. \fBmalloc_chain_check\fP() returns zero when there are no
+problems found in the malloc chain, non-zero otherwise.
+.SH "ENVIRONMENT VARIABLES"
+Environment variables can be used to control error handling, error logging
+and malloc chain checking at run time. The following environment variables
+are used:
+.P
+MALLOC_WARN - specifies the error handling for warning errors
+.br
+MALLOC_FATAL - specifies the error handling for fatal errors
+.br
+MALLOC_ERRFILE - specifies the error log file for error messages.
+.br
+MALLOC_CKCHAIN - if 1, turns on malloc chain checking at every call to any
+of the malloc functions.
+.P
+For example, to set up the session to generate a core file for
+every malloc warning, to drop core and exit on a malloc fatal, and
+to log all messages to the file "malloc_log" do the following:
+.sp
+.nf
+.in +.5i
+MALLOC_WARN=131
+MALLOC_FATAL=1
+MALLOC_ERRFILE=malloc_log
+
+export MALLOC_WARN MALLOC_FATAL MALLOC_ERRFILE
+.in -.5i
+.fi
+.SH WARNINGS
+This malloc library and it's associated string and memory functions are
+much less efficient than the standard functions due in part to the extra
+error checking. You do not want to use this library when generating a
+production (i.e. releasable) version of your software. It should only
+be used during development and testing.
+.SH SEE ALSO
+stat(2)
+.SH AUTHOR
+Conor P. Cahill
+Virtual Technologies Incorporated
+.sp
+uunet!virtech!cpcahil
diff --git a/dmake/dbug/malloc/malloc.c b/dmake/dbug/malloc/malloc.c
new file mode 100644
index 000000000000..ff84e3efce9f
--- /dev/null
+++ b/dmake/dbug/malloc/malloc.c
@@ -0,0 +1,627 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include <fcntl.h>
+#include "malloc.h"
+#include "tostring.h"
+
+/*
+ * Function: malloc()
+ *
+ * Purpose: memory allocator
+ *
+ * Arguments: size - size of data area needed
+ *
+ * Returns: pointer to allocated area, or NULL if unable
+ * to allocate addtional data.
+ *
+ * Narrative:
+ *
+ */
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: malloc.c,v 1.2 2006-07-25 10:08:36 rt Exp $";
+#endif
+
+extern int malloc_checking;
+char * malloc_data_start;
+char * malloc_data_end;
+struct mlist * malloc_end;
+int malloc_errfd = 2;
+int malloc_errno;
+int malloc_fatal_level = M_HANDLE_CORE;
+struct mlist malloc_start;
+int malloc_warn_level;
+void malloc_memset();
+
+char *
+malloc(size)
+ unsigned int size;
+{
+ char * func = "malloc";
+ char * getenv();
+ void malloc_fatal();
+ void malloc_init();
+ void malloc_split();
+ void malloc_warning();
+ unsigned int need;
+ struct mlist * oldptr;
+ struct mlist * ptr;
+ char * sbrk();
+
+ /*
+ * If this is the first call to malloc...
+ */
+ if( malloc_data_start == (char *) 0 )
+ {
+ malloc_init();
+ }
+
+ /*
+ * If malloc chain checking is on, go do it.
+ */
+ if( malloc_checking )
+ {
+ (void) malloc_chain_check(1);
+ }
+
+ /*
+ * always make sure there is at least on extra byte in the malloc
+ * area so that we can verify that the user does not overrun the
+ * data area.
+ */
+ size++;
+
+ /*
+ * Now look for a free area of memory of size bytes...
+ */
+ oldptr = NULL;
+ for(ptr = &malloc_start; ; ptr = ptr->next)
+ {
+ /*
+ * Since the malloc chain is a forward only chain, any
+ * pointer that we get should always be positioned in
+ * memory following the previous pointer. If this is not
+ * so, we must have a corrupted chain.
+ */
+ if( ptr )
+ {
+ if( ptr<oldptr )
+ {
+ malloc_errno = M_CODE_CHAIN_BROKE;
+ malloc_fatal(func);
+ return(NULL);
+ }
+ oldptr = ptr;
+ }
+ else if( oldptr != malloc_end )
+ {
+ /*
+ * This should never happen. If it does, then
+ * we got a real problem.
+ */
+ malloc_errno = M_CODE_NO_END;
+ malloc_fatal(func);
+ return(NULL);
+ }
+
+
+ /*
+ * if this element is already in use...
+ */
+ if( ptr && ((ptr->flag & M_INUSE) != 0) )
+ {
+ continue;
+ }
+
+ /*
+ * if there isn't room for this block..
+ */
+ if( ptr && (ptr->s.size < size) )
+ {
+ continue;
+ }
+
+ /*
+ * If ptr is null, we have run out of memory and must sbrk more
+ */
+ if( ptr == NULL )
+ {
+ need = (size + M_SIZE) * (size > 10*1024 ? 1:2);
+ if( need < M_BLOCKSIZE )
+ {
+ need = M_BLOCKSIZE;
+ }
+ else if( need & (M_BLOCKSIZE-1) )
+ {
+ need &= ~(M_BLOCKSIZE-1);
+ need += M_BLOCKSIZE;
+ }
+ ptr = (struct mlist *) sbrk((int)need);
+ if( ptr == (struct mlist *) -1 )
+ {
+ malloc_errno = M_CODE_NOMORE_MEM;
+ malloc_fatal(func);
+ }
+ malloc_data_end = sbrk((int)0);
+
+ ptr->prev = oldptr;
+ ptr->next = (struct mlist *) 0;
+ ptr->s.size = need - M_SIZE;
+ ptr->flag = M_MAGIC;
+
+ oldptr->next = ptr;
+ malloc_end = ptr;
+
+
+ } /* if( ptr ==... */
+
+ /*
+ * Now ptr points to a memory location that can store
+ * this data, so lets go to work.
+ */
+
+ ptr->r_size = size; /* save requested size */
+ ptr->flag |= M_INUSE;
+
+ /*
+ * split off unneeded data area in this block, if possible...
+ */
+ malloc_split(ptr);
+
+ /*
+ * re-adjust the requested size so that it is what the user
+ * actually requested...
+ */
+
+ ptr->r_size--;
+
+ /*
+ * just to make sure that noone is misusing malloced
+ * memory without initializing it, lets set it to
+ * all '\01's. We call local_memset() because memset()
+ * may be checking for malloc'd ptrs and this isn't
+ * a malloc'd ptr yet.
+ */
+ malloc_memset(ptr->data,M_FILL,(int)ptr->s.size);
+
+ return( ptr->data);
+
+ } /* for(... */
+
+} /* malloc(... */
+
+/*
+ * Function: malloc_split()
+ *
+ * Purpose: to split a malloc segment if there is enough room at the
+ * end of the segment that isn't being used
+ *
+ * Arguments: ptr - pointer to segment to split
+ *
+ * Returns: nothing of any use.
+ *
+ * Narrative:
+ * get the needed size of the module
+ * round the size up to appropriat boundry
+ * calculate amount of left over space
+ * if there is enough left over space
+ * create new malloc block out of remainder
+ * if next block is free
+ * join the two blocks together
+ * fill new empty block with free space filler
+ * re-adjust pointers and size of current malloc block
+ *
+ *
+ *
+ * Mod History:
+ * 90/01/27 cpcahil Initial revision.
+ */
+void
+malloc_split(ptr)
+ struct mlist * ptr;
+{
+ extern struct mlist * malloc_end;
+ void malloc_join();
+ int rest;
+ int size;
+ struct mlist * tptr;
+
+ size = ptr->r_size;
+
+ /*
+ * roundup size to the appropriate boundry
+ */
+
+ M_ROUNDUP(size);
+
+ /*
+ * figure out how much room is left in the array.
+ * if there is enough room, create a new mlist
+ * structure there.
+ */
+
+ if( ptr->s.size > size )
+ {
+ rest = ptr->s.size - size;
+ }
+ else
+ {
+ rest = 0;
+ }
+
+ if( rest > (M_SIZE+M_RND) )
+ {
+ tptr = (struct mlist *) (ptr->data+size);
+ tptr->prev = ptr;
+ tptr->next = ptr->next;
+ tptr->flag = M_MAGIC;
+ tptr->s.size = rest - M_SIZE;
+
+ /*
+ * If possible, join this segment with the next one
+ */
+
+ malloc_join(tptr, tptr->next,0,0);
+
+ if( tptr->next )
+ {
+ tptr->next->prev = tptr;
+ }
+
+ malloc_memset(tptr->data,M_FREE_FILL, (int)tptr->s.size);
+
+ ptr->next = tptr;
+ ptr->s.size = size;
+
+ if( malloc_end == ptr )
+ {
+ malloc_end = tptr;
+ }
+ }
+
+} /* malloc_split(... */
+
+/*
+ * Function: malloc_join()
+ *
+ * Purpose: to join two malloc segments together (if possible)
+ *
+ * Arguments: ptr - pointer to segment to join to.
+ * nextptr - pointer to next segment to join to ptr.
+ *
+ * Returns: nothing of any values.
+ *
+ * Narrative:
+ *
+ * Mod History:
+ * 90/01/27 cpcahil Initial revision.
+ */
+void
+malloc_join(ptr,nextptr, inuse_override, fill_flag)
+ struct mlist * ptr;
+ struct mlist * nextptr;
+ int inuse_override;
+ int fill_flag;
+{
+ unsigned int newsize;
+
+ if( ptr && ! (inuse_override || (ptr->flag & M_INUSE)) &&
+ nextptr && ! (nextptr->flag & M_INUSE) &&
+ ((ptr->data+ptr->s.size) == (char *) nextptr) )
+ {
+ if( malloc_end == nextptr )
+ {
+ malloc_end = ptr;
+ }
+ ptr->next = nextptr->next;
+ newsize = nextptr->s.size + M_SIZE;
+
+ /*
+ * if we are to fill and this segment is in use,
+ * fill in with M_FILL newly added space...
+ */
+
+ if(fill_flag && (ptr->flag & M_INUSE) )
+ {
+ malloc_memset(ptr->data+ptr->s.size,
+ M_FILL, (int)(nextptr->s.size + M_SIZE));
+ }
+
+ ptr->s.size += newsize;
+ if( ptr->next )
+ {
+ ptr->next->prev = ptr;
+ }
+ }
+
+} /* malloc_join(... */
+
+
+/*
+ * The following mess is just to ensure that the versions of these functions in
+ * the current library are included (to make sure that we don't accidentaly get
+ * the libc versions. (This is the lazy man's -u ld directive)
+ */
+
+void free();
+int strcmp();
+int memcmp();
+char * realloc();
+
+void (*malloc_void_funcs[])() =
+{
+ free,
+};
+
+int (*malloc_int_funcs[])() =
+{
+ strcmp,
+ memcmp,
+};
+
+char * (*malloc_char_star_funcs[])() =
+{
+ realloc,
+};
+
+/*
+ * This is malloc's own memset which is used without checking the parameters.
+ */
+
+void
+malloc_memset(ptr,byte,len)
+ char * ptr;
+ char byte;
+ int len;
+{
+
+ while(len-- > 0)
+ {
+ *ptr++ = byte;
+ }
+
+} /* malloc_memset(... */
+
+/*
+ * Function: malloc_fatal()
+ *
+ * Purpose: to display fatal error message and take approrpriate action
+ *
+ * Arguments: funcname - name of function calling this routine
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative:
+ *
+ * Notes: This routine does not make use of any libc functions to build
+ * and/or disply the error message. This is due to the fact that
+ * we are probably at a point where malloc is having a real problem
+ * and we don't want to call any function that may use malloc.
+ */
+void
+malloc_fatal(funcname)
+ char * funcname;
+{
+ char errbuf[128];
+ void exit();
+ void malloc_err_handler();
+ extern char * malloc_err_strings[];
+ extern int malloc_errno;
+ extern int malloc_fatal_level;
+ char * s;
+ char * t;
+
+ s = errbuf;
+ t = "Fatal error: ";
+ while( *s = *t++)
+ {
+ s++;
+ }
+ t = funcname;
+ while( *s = *t++)
+ {
+ s++;
+ }
+
+ t = "(): ";
+ while( *s = *t++)
+ {
+ s++;
+ }
+
+ t = malloc_err_strings[malloc_errno];
+ while( *s = *t++)
+ {
+ s++;
+ }
+
+ *(s++) = '\n';
+
+ if( write(malloc_errfd,errbuf,(unsigned)(s-errbuf)) != (s-errbuf))
+ {
+ (void) write(2,"I/O error to error file\n",(unsigned)24);
+ exit(110);
+ }
+ malloc_err_handler(malloc_fatal_level);
+
+} /* malloc_fatal(... */
+
+/*
+ * Function: malloc_warning()
+ *
+ * Purpose: to display warning error message and take approrpriate action
+ *
+ * Arguments: funcname - name of function calling this routine
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative:
+ *
+ * Notes: This routine does not make use of any libc functions to build
+ * and/or disply the error message. This is due to the fact that
+ * we are probably at a point where malloc is having a real problem
+ * and we don't want to call any function that may use malloc.
+ */
+void
+malloc_warning(funcname)
+ char * funcname;
+{
+ char errbuf[128];
+ void exit();
+ void malloc_err_handler();
+ extern char * malloc_err_strings[];
+ extern int malloc_errno;
+ extern int malloc_warn_level;
+ char * s;
+ char * t;
+
+ s = errbuf;
+ t = "Warning: ";
+ while( *s = *t++)
+ {
+ s++;
+ }
+ t = funcname;
+ while( *s = *t++)
+ {
+ s++;
+ }
+
+ t = "(): ";
+ while( *s = *t++)
+ {
+ s++;
+ }
+
+ t = malloc_err_strings[malloc_errno];
+ while( *s = *t++)
+ {
+ s++;
+ }
+
+ *(s++) = '\n';
+
+ if( write(malloc_errfd,errbuf,(unsigned)(s-errbuf)) != (s-errbuf))
+ {
+ (void) write(2,"I/O error to error file\n",(unsigned)24);
+ exit(110);
+ }
+
+ malloc_err_handler(malloc_warn_level);
+
+} /* malloc_warning(... */
+
+/*
+ * Function: malloc_err_handler()
+ *
+ * Purpose: to take the appropriate action for warning and/or fatal
+ * error conditions.
+ *
+ * Arguments: level - error handling level
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative:
+ *
+ * Notes: This routine does not make use of any libc functions to build
+ * and/or disply the error message. This is due to the fact that
+ * we are probably at a point where malloc is having a real problem
+ * and we don't want to call any function that may use malloc.
+ */
+void
+malloc_err_handler(level)
+{
+ void exit();
+ void malloc_dump();
+ extern int malloc_errfd;
+
+ if( level & M_HANDLE_DUMP )
+ {
+ malloc_dump(malloc_errfd);
+ }
+
+ switch( level & ~M_HANDLE_DUMP )
+ {
+ /*
+ * If we are to drop a core file and exit
+ */
+ case M_HANDLE_ABORT:
+ (void) abort();
+ break;
+
+ /*
+ * If we are to exit..
+ */
+ case M_HANDLE_EXIT:
+ exit(200);
+ break;
+
+#ifndef __MSDOS__
+ /*
+ * If we are to dump a core, but keep going on our merry way
+ */
+ case M_HANDLE_CORE:
+ {
+ int pid;
+
+ /*
+ * fork so child can abort (and dump core)
+ */
+ if( (pid = fork()) == 0 )
+ {
+ (void) write(2,"Child dumping core\n",
+ (unsigned)9);
+ (void) abort();
+ }
+
+ /*
+ * wait for child to finish dumping core
+ */
+ while( wait((int *)0) != pid)
+ {
+ }
+
+ /*
+ * Move core file to core.pid.cnt so
+ * multiple cores don't overwrite each
+ * other.
+ */
+ if( access("core",0) == 0 )
+ {
+ static int corecnt;
+ char filenam[32];
+ filenam[0] = 'c';
+ filenam[1] = 'o';
+ filenam[2] = 'r';
+ filenam[3] = 'e';
+ filenam[4] = '.';
+ (void)tostring(filenam+5,getpid(),
+ 5, B_DEC, '0');
+ filenam[10] = '.';
+ (void)tostring(filenam+11,corecnt++,
+ 3, B_DEC, '0');
+ filenam[14] = '\0';
+ (void) unlink(filenam);
+ if( link("core",filenam) == 0)
+ {
+ (void) unlink("core");
+ }
+ }
+ }
+#endif
+
+
+ /*
+ * If we are to just ignore the error and keep on processing
+ */
+ case M_HANDLE_IGNORE:
+ break;
+
+ } /* switch(... */
+
+} /* malloc_err_handler(... */
+
diff --git a/dmake/dbug/malloc/malloc.h b/dmake/dbug/malloc/malloc.h
new file mode 100644
index 000000000000..ed8c34f2a333
--- /dev/null
+++ b/dmake/dbug/malloc/malloc.h
@@ -0,0 +1,85 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+/*
+ * $Id: malloc.h,v 1.2 2006-07-25 10:08:50 rt Exp $
+ */
+struct mlist
+{
+ struct mlist * next; /* next entry in chain */
+ struct mlist * prev; /* prev entry in chain */
+ int flag; /* inuse flag */
+ unsigned int r_size; /* requested size */
+ union
+ {
+ unsigned int size; /* actual size */
+ double unused_just_for_alignment;
+ } s;
+ char data[4];
+};
+
+#define M_SIZE ((int)(char *)((struct mlist *)0)->data)
+#define M_RND 0x08
+
+#define M_INUSE 0x01
+#define M_MAGIC 0x03156100
+
+#define M_BLOCKSIZE (1024*8)
+
+#define M_FILL '\01'
+#define M_FREE_FILL '\02'
+
+#define M_ROUNDUP(size) {\
+ if( size & (M_RND-1) ) \
+ { \
+ size &= ~(M_RND-1); \
+ size += M_RND; \
+ } \
+ }
+
+/*
+ * Malloc warning/fatal error handler defines...
+ */
+#define M_HANDLE_DUMP 0x80 /* 128 */
+#define M_HANDLE_IGNORE 0
+#define M_HANDLE_ABORT 1
+#define M_HANDLE_EXIT 2
+#define M_HANDLE_CORE 3
+
+/*
+ * Mallopt commands and defaults
+ */
+
+#define MALLOC_WARN 1 /* set malloc warning handling */
+#define MALLOC_FATAL 2 /* set malloc fatal handling */
+#define MALLOC_ERRFILE 3 /* specify malloc error file */
+#define MALLOC_CKCHAIN 4 /* turn on chain checking */
+union malloptarg
+{
+ int i;
+ char * str;
+};
+
+/*
+ * Malloc warning/fatal error codes
+ */
+
+#define M_CODE_CHAIN_BROKE 1 /* malloc chain is broken */
+#define M_CODE_NO_END 2 /* chain end != endptr */
+#define M_CODE_BAD_PTR 3 /* pointer not in malloc area */
+#define M_CODE_BAD_MAGIC 4 /* bad magic number in header */
+#define M_CODE_BAD_CONNECT 5 /* chain poingers corrupt */
+#define M_CODE_OVERRUN 6 /* data overrun in malloc seg */
+#define M_CODE_REUSE 7 /* reuse of freed area */
+#define M_CODE_NOT_INUSE 8 /* pointer is not in use */
+#define M_CODE_NOMORE_MEM 9 /* no more memory available */
+#define M_CODE_OUTOF_BOUNDS 10 /* gone beyound bounds */
+
+void malloc_warning();
+void malloc_fatal();
+void malloc_check_data();
+void malloc_check_str();
+void malloc_verify();
+
diff --git a/dmake/dbug/malloc/mallopt.c b/dmake/dbug/malloc/mallopt.c
new file mode 100644
index 000000000000..d70daf88647a
--- /dev/null
+++ b/dmake/dbug/malloc/mallopt.c
@@ -0,0 +1,98 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include <fcntl.h>
+#include "malloc.h"
+
+/*
+ * Function: mallopt()
+ *
+ * Purpose: to set options for the malloc debugging library
+ *
+ * Arguments: none
+ *
+ * Returns: nothing of any value
+ *
+ * Narrative:
+ *
+ */
+
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: mallopt.c,v 1.2 2006-07-25 10:09:05 rt Exp $";
+#endif
+
+int
+mallopt(cmd,value)
+ int cmd;
+ union malloptarg value;
+{
+ int i;
+ extern int malloc_checking;
+ extern char * malloc_data_start;
+ extern int malloc_errfd;
+ extern int malloc_fatal_level;
+ void malloc_init();
+ extern int malloc_warn_level;
+ register char * s;
+
+ /*
+ * If not initialized...
+ */
+ if( malloc_data_start == (char *) 0)
+ {
+ malloc_init();
+ }
+
+
+ switch(cmd)
+ {
+ case MALLOC_WARN:
+ malloc_warn_level = value.i;
+ break;
+
+ case MALLOC_FATAL:
+ malloc_fatal_level = value.i;
+ break;
+
+ case MALLOC_CKCHAIN:
+ malloc_checking = value.i;
+ break;
+
+ case MALLOC_ERRFILE:
+
+ i = open(value.str,O_CREAT|O_APPEND|O_WRONLY,0666);
+ if( i == -1 )
+ {
+ (void) write(2,
+ "Unable to open malloc error file: ",
+ (unsigned) 34);
+ for(s=value.str; *s; s++)
+ {
+ /* do nothing */;
+ }
+ (void) write(2,value.str,
+ (unsigned)(s-value.str));
+ (void) write(2,"\n",(unsigned)1);
+ }
+ else
+ {
+ if( malloc_errfd != 2 )
+ {
+ (void) close(malloc_errfd);
+ }
+ malloc_errfd = i;
+ }
+
+ break;
+
+ default:
+ return(1);
+ }
+
+ return(0);
+}
+
diff --git a/dmake/dbug/malloc/memory.c b/dmake/dbug/malloc/memory.c
new file mode 100644
index 000000000000..b2087a76f5af
--- /dev/null
+++ b/dmake/dbug/malloc/memory.c
@@ -0,0 +1,195 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: memory.c,v 1.2 2006-07-25 10:09:19 rt Exp $";
+#endif
+
+void malloc_check_data();
+
+char *
+memccpy(ptr1, ptr2, ch, len)
+ register char * ptr1;
+ register char * ptr2;
+ int len;
+ int ch;
+{
+ int check;
+ register int i;
+ char * rtn;
+
+ /*
+ * I know that the assignment could be done in the following, but
+ * I wanted to perform a check before any assignment, so first I
+ * determine the length, check the pointers and then do the assignment.
+ */
+ for( i=0; (i < len) && (ptr2[i] != ch); i++)
+ {
+ }
+ if( ptr2[i] == ch )
+ {
+ check = i+1;
+ }
+ else
+ {
+ check = len;
+ }
+
+ malloc_check_data("memccpy", ptr1, check);
+ malloc_check_data("memccpy", ptr2, check);
+
+ /*
+ * if we found the character...
+ */
+
+ if( i < len )
+ {
+ rtn = ptr1+i+1;
+ i++;
+ }
+ else
+ {
+ rtn = (char *) 0;
+ }
+
+ while( i-- )
+ {
+ *(ptr1++) = *(ptr2++);
+ }
+
+ return(rtn);
+}
+
+char *
+memchr(ptr1,ch,len)
+ register char * ptr1;
+ register int ch;
+ int len;
+{
+ int i;
+
+ for( i=0; (i < len) && (ptr1[i] != (char) ch); i++)
+ {
+ }
+
+ malloc_check_data("memchr", ptr1, i);
+
+ if( i < len )
+ {
+ return( ptr1+i );
+ }
+ else
+ {
+ return( (char *) 0);
+ }
+}
+
+char *
+memcpy(ptr1, ptr2, len)
+ register char * ptr1;
+ register char * ptr2;
+ register int len;
+{
+ char * rtn = ptr1;
+
+ malloc_check_data("memcpy", ptr1, len);
+ malloc_check_data("memcpy", ptr2, len);
+
+ /*
+ * while the normal memcpy does not guarrantee that it will
+ * handle overlapping memory correctly, we will try...
+ */
+ if( ptr1 > ptr2 && ptr1 < (ptr2+len))
+ {
+ ptr1 += (len-1);
+ ptr2 += (len-1);
+ while( len-- > 0 )
+ {
+ *(ptr1--) = *(ptr2--);
+ }
+ }
+ else
+ {
+ while( len-- > 0 )
+ {
+ *(ptr1++) = *(ptr2++);
+ }
+ }
+
+ return(rtn);
+}
+
+int
+memcmp(ptr1, ptr2, len)
+ register char * ptr1;
+ register char * ptr2;
+ register int len;
+{
+ malloc_check_data("memcpy", ptr1, len);
+ malloc_check_data("memcpy", ptr2, len);
+
+ while( --len >= 0 && (*ptr1 == *ptr2) )
+ {
+ ptr1++;
+ ptr2++;
+ }
+
+ /*
+ * If stopped by len, return zero
+ */
+ if( len < 0 )
+ {
+ return(0);
+ }
+
+ return( *ptr1 - *ptr2 );
+}
+
+char *
+memset(ptr1, ch, len)
+ register char * ptr1;
+ register int ch;
+ register int len;
+{
+ char * rtn = ptr1;
+
+ malloc_check_data("memcpy", ptr1, len);
+
+ while( len-- )
+ {
+ *(ptr1++) = ch;
+ }
+
+ return(rtn);
+}
+
+char *
+bcopy(ptr2,ptr1,len)
+ char * ptr2;
+ char * ptr1;
+ int len;
+{
+ return(memcpy(ptr1,ptr2,len));
+}
+
+char *
+bzero(ptr1,len)
+ char * ptr1;
+ int len;
+{
+ return(memset(ptr1,'\0',len));
+}
+
+int
+bcmp(ptr2, ptr1, len)
+ char * ptr1;
+ char * ptr2;
+ int len;
+{
+ return( memcmp(ptr1,ptr2,len) );
+}
+
diff --git a/dmake/dbug/malloc/mlc_chk.c b/dmake/dbug/malloc/mlc_chk.c
new file mode 100644
index 000000000000..08a01172cb66
--- /dev/null
+++ b/dmake/dbug/malloc/mlc_chk.c
@@ -0,0 +1,256 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+
+#include <stdio.h>
+#include "malloc.h"
+#include "debug.h"
+
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: mlc_chk.c,v 1.2 2006-07-25 10:09:34 rt Exp $";
+#endif
+
+extern struct mlist malloc_start;
+extern struct mlist * malloc_end;
+extern char * malloc_data_start;
+extern char * malloc_data_end;
+
+/*
+ * Function: malloc_in_arena()
+ *
+ * Purpose: to verify address is within malloc arena.
+ *
+ * Arguments: ptr - pointer to verify
+ *
+ * Returns: TRUE - if pointer is within malloc area
+ * FALSE - otherwise
+ *
+ * Narrative:
+ * IF pointer is >= malloc area start AND <= malloc area end
+ * return TRUE
+ * ELSE
+ * return FALSE
+ *
+ * Mod History:
+ * 90/01/24 cpcahil Initial revision.
+ */
+int
+malloc_in_arena(ptr)
+ char * ptr;
+{
+ extern char * malloc_data_start;
+ extern char * malloc_data_end;
+ int rtn = 0;
+
+ if( ptr >= malloc_data_start && ptr <= malloc_data_end )
+ {
+ rtn = 1;
+ }
+
+ return(rtn);
+}
+
+/*
+ * Function: malloc_check_str()
+ *
+ * Arguments: func - name of function calling this routine
+ * str - pointer to area to check
+ *
+ * Purpose: to verify that if str is within the malloc arena, the data
+ * it points to does not extend beyond the applicable region.
+ *
+ * Returns: Nothing of any use (function is void).
+ *
+ * Narrative:
+ * IF pointer is within malloc arena
+ * determin length of string
+ * call malloc_verify() to verify data is withing applicable region
+ * return
+ *
+ * Mod History:
+ * 90/01/24 cpcahil Initial revision.
+ * 90/01/29 cpcahil Added code to ignore recursive calls.
+ */
+void
+malloc_check_str(func,str)
+ char * func;
+ char * str;
+{
+ static int layers;
+ register char * s;
+
+ if( (layers++ == 0) && malloc_in_arena(str) )
+ {
+ for( s=str; *s; s++)
+ {
+ }
+
+ malloc_verify(func,str,s-str+1);
+ }
+
+ layers--;
+}
+
+/*
+ * Function: malloc_check_strn()
+ *
+ * Arguments: func - name of function calling this routine
+ * str - pointer to area to check
+ * len - max length of string
+ *
+ * Purpose: to verify that if str is within the malloc arena, the data
+ * it points to does not extend beyond the applicable region.
+ *
+ * Returns: Nothing of any use (function is void).
+ *
+ * Narrative:
+ * IF pointer is within malloc arena
+ * determin length of string
+ * call malloc_verify() to verify data is withing applicable region
+ * return
+ *
+ * Mod History:
+ * 90/01/24 cpcahil Initial revision.
+ * 90/01/29 cpcahil Added code to ignore recursive calls.
+ * 90/08/29 cpcahil added length (for strn* functions)
+ */
+void
+malloc_check_strn(func,str,len)
+ char * func;
+ char * str;
+ int len;
+{
+ register int i;
+ static int layers;
+ register char * s;
+
+ if( (layers++ == 0) && malloc_in_arena(str) )
+ {
+ for( s=str,i=0; (i < len) && *s; s++)
+ {
+ }
+
+ malloc_verify(func,str,s-str+1);
+ }
+
+ layers--;
+}
+
+/*
+ * Function: malloc_check_data()
+ *
+ * Arguments: func - name of function calling this routine
+ * ptr - pointer to area to check
+ * len - length to verify
+ *
+ * Purpose: to verify that if ptr is within the malloc arena, the data
+ * it points to does not extend beyond the applicable region.
+ *
+ * Returns: Nothing of any use (function is void).
+ *
+ * Narrative:
+ * IF pointer is within malloc arena
+ * call malloc_verify() to verify data is withing applicable region
+ * return
+ *
+ * Mod History:
+ * 90/01/24 cpcahil Initial revision.
+ * 90/01/29 cpcahil Added code to ignore recursive calls.
+ */
+void
+malloc_check_data(func,ptr,len)
+ char * func;
+ char * ptr;
+ int len;
+{
+ static int layers;
+
+ if( layers++ == 0 )
+ {
+ DEBUG3(40,"malloc_check_data(%s,0x%x,%d) called...",
+ func,ptr,len);
+ if( malloc_in_arena(ptr) )
+ {
+ DEBUG0(10,"pointer in malloc arena, verifying...");
+ malloc_verify(func,ptr,len);
+ }
+ }
+
+ layers--;
+}
+
+/*
+ * Function: malloc_verify()
+ *
+ * Arguments: func - name of function calling the malloc check routines
+ * ptr - pointer to area to check
+ * len - length to verify
+ *
+ * Purpose: to verify that the data ptr points to does not extend beyond
+ * the applicable malloc region. This function is only called
+ * if it has been determined that ptr points into the malloc arena.
+ *
+ * Returns: Nothing of any use (function is void).
+ *
+ * Narrative:
+ *
+ * Mod History:
+ * 90/01/24 cpcahil Initial revision.
+ */
+void
+malloc_verify(func,ptr,len)
+ char * func;
+ char * ptr;
+ int len;
+{
+ extern struct mlist * malloc_end;
+ extern int malloc_errno;
+ extern struct mlist malloc_start;
+ struct mlist * mptr;
+
+ DEBUG3(40,"malloc_verify(%s,0x%x,%d) called...", func,ptr,len);
+ /*
+ * Find the malloc block that includes this pointer
+ */
+ mptr = &malloc_start;
+ while( mptr &&
+ ! (((char *)mptr < ptr) && ((mptr->data+mptr->s.size) > ptr) ) )
+ {
+ mptr = mptr->next;
+ }
+
+ /*
+ * if ptr was not in a malloc block, it must be part of
+ * some direct sbrk() stuff, so just return.
+ */
+ if( ! mptr )
+ {
+ DEBUG1(10,"ptr (0x%x) not found in malloc search", ptr);
+ return;
+ }
+
+ /*
+ * Now we have a valid malloc block that contains the indicated
+ * pointer. We must verify that it is withing the requested block
+ * size (as opposed to the real block size which is rounded up to
+ * allow for correct alignment).
+ */
+
+ DEBUG4(60,"Checking 0x%x-0x%x, 0x%x-0x%x",
+ ptr, ptr+len, mptr->data, mptr->data+mptr->r_size);
+
+ if( (ptr < mptr->data) || ((ptr+len) > (mptr->data+mptr->r_size)) )
+ {
+ DEBUG4(0,"pointer not within region 0x%x-0x%x, 0x%x-0x%x",
+ ptr, ptr+len, mptr->data, mptr->data+mptr->r_size);
+
+ malloc_errno = M_CODE_OUTOF_BOUNDS;
+ malloc_warning(func);
+ }
+
+ return;
+}
+
diff --git a/dmake/dbug/malloc/mlc_chn.c b/dmake/dbug/malloc/mlc_chn.c
new file mode 100644
index 000000000000..3f24333611f9
--- /dev/null
+++ b/dmake/dbug/malloc/mlc_chn.c
@@ -0,0 +1,188 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include <fcntl.h>
+#include "malloc.h"
+
+/*
+ * Function: malloc_chain_check()
+ *
+ * Purpose: to verify malloc chain is intact
+ *
+ * Arguments: todo - 0 - just check and return status
+ * 1 - call malloc_warn if error detected
+ *
+ * Returns: 0 - malloc chain intact & no overflows
+ * other - problems detected in malloc chain
+ *
+ * Narrative:
+ *
+ * Notes: If todo is non-zero the malloc_warn function, when called
+ * may not return (i.e. it may exit)
+ *
+ */
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: mlc_chn.c,v 1.1.1.1 2000-09-22 15:33:26 hr Exp $";
+#endif
+
+
+int
+malloc_chain_check(todo)
+ int todo;
+{
+ char * func = "malloc_chain_check";
+ int i;
+ extern char * malloc_data_start;
+ extern char * malloc_data_end;
+ extern struct mlist * malloc_end;
+ extern int malloc_errno;
+ extern struct mlist malloc_start;
+ struct mlist * oldptr;
+ struct mlist * ptr;
+ int rtn = 0;
+
+ oldptr = &malloc_start;
+ for(ptr = malloc_start.next; ; ptr = ptr->next)
+ {
+ /*
+ * Since the malloc chain is a forward only chain, any
+ * pointer that we get should always be positioned in
+ * memory following the previous pointer. If this is not
+ * so, we must have a corrupted chain.
+ */
+ if( ptr )
+ {
+ if(ptr < oldptr )
+ {
+ malloc_errno = M_CODE_CHAIN_BROKE;
+ if( todo )
+ {
+ malloc_fatal(func);
+ }
+ rtn++;
+ break;
+ }
+ oldptr = ptr;
+ }
+ else
+ {
+ if( oldptr != malloc_end )
+ {
+ /*
+ * This should never happen. If it does, then
+ * we got a real problem.
+ */
+ malloc_errno = M_CODE_NO_END;
+ if( todo )
+ {
+ malloc_fatal(func);
+ }
+ rtn++;
+ }
+ break;
+ }
+
+ /*
+ * verify that ptr is within the malloc region...
+ * since we started within the malloc chain this should never
+ * happen.
+ */
+
+ if( ((char *)ptr < malloc_data_start) ||
+ ((char *)ptr > malloc_data_end) )
+ {
+ malloc_errno = M_CODE_BAD_PTR;
+ if( todo )
+ {
+ malloc_fatal(func);
+ }
+ rtn++;
+ break;
+ }
+
+ /*
+ * verify magic flag is set
+ */
+
+ if( (ptr->flag&M_MAGIC) != M_MAGIC )
+ {
+ malloc_errno = M_CODE_BAD_MAGIC;
+ if( todo )
+ {
+ malloc_warning(func);
+ }
+ rtn++;
+ continue;
+ }
+
+ /*
+ * verify segments are correctly linked together
+ */
+
+ if( (ptr->prev && (ptr->prev->next != ptr) ) ||
+ (ptr->next && (ptr->next->prev != ptr) ) ||
+ ((ptr->next == NULL) && (ptr->prev == NULL)) )
+ {
+ malloc_errno = M_CODE_BAD_CONNECT;
+ if( todo )
+ {
+ malloc_warning(func);
+ }
+ rtn++;
+ continue;
+ }
+
+ /*
+ * If this segment is allocated
+ */
+
+ if( (ptr->flag & M_INUSE) != 0 )
+ {
+ /*
+ * verify no overflow of data area
+ */
+
+ for(i=ptr->r_size; i < ptr->s.size; i++)
+ {
+ if( ptr->data[i] != M_FILL )
+ {
+ malloc_errno = M_CODE_OVERRUN;
+ if( todo )
+ {
+ malloc_warning(func);
+ }
+ rtn++;
+ break;
+ }
+ }
+ }
+ else /* it's not allocated so */
+ {
+ /*
+ * verify no reuse of freed data blocks
+ */
+
+ for(i=0; i < ptr->s.size; i++)
+ {
+ if( ptr->data[i] != M_FREE_FILL )
+ {
+ malloc_errno = M_CODE_REUSE;
+ if( todo )
+ {
+ malloc_warning(func);
+ }
+ rtn++;
+ break;
+ }
+ }
+ }
+
+ } /* for(... */
+
+ return(rtn);
+
+} /* malloc_chain_check(... */
diff --git a/dmake/dbug/malloc/patchlev b/dmake/dbug/malloc/patchlev
new file mode 100644
index 000000000000..00750edc07d6
--- /dev/null
+++ b/dmake/dbug/malloc/patchlev
@@ -0,0 +1 @@
+3
diff --git a/dmake/dbug/malloc/realloc.c b/dmake/dbug/malloc/realloc.c
new file mode 100644
index 000000000000..2801cd86212d
--- /dev/null
+++ b/dmake/dbug/malloc/realloc.c
@@ -0,0 +1,180 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include <stdio.h>
+#include "malloc.h"
+
+/*
+ * Function: realloc()
+ *
+ * Purpose: to re-allocate a data area.
+ *
+ * Arguments: cptr - pointer to area to reallocate
+ * size - size to change area to
+ *
+ * Returns: pointer to new area (may be same area)
+ *
+ * Narrative: verify pointer is within malloc region
+ * obtain mlist pointer from cptr
+ * verify magic number is correct
+ * verify inuse flag is set
+ * verify connection to adjoining segments is correct
+ * save requested size
+ * round-up size to appropriate boundry
+ * IF size is bigger than what is in this segment
+ * try to join next segment to this segment
+ * IF size is less than what is is this segment
+ * determine leftover amount of space
+ * ELSE
+ * allocate new segment of size bites
+ * IF allocation failed
+ * return NULL
+ * copy previous data to new segment
+ * free previous segment
+ * return new pointer
+ * split of extra space in this segment (if any)
+ * clear bytes beyound what they had before
+ * return pointer to data
+ */
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: realloc.c,v 1.2 2006-07-25 10:09:48 rt Exp $";
+#endif
+
+char *
+realloc(cptr,size)
+ char * cptr;
+ unsigned int size;
+{
+ void free();
+ char * func = "realloc";
+ int i;
+ char * malloc();
+ extern int malloc_checking;
+ extern struct mlist * malloc_end;
+ extern int malloc_errno;
+ extern char * malloc_data_end;
+ extern char * malloc_data_start;
+ void malloc_join();
+ void malloc_memset();
+ void malloc_split();
+ char * memcpy();
+ char * new_cptr;
+ struct mlist * ptr;
+ int r_size;
+
+ /*
+ * IF malloc chain checking is on, go do it.
+ */
+ if( malloc_checking )
+ {
+ (void) malloc_chain_check(1);
+ }
+
+ /*
+ * verify that cptr is within the malloc region...
+ */
+ if( cptr < malloc_data_start || cptr > malloc_data_end )
+ {
+ malloc_errno = M_CODE_BAD_PTR;
+ malloc_warning(func);
+ return (NULL);
+ }
+
+ /*
+ * convert pointer to mlist struct pointer. To do this we must
+ * move the pointer backwards the correct number of bytes...
+ */
+
+ ptr = (struct mlist *) (cptr - M_SIZE);
+
+ if( (ptr->flag&M_MAGIC) != M_MAGIC )
+ {
+ malloc_errno = M_CODE_BAD_MAGIC;
+ malloc_warning(func);
+ return(NULL);
+ }
+
+ if( ! (ptr->flag & M_INUSE) )
+ {
+ malloc_errno = M_CODE_NOT_INUSE ;
+ malloc_warning(func);
+ return(NULL);
+ }
+
+ if( (ptr->prev && (ptr->prev->next != ptr) ) ||
+ (ptr->next && (ptr->next->prev != ptr) ) ||
+ ((ptr->next == NULL) && (ptr->prev == NULL)) )
+ {
+ malloc_errno = M_CODE_BAD_CONNECT;
+ malloc_warning(func);
+ return(NULL);
+ }
+
+ r_size = ++size;
+
+ M_ROUNDUP(size);
+
+ if( size > ptr->s.size )
+ {
+ malloc_join(ptr,ptr->next,1,1);
+ }
+
+ if( size > ptr->s.size )
+ {
+ /*
+ * else we can't combine it, so lets allocate a new chunk,
+ * copy the data and free the old chunk...
+ */
+ new_cptr = malloc(size);
+
+ if( new_cptr == (char *) 0)
+ {
+ return(new_cptr);
+ }
+
+ if( r_size < ptr->r_size )
+ {
+ i = r_size;
+ }
+ else
+ {
+ i = ptr->r_size;
+ }
+ (void)memcpy(new_cptr,ptr->data,i);
+ free(cptr);
+ return(new_cptr);
+
+ } /* else... */
+
+ /*
+ * save amount of real data in new segment (this will be used in the
+ * memset later) and then save requested size of this segment.
+ */
+
+ if( ptr->r_size < r_size )
+ {
+ i = ptr->r_size;
+ }
+ else
+ {
+ i = r_size;
+ }
+
+ ptr->r_size = r_size;
+
+ /*
+ * split off extra free space at end of this segment, if possible...
+ */
+
+ malloc_split(ptr);
+
+ malloc_memset( ptr->data+i, M_FILL, (int) (ptr->s.size - i));
+
+ return(ptr->data);
+
+} /* realloc(... */
+
+
diff --git a/dmake/dbug/malloc/string.c b/dmake/dbug/malloc/string.c
new file mode 100644
index 000000000000..7b92bf07ad1b
--- /dev/null
+++ b/dmake/dbug/malloc/string.c
@@ -0,0 +1,533 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include "malloc.h"
+
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: string.c,v 1.2 2006-07-25 10:10:03 rt Exp $";
+#endif
+
+int malloc_checking = 0;
+
+char *
+strcat(str1,str2)
+ register char * str1;
+ register char * str2;
+{
+ char * rtn;
+ int len;
+
+ /*
+ * check pointers agains malloc region. The malloc* functions
+ * will properly handle the case where a pointer does not
+ * point into malloc space.
+ */
+ malloc_checking = 1;
+
+ len = strlen(str2);
+ malloc_check_str("strcat", str2);
+
+ len += strlen(str1) + 1;
+ malloc_checking = 0;
+
+ malloc_check_data("strcat", str1, len);
+
+ rtn = str1;
+
+ while( *str1 )
+ {
+ str1++;
+ }
+
+ while( (*str1 = *str2) != '\0' )
+ {
+ str1++;
+ str2++;
+ }
+
+ return(rtn);
+}
+
+char *
+strdup(str1)
+ register char * str1;
+{
+ char * malloc();
+ char * rtn;
+ register char * str2;
+
+ malloc_check_str("strdup", str1);
+
+ rtn = str2 = malloc((unsigned)strlen(str1)+1);
+
+ if( rtn != (char *) 0)
+ {
+ while( (*str2 = *str1) != '\0' )
+ {
+ str1++;
+ str2++;
+ }
+ }
+
+ return(rtn);
+}
+
+char *
+strncat(str1,str2,len)
+ register char * str1;
+ register char * str2;
+ register int len;
+{
+ int len1;
+ int len2;
+ char * rtn;
+
+ malloc_check_strn("strncat", str2, len);
+
+ malloc_checking = 1;
+
+ len2 = strlen(str2) + 1;
+ len1 = strlen(str1);
+
+ malloc_checking = 0;
+
+
+ if( (len+1) < len2 )
+ {
+ len1 += len + 1;
+ }
+ else
+ {
+ len1 += len2;
+ }
+ malloc_check_data("strncat", str1, len1);
+
+ rtn = str1;
+
+ while( *str1 )
+ {
+ str1++;
+ }
+
+ while( len-- && ((*str1++ = *str2++) != '\0') )
+ {
+ }
+
+ if( ! len )
+ {
+ *str1 = '\0';
+ }
+
+ return(rtn);
+}
+
+int
+strcmp(str1,str2)
+ register char * str1;
+ register char * str2;
+{
+ malloc_check_str("strcmp", str1);
+ malloc_check_str("strcmp", str2);
+
+ while( *str1 && (*str1 == *str2) )
+ {
+ str1++;
+ str2++;
+ }
+
+
+ /*
+ * in order to deal with the case of a negative last char of either
+ * string when the other string has a null
+ */
+ if( (*str2 == '\0') && (*str1 == '\0') )
+ {
+ return(0);
+ }
+ else if( *str2 == '\0' )
+ {
+ return(1);
+ }
+ else if( *str1 == '\0' )
+ {
+ return(-1);
+ }
+
+ return( *str1 - *str2 );
+}
+
+int
+strncmp(str1,str2,len)
+ register char * str1;
+ register char * str2;
+ register int len;
+{
+ malloc_check_strn("strncmp", str1, len);
+ malloc_check_strn("strncmp", str2, len);
+
+ while( --len >= 0 && *str1 && (*str1 == *str2) )
+ {
+ str1++;
+ str2++;
+ }
+
+ if( len < 0 )
+ {
+ return(0);
+ }
+ /*
+ * in order to deal with the case of a negative last char of either
+ * string when the other string has a null
+ */
+ if( (*str2 == '\0') && (*str1 == '\0') )
+ {
+ return(0);
+ }
+ else if( *str2 == '\0' )
+ {
+ return(1);
+ }
+ else if( *str1 == '\0' )
+ {
+ return(-1);
+ }
+
+ return( *str1 - *str2 );
+}
+
+char *
+strcpy(str1,str2)
+ register char * str1;
+ register char * str2;
+{
+ char * rtn;
+ int len;
+
+ malloc_checking = 1;
+ len = strlen(str2) + 1;
+ malloc_checking = 0;
+
+ malloc_check_data("strcpy", str1, len);
+ malloc_check_data("strcpy", str2, len);
+
+ rtn = str1;
+
+ while( (*str1++ = *str2++) != '\0')
+ {
+ }
+
+ return(rtn);
+}
+
+char *
+strncpy(str1,str2,len)
+ register char * str1;
+ register char * str2;
+ register int len;
+{
+ extern int malloc_checking;
+ char * rtn;
+
+ malloc_check_data("strncpy", str1, len);
+ malloc_check_strn("strncpy", str2, len);
+
+ rtn = str1;
+
+ while((len-- > 0) && (*str1++ = *str2++) != '\0')
+ {
+ }
+ while( (len-- > 0) )
+ {
+ *str1++ = '\0';
+ }
+
+ return(rtn);
+}
+
+int
+strlen(str1)
+ register char * str1;
+{
+ register char * s;
+
+ if(! malloc_checking )
+ {
+ malloc_check_str("strlen", str1);
+ }
+
+ for( s = str1; *s; s++)
+ {
+ }
+
+ return( s - str1 );
+}
+
+char *
+strchr(str1,c)
+ register char * str1;
+ register int c;
+{
+ malloc_check_str("strchr", str1);
+
+ while( *str1 && (*str1 != (char) c) )
+ {
+ str1++;
+ }
+
+ if(*str1 != (char) c)
+ {
+ str1 = (char *) 0;
+ }
+
+ return(str1);
+}
+
+char *
+strrchr(str1,c)
+ register char * str1;
+ register int c;
+{
+ register char * rtn = (char *) 0;
+
+ malloc_check_str("strrchr", str1);
+
+ while( *str1 )
+ {
+ if(*str1 == (char) c )
+ {
+ rtn = str1;
+ }
+ str1++;
+ }
+
+ if( *str1 == (char) c)
+ {
+ rtn = str1;
+ }
+
+ return(rtn);
+}
+
+char *
+index(str1,c)
+ char * str1;
+ char c;
+{
+ return( strchr(str1,c) );
+}
+
+char *
+rindex(str1,c)
+ char * str1;
+ char c;
+{
+ return( strrchr(str1,c) );
+}
+
+char *
+strpbrk(str1,str2)
+ register char * str1;
+ register char * str2;
+{
+ register char * tmp;
+
+ malloc_check_str("strpbrk", str1);
+ malloc_check_str("strpbrk", str2);
+
+ while(*str1)
+ {
+ for( tmp=str2; *tmp && *tmp != *str1; tmp++)
+ {
+ }
+ if( *tmp )
+ {
+ break;
+ }
+ str1++;
+ }
+
+ if( ! *str1 )
+ {
+ str1 = (char *) 0;
+ }
+
+ return(str1);
+}
+
+int
+strspn(str1,str2)
+ register char * str1;
+ register char * str2;
+{
+ register char * tmp;
+ char * orig = str1;
+
+ malloc_check_str("strspn", str1);
+ malloc_check_str("strspn", str2);
+
+ while(*str1)
+ {
+ for( tmp=str2; *tmp && *tmp != *str1; tmp++)
+ {
+ }
+ if(! *tmp )
+ {
+ break;
+ }
+ str1++;
+ }
+
+ return( (int) (str1 - orig) );
+}
+
+int
+strcspn(str1,str2)
+ register char * str1;
+ register char * str2;
+{
+ register char * tmp;
+ char * orig = str1;
+
+ malloc_check_str("strcspn", str1);
+ malloc_check_str("strcspn", str2);
+
+ while(*str1)
+ {
+ for( tmp=str2; *tmp && *tmp != *str1; tmp++)
+ {
+ }
+ if( *tmp )
+ {
+ break;
+ }
+ str1++;
+ }
+
+ return( (int) (str1 - orig) );
+}
+
+/*
+ * strtok() source taken from that posted to comp.lang.c by Chris Torek
+ * in Jan 1990.
+ */
+
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/*
+ * Get next token from string s (NULL on 2nd, 3rd, etc. calls),
+ * where tokens are nonempty strings separated by runs of
+ * chars from delim. Writes NULs into s to end tokens. delim need not
+ * remain constant from call to call.
+ *
+ * Modified by cpc: changed variable names to conform with naming
+ * conventions used in rest of code. Added malloc pointer
+ * check calls.
+ */
+char *
+strtok(str1, str2)
+ char * str1;
+ char * str2;
+{
+ static char * last;
+ char * strtoken();
+
+ if( str1 )
+ {
+ malloc_check_str("strtok", str1);
+ last = str1;
+ }
+ malloc_check_str("strtok", str2);
+
+ return (strtoken(&last, str2, 1));
+}
+
+
+/*
+ * Get next token from string *stringp, where tokens are (possibly empty)
+ * strings separated by characters from delim. Tokens are separated
+ * by exactly one delimiter iff the skip parameter is false; otherwise
+ * they are separated by runs of characters from delim, because we
+ * skip over any initial `delim' characters.
+ *
+ * Writes NULs into the string at *stringp to end tokens.
+ * delim will usually, but need not, remain constant from call to call.
+ * On return, *stringp points past the last NUL written (if there might
+ * be further tokens), or is NULL (if there are definitely no more tokens).
+ *
+ * If *stringp is NULL, strtoken returns NULL.
+ */
+char *
+strtoken(stringp, delim, skip)
+ register char **stringp;
+ register char *delim;
+ int skip;
+{
+ register char *s;
+ register char *spanp;
+ register int c, sc;
+ char *tok;
+
+ if ((s = *stringp) == NULL)
+ return (NULL);
+
+ if (skip) {
+ /*
+ * Skip (span) leading delimiters (s += strspn(s, delim)).
+ */
+ cont:
+ c = *s;
+ for (spanp = delim; (sc = *spanp++) != 0;) {
+ if (c == sc) {
+ s++;
+ goto cont;
+ }
+ }
+ if (c == 0) { /* no token found */
+ *stringp = NULL;
+ return (NULL);
+ }
+ }
+
+ /*
+ * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+ * Note that delim must have one NUL; we stop if we see that, too.
+ */
+ for (tok = s;;) {
+ c = *s++;
+ spanp = delim;
+ do {
+ if ((sc = *spanp++) == c) {
+ if (c == 0)
+ s = NULL;
+ else
+ s[-1] = 0;
+ *stringp = s;
+ return (tok);
+ }
+ } while (sc != 0);
+ }
+ /* NOTREACHED */
+}
+
diff --git a/dmake/dbug/malloc/testmem.c b/dmake/dbug/malloc/testmem.c
new file mode 100644
index 000000000000..7da5e8ced89b
--- /dev/null
+++ b/dmake/dbug/malloc/testmem.c
@@ -0,0 +1,618 @@
+/*
+ * This stuff is all stolen (with permission, since it was in the public
+ * domain) from Henry Spencer's string and memory library. Thanks Henry.
+ */
+
+/*
+ * Test program for string(3) routines.
+ *
+ * Note that at least one Bell Labs implementation of the string
+ * routines flunks a couple of these tests -- the ones which test
+ * behavior on "negative" characters.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+char * index();
+char * rindex();
+
+#define STREQ(a, b) (strcmp((a), (b)) == 0)
+
+char *it = "<UNSET>"; /* Routine name for message routines. */
+int waserror = 0; /* For exit status. */
+
+char uctest[] = "\004\203"; /* For testing signedness of chars. */
+int charsigned; /* Result. */
+
+/*
+ - check - complain if condition is not true
+ */
+void
+check(thing, number)
+int thing;
+int number; /* Test number for error message. */
+{
+ if (!thing) {
+ printf("%s flunked test %d\n", it, number);
+ waserror = 1;
+ }
+}
+
+/*
+ - equal - complain if first two args don't strcmp as equal
+ */
+void
+equal(a, b, number)
+char *a;
+char *b;
+int number; /* Test number for error message. */
+{
+ check(a != NULL && b != NULL && STREQ(a, b), number);
+}
+
+char one[50];
+char two[50];
+
+#ifdef UNIXERR
+#define ERR 1
+#endif
+#ifdef BERKERR
+#define ERR 1
+#endif
+#ifdef ERR
+int f;
+extern char *sys_errlist[];
+extern int sys_nerr;
+extern int errno;
+#endif
+
+/* ARGSUSED */
+main(argc, argv)
+int argc;
+char *argv[];
+{
+ /*
+ * First, establish whether chars are signed.
+ */
+ if (uctest[0] < uctest[1])
+ charsigned = 0;
+ else
+ charsigned = 1;
+
+ /*
+ * Then, do the rest of the work. Split into two functions because
+ * some compilers get unhappy about a single immense function.
+ */
+ first();
+ second();
+
+ exit((waserror) ? 1 : 0);
+}
+
+first()
+{
+ /*
+ * Test strcmp first because we use it to test other things.
+ */
+ it = "strcmp";
+ check(strcmp("", "") == 0, 1); /* Trivial case. */
+ check(strcmp("a", "a") == 0, 2); /* Identity. */
+ check(strcmp("abc", "abc") == 0, 3); /* Multicharacter. */
+ check(strcmp("abc", "abcd") < 0, 4); /* Length mismatches. */
+ check(strcmp("abcd", "abc") > 0, 5);
+ check(strcmp("abcd", "abce") < 0, 6); /* Honest miscompares. */
+ check(strcmp("abce", "abcd") > 0, 7);
+ check(strcmp("a\203", "a") > 0, 8); /* Tricky if char signed. */
+ if (charsigned) /* Sign-bit comparison. */
+ check(strcmp("a\203", "a\003") < 0, 9);
+ else
+ check(strcmp("a\203", "a\003") > 0, 9);
+ check(strcmp("a", "a\203") < 0, 10); /* Tricky if char signed. */
+
+ /*
+ * Test strcpy next because we need it to set up other tests.
+ */
+ it = "strcpy";
+ check(strcpy(one, "abcd") == one, 1); /* Returned value. */
+ equal(one, "abcd", 2); /* Basic test. */
+
+ (void) strcpy(one, "x");
+ equal(one, "x", 3); /* Writeover. */
+ equal(one+2, "cd", 4); /* Wrote too much? */
+
+ (void) strcpy(two, "hi there");
+ (void) strcpy(one, two);
+ equal(one, "hi there", 5); /* Basic test encore. */
+ equal(two, "hi there", 6); /* Stomped on source? */
+
+ (void) strcpy(one, "");
+ equal(one, "", 7); /* Boundary condition. */
+
+ /*
+ * strcat
+ */
+ it = "strcat";
+ (void) strcpy(one, "ijk");
+ check(strcat(one, "lmn") == one, 1); /* Returned value. */
+ equal(one, "ijklmn", 2); /* Basic test. */
+
+ (void) strcpy(one, "x");
+ (void) strcat(one, "yz");
+ equal(one, "xyz", 3); /* Writeover. */
+ equal(one+4, "mn", 4); /* Wrote too much? */
+
+ (void) strcpy(one, "gh");
+ (void) strcpy(two, "ef");
+ (void) strcat(one, two);
+ equal(one, "ghef", 5); /* Basic test encore. */
+ equal(two, "ef", 6); /* Stomped on source? */
+
+ (void) strcpy(one, "");
+ (void) strcat(one, "");
+ equal(one, "", 7); /* Boundary conditions. */
+ (void) strcpy(one, "ab");
+ (void) strcat(one, "");
+ equal(one, "ab", 8);
+ (void) strcpy(one, "");
+ (void) strcat(one, "cd");
+ equal(one, "cd", 9);
+
+ /*
+ * strncat - first test it as strcat, with big counts, then
+ * test the count mechanism.
+ */
+ it = "strncat";
+ (void) strcpy(one, "ijk");
+ check(strncat(one, "lmn", 99) == one, 1); /* Returned value. */
+ equal(one, "ijklmn", 2); /* Basic test. */
+
+ (void) strcpy(one, "x");
+ (void) strncat(one, "yz", 99);
+ equal(one, "xyz", 3); /* Writeover. */
+ equal(one+4, "mn", 4); /* Wrote too much? */
+
+ (void) strcpy(one, "gh");
+ (void) strcpy(two, "ef");
+ (void) strncat(one, two, 99);
+ equal(one, "ghef", 5); /* Basic test encore. */
+ equal(two, "ef", 6); /* Stomped on source? */
+
+ (void) strcpy(one, "");
+ (void) strncat(one, "", 99);
+ equal(one, "", 7); /* Boundary conditions. */
+ (void) strcpy(one, "ab");
+ (void) strncat(one, "", 99);
+ equal(one, "ab", 8);
+ (void) strcpy(one, "");
+ (void) strncat(one, "cd", 99);
+ equal(one, "cd", 9);
+
+ (void) strcpy(one, "ab");
+ (void) strncat(one, "cdef", 2);
+ equal(one, "abcd", 10); /* Count-limited. */
+
+ (void) strncat(one, "gh", 0);
+ equal(one, "abcd", 11); /* Zero count. */
+
+ (void) strncat(one, "gh", 2);
+ equal(one, "abcdgh", 12); /* Count and length equal. */
+
+ /*
+ * strncmp - first test as strcmp with big counts, then test
+ * count code.
+ */
+ it = "strncmp";
+ check(strncmp("", "", 99) == 0, 1); /* Trivial case. */
+ check(strncmp("a", "a", 99) == 0, 2); /* Identity. */
+ check(strncmp("abc", "abc", 99) == 0, 3); /* Multicharacter. */
+ check(strncmp("abc", "abcd", 99) < 0, 4); /* Length unequal. */
+ check(strncmp("abcd", "abc", 99) > 0, 5);
+ check(strncmp("abcd", "abce", 99) < 0, 6); /* Honestly unequal. */
+ check(strncmp("abce", "abcd", 99) > 0, 7);
+ check(strncmp("a\203", "a", 2) > 0, 8); /* Tricky if '\203' < 0 */
+ if (charsigned) /* Sign-bit comparison. */
+ check(strncmp("a\203", "a\003", 2) < 0, 9);
+ else
+ check(strncmp("a\203", "a\003", 2) > 0, 9);
+ check(strncmp("abce", "abcd", 3) == 0, 10); /* Count limited. */
+ check(strncmp("abce", "abc", 3) == 0, 11); /* Count == length. */
+ check(strncmp("abcd", "abce", 4) < 0, 12); /* Nudging limit. */
+ check(strncmp("abc", "def", 0) == 0, 13); /* Zero count. */
+
+ /*
+ * strncpy - testing is a bit different because of odd semantics
+ */
+ it = "strncpy";
+ check(strncpy(one, "abc", 4) == one, 1); /* Returned value. */
+ equal(one, "abc", 2); /* Did the copy go right? */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) strncpy(one, "xyz", 2);
+ equal(one, "xycdefgh", 3); /* Copy cut by count. */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
+ equal(one, "xyzdefgh", 4);
+
+ (void) strcpy(one, "abcdefgh");
+ (void) strncpy(one, "xyz", 4); /* Copy just includes NUL. */
+ equal(one, "xyz", 5);
+ equal(one+4, "efgh", 6); /* Wrote too much? */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) strncpy(one, "xyz", 5); /* Copy includes padding. */
+ equal(one, "xyz", 7);
+ equal(one+4, "", 8);
+ equal(one+5, "fgh", 9);
+
+ (void) strcpy(one, "abc");
+ (void) strncpy(one, "xyz", 0); /* Zero-length copy. */
+ equal(one, "abc", 10);
+
+ (void) strncpy(one, "", 2); /* Zero-length source. */
+ equal(one, "", 11);
+ equal(one+1, "", 12);
+ equal(one+2, "c", 13);
+
+ (void) strcpy(one, "hi there");
+ (void) strncpy(two, one, 9);
+ equal(two, "hi there", 14); /* Just paranoia. */
+ equal(one, "hi there", 15); /* Stomped on source? */
+
+ /*
+ * strlen
+ */
+ it = "strlen";
+ check(strlen("") == 0, 1); /* Empty. */
+ check(strlen("a") == 1, 2); /* Single char. */
+ check(strlen("abcd") == 4, 3); /* Multiple chars. */
+
+ /*
+ * strchr
+ */
+ it = "strchr";
+ check(strchr("abcd", 'z') == NULL, 1); /* Not found. */
+ (void) strcpy(one, "abcd");
+ check(strchr(one, 'c') == one+2, 2); /* Basic test. */
+ check(strchr(one, 'd') == one+3, 3); /* End of string. */
+ check(strchr(one, 'a') == one, 4); /* Beginning. */
+ check(strchr(one, '\0') == one+4, 5); /* Finding NUL. */
+ (void) strcpy(one, "ababa");
+ check(strchr(one, 'b') == one+1, 6); /* Finding first. */
+ (void) strcpy(one, "");
+ check(strchr(one, 'b') == NULL, 7); /* Empty string. */
+ check(strchr(one, '\0') == one, 8); /* NUL in empty string. */
+
+ /*
+ * index - just like strchr
+ */
+ it = "index";
+ check(index("abcd", 'z') == NULL, 1); /* Not found. */
+ (void) strcpy(one, "abcd");
+ check(index(one, 'c') == one+2, 2); /* Basic test. */
+ check(index(one, 'd') == one+3, 3); /* End of string. */
+ check(index(one, 'a') == one, 4); /* Beginning. */
+ check(index(one, '\0') == one+4, 5); /* Finding NUL. */
+ (void) strcpy(one, "ababa");
+ check(index(one, 'b') == one+1, 6); /* Finding first. */
+ (void) strcpy(one, "");
+ check(index(one, 'b') == NULL, 7); /* Empty string. */
+ check(index(one, '\0') == one, 8); /* NUL in empty string. */
+
+ /*
+ * strrchr
+ */
+ it = "strrchr";
+ check(strrchr("abcd", 'z') == NULL, 1); /* Not found. */
+ (void) strcpy(one, "abcd");
+ check(strrchr(one, 'c') == one+2, 2); /* Basic test. */
+ check(strrchr(one, 'd') == one+3, 3); /* End of string. */
+ check(strrchr(one, 'a') == one, 4); /* Beginning. */
+ check(strrchr(one, '\0') == one+4, 5); /* Finding NUL. */
+ (void) strcpy(one, "ababa");
+ check(strrchr(one, 'b') == one+3, 6); /* Finding last. */
+ (void) strcpy(one, "");
+ check(strrchr(one, 'b') == NULL, 7); /* Empty string. */
+ check(strrchr(one, '\0') == one, 8); /* NUL in empty string. */
+
+ /*
+ * rindex - just like strrchr
+ */
+ it = "rindex";
+ check(rindex("abcd", 'z') == NULL, 1); /* Not found. */
+ (void) strcpy(one, "abcd");
+ check(rindex(one, 'c') == one+2, 2); /* Basic test. */
+ check(rindex(one, 'd') == one+3, 3); /* End of string. */
+ check(rindex(one, 'a') == one, 4); /* Beginning. */
+ check(rindex(one, '\0') == one+4, 5); /* Finding NUL. */
+ (void) strcpy(one, "ababa");
+ check(rindex(one, 'b') == one+3, 6); /* Finding last. */
+ (void) strcpy(one, "");
+ check(rindex(one, 'b') == NULL, 7); /* Empty string. */
+ check(rindex(one, '\0') == one, 8); /* NUL in empty string. */
+}
+
+second()
+{
+ /*
+ * strpbrk - somewhat like strchr
+ */
+ it = "strpbrk";
+ check(strpbrk("abcd", "z") == NULL, 1); /* Not found. */
+ (void) strcpy(one, "abcd");
+ check(strpbrk(one, "c") == one+2, 2); /* Basic test. */
+ check(strpbrk(one, "d") == one+3, 3); /* End of string. */
+ check(strpbrk(one, "a") == one, 4); /* Beginning. */
+ check(strpbrk(one, "") == NULL, 5); /* Empty search list. */
+ check(strpbrk(one, "cb") == one+1, 6); /* Multiple search. */
+ (void) strcpy(one, "abcabdea");
+ check(strpbrk(one, "b") == one+1, 7); /* Finding first. */
+ check(strpbrk(one, "cb") == one+1, 8); /* With multiple search. */
+ check(strpbrk(one, "db") == one+1, 9); /* Another variant. */
+ (void) strcpy(one, "");
+ check(strpbrk(one, "bc") == NULL, 10); /* Empty string. */
+ check(strpbrk(one, "") == NULL, 11); /* Both strings empty. */
+
+ /*
+ * strspn
+ */
+ it = "strspn";
+ check(strspn("abcba", "abc") == 5, 1); /* Whole string. */
+ check(strspn("abcba", "ab") == 2, 2); /* Partial. */
+ check(strspn("abc", "qx") == 0, 3); /* None. */
+ check(strspn("", "ab") == 0, 4); /* Null string. */
+ check(strspn("abc", "") == 0, 5); /* Null search list. */
+
+ /*
+ * strcspn
+ */
+ it = "strcspn";
+ check(strcspn("abcba", "qx") == 5, 1); /* Whole string. */
+ check(strcspn("abcba", "cx") == 2, 2); /* Partial. */
+ check(strcspn("abc", "abc") == 0, 3); /* None. */
+ check(strcspn("", "ab") == 0, 4); /* Null string. */
+ check(strcspn("abc", "") == 3, 5); /* Null search list. */
+
+ /*
+ * strtok - the hard one
+ */
+ it = "strtok";
+ (void) strcpy(one, "first, second, third");
+ equal(strtok(one, ", "), "first", 1); /* Basic test. */
+ equal(one, "first", 2);
+ equal(strtok((char *)NULL, ", "), "second", 3);
+ equal(strtok((char *)NULL, ", "), "third", 4);
+ check(strtok((char *)NULL, ", ") == NULL, 5);
+ (void) strcpy(one, ", first, ");
+ equal(strtok(one, ", "), "first", 6); /* Extra delims, 1 tok. */
+ check(strtok((char *)NULL, ", ") == NULL, 7);
+ (void) strcpy(one, "1a, 1b; 2a, 2b");
+ equal(strtok(one, ", "), "1a", 8); /* Changing delim lists. */
+ equal(strtok((char *)NULL, "; "), "1b", 9);
+ equal(strtok((char *)NULL, ", "), "2a", 10);
+ (void) strcpy(two, "x-y");
+ equal(strtok(two, "-"), "x", 11); /* New string before done. */
+ equal(strtok((char *)NULL, "-"), "y", 12);
+ check(strtok((char *)NULL, "-") == NULL, 13);
+ (void) strcpy(one, "a,b, c,, ,d");
+ equal(strtok(one, ", "), "a", 14); /* Different separators. */
+ equal(strtok((char *)NULL, ", "), "b", 15);
+ equal(strtok((char *)NULL, " ,"), "c", 16); /* Permute list too. */
+ equal(strtok((char *)NULL, " ,"), "d", 17);
+ check(strtok((char *)NULL, ", ") == NULL, 18);
+ check(strtok((char *)NULL, ", ") == NULL, 19); /* Persistence. */
+ (void) strcpy(one, ", ");
+ check(strtok(one, ", ") == NULL, 20); /* No tokens. */
+ (void) strcpy(one, "");
+ check(strtok(one, ", ") == NULL, 21); /* Empty string. */
+ (void) strcpy(one, "abc");
+ equal(strtok(one, ", "), "abc", 22); /* No delimiters. */
+ check(strtok((char *)NULL, ", ") == NULL, 23);
+ (void) strcpy(one, "abc");
+ equal(strtok(one, ""), "abc", 24); /* Empty delimiter list. */
+ check(strtok((char *)NULL, "") == NULL, 25);
+ (void) strcpy(one, "abcdefgh");
+ (void) strcpy(one, "a,b,c");
+ equal(strtok(one, ","), "a", 26); /* Basics again... */
+ equal(strtok((char *)NULL, ","), "b", 27);
+ equal(strtok((char *)NULL, ","), "c", 28);
+ check(strtok((char *)NULL, ",") == NULL, 29);
+ equal(one+6, "gh", 30); /* Stomped past end? */
+ equal(one, "a", 31); /* Stomped old tokens? */
+ equal(one+2, "b", 32);
+ equal(one+4, "c", 33);
+
+ /*
+ * memcmp
+ */
+ it = "memcmp";
+ check(memcmp("a", "a", 1) == 0, 1); /* Identity. */
+ check(memcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */
+ check(memcmp("abcd", "abce", 4) < 0, 3); /* Honestly unequal. */
+ check(memcmp("abce", "abcd", 4) > 0, 4);
+ check(memcmp("alph", "beta", 4) < 0, 5);
+ if (charsigned) /* Sign-bit comparison. */
+ check(memcmp("a\203", "a\003", 2) < 0, 6);
+ else
+ check(memcmp("a\203", "a\003", 2) > 0, 6);
+ check(memcmp("abce", "abcd", 3) == 0, 7); /* Count limited. */
+ check(memcmp("abc", "def", 0) == 0, 8); /* Zero count. */
+
+ /*
+ * memchr
+ */
+ it = "memchr";
+ check(memchr("abcd", 'z', 4) == NULL, 1); /* Not found. */
+ (void) strcpy(one, "abcd");
+ check(memchr(one, 'c', 4) == one+2, 2); /* Basic test. */
+ check(memchr(one, 'd', 4) == one+3, 3); /* End of string. */
+ check(memchr(one, 'a', 4) == one, 4); /* Beginning. */
+ check(memchr(one, '\0', 5) == one+4, 5); /* Finding NUL. */
+ (void) strcpy(one, "ababa");
+ check(memchr(one, 'b', 5) == one+1, 6); /* Finding first. */
+ check(memchr(one, 'b', 0) == NULL, 7); /* Zero count. */
+ check(memchr(one, 'a', 1) == one, 8); /* Singleton case. */
+ (void) strcpy(one, "a\203b");
+ check(memchr(one, 0203, 3) == one+1, 9); /* Unsignedness. */
+
+ /*
+ * memcpy
+ *
+ * Note that X3J11 says memcpy must work regardless of overlap.
+ * The SVID says it might fail.
+ */
+ it = "memcpy";
+ check(memcpy(one, "abc", 4) == one, 1); /* Returned value. */
+ equal(one, "abc", 2); /* Did the copy go right? */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) memcpy(one+1, "xyz", 2);
+ equal(one, "axydefgh", 3); /* Basic test. */
+
+ (void) strcpy(one, "abc");
+ (void) memcpy(one, "xyz", 0);
+ equal(one, "abc", 4); /* Zero-length copy. */
+
+ (void) strcpy(one, "hi there");
+ (void) strcpy(two, "foo");
+ (void) memcpy(two, one, 9);
+ equal(two, "hi there", 5); /* Just paranoia. */
+ equal(one, "hi there", 6); /* Stomped on source? */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) memcpy(one+1, one, 9);
+ equal(one, "aabcdefgh", 7); /* Overlap, right-to-left. */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) memcpy(one+1, one+2, 7);
+ equal(one, "acdefgh", 8); /* Overlap, left-to-right. */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) memcpy(one, one, 9);
+ equal(one, "abcdefgh", 9); /* 100% overlap. */
+
+ /*
+ * memccpy - first test like memcpy, then the search part
+ *
+ * The SVID, the only place where memccpy is mentioned, says
+ * overlap might fail, so we don't try it. Besides, it's hard
+ * to see the rationale for a non-left-to-right memccpy.
+ */
+ it = "memccpy";
+ check(memccpy(one, "abc", 'q', 4) == NULL, 1); /* Returned value. */
+ equal(one, "abc", 2); /* Did the copy go right? */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) memccpy(one+1, "xyz", 'q', 2);
+ equal(one, "axydefgh", 3); /* Basic test. */
+
+ (void) strcpy(one, "abc");
+ (void) memccpy(one, "xyz", 'q', 0);
+ equal(one, "abc", 4); /* Zero-length copy. */
+
+ (void) strcpy(one, "hi there");
+ (void) strcpy(two, "foo");
+ (void) memccpy(two, one, 'q', 9);
+ equal(two, "hi there", 5); /* Just paranoia. */
+ equal(one, "hi there", 6); /* Stomped on source? */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) strcpy(two, "horsefeathers");
+ check(memccpy(two, one, 'f', 9) == two+6, 7); /* Returned value. */
+ equal(one, "abcdefgh", 8); /* Source intact? */
+ equal(two, "abcdefeathers", 9); /* Copy correct? */
+
+ (void) strcpy(one, "abcd");
+ (void) strcpy(two, "bumblebee");
+ check(memccpy(two, one, 'a', 4) == two+1, 10); /* First char. */
+ equal(two, "aumblebee", 11);
+ check(memccpy(two, one, 'd', 4) == two+4, 12); /* Last char. */
+ equal(two, "abcdlebee", 13);
+ (void) strcpy(one, "xyz");
+ check(memccpy(two, one, 'x', 1) == two+1, 14); /* Singleton. */
+ equal(two, "xbcdlebee", 15);
+
+ /*
+ * memset
+ */
+ it = "memset";
+ (void) strcpy(one, "abcdefgh");
+ check(memset(one+1, 'x', 3) == one+1, 1); /* Return value. */
+ equal(one, "axxxefgh", 2); /* Basic test. */
+
+ (void) memset(one+2, 'y', 0);
+ equal(one, "axxxefgh", 3); /* Zero-length set. */
+
+ (void) memset(one+5, 0, 1);
+ equal(one, "axxxe", 4); /* Zero fill. */
+ equal(one+6, "gh", 5); /* And the leftover. */
+
+ (void) memset(one+2, 010045, 1);
+ equal(one, "ax\045xe", 6); /* Unsigned char convert. */
+
+ /*
+ * bcopy - much like memcpy
+ *
+ * Berklix manual is silent about overlap, so don't test it.
+ */
+ it = "bcopy";
+ (void) bcopy("abc", one, 4);
+ equal(one, "abc", 1); /* Simple copy. */
+
+ (void) strcpy(one, "abcdefgh");
+ (void) bcopy("xyz", one+1, 2);
+ equal(one, "axydefgh", 2); /* Basic test. */
+
+ (void) strcpy(one, "abc");
+ (void) bcopy("xyz", one, 0);
+ equal(one, "abc", 3); /* Zero-length copy. */
+
+ (void) strcpy(one, "hi there");
+ (void) strcpy(two, "foo");
+ (void) bcopy(one, two, 9);
+ equal(two, "hi there", 4); /* Just paranoia. */
+ equal(one, "hi there", 5); /* Stomped on source? */
+
+ /*
+ * bzero
+ */
+ it = "bzero";
+ (void) strcpy(one, "abcdef");
+ bzero(one+2, 2);
+ equal(one, "ab", 1); /* Basic test. */
+ equal(one+3, "", 2);
+ equal(one+4, "ef", 3);
+
+ (void) strcpy(one, "abcdef");
+ bzero(one+2, 0);
+ equal(one, "abcdef", 4); /* Zero-length copy. */
+
+ /*
+ * bcmp - somewhat like memcmp
+ */
+ it = "bcmp";
+ check(bcmp("a", "a", 1) == 0, 1); /* Identity. */
+ check(bcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */
+ check(bcmp("abcd", "abce", 4) != 0, 3); /* Honestly unequal. */
+ check(bcmp("abce", "abcd", 4) != 0, 4);
+ check(bcmp("alph", "beta", 4) != 0, 5);
+ check(bcmp("abce", "abcd", 3) == 0, 6); /* Count limited. */
+ check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */
+
+#ifdef ERR
+ /*
+ * strerror - VERY system-dependent
+ */
+ it = "strerror";
+ f = open("/", 1); /* Should always fail. */
+ check(f < 0 && errno > 0 && errno < sys_nerr, 1);
+ equal(strerror(errno), sys_errlist[errno], 2);
+#ifdef UNIXERR
+ equal(strerror(errno), "Is a directory", 3);
+#endif
+#ifdef BERKERR
+ equal(strerror(errno), "Permission denied", 3);
+#endif
+#endif
+}
diff --git a/dmake/dbug/malloc/testmlc.c b/dmake/dbug/malloc/testmlc.c
new file mode 100644
index 000000000000..16e11736cc18
--- /dev/null
+++ b/dmake/dbug/malloc/testmlc.c
@@ -0,0 +1,176 @@
+/* NOT copyright by SoftQuad Inc. -- msb, 1988 */
+#ifndef lint
+static char *SQ_SccsId = "@(#)mtest3.c 1.2 88/08/25";
+#endif
+#include <stdio.h>
+/*
+** looptest.c -- intensive allocator tester
+**
+** Usage: looptest
+**
+** History:
+** 4-Feb-1987 rtech!daveb
+*/
+
+# ifdef SYS5
+# define random rand
+# else
+# include <sys/vadvise.h>
+# endif
+
+# include <stdio.h>
+# include <signal.h>
+# include <setjmp.h>
+
+# define MAXITER 1000000 /* main loop iterations */
+# define MAXOBJS 1000 /* objects in pool */
+# define BIGOBJ 90000 /* max size of a big object */
+# define TINYOBJ 80 /* max size of a small object */
+# define BIGMOD 100 /* 1 in BIGMOD is a BIGOBJ */
+# define STATMOD 10000 /* interation interval for status */
+
+main( argc, argv )
+int argc;
+char **argv;
+{
+ register int **objs; /* array of objects */
+ register int *sizes; /* array of object sizes */
+ register int n; /* iteration counter */
+ register int i; /* object index */
+ register int size; /* object size */
+ register int r; /* random number */
+
+ int objmax; /* max size this iteration */
+ int cnt; /* number of allocated objects */
+ int nm = 0; /* number of mallocs */
+ int nre = 0; /* number of reallocs */
+ int nal; /* number of allocated objects */
+ int nfre; /* number of free list objects */
+ long alm; /* memory in allocated objects */
+ long frem; /* memory in free list */
+ long startsize; /* size at loop start */
+ long endsize; /* size at loop exit */
+ long maxiter = 0; /* real max # iterations */
+
+ extern char end; /* memory before heap */
+ char *calloc();
+ char *malloc();
+ char *sbrk();
+ long atol();
+
+# ifndef SYS5
+ /* your milage may vary... */
+ vadvise( VA_ANOM );
+# endif
+
+ if (argc > 1)
+ maxiter = atol (argv[1]);
+ if (maxiter <= 0)
+ maxiter = MAXITER;
+
+ printf("MAXITER %d MAXOBJS %d ", maxiter, MAXOBJS );
+ printf("BIGOBJ %d, TINYOBJ %d, nbig/ntiny 1/%d\n",
+ BIGOBJ, TINYOBJ, BIGMOD );
+ fflush( stdout );
+
+ if( NULL == (objs = (int **)calloc( MAXOBJS, sizeof( *objs ) ) ) )
+ {
+ fprintf(stderr, "Can't allocate memory for objs array\n");
+ exit(1);
+ }
+
+ if( NULL == ( sizes = (int *)calloc( MAXOBJS, sizeof( *sizes ) ) ) )
+ {
+ fprintf(stderr, "Can't allocate memory for sizes array\n");
+ exit(1);
+ }
+
+ /* as per recent discussion on net.lang.c, calloc does not
+ ** necessarily fill in NULL pointers...
+ */
+ for( i = 0; i < MAXOBJS; i++ )
+ objs[ i ] = NULL;
+
+ startsize = sbrk(0) - &end;
+ printf( "Memory use at start: %d bytes\n", startsize );
+ fflush(stdout);
+
+ printf("Starting the test...\n");
+ fflush(stdout);
+ for( n = 0; n < maxiter ; n++ )
+ {
+ if( !(n % STATMOD) )
+ {
+ printf("%d iterations\n", n);
+ fflush(stdout);
+ }
+
+ /* determine object of interst and it's size */
+
+ r = random();
+ objmax = ( r % BIGMOD ) ? TINYOBJ : BIGOBJ;
+ size = r % objmax;
+ i = r % (MAXOBJS - 1);
+
+ /* either replace the object of get a new one */
+
+ if( objs[ i ] == NULL )
+ {
+ objs[ i ] = (int *)malloc( size );
+ nm++;
+ }
+ else
+ {
+ /* don't keep bigger objects around */
+ if( size > sizes[ i ] )
+ {
+ objs[ i ] = (int *)realloc( objs[ i ], size );
+ nre++;
+ }
+ else
+ {
+ free( objs[ i ] );
+ objs[ i ] = (int *)malloc( size );
+ nm++;
+ }
+ }
+
+ sizes[ i ] = size;
+ if( objs[ i ] == NULL )
+ {
+ printf("\nCouldn't allocate %d byte object!\n",
+ size );
+ break;
+ }
+ } /* for() */
+
+ printf( "\n" );
+ cnt = 0;
+ for( i = 0; i < MAXOBJS; i++ )
+ if( objs[ i ] )
+ cnt++;
+
+ printf( "Did %d iterations, %d objects, %d mallocs, %d reallocs\n",
+ n, cnt, nm, nre );
+ printf( "Memory use at end: %d bytes\n", sbrk(0) - &end );
+ fflush( stdout );
+
+ /* free all the objects */
+ for( i = 0; i < MAXOBJS; i++ )
+ if( objs[ i ] != NULL )
+ free( objs[ i ] );
+
+ endsize = sbrk(0) - &end;
+ printf( "Memory use after free: %d bytes\n", endsize );
+ fflush( stdout );
+
+ if( startsize != endsize )
+ printf("startsize %d != endsize %d\n", startsize, endsize );
+
+ free( objs );
+ free( sizes );
+
+ malloc_dump(2);
+ exit( 0 );
+}
+
diff --git a/dmake/dbug/malloc/tostring.c b/dmake/dbug/malloc/tostring.c
new file mode 100644
index 000000000000..e3bc9990271d
--- /dev/null
+++ b/dmake/dbug/malloc/tostring.c
@@ -0,0 +1,132 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+#include "tostring.h"
+
+/*
+ * Function: tostring()
+ *
+ * Purpose: to convert an integer to an ascii display string
+ *
+ * Arguments: buf - place to put the
+ * val - integer to convert
+ * len - length of output field (0 if just enough to hold data)
+ * base - base for number conversion (only works for base <= 16)
+ * fill - fill char when len > # digits
+ *
+ * Returns: length of string
+ *
+ * Narrative: IF fill character is non-blank
+ * Determine base
+ * If base is HEX
+ * add "0x" to begining of string
+ * IF base is OCTAL
+ * add "0" to begining of string
+ *
+ * While value is greater than zero
+ * use val % base as index into xlation str to get cur char
+ * divide val by base
+ *
+ * Determine fill-in length
+ *
+ * Fill in fill chars
+ *
+ * Copy in number
+ *
+ *
+ * Mod History:
+ * 90/01/24 cpcahil Initial revision.
+ */
+
+#ifndef lint
+static
+char rcs_hdr[] = "$Id: tostring.c,v 1.2 2006-07-25 10:10:17 rt Exp $";
+#endif
+
+#define T_LEN 10
+
+int
+tostring(buf,val,len,base,fill)
+ int base;
+ char * buf;
+ char fill;
+ int len;
+ int val;
+
+{
+ char * bufstart = buf;
+ int i = T_LEN;
+ char * xbuf = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ char tbuf[T_LEN];
+
+ /*
+ * if we are filling with non-blanks, make sure the
+ * proper start string is added
+ */
+ if( fill != ' ' )
+ {
+ switch(base)
+ {
+ case B_HEX:
+ *(buf++) = '0';
+ *(buf++) = 'x';
+ if( len )
+ {
+ len -= 2;
+ }
+ break;
+ case B_OCTAL:
+ *(buf++) = fill;
+ if( len )
+ {
+ len--;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ while( val > 0 )
+ {
+ tbuf[--i] = xbuf[val % base];
+ val = val / base;
+ }
+
+ if( len )
+ {
+ len -= (T_LEN - i);
+
+ if( len > 0 )
+ {
+ while(len-- > 0)
+ {
+ *(buf++) = fill;
+ }
+ }
+ else
+ {
+ /*
+ * string is too long so we must truncate
+ * off some characters. We do this the easiest
+ * way by just incrementing i. This means the
+ * most significant digits are lost.
+ */
+ while( len++ < 0 )
+ {
+ i++;
+ }
+ }
+ }
+
+ while( i < T_LEN )
+ {
+ *(buf++) = tbuf[i++];
+ }
+
+ return( (int) (buf - bufstart) );
+
+} /* tostring(... */
+
diff --git a/dmake/dbug/malloc/tostring.h b/dmake/dbug/malloc/tostring.h
new file mode 100644
index 000000000000..ccde36db4173
--- /dev/null
+++ b/dmake/dbug/malloc/tostring.h
@@ -0,0 +1,13 @@
+/*
+ * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
+ * You may copy, distribute, and use this software as long as this
+ * copyright statement is not removed.
+ */
+/*
+ * $Id: tostring.h,v 1.2 2006-07-25 10:10:32 rt Exp $
+ */
+#define B_BIN 2
+#define B_DEC 10
+#define B_HEX 16
+#define B_OCTAL 8
+
diff --git a/dmake/dbug/readme b/dmake/dbug/readme
new file mode 100644
index 000000000000..15efc00a7edc
--- /dev/null
+++ b/dmake/dbug/readme
@@ -0,0 +1,13 @@
+This directory contains two public domain debugging packages.
+
+ 1. Fred Fishes DEBUG macros.
+ 2. Connor P. Cahills malloc library.
+
+Descriptions of both can be found in their respective sub-directories. dbug
+for the DEBUG macros and malloc for the malloc library. I have left the
+malloc distribution intact as it comes from the net except for the changes
+noted in the _changes file.
+
+I thank the authors for making them available for others to use.
+
+-dennis
diff --git a/dmake/depcomp b/dmake/depcomp
new file mode 100755
index 000000000000..04701da536f3
--- /dev/null
+++ b/dmake/depcomp
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mecanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/dmake/dmake.c b/dmake/dmake.c
new file mode 100644
index 000000000000..52db2b6049da
--- /dev/null
+++ b/dmake/dmake.c
@@ -0,0 +1,947 @@
+/* $RCSfile: dmake.c,v $
+-- $Revision: 1.13 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:28:04 $
+--
+-- SYNOPSIS
+-- The main program.
+--
+-- DESCRIPTION
+--
+-- dmake [-#dbug_string] [ options ]
+-- [ macro definitions ] [ target ... ]
+--
+-- This file contains the main command line parser for the
+-- make utility. The valid flags recognized are as follows:
+--
+-- -f file - use file as the makefile
+-- -C file - duplicate console output to file (MSDOS only)
+-- -K file - .KEEP_STATE file
+-- -#dbug_string - dump out debugging info, see below
+-- -v[cdfimrtw] - verbose, print what we are doing, as we do it
+-- -m[trae] - measure timing information
+--
+-- options: (can be catenated, ie -irn == -i -r -n)
+--
+-- -A - enable AUGMAKE special target mapping
+-- -B - enable non-use of TABS to start recipe lines
+-- -c - use non-standard comment scanning
+-- -d - do not use directory cache
+-- -i - ignore errors
+-- -n - trace and print, do not execute commands
+-- -t - touch, update dates without executing commands
+-- -T - do not apply transitive closure on inference rules
+-- -r - don't use internal rules
+-- -s - do your work silently
+-- -S - force Sequential make, overrides -P
+-- -q - check if target is up to date. Does not
+-- do anything. Returns 0 if up to date, -1
+-- otherwise.
+-- -p - print out a version of the makefile
+-- -P# - set value of MAXPROCESS
+-- -E - define environment strings as macros
+-- -e - as -E but done after parsing makefile
+-- -u - force unconditional update of target
+-- -k - make all independent targets even if errors
+-- -V - print out this make version number
+-- -M - Microsoft make compatibility, (* disabled *)
+-- -h - print out usage info
+-- -x - export macro defs to environment
+-- -X - ignore #! lines found in makefile
+--
+-- NOTE: - #ddbug_string is only availabe for versions of dmake that
+-- have been compiled with -DDBUG switch on. Not the case for
+-- distributed versions. Any such versions must be linked
+-- together with a version of Fred Fish's debug code.
+--
+-- NOTE: - in order to compile the code the include file stddef.h
+-- must be shipped with the bundled code.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* Set this flag to one, and the global variables in vextern.h will not
+ * be defined as 'extern', instead they will be defined as global vars
+ * when this module is compiled. */
+#define _DEFINE_GLOBALS_ 1
+
+#include "extern.h" /* this includes config.h */
+#include "sysintf.h"
+
+#ifndef MSDOS
+#define USAGE \
+"Usage:\n%s [-P#] [-{f|K} file] [-{w|W} target ...] [macro[!][[*][+][:]]=value ...]\n"
+#define USAGE2 \
+"%s [-v[cdfimrtw]] [-m[trae]] [-ABcdeEghiknpqrsStTuVxX] [target ...]\n"
+#else
+#define USAGE \
+"Usage:\n%s [-P#] [-{f|C|K} file] [-{w|W} target ...] [macro[!][[*][+][:]]=value ...]\n"
+#define USAGE2 \
+"%s [-v[cdfimrtw]] [-m[trae]] [-ABcdeEghiknpqrsStTuVxX] [target ...]\n"
+#endif
+
+/* We don't use va_end at all, so define it out so that it doesn't produce
+ * lots of "Value not used" warnings. */
+#ifdef va_end
+#undef va_end
+#endif
+#define va_end(expand_to_null)
+
+/* Make certain that ARG macro is correctly defined. */
+#ifdef ARG
+#undef ARG
+#endif
+#define ARG(a,b) a b
+
+static char *sccid = "Copyright (c) 1990,...,1997 by WTI Corp.";
+static char _warn = TRUE; /* warnings on by default */
+
+static void _do_VPATH();
+static void _do_ReadEnvironment();
+#if !defined(__GNUC__) && !defined(__IBMC__)
+static void _do_f_flag ANSI((char, char *, char **));
+#else
+static void _do_f_flag ANSI((int, char *, char **));
+#endif
+
+PUBLIC int
+main(argc, argv)
+int argc;
+char **argv;
+{
+#ifdef MSDOS
+ char* std_fil_name = NIL(char);
+#endif
+
+ char* fil_name = NIL(char);
+ char* state_name = NIL(char);
+ char* whatif = NIL(char);
+ char* cmdmacs;
+ char* targets;
+ STRINGPTR cltarget = NIL(STRING); /* list of targets from command line. */
+ STRINGPTR cltarget_first = NIL(STRING); /* Pointer to first element. */
+ FILE* mkfil;
+ int ex_val;
+ int m_export;
+
+ /* Uncomment the following line to pass commands to the DBUG engine
+ * before the command line switches (-#..) are evaluated. */
+ /*
+ DB_PUSH("d,path");
+ */
+ DB_ENTER("main");
+
+ /* Initialize Global variables to their default values */
+ Prolog(argc, argv);
+ /* Set internal macros to their initial values, some are changed
+ * later again by Make_rules() that parses the values from ruletab.c. */
+ Create_macro_vars();
+ Catch_signals(Quit);
+
+ /* This macro is only defined for some OSs, see sysintf.c for details *
+ * and NULL if undefined. */
+ Def_macro("ABSMAKECMD", AbsPname, M_PRECIOUS|M_NOEXPORT|M_EXPANDED );
+
+ Def_macro( "MAKECMD", Pname, M_PRECIOUS|M_NOEXPORT|M_EXPANDED );
+ Pname = Basename(Pname);
+
+ DB_PROCESS(Pname);
+ (void) setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* stdout line buffered */
+
+ Continue = FALSE;
+ Comment = FALSE;
+ Get_env = FALSE;
+ Force = FALSE;
+ Target = FALSE;
+ If_expand = FALSE;
+ Listing = FALSE;
+ Readenv = FALSE;
+ Rules = TRUE;
+ Trace = FALSE;
+ Touch = FALSE;
+ Check = FALSE;
+ Microsoft = FALSE;
+ Makemkf = FALSE;
+ UseWinpath= FALSE;
+ No_exec = FALSE;
+ m_export = FALSE;
+ cmdmacs = NIL(char);
+ targets = NIL(char);
+ Is_exec_shell = FALSE;
+ Shell_exec_target = NIL(CELL);
+ stdout_redir = NIL(FILE);
+
+ /* Get fd for for @@-recipe silencing. */
+ if( (zerofd = open(NULLDEV, O_WRONLY)) == -1 )
+ Fatal( "Error opening %s !", NULLDEV );
+
+ Verbose = V_NOFLAG;
+ Measure = M_NOFLAG;
+ Transitive = TRUE;
+ Nest_level = 0;
+ Line_number = 0;
+ Suppress_temp_file = FALSE;
+ Skip_to_eof = FALSE;
+
+ while( --argc > 0 ) {
+ register char *p;
+ char *q;
+
+ if( *(p = *++argv) == '-' ) {
+ if( p[1] == '\0' ) Fatal("Missing option letter");
+
+ /* copy options to Buffer for $(MFLAGS), strip 'f' and 'C'*/
+ q = strchr(Buffer, '\0');
+ while (*p != '\0') {
+ char c = (*q++ = *p++);
+ if( c == 'f' || c == 'C' ) q--;
+ }
+
+ if( *(q-1) == '-' )
+ q--;
+ else
+ *q++ = ' ';
+
+ *q = '\0';
+
+ for( p = *argv+1; *p; p++) switch (*p) {
+ case 'f':
+ _do_f_flag( 'f', *++argv, &fil_name ); argc--;
+ break;
+
+#if defined(MSDOS) && !defined(OS2)
+ case 'C':
+ _do_f_flag( 'C', *++argv, &std_fil_name ); argc--;
+ Hook_std_writes( std_fil_name );
+ break;
+#endif
+
+ case 'K':
+ _do_f_flag( 'K', *++argv, &state_name ); argc--;
+ Def_macro(".KEEP_STATE", state_name, M_EXPANDED|M_PRECIOUS);
+ break;
+
+ case 'W':
+ case 'w': {
+ CELLPTR wif;
+ _do_f_flag( 'w', *++argv, &whatif ); argc--;
+ wif = Def_cell(whatif);
+ wif->ce_attr |= A_WHATIF;
+ whatif = NIL(char);
+
+ if ( *p == 'W')
+ break;
+ }
+ /*FALLTHRU*/
+
+ case 'n':
+ Trace = TRUE;
+ break;
+
+ case 'k': Continue = TRUE; break;
+ case 'c': Comment = TRUE; break;
+ case 'p': Listing = TRUE; break;
+ case 'r': Rules = FALSE; break;
+ case 't': Touch = TRUE; break;
+ case 'q': Check = TRUE; break;
+ case 'u': Force = TRUE; break;
+ case 'x': m_export = TRUE; break;
+ case 'X': No_exec = TRUE; break;
+ case 'T': Transitive = FALSE; break;
+ case 'e': Get_env = 'e'; break;
+ case 'E': Get_env = 'E'; break;
+
+ case 'V': Version(); Quit(0); break;
+ case 'A': Def_macro("AUGMAKE", "y", M_EXPANDED); break;
+ case 'B': Def_macro(".NOTABS", "y", M_EXPANDED); break;
+ case 'i': Def_macro(".IGNORE", "y", M_EXPANDED); break;
+ case 's': Def_macro(".SILENT", "y", M_EXPANDED); break;
+ case 'S': Def_macro(".SEQUENTIAL", "y", M_EXPANDED); break;
+ case 'g': Def_macro(".IGNOREGROUP","y", M_EXPANDED); break;
+ case 'd': Def_macro(".DIRCACHE",NIL(char),M_EXPANDED); break;
+
+ case 'v':
+ if( p[-1] != '-' ) Usage(TRUE);
+ while( p[1] ) switch( *++p ) {
+ case 'c': Verbose |= V_DIR_CACHE; break;
+ case 'd': Verbose |= V_DIR_SET; break;
+ case 'f': Verbose |= V_FILE_IO; break;
+ case 'i': Verbose |= V_INFER; break;
+ case 'm': Verbose |= V_MAKE; break;
+ case 'r': Verbose |= V_FORCEECHO; break;
+ case 't': Verbose |= V_LEAVE_TMP; break;
+ case 'w': Verbose |= V_WARNALL; break;
+
+ default: Usage(TRUE); break;
+ }
+ if( !Verbose ) Verbose = V_ALL;
+ if( Verbose & V_FORCEECHO ) {
+ HASHPTR hp;
+ /* This cleans the .SILENT setting */
+ hp = Def_macro(".SILENT", "", M_EXPANDED);
+ /* This overrides the bitmask for further occurences of
+ * .SILENT to "no bits allowed", see bit variables in the
+ * set_macro_value() definition in dag.c.
+ * The bitmask is already set by Create_macro_vars() in
+ * imacs.c and is overridden for the V_FORCEECHO case. */
+ hp->MV_MASK = A_DEFAULT;
+ }
+ break;
+
+ case 'm':
+ if( p[-1] != '-' ) Usage(TRUE);
+ while( p[1] ) switch( *++p ) {
+ case 't': Measure |= M_TARGET; break;
+ case 'r': Measure |= M_RECIPE; break;
+ case 'a': Measure |= M_ABSPATH; break;
+ case 'e': Measure |= M_SHELLESC; break;
+
+ default: Usage(TRUE); break;
+ }
+ if( !Measure ) Measure = M_TARGET;
+ break;
+
+ case 'P':
+ if( p[1] ) {
+ /* Only set MAXPROCESS if -S flag is *not* used. */
+ if( !(Glob_attr & A_SEQ) ) {
+ Def_macro( "MAXPROCESS", p+1, M_MULTI|M_EXPANDED );
+ }
+ p += strlen(p)-1;
+ }
+ else
+ Fatal( "Missing number for -P flag" );
+ break;
+
+#ifdef DBUG
+ case '#':
+ DB_PUSH(p+1);
+ p += strlen(p)-1;
+ break;
+#endif
+
+ case 'h': Usage(FALSE); break;
+ case 0: break; /* lone - */
+ default: Usage(TRUE); break;
+ }
+ }
+ else if( (q = strchr(p, '=')) != NIL(char) ) {
+ cmdmacs = DmStrAdd( cmdmacs, DmStrDup2(p), TRUE );
+ /* Macros defined on the command line are marked precious.
+ * FIXME: The exception for += appears to be bogus. */
+ Parse_macro( p, (q[-1]!='+')?M_PRECIOUS:M_DEFAULT );
+ }
+ else {
+ /* Remember the targets from the command line. */
+ register STRINGPTR nsp;
+
+ targets = DmStrAdd( targets, DmStrDup(p), TRUE );
+
+ TALLOC(nsp, 1, STRING);
+ nsp->st_string = DmStrDup( p );
+ nsp->st_next = NIL(STRING);
+
+ if(cltarget != NIL(STRING) )
+ cltarget->st_next = nsp;
+ else
+ cltarget_first = nsp;
+
+ cltarget = nsp;
+ }
+ }
+
+ Def_macro( "MAKEMACROS", cmdmacs, M_PRECIOUS|M_NOEXPORT );
+ Def_macro( "MAKETARGETS", targets, M_PRECIOUS|M_NOEXPORT );
+ if( cmdmacs != NIL(char) ) FREE(cmdmacs);
+ if( targets != NIL(char) ) FREE(targets);
+
+ Def_macro( "MFLAGS", Buffer, M_PRECIOUS|M_NOEXPORT );
+ Def_macro( "%", "$@", M_PRECIOUS|M_NOEXPORT );
+
+ if( *Buffer ) Def_macro( "MAKEFLAGS", Buffer+1, M_PRECIOUS|M_NOEXPORT );
+
+ _warn = FALSE; /* disable warnings for builtin rules */
+ Target = TRUE; /* make sure we don't mark any of the default rules as
+ * potential targets. */
+ Make_rules(); /* Parse the strings stored in Rule_tab. */
+ _warn = TRUE;
+
+ /* If -r was not given find and parse startup-makefile. */
+ if( Rules ) {
+ char *fname;
+
+ /* Search_file() also checks the environment variable. */
+ if( (mkfil=Search_file("MAKESTARTUP", &fname)) != NIL(FILE) ) {
+ Parse(mkfil);
+ Def_macro( "MAKESTARTUP", fname, M_EXPANDED|M_MULTI|M_FORCE );
+ }
+ else
+ Fatal( "Configuration file `%s' not found", fname );
+ }
+
+ /* Define the targets set on the command line now. */
+ Target = FALSE; /* Will be set to TRUE when the default targets are set. */
+ for( cltarget = cltarget_first; cltarget != NIL(STRING); ) {
+ CELLPTR cp;
+ STRINGPTR nta = cltarget->st_next;
+
+ Add_prerequisite(Targets, cp = Def_cell(cltarget->st_string),
+ FALSE, FALSE);
+ cp->ce_flag |= F_TARGET;
+ cp->ce_attr |= A_FRINGE;
+ Target = TRUE;
+
+ FREE(cltarget->st_string);
+ FREE(cltarget);
+ cltarget = nta;
+ }
+
+ if( Get_env == 'E' ) _do_ReadEnvironment();
+
+ /* Search for and parse user makefile. */
+ if( fil_name != NIL(char) )
+ mkfil = Openfile( fil_name, FALSE, TRUE );
+ else {
+ /* Search .MAKEFILES dependent list looking for a makefile.
+ */
+ register CELLPTR cp;
+
+ cp = Def_cell( ".MAKEFILES" );
+ mkfil = TryFiles(cp->CE_PRQ);
+ }
+
+ if( mkfil != NIL(FILE) ) {
+ char *f = Filename();
+ char *p;
+
+ if( strcmp(f, "stdin") == 0 ) f = "-";
+ p = DmStrAdd( "-f", f, FALSE );
+ Def_macro( "MAKEFILE", p, M_PRECIOUS|M_NOEXPORT );
+ Parse( mkfil );
+ }
+ else if( !Rules )
+ Fatal( "No `makefile' present" );
+
+ if( Nest_level ) Fatal( "Missing .END for .IF" );
+ if( Get_env == 'e' ) _do_ReadEnvironment();
+
+ _do_VPATH(); /* kludge it up with .SOURCE */
+
+ if( Listing ) Dump(); /* print out the structures */
+ if( Trace ) Glob_attr &= ~A_SILENT; /* make sure we see the trace */
+
+ if( !Target )
+ Fatal( "No target" );
+ else {
+ Test_circle( Root, TRUE );
+ Check_circle_dfa();
+ }
+
+ if( m_export ) {
+ int i;
+
+ for( i=0; i<HASH_TABLE_SIZE; ++i ) {
+ HASHPTR hp = Macs[i];
+
+ while( hp ) {
+ if( !(hp->ht_flag & M_NOEXPORT) && hp->ht_value != NIL(char) )
+ if( Write_env_string(hp->ht_name, hp->ht_value) != 0 )
+ Warning( "Could not export %s", hp->ht_name );
+ hp = hp->ht_next;
+ }
+ }
+ }
+
+ if( Buffer != NIL(char) ) {FREE( Buffer ); Buffer = NIL(char);}
+ if( Trace ) Def_macro(".SEQUENTIAL", "y", M_EXPANDED);
+
+ ex_val = Make_targets();
+
+ Clear_signals();
+
+ /* Close fd for for @@-recipe silencing. */
+ if( close(zerofd) )
+ Fatal( "Error closing %s !", NULLDEV );
+ Epilog(ex_val); /* Does not return -- EVER */
+ return 0;
+}
+
+
+static void
+_do_f_flag( flag, name, fname )
+char flag;
+char *name;
+char **fname;
+{
+ if( *fname == NIL(char) ) {
+ if( name != NIL(char) ) {
+ *fname = name;
+ } else
+ Fatal("No file name for -%c", flag);
+ } else
+ Fatal("Only one `-%c file' allowed", flag);
+}
+
+
+static void
+_do_ReadEnvironment()
+{
+ t_attr saveattr = Glob_attr;
+
+ Glob_attr |= A_SILENT;
+ ReadEnvironment();
+ Glob_attr = saveattr;
+}
+
+
+static void
+_do_VPATH()
+{
+ HASHPTR hp;
+ char *_rl[2];
+ extern char **Rule_tab;
+
+ hp = GET_MACRO("VPATH");
+ if( hp == NIL(HASH) ) return;
+
+ _rl[0] = ".SOURCE :^ $(VPATH:s/:/ /)";
+ _rl[1] = NIL(char);
+
+ Rule_tab = _rl;
+ Parse( NIL(FILE) );
+}
+
+
+/* The file table and pointer to the next FREE slot for use by both
+ Openfile and Closefile. Each open stacks the new file onto the open
+ file stack, and a corresponding close will close the passed file, and
+ return the next file on the stack. The maximum number of nested
+ include files is limited by the value of MAX_INC_DEPTH */
+
+static struct {
+ FILE *file; /* file pointer */
+ char *name; /* name of file */
+ int numb; /* line number */
+} ftab[ MAX_INC_DEPTH ];
+
+static int next_file_slot = 0;
+
+/* Set the proper macro value to reflect the depth of the .INCLUDE directives
+ * and the name of the file we are reading.
+ */
+static void
+_set_inc_depth()
+{
+ char buf[10];
+ sprintf( buf, "%d", next_file_slot );
+ Def_macro( "INCDEPTH", buf, M_MULTI|M_NOEXPORT );
+ Def_macro( "INCFILENAME",
+ next_file_slot ? ftab[next_file_slot-1].name : "",
+ M_MULTI|M_NOEXPORT|M_EXPANDED );
+}
+
+
+PUBLIC FILE *
+Openfile(name, mode, err)/*
+===========================
+ This routine opens a file for input or output depending on mode.
+ If the file name is `-' then it returns standard input.
+ The file is pushed onto the open file stack. */
+char *name;
+int mode;
+int err;
+{
+ FILE *fil;
+
+ DB_ENTER("Openfile");
+
+ if( name == NIL(char) || !*name ) {
+ if( !err )
+ DB_RETURN(NIL(FILE));
+ else
+ Fatal( "Openfile: NIL filename" );
+ }
+
+ if( next_file_slot == MAX_INC_DEPTH )
+ Fatal( "Too many open files. Max nesting level is %d.", MAX_INC_DEPTH);
+
+ DB_PRINT( "io", ("Opening file [%s], in slot %d", name, next_file_slot) );
+
+ if( strcmp("-", name) == 0 ) {
+ name = "stdin";
+ fil = stdin;
+ }
+ else
+ fil = fopen( name, mode ? "w":"r" );
+
+ if( Verbose & V_FILE_IO )
+ printf( "%s: Openning [%s] for %s", Pname, name, mode?"write":"read" );
+
+ if( fil == NIL(FILE) ) {
+ if( Verbose & V_FILE_IO ) printf( " (fail)\n" );
+ if( err )
+ Fatal( mode ? "Cannot open file %s for write" : "File %s not found",
+ name );
+ }
+ else {
+ if( Verbose & V_FILE_IO ) printf( " (success)\n" );
+ ftab[next_file_slot].file = fil;
+ ftab[next_file_slot].numb = Line_number;
+ ftab[next_file_slot++].name = DmStrDup(name);
+ Line_number = 0;
+ _set_inc_depth();
+ }
+
+ DB_RETURN(fil);
+}
+
+
+PUBLIC FILE *
+Closefile()/*
+=============
+ This routine is used to close the last file opened. This forces make
+ to open files in a last open first close fashion. It returns the
+ file pointer to the next file on the stack, and NULL if the stack is empty.*/
+{
+ DB_ENTER("Closefile");
+
+ if( !next_file_slot )
+ DB_RETURN( NIL(FILE) );
+
+ if( ftab[--next_file_slot].file != stdin ) {
+ DB_PRINT( "io", ("Closing file in slot %d", next_file_slot) );
+
+ if( Verbose & V_FILE_IO )
+ printf( "%s: Closing [%s]\n", Pname, ftab[next_file_slot].name );
+
+ fclose( ftab[next_file_slot].file );
+ FREE( ftab[next_file_slot].name );
+ }
+
+ _set_inc_depth();
+
+ if( next_file_slot > 0 ) {
+ Line_number = ftab[next_file_slot].numb;
+ DB_RETURN( ftab[next_file_slot-1].file );
+ }
+ else
+ Line_number = 0;
+
+ DB_RETURN( NIL(FILE) );
+}
+
+
+PUBLIC FILE *
+Search_file( macname, rname )
+char *macname;
+char **rname;
+{
+ HASHPTR hp;
+ FILE *fil = NIL(FILE);
+ char *fname = NIL(char);
+ char *ename = NIL(char);
+
+ /* order of precedence is:
+ *
+ * MACNAME from command line (precious is marked)
+ * ... via MACNAME:=filename definition.
+ * MACNAME from environment
+ * MACNAME from builtin rules (not precious)
+ */
+
+ if( (hp = GET_MACRO(macname)) != NIL(HASH) ) {
+ /* Only expand if needed. */
+ if( hp->ht_flag & M_EXPANDED ) {
+ ename = fname = DmStrDup(hp->ht_value);
+ } else {
+ ename = fname = Expand(hp->ht_value);
+ }
+
+ if( hp->ht_flag & M_PRECIOUS ) fil = Openfile(fname, FALSE, FALSE);
+ }
+
+ if( fil == NIL(FILE) ) {
+ fname=Expand(Read_env_string(macname));
+ if( (fil = Openfile(fname, FALSE, FALSE)) != NIL(FILE) ) FREE(ename);
+ }
+
+ if( fil == NIL(FILE) && hp != NIL(HASH) )
+ fil = Openfile(fname=ename, FALSE, FALSE);
+
+ if( rname ) *rname = fname;
+
+ return(fil);
+}
+
+
+PUBLIC char *
+Filename()/*
+============
+ Return name of file on top of stack */
+{
+ return( next_file_slot==0 ? NIL(char) : ftab[next_file_slot-1].name );
+}
+
+
+PUBLIC int
+Nestlevel()/*
+=============
+ Return the file nesting level */
+{
+ return( next_file_slot );
+}
+
+
+PUBLIC FILE *
+TryFiles(lp)/*
+==============
+ Try to open a makefile, try to make it if needed and return a
+ filepointer to the first successful found or generated file.
+ The function returns NIL(FILE) if nothing was found. */
+LINKPTR lp;
+{
+ FILE *mkfil = NIL(FILE);
+
+ if( lp != NIL(LINK) ) {
+ int s_n, s_t, s_q;
+
+ s_n = Trace;
+ s_t = Touch;
+ s_q = Check;
+
+ Trace = Touch = Check = FALSE;
+ /* We are making a makefile. Wait for it. */
+ Makemkf = Wait_for_completion = TRUE;
+ mkfil = NIL(FILE);
+
+ for(; lp != NIL(LINK) && mkfil == NIL(FILE); lp=lp->cl_next) {
+ if( lp->cl_prq->ce_attr & A_FRINGE ) continue;
+
+ mkfil = Openfile( lp->cl_prq->CE_NAME, FALSE, FALSE );
+
+ /* Note that no error handling for failed Make() calls is possible
+ * as expected errors (no rule to make the makefile) or unexpected
+ * errors both return -1. */
+ if( mkfil == NIL(FILE) && Make(lp->cl_prq, NIL(CELL)) != -1 ) {
+ mkfil = Openfile( lp->cl_prq->CE_NAME, FALSE, FALSE );
+ /* Remove flags that indicate that the target was already made.
+ * This is also needed to avoid conflicts with the circular
+ * dependency check in rulparse(), see issues 62118 and 81296
+ * for details. */
+ Unmake(lp->cl_prq);
+ }
+ }
+
+ Trace = s_n;
+ Touch = s_t;
+ Check = s_q;
+ Makemkf = Wait_for_completion = FALSE;
+ }
+
+ return(mkfil);
+}
+
+
+/*
+** print error message from variable arg list
+*/
+
+static int errflg = TRUE;
+static int warnflg = FALSE;
+
+static void
+errargs(fmt, args)
+char *fmt;
+va_list args;
+{
+ int warn = _warn && warnflg && !(Glob_attr & A_SILENT);
+
+ if( errflg || warn ) {
+ char *f = Filename();
+
+ fprintf( stderr, "%s: ", Pname );
+ if( f != NIL(char) ) fprintf(stderr, "%s: line %d: ", f, Line_number);
+
+ if( errflg )
+ fprintf(stderr, "Error: -- ");
+ else if( warn )
+ fprintf(stderr, "Warning: -- ");
+
+ vfprintf( stderr, fmt, args );
+ putc( '\n', stderr );
+ if( errflg && !Continue ) Quit(0);
+ }
+}
+
+
+/*
+** Print error message and abort
+*/
+PUBLIC void
+Fatal(ARG(char *,fmt), ARG(va_alist_type,va_alist))
+DARG(char *,fmt)
+DARG(va_alist_type,va_alist)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ Continue = FALSE;
+ errargs(fmt, args);
+ va_end(args);
+}
+
+/*
+** error message and exit (unless -k)
+*/
+PUBLIC void
+Error(ARG(char *,fmt), ARG(va_alist_type,va_alist))
+DARG(char *,fmt)
+DARG(va_alist_type,va_alist)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ errargs(fmt, args);
+ va_end(args);
+}
+
+
+/*
+** non-fatal message
+*/
+PUBLIC void
+Warning(ARG(char *,fmt), ARG(va_alist_type,va_alist))
+DARG(char *,fmt)
+DARG(va_alist_type,va_alist)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ warnflg = TRUE;
+ errflg = FALSE;
+ errargs(fmt, args);
+ errflg = TRUE;
+ warnflg = FALSE;
+ va_end(args);
+}
+
+
+PUBLIC void
+No_ram()
+{
+ Fatal( "No more memory" );
+}
+
+
+PUBLIC void
+Usage( eflag )
+int eflag;
+{
+ register char *p;
+ char *fill;
+
+ fill = DmStrDup(Pname);
+ for(p=fill; *p; p++) *p=' ';
+
+ if( eflag ) {
+ fprintf(stderr, USAGE, Pname);
+ fprintf(stderr, USAGE2, fill);
+ }
+ else {
+ printf(USAGE, Pname);
+ printf(USAGE2, fill);
+ puts(" -P# - set max number of child processes for parallel make");
+ puts(" -f file - use file as the makefile");
+#ifdef MSDOS
+ puts(" -C [+]file - duplicate console output to file, ('+' => append)");
+#endif
+ puts(" -K file - use file as the .KEEP_STATE file");
+ puts(" -w target - show what you would do if 'target' were out of date");
+ puts(" -W target - rebuild pretending that 'target' is out of date");
+ puts(" -v[cdfimrtw] - verbose, indicate what we are doing, (-v => -vcdfimrtw)");
+ puts(" c => dump directory cache info only" );
+ puts(" d => dump change of directory info only" );
+ puts(" f => dump file open/close info only" );
+ puts(" i => dump inference information only" );
+ puts(" m => dump make of target information only" );
+ puts(" r => Force output of recipe lines and warnings," );
+ puts(" overrides -s" );
+ puts(" t => keep temporary files when done" );
+ puts(" w => issue non-essential warnings\n" );
+
+ puts(" -m[trae] - Measure timing information, (-m => -mt)");
+ puts(" t => display the start and end time of each target" );
+ puts(" r => display the start and end time of each recipe" );
+ puts(" a => display the target as an absolute path" );
+ puts(" e => display the timing of shell escape macros\n" );
+
+ puts("Options: (can be catenated, ie -irn == -i -r -n)");
+ puts(" -A - enable AUGMAKE special target mapping");
+ puts(" -B - enable the use of spaces instead of tabs to start recipes");
+ puts(" -c - use non standard comment scanning");
+ puts(" -d - do not use directory cache");
+ puts(" -E - define environment strings as macros");
+ puts(" -e - same as -E but done after parsing makefile");
+ puts(" -g - disable the special meaning of [ ... ] for group recipes");
+ puts(" -h - print out usage info");
+ puts(" -i - ignore errors");
+ puts(" -k - make independent targets, even if errors");
+ puts(" -n - trace and print, do not execute commands");
+ puts(" -p - print out a version of the makefile");
+ puts(" -q - check if target is up to date. Does not do");
+ puts(" anything. Returns 0 if up to date, 1 otherwise");
+ puts(" -r - don't use internal rules");
+ puts(" -s - do your work silently");
+ puts(" -S - disable parallel (force sequential) make, overrides -P");
+ puts(" -t - touch, update time stamps without executing commands");
+ puts(" -T - do not apply transitive closure on inference rules");
+ puts(" -u - force unconditional update of target");
+ puts(" -V - print out version number");
+ puts(" -x - export macro values to environment");
+ puts(" -X - ignore #! lines at start of makefile");
+ }
+
+ Quit(0);
+}
+
+
+PUBLIC void
+Version()
+{
+ extern char **Rule_tab;
+ char **p;
+
+ printf("%s - Version %s (%s)\n", Pname, VERSION, BUILDINFO);
+ printf("%s\n\n", sccid);
+
+ puts("Default Configuration:");
+ for (p=Rule_tab; *p != NIL(char); p++)
+ printf("\t%s\n", *p);
+
+ printf("\n");
+
+#if defined(HAVE_SPAWN_H) || defined(__CYGWIN__)
+ /* Only systems that have spawn ar concerned whether spawn or fork/exec
+ * are used. */
+#if ENABLE_SPAWN
+ printf("Subprocesses are executed using: spawn.\n\n");
+#else
+ printf("Subprocesses are executed using: fork/exec.\n\n");
+#endif
+#endif
+
+ printf("Please read the NEWS file for the latest release notes.\n");
+}
diff --git a/dmake/dmake.h b/dmake/dmake.h
new file mode 100644
index 000000000000..457031fdb50d
--- /dev/null
+++ b/dmake/dmake.h
@@ -0,0 +1,230 @@
+/* RCS $Id: dmake.h,v 1.8 2007-10-15 15:38:34 ihi Exp $
+--
+-- SYNOPSIS
+-- Global defines for dmake.
+--
+-- DESCRIPTION
+-- All the interesting bits and flags that dmake uses are defined here.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_INCLUDED_
+#define _DMAKE_INCLUDED_
+
+#define MAX_INC_DEPTH 10 /* max of ten nested include files */
+#define MAX_COND_DEPTH 20 /* max nesting level of conditionals */
+#define ERROR_EXIT_VALUE 255 /* return code of aborted make */
+#define CONTINUATION_CHAR '\\' /* line continuation \<nl> */
+#define DEF_ESCAPE_CHAR '\\' /* escape char for used chars */
+#define ESCAPE_CHAR *Escape_char
+#define COMMENT_CHAR '#' /* start of comment chars */
+#define TGT_DEP_SEP ':' /* separator for targets and dependents */
+#define CONDSTART '.' /* start of conditional token eg .IF */
+#define DEF_MAKE_PNAME "dmake"/* default name to use as name of make */
+
+
+/* ............... Hashing function constants ......................... */
+#define HASH_TABLE_SIZE 200 /* See hash.c for description */
+
+
+/* Bit flags for cells and macro definitions. */
+#define M_DEFAULT 0x0000 /* default flag value */
+#define M_MARK 0x0001 /* mark for circularity checks */
+#define M_PRECIOUS 0x0002 /* keep macro, same as A_PRE... */
+#define M_MULTI 0x0004 /* multiple redefinitions ok! */
+#define M_EXPANDED 0x0008 /* macro has been assigned after
+ * being completely expanded */
+#define M_USED 0x0010 /* macro has been used in the
+ * makefile. (From another macro
+ * or target definition.) */
+#define M_LITERAL 0x0020 /* don't strip w/s on macro def */
+#define M_NOEXPORT 0x0040 /* don't export macro for -x */
+#define M_FORCE 0x0080 /* Force a macro redefinition */
+#define M_PUSH 0x0100 /* Push previous macro defintn */
+#define M_INIT 0x0200 /* Macro is defined initially or
+ * an empty macro implicitly
+ * defined when expanding it. */
+#define M_VAR_BIT 0x1000 /* macro bit variable */
+#define M_VAR_CHAR 0x2000 /* macro char variable */
+#define M_VAR_STRING 0x4000 /* macro string variable */
+#define M_VAR_INT 0x8000 /* macro integer variable */
+
+#define M_VAR_MASK 0xf000 /* macro variable mask */
+
+
+
+/* Global and target attribute flag definitions.
+ * If you change the values of these or re-order them make appropriate changes
+ * in dmdump.c so that the output of dmake -p matches the attribute info for a
+ * target. */
+
+#define A_DEFAULT 0x00000 /* default flag value */
+#define A_PRECIOUS 0x00001 /* object is precious */
+#define A_SILENT 0x00002 /* don't echo commands */
+#define A_LIBRARY 0x00004 /* target is an archive */
+#define A_EPILOG 0x00008 /* insert shell epilog code */
+#define A_PROLOG 0x00010 /* insert shell prolog code */
+#define A_IGNORE 0x00020 /* ignore errors */
+#define A_SYMBOL 0x00040 /* lib member is a symbol */
+#define A_NOINFER 0x00080 /* no trans closure from cell */
+#define A_UPDATEALL 0x00100 /* all targets of rule modified */
+#define A_SEQ 0x00200 /* sequential make attribute */
+/* Reuse the sequential flag to signal Wait_for_completion to Do_cmnd()
+ * and related methods of executing a sub process. */
+#define A_WFC A_SEQ
+#define A_SETDIR 0x00400 /* cd to dir when making target */
+#define A_SHELL 0x00800 /* run the recipe using a shell */
+#define A_SWAP 0x01000 /* Use swap on MSDOS */
+/* Reuse A_SWAP for the .WINPATH attribute to convert cygwin POSIX paths
+ * into DOS style paths. */
+#define A_WINPATH 0x01000 /* Enable dos paths on cygwin */
+#define A_MKSARGS 0x02000 /* use MKS argument swapping */
+#define A_PHONY 0x04000 /* .PHONY attribute */
+#define A_NOSTATE 0x08000 /* don't track state for me */
+#define A_IGNOREGROUP 0x10000 /* Ignore group recipe */
+#define A_EXECUTE 0x20000 /* execute this recipe under -n */
+#define A_ERRREMOVE 0x40000 /* remove this target if error */
+#define MAX_ATTR A_ERRREMOVE /* highest valid attribute */
+#define A_LIBRARYM 0x80000 /* target is an archive member */
+#define A_FRINGE 0x100000 /* cell is on the fringe */
+#define A_COMPOSITE 0x200000 /* member of lib(targ) name */
+#define A_FFNAME 0x400000 /* if set, free ce_fname in stat*/
+#define A_UPDATED 0x800000 /* Used to mark cell as updated */
+#define A_ROOT 0x01000000 /* True if it is a root prereq */
+#define A_GROUP 0x02000000 /* True if rule is to be a group*/
+#define A_WHATIF 0x04000000 /* used for WHATIF tests */
+#define A_POOL 0x08000000 /* used for directory pool */
+#define A_ERROR 0x10000000 /* used to halt construction */
+#define A_FIRST 0x20000000 /* used for .INCLUDE termination*/
+#define A_SHELLESC 0x40000000 /* used for shell escape target */
+#define A_MUTE 0x80000000 /* silence a recipe line */
+
+
+/* Global and target bit flag definitions */
+
+#define F_DEFAULT 0x0000 /* default flag value */
+#define F_MARK 0x0001 /* circularity check mark */
+#define F_MULTI 0x0002 /* multiple rules for target */
+#define F_SINGLE 0x0004 /* exec recipes for each out of
+ * date prerequisite (! ruleop) */
+#define F_TARGET 0x0008 /* is set if a rule for a target exists.
+ * Prerequisites do not necessarily need
+ * to have a rule, in which case F_TARGET
+ * is not set. */
+#define F_RULES 0x0010 /* indicates target has rules */
+#define F_GROUP 0x0020 /* indicates that rules are to */
+ /* fed to the shell as a group */
+
+#define F_TRANS 0x0040 /* same as F_STAT not used tgthr*/
+#define F_STAT 0x0040 /* target already stated */
+#define F_VISITED 0x0080 /* Used for two different purposes:
+ make.c: Mark that a target is scheduled
+ to be made.
+ rulparse.c: Detect circular
+ dependencies. */
+#define F_SPECIAL 0x0100 /* marks a special target */
+#define F_DFA 0x0200 /* bit for marking added DFA */
+#define F_EXPLICIT 0x0400 /* explicit target in makefile */
+#define F_PERCENT 0x0800 /* marks a target as a % rule */
+#define F_REMOVE 0x1000 /* marks an intermediate target */
+#define F_MAGIC 0x2000 /* marks a magic target */
+#define F_INFER 0x4000 /* target is result of inference*/
+#define F_MADE 0x8000 /* target is currently made */
+
+
+/* Definitions for the Parser states */
+#define NORMAL_SCAN 0 /* normal processing state */
+#define RULE_SCAN 1 /* scan of rule text */
+
+/* definitions for macro operator types */
+#define M_OP_EQ 1 /* macro operation is '=' 0000 0001 */
+#define M_OP_CL 3 /* macro operation is ':=' 0000 0011 */
+#define M_OP_PL 5 /* macro operation is '+=' 0000 0101 */
+#define M_OP_DF 9 /* macro operation is '*=' 0000 1001 */
+#define M_OP_PLCL 7 /* macro operation is '+:=' 0000 0111 */
+#define M_OP_DFCL 11 /* macro operation is '*:=' 0000 1011 */
+#define M_OP_CM 17 /* macro operation is '?=' 0001 0001 */
+#define M_OP_SI 32 /* macro operation is '!' 0010 ---- */
+
+/* definitions for rule operator types */
+#define R_OP_CL 1 /* rule operation is ':' */
+#define R_OP_DCL 2 /* rule operation is '::' */
+#define R_OP_BG 4 /* rule operation is ':!' */
+#define R_OP_UP 8 /* rule operation is ':^' */
+#define R_OP_MI 16 /* rule operation is ':-' */
+#define R_OP_OR 32 /* rule operation is ':|' */
+
+/* definitions for modifier application in Apply_modifiers in expand.c */
+#define SUFFIX_FLAG 1 /* defines for macro modifier code */
+#define DIRECTORY_FLAG 2
+#define FILE_FLAG 4
+#define WHOLENAME_FLAGS 7
+#define TOLOWER_FLAG 8
+#define TOUPPER_FLAG 16
+#define INFNAME_FLAG 32
+#define JUST_FIRST_FLAG 64
+#define NORMPATH_FLAG 128
+
+/* special target definitions for use inside dmake */
+#define ST_IF 1
+#define ST_ELSE 2
+#define ST_END 3
+#define ST_REST 4 /* remaining special targets */
+#define ST_INCLUDE 5
+#define ST_SOURCE 7
+#define ST_EXPORT 8
+#define ST_IMPORT 9
+#define ST_ELIF 10
+#define ST_KEEP 11
+#define ST_EXIT 12
+#define ST_IFEQ 13
+#define ST_IFNEQ 14
+
+/* Flags for controling use of -v switch */
+#define V_NOFLAG 0x00 /* V_NONE is used in MinGW w32api/oleauto.h */
+#define V_LEAVE_TMP 0x01
+#define V_DIR_SET 0x02
+#define V_DIR_CACHE 0x04
+#define V_INFER 0x08
+#define V_MAKE 0x10
+#define V_FILE_IO 0x20
+#define V_WARNALL 0x40
+#define V_FORCEECHO 0x80
+#define V_ALL (V_LEAVE_TMP | V_DIR_SET | V_INFER | V_MAKE |\
+ V_FILE_IO | V_DIR_CACHE | V_WARNALL | V_FORCEECHO)
+
+/* Flags for controling use of -m switch */
+#define M_NOFLAG 0x00
+#define M_TARGET 0x01
+#define M_RECIPE 0x02
+#define M_ABSPATH 0x04
+#define M_SHELLESC 0x08
+#define M_ALL (M_TARGET | M_RECIPE | M_ABSPATH | M_SHELLESC)
+
+/* Macro definitions for use inside dmake */
+#define SET_TOKEN(A, B) (A)->tk_str = (B);\
+ (A)->tk_cchar = *(B);\
+ (A)->tk_quote = 1;
+
+#define CLEAR_TOKEN(A) *(A)->tk_str = (A)->tk_cchar
+#define GET_MACRO(A) Get_name(A, Macs, FALSE)
+#define iswhite(C) ((C == ' ') || (C == '\t'))
+#define STOBOOL(A) (A && ((*A | 0x20) == 'y'))
+
+#endif
+
diff --git a/dmake/dmakeroot.h.in b/dmake/dmakeroot.h.in
new file mode 100644
index 000000000000..fe597de2378a
--- /dev/null
+++ b/dmake/dmakeroot.h.in
@@ -0,0 +1,6 @@
+ /* dmakeroot.h
+ *
+ * This is a generated file. Please modify `configure.in'
+ */
+
+@DMAKEROOT_H_LINE1@
diff --git a/dmake/dmdump.c b/dmake/dmdump.c
new file mode 100644
index 000000000000..631359758a05
--- /dev/null
+++ b/dmake/dmdump.c
@@ -0,0 +1,287 @@
+/* RCS $Id: dmdump.c,v 1.4 2007-06-12 06:05:11 obo Exp $
+--
+-- SYNOPSIS
+-- Dump the internal dag to stdout.
+--
+-- DESCRIPTION
+-- This file contains the routine that is called to dump a version of
+-- the digested makefile to the standard output. May be useful perhaps
+-- to the ordinary user, and invaluable for debugging make.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+#define M_TEST (M_PRECIOUS | M_VAR_MASK)
+
+static void dump_name ANSI((CELLPTR, int, int));
+static void dump_normal_target ANSI((CELLPTR, CELLPTR, int));
+static void dump_prerequisites ANSI((LINKPTR, CELLPTR, int, int, int));
+static void dump_conditionals ANSI((CELLPTR,STRINGPTR,int,int));
+static void dump_macro ANSI((HASHPTR, int));
+
+
+PUBLIC void
+Dump()/*
+======== Dump onto standard output the digested makefile. Note that
+ the form of the dump is not representative of the contents
+ of the original makefile contents at all */
+{
+ HASHPTR hp;
+ int i;
+
+ DB_ENTER( "Dump" );
+
+ puts( "# Dump of dmake macro variables:" );
+ for( i=0; i<HASH_TABLE_SIZE; i++)
+ for( hp=Macs[i]; hp != NIL(HASH); hp = hp->ht_next ) {
+ int flag = hp->ht_flag;
+ dump_macro(hp, flag);
+ }
+
+ puts( "\n#====================================" );
+ puts( "# Dump of targets:\n" );
+
+ for( i=0; i<HASH_TABLE_SIZE; i++ )
+ for( hp = Defs[i]; hp != NIL(HASH); hp = hp->ht_next )
+ if( !(hp->CP_OWNR->ce_flag & F_PERCENT) ) {
+ if( hp->CP_OWNR == Root )
+ puts( "# ******* ROOT TARGET ********" );
+ if (Targets->ce_prq && hp->CP_OWNR == Targets->ce_prq->cl_prq)
+ puts( "# ******* FIRST USER DEFINED TARGET ******" );
+ dump_normal_target( hp->CP_OWNR,NIL(CELL),hp->CP_OWNR->ce_flag);
+ }
+
+ puts( "\n#====================================" );
+ puts( "# Dump of inference graph\n" );
+
+ for( i=0; i<HASH_TABLE_SIZE; i++ )
+ for( hp = Defs[i]; hp != NIL(HASH); hp = hp->ht_next )
+ if( (hp->CP_OWNR->ce_flag & F_PERCENT) &&
+ !(hp->CP_OWNR->ce_flag & F_MAGIC) )
+ dump_normal_target(hp->CP_OWNR,NIL(CELL),hp->CP_OWNR->ce_flag);
+
+ DB_VOID_RETURN;
+}
+
+
+
+PUBLIC void
+Dump_recipe( sp )/*
+===================
+ Given a string pointer print the recipe line out */
+STRINGPTR sp;
+{
+ char *st;
+ char *nl;
+
+ if( sp == NIL(STRING) ) return;
+
+ putchar( '\t' );
+ if( sp->st_attr & A_SILENT ) putchar( '@' );
+ if( sp->st_attr & A_IGNORE ) putchar( '-' );
+ if( sp->st_attr & A_SHELL ) putchar( '+' );
+ if( sp->st_attr & A_SWAP ) putchar( '%' );
+
+ st = sp->st_string;
+ for( nl=strchr(st,'\n'); nl != NIL( char); nl=strchr(st,'\n') ) {
+ *nl = '\0';
+ printf( "%s\\\n", st );
+ *nl = '\n';
+ st = nl+1;
+ }
+ printf( "%s\n", st );
+}
+
+
+static char *_attrs[] = { ".PRECIOUS", ".SILENT", ".LIBRARY",
+ ".EPILOG", ".PROLOG", ".IGNORE", ".SYMBOL", ".NOINFER",
+ ".UPDATEALL", ".SEQUENTIAL", ".SETDIR=", ".USESHELL",
+#if defined(MSDOS)
+ ".SWAP",
+#else
+# if defined(__CYGWIN__)
+ ".WINPATH",
+# else
+ "- unused -",
+# endif
+#endif
+ ".MKSARGS",
+ ".PHONY", ".NOSTATE", ".IGNOREGROUP", ".EXECUTE", ".ERRREMOVE" };
+
+static void
+dump_normal_target( cp, namecp, flag )/*
+========================================
+ Dump in makefile like format the dag information */
+CELLPTR cp;
+CELLPTR namecp;
+int flag;
+{
+ register STRINGPTR sp;
+ t_attr attr;
+ unsigned int k;
+
+ DB_ENTER( "dump_normal_target" );
+
+ if(!(cp->ce_flag & F_TARGET) && !cp->ce_attr && !cp->ce_prq) {
+ DB_VOID_RETURN;
+ }
+
+ if(cp->ce_set && cp->ce_set != cp) {
+ DB_VOID_RETURN;
+ }
+
+ if( cp->ce_flag & F_MULTI ) {
+ /* recursively print multi or %-targets. */
+ int tflag = cp->ce_prq->cl_prq->ce_flag;
+ if( !(cp->ce_flag & F_PERCENT) ) tflag |= F_MULTI;
+ dump_conditionals(cp, cp->ce_cond, TRUE, TRUE);
+ putchar('\n');
+
+#ifdef DBUG
+ /* Output also master targtet. (Only in debug builds) */
+ printf("Master name(s) (DBUG build): ");
+ dump_name(cp, FALSE, TRUE );
+ putchar('\n');
+#endif
+
+ /* %-targets set namecp (3rd parameter) to NULL so that the next
+ * recursive dump_normal_target() prints the name of cp->ce_prq->cl_prq
+ * instead of cp. This should be the same unless CeMeToo(cp) points
+ * to a cell that is the head of an .UPDATEALL list. */
+ dump_prerequisites(cp->ce_prq,(cp->ce_flag&F_PERCENT)?NIL(CELL):cp,
+ FALSE, TRUE, tflag);
+ }
+ else {
+ dump_name(namecp?namecp:cp, FALSE, TRUE );
+
+ for( k=0, attr=1; attr <= MAX_ATTR; attr <<= 1, k++ )
+ if( cp->ce_attr & attr ) {
+ printf( "%s%s ", _attrs[k],
+ (attr != A_SETDIR) ? "" : (cp->ce_dir?cp->ce_dir:"") );
+ }
+
+ putchar( ':' );
+
+ if( flag & F_MULTI ) putchar( ':' );
+ if( flag & F_SINGLE ) putchar( '!' );
+ putchar( ' ' );
+
+ dump_prerequisites( cp->ce_prq, NIL(CELL), FALSE, FALSE, F_DEFAULT);
+ dump_prerequisites( cp->ce_indprq, NIL(CELL),TRUE, FALSE, F_DEFAULT);
+
+ putchar( '\n' );
+ if( cp->ce_flag & F_GROUP ) puts( "[" );
+ for( sp = cp->ce_recipe; sp != NIL(STRING); sp = sp->st_next )
+ Dump_recipe( sp );
+ if( cp->ce_flag & F_GROUP ) {
+ puts( "]" );
+ putchar( '\n' );
+ }
+ dump_conditionals(cp, cp->ce_cond, flag&F_MULTI, FALSE);
+ putchar('\n');
+ }
+
+ DB_VOID_RETURN;
+}
+
+
+static void
+dump_conditionals( cp, sp, multi, global )
+CELLPTR cp;
+STRINGPTR sp;
+int multi;
+int global;
+{
+ if (sp) {
+ dump_name(cp, FALSE, TRUE);
+ printf(".%sCONDITIONALS %s\n", global?"GLOBAL":"",multi?"::":":");
+
+ while(sp) {
+ printf("\t%s\n",sp->st_string);
+ sp=sp->st_next;
+ }
+ }
+}
+
+
+static void
+dump_macro(hp, flag)
+HASHPTR hp;
+int flag;
+{
+ printf( "%s ", hp->ht_name );
+ if(flag & M_EXPANDED)
+ putchar( ':' );
+
+ printf( "= " );
+ if(hp->ht_value != NIL(char))
+ printf( "%s",hp->ht_value );
+
+ if(flag & M_PRECIOUS)
+ printf( "\t # PRECIOUS " );
+
+ putchar( '\n' );
+}
+
+
+static void
+dump_prerequisites( lp, namecp, quote, recurse, flag )/*
+========================================================
+ Dump as prerequisites if recurse is FALSE or as targets
+ if recurse is TRUE. (For F_MULTI/F_PERCENT targets.) */
+LINKPTR lp;
+CELLPTR namecp;
+int quote;
+int recurse;
+int flag;
+{
+ for( ; lp; lp=lp->cl_next )
+ if( recurse )
+ dump_normal_target(lp->cl_prq, namecp, flag);
+ else if( lp->cl_prq )
+ dump_name(lp->cl_prq, quote, FALSE);
+}
+
+
+static void
+dump_name( cp, quote, all )/*
+=============================
+ Prints out the first or all (if all is TRUE) names of an lcell list.
+ If quote is true enclose in ' quotes, if quote
+ is FALSE and the name includes a space enclose in " quotes. */
+CELLPTR cp;
+int quote;
+int all;
+{
+ LINKPTR lp;
+ char qc = '\'';
+
+ for(lp=CeMeToo(cp);lp;lp=lp->cl_next) {
+ if( !quote && strchr(lp->cl_prq->CE_NAME,' ') != NIL(char)) {
+ quote = TRUE;
+ qc = '"';
+ }
+
+ if (quote) putchar(qc);
+ printf( "%s", lp->cl_prq->CE_NAME );
+ if (quote) putchar(qc);
+ putchar(' ');
+ if (!all) break;
+ }
+}
diff --git a/dmake/dmstring.c b/dmake/dmstring.c
new file mode 100644
index 000000000000..9659fc406768
--- /dev/null
+++ b/dmake/dmstring.c
@@ -0,0 +1,300 @@
+/* RCS $Id: dmstring.c,v 1.2 2007-01-18 09:29:40 vg Exp $
+--
+-- SYNOPSIS
+-- String handling code
+--
+-- DESCRIPTION
+-- Routines to handle string manipulation. This code is not specific
+-- to dmake and has/and will be used in other programs. The string
+-- "" is considered the NULL string, if NIL(char) is received instead
+-- undefined results may occurr. (In reality NIL(char) is checked for
+-- but in general it is not safe to assume NIL(char) == NULL)
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+PUBLIC char *
+DmStrJoin( src, data, n, fr )/*
+===============================
+ Join data to src according to value of n.
+
+ n = -1 - return strcat( src, data )
+ n >= 0 - return strncat( src, data, n )
+
+ FREE original src if fr == TRUE, else leave it alone */
+
+char *src;
+char *data;
+int n;
+int fr;
+{
+ char *t;
+ int l;
+ int flag = FALSE;
+
+ DB_ENTER( "DmStrJoin" );
+
+ if( src == NIL(char) ) { src = ""; flag = TRUE; }
+ if( data == NIL(char) ) data = "";
+ DB_PRINT( "str", ("Joining [%s] [%s] %d", src, data, n) );
+
+ if( n == -1 ) n = strlen( data );
+
+ l = strlen( src ) + n + 1;
+ if( (t = MALLOC( l, char )) == NIL(char) ) No_ram();
+
+ strcpy( t, src );
+ if (n) strncat( t, data, n );
+ t[ l-1 ] = '\0';
+
+ if( !flag && fr ) FREE( src );
+
+ DB_PRINT( "str", ("Result [%s]", t) );
+ DB_RETURN( t );
+}
+
+
+
+
+PUBLIC char *
+DmStrAdd( src, data, fr )/*
+===========================
+ append data to src with space in between if src is not NIL(char) or ""
+ and free both src and data if fr == TRUE, otherwise leave them be */
+
+char *src;
+char *data;
+int fr;
+{
+ char *t;
+ int l;
+ int sflag;
+ int dflag;
+
+ DB_ENTER( "DmStrAdd" );
+
+ sflag = dflag = fr;
+
+ if( src == NIL(char) ) { src = ""; sflag = FALSE; }
+ if( data == NIL(char) ) { data = ""; dflag = FALSE; }
+ DB_PRINT( "str", ("Adding [%s] [%s] %d", src, data, fr) );
+
+ l = strlen(src) + strlen(data) + 1;
+ if( *src ) l++;
+
+ if( (t = MALLOC( l, char )) == NIL(char) ) No_ram();
+
+ strcpy( t, src );
+
+ if( *data )
+ {
+ if( *src ) strcat( t, " " );
+ strcat( t, data );
+ }
+
+ if( sflag ) FREE( src );
+ if( dflag ) FREE( data );
+
+ DB_PRINT( "str", ("Result [%s]", t) );
+ DB_RETURN( t );
+}
+
+
+
+PUBLIC char *
+DmStrApp( src1, src2 )/*
+========================
+ Append two strings together, and return the result with a space between
+ the two strings. FREE the first string if it is not NIL and always
+ leave the second string be. */
+char *src1;
+char *src2;
+{
+ src2 = DmStrAdd( src1, src2, FALSE );
+ if( src1 != NIL(char) ) FREE( src1 );
+ return( src2 );
+}
+
+
+PUBLIC char *
+DmStrDup( str )/*
+================= Duplicate the contents of a string, by using malloc */
+char *str;
+{
+ char *t;
+
+ if( str == NIL(char) ) return( NIL(char) );
+
+ if( (t = MALLOC( strlen( str )+1, char )) == NIL(char) ) No_ram();
+ strcpy( t, str );
+
+ return( t );
+}
+
+
+
+PUBLIC char *
+DmStrDup2( str )/*
+==================
+ This function is used solely to properly quote command line arguments when
+ they are reinserted int MAKEMACROS so that they can be used further in
+ a processing line. */
+char *str;
+{
+ char *t;
+ size_t size;
+ size_t alloced;
+ char *tmp;
+ char *dest;
+ int seen_equal = 0;
+
+ if(str == NIL(char)) return(NIL(char));
+ size = strlen(str) + 1;
+ alloced = size + 2; /* for two quotes */
+
+ for(tmp = str; *tmp; tmp++)
+ if(*tmp == '"')
+ alloced++;
+
+ if((t = MALLOC(alloced, char)) == NIL(char)) No_ram();
+
+ for(tmp = str, dest = t; *tmp; tmp++, dest++) {
+ if(*tmp == '=' && !seen_equal) {
+ seen_equal = 1;
+ *dest++ = *tmp;
+ *dest = '"';
+ continue;
+ }
+ if(*tmp == '"')
+ *dest++ = '\\';
+ *dest = *tmp;
+ }
+
+ if(!seen_equal)
+ Fatal("DmStrDup2 invoked without argument of form x=y\n");
+
+ *dest++ = '"';
+ *dest = 0;
+
+ return t;
+}
+
+
+
+PUBLIC char *
+DmStrPbrk( s1, s2 )/*
+====================
+ find first occurence of char in s2 in string s1.
+ Returns a pointer to the first occurrence. NOTE '\0' is considered part
+ of s2 and a pointer to it is returned if no other chars match. */
+
+char *s1;
+char *s2;
+{
+ register char *t;
+
+ if( s1 == NIL(char) || s2 == NIL(char) ) return( "" );
+
+ for( t=s1; *t && (strchr( s2, *t ) == NIL(char)); t++ );
+ return( t );
+}
+
+
+
+
+PUBLIC char *
+DmStrSpn( s1, s2 )/*
+====================
+ return pointer to first char in s1 that does not belong to s2.
+ Returns the pointer if match found, else returns pointer to null char
+ in s1. (ie. "" ) */
+
+char *s1;
+char *s2;
+{
+ register char *t;
+
+ if( s1 == NIL(char) || s2 == NIL(char) ) return( "" );
+
+ for( t=s1; *t && (strchr( s2, *t ) != NIL(char)); t++ );
+ return( t );
+}
+
+
+
+
+PUBLIC char *
+DmStrStr( s1, s2 )/*
+==================== find first occurrence in s1 of s2 */
+char *s1;
+char *s2;
+{
+ register char *s;
+ register char *p;
+ register char *r;
+
+ if( s1 != NIL(char) && s2 != NIL(char) )
+ for( s=s1; *s; s++ )
+ if( *s == *s2 )
+ {
+ for( r=s+1, p = s2+1; *p && (*r == *p); r++, p++ );
+ if( !*p ) return( s );
+ }
+
+ return( NIL(char) );
+}
+
+
+
+PUBLIC char *
+DmSubStr( s, e )/*
+==================
+ Return the string between the two pointers s and e, not including the
+ char that e points to. NOTE: This routine assumes that s and e point
+ into the same string. */
+
+char *s;
+char *e;
+{
+ char save;
+ int len = e-s;
+
+ if( len < 0 || len > strlen(s) )
+ Fatal( "Internal Error: SubStr fails consistency test" );
+
+ save = *e;
+ *e = '\0';
+ s = DmStrDup( s );
+ *e = save;
+
+ return( s );
+}
+
+
+/* Provide "missing" string function. */
+#ifndef HAVE_STRLWR
+char *
+strlwr(char *s)
+{
+ char *p;
+ for(p=s; *p; p++ )
+ *p = tolower(*p);
+ return s;
+}
+#endif
diff --git a/dmake/dstdarg.h b/dmake/dstdarg.h
new file mode 100644
index 000000000000..f0dc760b5db4
--- /dev/null
+++ b/dmake/dstdarg.h
@@ -0,0 +1,43 @@
+/* RCS $Id: dstdarg.h,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $
+--
+-- SYNOPSIS
+--
+-- DESCRIPTION
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#include <stdarg.h>
+
+#define ARG(a,b) a
+
+#if __STDC__ || defined(__TURBOC__) || defined(__IBMC__)
+# define va_alist_type ...
+# ifdef va_alist
+# undef va_alist
+# endif
+# define va_alist
+# define DARG(a,b)
+#else
+# ifdef va_alist
+# define va_alist_type int
+# define DARG(a,b) a b;
+# else
+# define va_alist_type ...
+# define va_alist
+# define DARG(a,b)
+# endif
+#endif
diff --git a/dmake/expand.c b/dmake/expand.c
new file mode 100644
index 000000000000..b7232303177e
--- /dev/null
+++ b/dmake/expand.c
@@ -0,0 +1,1204 @@
+/* $RCSfile: expand.c,v $
+-- $Revision: 1.8 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:38:46 $
+--
+-- SYNOPSIS
+-- Macro expansion code.
+--
+-- DESCRIPTION
+--
+-- This routine handles all the necessary junk that deals with macro
+-- expansion. It understands the following syntax. If a macro is
+-- not defined it expands to NULL, and {} are synonyms for ().
+--
+-- $$ - expands to $
+-- {{ - expands to {
+-- }} - expands to }
+-- $A - expands to whatever the macro A is defined as
+-- $(AA) - expands to whatever the macro AA is defined as
+-- $($(A)) - represents macro indirection
+-- <+...+> - get mapped to $(mktmp ...)
+--
+-- following macro is recognized
+--
+-- string1{ token_list }string2
+--
+-- and expands to string1 prepended to each element of token_list and
+-- string2 appended to each of the resulting tokens from the first
+-- operation. If string2 is of the form above then the result is
+-- the cross product of the specified (possibly modified) token_lists.
+--
+-- The folowing macro modifiers are defined and expanded:
+--
+-- $(macro:modifier_list:modifier_list:...)
+--
+-- where modifier_list a combination of:
+--
+-- D or d - Directory portion of token including separator
+-- F or f - File portion of token including suffix
+-- B or b - basename portion of token not including suffix
+-- E or e - Suffix portion of name
+-- L or l - translate to lower case
+-- U or u - translate to upper case
+-- I or i - return inferred names
+-- N or n - return normalized paths
+-- 1 - return the first white space separated token
+--
+-- or a single one of:
+-- M or m - map escape codes
+-- S or s - pattern substitution (simple)
+-- T or t - for tokenization
+-- ^ - prepend a prefix to each token
+-- + - append a suffix to each token
+--
+-- NOTE: Modifiers are applied once the macro value has been found.
+-- Thus the construct $($(test):s/joe/mary/) is defined and
+-- modifies the value of $($(test))
+--
+-- Also the construct $(m:d:f) is not the same as $(m:df)
+-- the first applies d to the value of $(m) and then
+-- applies f to the value of that whereas the second form
+-- applies df to the value of $(m).
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+/* Microsoft BRAINDAMAGE ALERT!!!!
+ * This #ifdef is here only to satisfy stupid bugs in MSC5.0 and MSC5.1
+ * it isn't needed for anything else. It turns loop optimization off. */
+#if defined(_MSV_VER) && _MSC_VER < 600
+#include "optoff.h"
+#endif
+
+static char* _scan_macro ANSI((char*, char**, int));
+static char* _scan_brace ANSI((char*, char**, int*));
+static char* _cross_prod ANSI((char*, char*));
+
+#if !defined(__GNUC__) && !defined(__IBMC__)
+static char* _scan_ballanced_parens ANSI((char*, char));
+#else
+static char* _scan_ballanced_parens ANSI((char*, int));
+#endif
+
+
+PUBLIC char *
+Expand( src )/*
+===============
+ This is the driver routine for the expansion, it identifies non-white
+ space tokens and gets the ScanToken routine to figure out if they should
+ be treated in a special way. */
+
+char *src; /* pointer to source string */
+{
+ char *tmp; /* pointer to temporary str */
+ char *res; /* pointer to result string */
+ char *start; /* pointer to start of token */
+
+ DB_ENTER( "Expand" );
+ DB_PRINT( "exp", ("Expanding [%s]", src) );
+
+ res = DmStrDup( "" );
+ if( src == NIL(char) ) DB_RETURN( res );
+
+ while( *src ) {
+ char *ks, *ke;
+
+ /* Here we find the next non white space token in the string
+ * and find it's end, with respect to non-significant white space. */
+
+#if !defined( _MPW) && !defined(__EMX__)
+ start = DmStrSpn( src, " \t\n" );
+#else
+ start = DmStrSpn( src, " \t\r\n" );
+#endif
+
+ res = DmStrJoin( res, src, start-src, TRUE );
+ if( !(*start) ) break;
+
+ /* START <+...+> KLUDGE */
+ if( (ks=DmStrStr(start,"<+")) != NIL(char)
+ && (ke=DmStrStr(ks,"+>")) != NIL(char) ){
+ char *t1, *t2;
+
+ res = DmStrJoin( res, t2=Expand(t1=DmSubStr(start,ks)), -1, TRUE);
+ FREE(t1); FREE(t2);
+
+ t1 = DmSubStr(ks+2, ke+1); t1[ke-ks-2] = ')';
+ t2 = DmStrJoin( "$(mktmp ", t1, -1,FALSE);
+ FREE(t1);
+ res = DmStrJoin( res, t2=Expand(t2), -1, TRUE);
+ FREE(t2);
+ src = ke+2;
+ }
+ /* END <+...+> KLUDGE */
+ else {
+ res = DmStrJoin( res, tmp = ScanToken(start,&src,TRUE), -1, TRUE );
+ FREE( tmp );
+ }
+ }
+
+ DB_PRINT( "exp", ("Returning [%s]", res) );
+ DB_RETURN( res );
+}
+
+
+PUBLIC char *
+Apply_edit( src, pat, subst, fr, anchor )/*
+===========================================
+ Take the src string and apply the pattern substitution. ie. look for
+ occurrences of pat in src and replace each occurrence with subst. This is
+ NOT a regular expressions pattern substitution, it's just not worth it.
+
+ if anchor == TRUE then the src pattern match must be at the end of a token.
+ ie. this is for SYSV compatibility and is only used for substitutions of
+ the caused by $(macro:pat=sub). So if src = "fre.o.k june.o" then
+ $(src:.o=.a) results in "fre.o.k june.a", and $(src:s/.o/.a) results in
+ "fre.a.k june.a" */
+
+char *src; /* the source string */
+char *pat; /* pattern to find */
+char *subst; /* substitute string */
+int fr; /* if TRUE free src */
+int anchor; /* if TRUE anchor */
+{
+ char *res;
+ char *p;
+ char *s;
+ int l;
+
+ DB_ENTER( "Apply_edit" );
+
+ /* do nothing if pat is NULL or pat and subst are equal */
+ if( !*pat || !strcmp(pat,subst) ) DB_RETURN( src );
+
+ DB_PRINT( "mod", ("Source str: [%s]", src) );
+ DB_PRINT( "mod", ("Replacing [%s], with [%s]", pat, subst) );
+
+ /* FIXME: This routine is used frequently and has room for optimizations */
+ s = src;
+ l = strlen( pat );
+ if( (p = DmStrStr( s, pat )) != NIL(char) ) {
+ res = DmStrDup( "" );
+ do {
+ if( anchor )
+ if( !*(p+l) || (strchr(" \t", *(p+l)) != NIL(char)) )
+ res = DmStrJoin( DmStrJoin(res,s,p-s,TRUE), subst, -1, TRUE );
+ else
+ res = DmStrJoin( res, s, p+l-s, TRUE );
+ else
+ res = DmStrJoin( DmStrJoin(res,s,p-s,TRUE), subst, -1, TRUE );
+
+ s = p + l;
+ }
+ while( (p = DmStrStr( s, pat )) != NIL(char) );
+
+ res = DmStrJoin( res, s, -1, TRUE );
+ if( fr ) FREE( src );
+ }
+ else
+ res = src;
+
+
+ DB_PRINT( "mod", ("Result [%s]", res) );
+ DB_RETURN( res );
+}
+
+
+PUBLIC void
+Map_esc( tok )/*
+================
+ Map an escape sequence and replace it by it's corresponding character
+ value. It is assumed that tok points at the initial \, the esc
+ sequence in the original string is replaced and the value of tok
+ is not modified. */
+char *tok;
+{
+ if( strchr( "\"\\vantbrf01234567", tok[1] ) ) {
+ size_t len;
+ switch( tok[1] ) {
+ case 'a' : *tok = 0x07; break;
+ case 'b' : *tok = '\b'; break;
+ case 'f' : *tok = '\f'; break;
+ case 'n' : *tok = '\n'; break;
+ case 'r' : *tok = '\r'; break;
+ case 't' : *tok = '\t'; break;
+ case 'v' : *tok = 0x0b; break;
+ case '\\': *tok = '\\'; break;
+ case '\"': *tok = '\"'; break;
+
+ default: {
+ register int i = 0;
+ register int j = 0;
+ for( ; i<2 && isdigit(tok[2]); i++ ) {
+ j = (j << 3) + (tok[1] - '0');
+ len = strlen(tok+2)+1;
+ memmove( tok+1, tok+2, len );
+ }
+ j = (j << 3) + (tok[1] - '0');
+ *tok = j;
+ }
+ }
+ len = strlen(tok+2)+1;
+ memmove( tok+1, tok+2, len );
+ }
+}
+
+
+PUBLIC char*
+Apply_modifiers( mod, src )/*
+=============================
+ This routine applies the appropriate modifiers to the string src
+ and returns the proper result string */
+
+int mod;
+char *src;
+{
+ char *s;
+ char *e;
+ char *res;
+ TKSTR str;
+
+ DB_ENTER( "Apply_modifiers" );
+
+ if ( mod & INFNAME_FLAG ) {
+ SET_TOKEN( &str, src );
+ e = NIL(char);
+
+ while( *(s = Get_token( &str, "", FALSE )) != '\0' ) {
+ HASHPTR hp;
+
+ if ( (hp = Get_name(normalize_path(s), Defs, FALSE)) != NIL(HASH)
+ && hp->CP_OWNR
+ && hp->CP_OWNR->ce_fname
+ ) {
+ res = hp->CP_OWNR->ce_fname;
+ }
+ else
+ res = s;
+
+ if(str.tk_quote == 0) {
+ /* Add leading quote. */
+ e = DmStrApp(e, "\"");
+ e = DmStrJoin(e, res, -1, TRUE);
+ /* Append the trailing quote. */
+ e = DmStrJoin(e, "\"", 1, TRUE);
+ } else {
+ e = DmStrApp(e, res);
+ }
+
+ }
+
+ FREE(src);
+ src = e;
+ mod &= ~INFNAME_FLAG;
+ }
+
+ if ( mod & NORMPATH_FLAG ) {
+ e = exec_normpath(src);
+
+ FREE(src);
+ src = e;
+ mod &= ~NORMPATH_FLAG;
+ }
+
+ if(mod & (TOLOWER_FLAG|TOUPPER_FLAG) ) {
+ int lower;
+ lower = mod & TOLOWER_FLAG;
+
+ for (s=src; *s; s++)
+ if ( isalpha(*s) )
+ *s = ((lower) ? tolower(*s) : toupper(*s));
+
+ mod &= ~(TOLOWER_FLAG|TOUPPER_FLAG);
+ }
+
+ if (mod & JUST_FIRST_FLAG) {
+ SET_TOKEN(&str, src);
+ if ((s = Get_token(&str,"",FALSE)) != '\0') {
+ /* Recycle the quote at the beginning. */
+ if(str.tk_quote == 0) {
+ s--;
+ }
+ e = DmStrDup(s);
+ /* Add trailing quote. */
+ if(str.tk_quote == 0) {
+ e = DmStrJoin(e, "\"", 1, TRUE);
+ }
+
+ CLEAR_TOKEN(&str);
+ FREE(src);
+ src = e;
+ }
+ else {
+ CLEAR_TOKEN(&str);
+ }
+ mod &= ~JUST_FIRST_FLAG;
+ }
+
+ if( !mod || mod == (SUFFIX_FLAG | DIRECTORY_FLAG | FILE_FLAG) )
+ DB_RETURN( src );
+
+ SET_TOKEN( &str, src );
+ DB_PRINT( "mod", ("Source string [%s]", src) );
+ res = DmStrDup("");
+
+ while( *(s = Get_token( &str, "", FALSE )) != '\0' ) {
+ char *tokstart = s;
+
+ /* search for the directory portion of the filename. If the
+ * DIRECTORY_FLAG is set, then we want to keep the directory portion
+ * othewise throw it away and blank out to the end of the token */
+
+ if( (e = Basename(s)) != s) {
+ if( !(mod & DIRECTORY_FLAG) ) {
+ /* Move the basename to the start. */
+ size_t len = strlen(e)+1;
+ memmove(s, e, len);
+ }
+ else
+ s = e;
+ }
+ /* s now points to the start of the basename. */
+
+
+ /* search for the suffix, if there is none, treat it as a NULL suffix.
+ * if no file name treat it as a NULL file name. same copy op as
+ * for directory case above */
+
+ e = strrchr( s, '.' ); /* NULL suffix if e=0 */
+ if( e == NIL(char) ) e = s+strlen(s);
+
+ if( !(mod & FILE_FLAG) ) {
+ /* Move the suffix to the start. */
+ size_t len = strlen(e)+1;
+ memmove(s, e, len);
+ }
+ else
+ s = e;
+
+ /* s now points to the start of the suffix. */
+
+
+ /* The last and final part. This is the suffix case, if we don't want
+ * it then just erase it. */
+
+ if( s != NIL(char) )
+ if( !(mod & SUFFIX_FLAG) && s != str.tk_str )
+ *s = '\0';
+
+
+ /* only keep non-empty tokens. (This also discards empty quoted ""
+ * tokens.) */
+ if( strlen(tokstart) ) {
+ /* Recycle the quote at the beginning. */
+ if(str.tk_quote == 0) {
+ tokstart--;
+ }
+ res = DmStrApp(res, tokstart);
+ /* Add trailing quote. */
+ if(str.tk_quote == 0) {
+ res = DmStrJoin(res, "\"", 1, TRUE);
+ }
+ }
+ }
+
+ FREE(src);
+ src = res;
+
+
+ DB_PRINT( "mod", ("Result string [%s]", src) );
+ DB_RETURN( src );
+}
+
+
+PUBLIC char*
+Tokenize( src, separator, op, mapesc )/*
+========================================
+ Tokenize the input of src and join each token found together with
+ the next token separated by the separator string.
+
+ When doing the tokenization, <sp>, <tab>, <nl>, and \<nl> all
+ constitute white space. */
+
+char *src;
+char *separator;
+char op;
+int mapesc;
+{
+ TKSTR tokens;
+ char *tok;
+ char *res;
+ int first = (op == 't' || op == 'T');
+
+ DB_ENTER( "Tokenize" );
+
+ /* map the escape codes in the separator string first */
+ if ( mapesc )
+ for(tok=separator; (tok = strchr(tok,ESCAPE_CHAR)) != NIL(char); tok++)
+ Map_esc( tok );
+
+ DB_PRINT( "exp", ("Separator [%s]", separator) );
+
+ /* By default we return an empty string */
+ res = DmStrDup( "" );
+
+ /* Build the token list */
+ SET_TOKEN( &tokens, src );
+ while( *(tok = Get_token( &tokens, "", FALSE )) != '\0' ) {
+ char *x;
+
+ if( first ) {
+ FREE( res );
+ res = DmStrDup( tok );
+ first = FALSE;
+ }
+ else if (op == '^') {
+ res = DmStrAdd(res, DmStrJoin(separator, tok, -1, FALSE), TRUE);
+ }
+ else if (op == '+') {
+ res = DmStrAdd(res, DmStrJoin(tok, separator, -1, FALSE), TRUE);
+ }
+ else {
+ res = DmStrJoin(res, x =DmStrJoin(separator, tok, -1, FALSE),
+ -1, TRUE);
+ FREE( x );
+ }
+
+ DB_PRINT( "exp", ("Tokenizing [%s] --> [%s]", tok, res) );
+ }
+
+ FREE( src );
+ DB_RETURN( res );
+}
+
+
+static char*
+_scan_ballanced_parens(p, delim)
+char *p;
+char delim;
+{
+ int pcount = 0;
+ int bcount = 0;
+
+ if ( p ) {
+ do {
+ if (delim)
+ if( !(bcount || pcount) && *p == delim) {
+ return(p);
+ }
+
+ if ( *p == '(' ) pcount++;
+ else if ( *p == '{' ) bcount++;
+ else if ( *p == ')' && pcount ) pcount--;
+ else if ( *p == '}' && bcount ) bcount--;
+
+ p++;
+ }
+ while (*p && (pcount || bcount || delim));
+ }
+
+ return(p);
+}
+
+
+PUBLIC char*
+ScanToken( s, ps, doexpand )/*
+==============================
+ This routine scans the token characters one at a time and identifies
+ macros starting with $( and ${ and calls _scan_macro to expand their
+ value. the string1{ token_list }string2 expansion is also handled.
+ In this case a temporary result is maintained so that we can take it's
+ cross product with any other token_lists that may possibly appear. */
+
+char *s; /* pointer to start of src string */
+char **ps; /* pointer to start pointer */
+int doexpand;
+{
+ char *res; /* pointer to result */
+ char *start; /* pointer to start of prefix */
+ int crossproduct = 0; /* if 1 then computing X-prod */
+
+ start = s;
+ res = DmStrDup( "" );
+ while( 1 ) {
+ switch( *s ) {
+ /* Termination, We halt at seeing a space or a tab or end of string.
+ * We return the value of the result with any new macro's we scanned
+ * or if we were computing cross_products then we return the new
+ * cross_product.
+ * NOTE: Once we start computing cross products it is impossible to
+ * stop. ie. the semantics are such that once a {} pair is
+ * seen we compute cross products until termination. */
+
+ case ' ':
+ case '\t':
+ case '\n':
+ case '\r':
+ case '\0':
+ {
+ char *tmp;
+
+ *ps = s;
+ if( !crossproduct )
+ tmp = DmStrJoin( res, start, (s-start), TRUE );
+ else
+ {
+ tmp = DmSubStr( start, s );
+ tmp = _cross_prod( res, tmp );
+ }
+ return( tmp );
+ }
+
+ case '$':
+ case '{':
+ {
+ /* Handle if it's a macro or if it's a {} construct.
+ * The results of a macro expansion are handled differently based
+ * on whether we have seen a {} beforehand. */
+
+ char *tmp;
+ tmp = DmSubStr( start, s ); /* save the prefix */
+
+ if( *s == '$' ) {
+ start = _scan_macro( s+1, &s, doexpand );
+
+ if( crossproduct ) {
+ res = _cross_prod( res, DmStrJoin( tmp, start, -1, TRUE ) );
+ }
+ else {
+ res = DmStrJoin(res,tmp=DmStrJoin(tmp,start,-1,TRUE),-1,TRUE);
+ FREE( tmp );
+ }
+ FREE( start );
+ }
+ else if( strchr("{ \t",s[1]) == NIL(char) ){
+ int ok;
+ start = _scan_brace( s+1, &s, &ok );
+
+ if( ok ) {
+ if ( crossproduct ) {
+ res = _cross_prod(res,_cross_prod(tmp,start));
+ }
+ else {
+ char *freeres;
+ res = Tokenize(start,
+ freeres=DmStrJoin(res,tmp,-1,TRUE),
+ '^', FALSE);
+ FREE(freeres);
+ FREE(tmp);
+ }
+ crossproduct = TRUE;
+ }
+ else {
+ res =DmStrJoin(res,tmp=DmStrJoin(tmp,start,-1,TRUE),-1,TRUE);
+ FREE( start );
+ FREE( tmp );
+ }
+ }
+ else { /* handle the {{ case */
+ res = DmStrJoin( res, start, (s-start+1), TRUE );
+ s += (s[1]=='{')?2:1;
+ FREE( tmp );
+ }
+
+ start = s;
+ }
+ break;
+
+ case '}':
+ if( s[1] != '}' ) {
+ /* error malformed macro expansion */
+ s++;
+ }
+ else { /* handle the }} case */
+ res = DmStrJoin( res, start, (s-start+1), TRUE );
+ s += 2;
+ start = s;
+ }
+ break;
+
+ default: s++;
+ }
+ }
+}
+
+
+static char*
+_scan_macro( s, ps, doexpand )/*
+================================
+ This routine scans a macro use and expands it to the value. It
+ returns the macro's expanded value and modifies the pointer into the
+ src string to point at the first character after the macro use.
+ The types of uses recognized are:
+
+ $$ and $<sp> - expands to $
+ $(name) - expands to value of name
+ ${name} - same as above
+ $($(name)) - recurses on macro names (any level)
+ and
+ $(func[,args ...] [data])
+ and
+ $(name:modifier_list:modifier_list:...)
+
+ see comment for Expand for description of valid modifiers.
+
+ NOTE that once a macro name bounded by ( or { is found only
+ the appropriate terminator (ie. ( or } is searched for. */
+
+char *s; /* pointer to start of src string */
+char **ps; /* pointer to start pointer */
+int doexpand; /* If TRUE enables macro expansion */
+{
+ char sdelim; /* start of macro delimiter */
+ char edelim; /* corresponding end macro delim */
+ char *start; /* start of prefix */
+ char *macro_name; /* temporary macro name */
+ char *recurse_name; /* recursive macro name */
+ char *result; /* result for macro expansion */
+ int bflag = 0; /* brace flag, ==0 => $A type macro */
+ int done = 0; /* != 0 => done macro search */
+ int lev = 0; /* brace level */
+ int mflag = 0; /* != 0 => modifiers present in mac */
+ int fflag = 0; /* != 0 => GNU style function */
+ HASHPTR hp; /* hash table pointer for macros */
+
+ DB_ENTER( "_scan_macro" );
+
+ /* Check for $ at end of line, or $ followed by white space */
+ /* FIXME: Shouldn't a single '$' be an error? */
+ if( !*s || strchr(" \t", *s) != NIL(char)) {
+ *ps = s;
+ DB_RETURN( DmStrDup("") );
+ }
+
+ if( *s == '$' ) { /* Take care of the simple $$ case. */
+ *ps = s+1;
+ DB_RETURN( DmStrDup("$") );
+ }
+
+ sdelim = *s; /* set and remember start/end delim */
+ if( sdelim == '(' )
+ edelim = ')';
+ else
+ edelim = '}';
+
+ start = s; /* build up macro name, find its end */
+ while( !done ) {
+ switch( *s ) {
+ case '(': /* open macro brace */
+ case '{':
+ if( *s == sdelim ) {
+ lev++;
+ bflag++;
+ }
+ break;
+
+ case ':': /* halt at modifier */
+ if( lev == 1 && !fflag && doexpand ) {
+ done = TRUE;
+ mflag = 1;
+ }
+ else if( !lev ) /* must be $: */
+ Fatal( "Syntax error in macro [$%s]. A colon [:] cannot be a macro name.\n", start );
+
+ /* continue if a colon is found but lev > 1 */
+ break;
+
+ case '\n': /* Not possible because of the
+ * following case. */
+ Fatal( "DEBUG: No standalone '\n' [%s].\n", start );
+ break;
+
+ case '\\': /* Transform \<nl> -> ' '. */
+ if( s[1] != '\n' ) {
+ done = !lev;
+ break;
+ } else {
+ size_t len;
+ s[1] = ' ';
+ len = strlen(s+1)+1;
+ memmove( s, s+1, len );
+ }
+ /*FALLTHRU*/
+ case ' ':
+ case '\t':
+ if ( lev == 1 ) fflag = 1;
+ break;
+
+ case '\0': /* check for null */
+ *ps = s;
+ done = TRUE;
+ if( lev ) { /* catch $( or ${ without closing bracket */
+ Fatal( "Syntax error in macro [$%s]. The closing bracket [%c] is missing.\n", start, edelim );
+ } else
+ Fatal( "DEBUG: This cannot occur! [%s].\n", start );
+ break;
+
+ case ')': /* close macro brace */
+ case '}':
+ if( !lev ) /* A closing bracket without an .. */
+ Fatal("Syntax error in macro [$%s]. Closing bracket [%c] cannot be a macro name.\n", start, *s );
+ else if( *s == edelim ) --lev;
+ /*FALLTHRU*/
+
+ default: /* Done when lev == 0. This means either no */
+ done = !lev; /* opening bracket (single letter macro) or */
+ /* a fully enclosed $(..) or ${..} macro */
+ /* was found. */
+ }
+ s++;
+ }
+
+ /* Check if this is a $A type macro. If so then we have to
+ * handle it a little differently. */
+ if( bflag )
+ macro_name = DmSubStr( start+1, s-1 );
+ else
+ macro_name = DmSubStr( start, s );
+
+ /* If we don't have to expand the macro we're done. */
+ if (!doexpand) {
+ *ps = s;
+ DB_RETURN(macro_name);
+ }
+
+ /* Check to see if the macro name contains spaces, if so then treat it
+ * as a GNU style function invocation and call the function mapper to
+ * deal with it. We do not call the function expander if the function
+ * invocation begins with a '$' */
+ if( fflag && *macro_name != '$' ) {
+ result = Exec_function(macro_name);
+ }
+ else {
+ /* Check if the macro is a recursive macro name, if so then
+ * EXPAND the name before expanding the value */
+ if( strchr( macro_name, '$' ) != NIL(char) ) {
+ recurse_name = Expand( macro_name );
+ FREE( macro_name );
+ macro_name = recurse_name;
+ }
+
+ /* Code to do value expansion goes here, NOTE: macros whose assign bit
+ is one have been evaluated and assigned, they contain no further
+ expansions and thus do not need their values expanded again. */
+
+ if( (hp = GET_MACRO( macro_name )) != NIL(HASH) ) {
+ if( hp->ht_flag & M_MARK )
+ Fatal( "Detected circular macro [%s]", hp->ht_name );
+
+ if( !(hp->ht_flag & M_EXPANDED) ) {
+ hp->ht_flag |= M_MARK;
+ result = Expand( hp->ht_value );
+ hp->ht_flag ^= M_MARK;
+ }
+ else if( hp->ht_value != NIL(char) )
+ result = DmStrDup( hp->ht_value );
+ else
+ result = DmStrDup( "" );
+
+ }
+ else {
+ /* The use of an undefined macro implicitly defines it but
+ * leaves its value to NIL(char). */
+ hp = Def_macro( macro_name, NIL(char), M_EXPANDED );
+ /* Setting M_INIT assures that this macro is treated unset like
+ * default internal macros. (Necessary for *= and *:=) */
+ hp->ht_flag |= M_INIT;
+
+ result = DmStrDup( "" );
+ }
+ /* Mark macros as used only if we are not expanding them for
+ * the purpose of a .IF test, so we can warn about redef after use*/
+ if( !If_expand ) hp->ht_flag |= M_USED;
+
+ }
+
+ if( mflag ) {
+ char separator;
+ int modifier_list = 0;
+ int aug_mod = FALSE;
+ char *pat1;
+ char *pat2;
+ char *p;
+
+ /* We are inside of a macro expansion. The "build up macro name,
+ * find its while loop above should have caught all \<nl> and
+ * converted them to a real space. Let's verify this. */
+ for( p=s; *p && *p != edelim && *p; p++ ) {
+ if( p[0] == '\\' && p[1] == '\n' ) {
+ size_t len;
+ p[1] = ' ';
+ len = strlen(p+1)+1;
+ memmove( p, p+1, len );
+ }
+ }
+ if( !*p )
+ Fatal( "Syntax error in macro modifier pattern [$%s]. The closing bracket [%c] is missing.\n", start, edelim );
+
+ /* Yet another brain damaged AUGMAKE kludge. We should accept the
+ * AUGMAKE bullshit of $(f:pat=sub) form of macro expansion. In
+ * order to do this we will forgo the normal processing if the
+ * AUGMAKE solution pans out, otherwise we will try to process the
+ * modifiers ala dmake.
+ *
+ * So we look for = in modifier string.
+ * If found we process it and not do the normal stuff */
+
+ for( p=s; *p && *p != '=' && *p != edelim; p++ );
+
+ if( *p == '=' ) {
+ char *tmp;
+
+ pat1 = Expand(tmp = DmSubStr(s,p)); FREE(tmp);
+ s = p+1;
+ p = _scan_ballanced_parens(s+1, edelim);
+
+ if ( !*p ) {
+ Fatal( "Incomplete macro expression [%s]", s );
+ p = s+1;
+ }
+ pat2 = Expand(tmp = DmSubStr(s,p)); FREE(tmp);
+
+ result = Apply_edit( result, pat1, pat2, TRUE, TRUE );
+ FREE( pat1 );
+ FREE( pat2 );
+ s = p;
+ aug_mod = TRUE;
+ }
+
+ if( !aug_mod )
+ while( *s && *s != edelim ) { /* while not at end of macro */
+ char switch_char;
+
+ switch( switch_char = *s++ ) {
+ case '1': modifier_list |= JUST_FIRST_FLAG; break;
+
+ case 'b':
+ case 'B': modifier_list |= FILE_FLAG; break;
+
+ case 'd':
+ case 'D': modifier_list |= DIRECTORY_FLAG; break;
+
+ case 'f':
+ case 'F': modifier_list |= FILE_FLAG | SUFFIX_FLAG; break;
+
+ case 'e':
+ case 'E': modifier_list |= SUFFIX_FLAG; break;
+
+ case 'l':
+ case 'L': modifier_list |= TOLOWER_FLAG; break;
+
+ case 'i':
+ case 'I': modifier_list |= INFNAME_FLAG; break;
+
+ case 'u':
+ case 'U': modifier_list |= TOUPPER_FLAG; break;
+
+ case 'm':
+ case 'M':
+ if( modifier_list || ( (*s != edelim) && (*s != ':') ) ) {
+ Warning( "Map escape modifier must appear alone, ignored");
+ modifier_list = 0;
+ }
+ else {
+ /* map the escape codes in the separator string first */
+ for(p=result; (p = strchr(p,ESCAPE_CHAR)) != NIL(char); p++)
+ Map_esc( p );
+ }
+ /* find the end of the macro spec, or the start of a new
+ * modifier list for further processing of the result */
+
+ for( ; (*s != edelim) && (*s != ':') && *s; s++ );
+ if( !*s )
+ Fatal( "Syntax error in macro. [$%s].\n", start );
+ if( *s == ':' ) s++;
+ break;
+
+ case 'n':
+ case 'N': modifier_list |= NORMPATH_FLAG; break;
+
+ case 'S':
+ case 's':
+ if( modifier_list ) {
+ Warning( "Edit modifier must appear alone, ignored");
+ modifier_list = 0;
+ }
+ else {
+ separator = *s++;
+ for( p=s; *p != separator && *p; p++ );
+
+ if( !*p )
+ Fatal( "Syntax error in subst macro. [$%s].\n", start );
+ else {
+ char *t1, *t2;
+ pat1 = DmSubStr( s, p );
+ for(s=p=p+1; (*p != separator) && *p; p++ );
+ /* Before the parsing fixes in iz36027 the :s macro modifier
+ * erroneously worked with patterns with missing pattern
+ * separator, i.e. $(XXX:s#pat#sub). This is an error because
+ * it prohibits the use of following macro modifiers.
+ * I.e. $(XXX:s#pat#sub:u) falsely replaces with "sub:u".
+ * ??? Remove this special case once OOo compiles without
+ * any of this warnings. */
+ if( !*p ) {
+ if( *(p-1) == edelim ) {
+ p--;
+ Warning( "Syntax error in subst macro. Bracket found, but third delimiter [%c] missing in [$%s].\n", separator, start );
+ }
+ else {
+ Fatal( "Syntax error in subst macro. Third delimiter [%c] missing in [$%s].\n", separator, start );
+ }
+ }
+ pat2 = DmSubStr( s, p );
+ t1 = Expand(pat1); FREE(pat1);
+ t2 = Expand(pat2); FREE(pat2);
+ result = Apply_edit( result, t1, t2, TRUE, FALSE );
+ FREE( t1 );
+ FREE( t2 );
+ }
+ s = p;
+ }
+ /* find the end of the macro spec, or the start of a new
+ * modifier list for further processing of the result */
+
+ for( ; (*s != edelim) && (*s != ':') && *s; s++ );
+ if( !*s )
+ Fatal( "Syntax error in macro. [$%s].\n", start );
+ if( *s == ':' ) s++;
+ break;
+
+ case 'T':
+ case 't':
+ case '^':
+ case '+':
+ if( modifier_list ) {
+ Warning( "Tokenize modifier must appear alone, ignored");
+ modifier_list = 0;
+ }
+ else {
+ separator = *s++;
+
+ if( separator == '$' ) {
+ p = _scan_ballanced_parens(s,'\0');
+
+ if ( *p ) {
+ char *tmp;
+ pat1 = Expand(tmp = DmSubStr(s-1,p));
+ FREE(tmp);
+ result = Tokenize(result, pat1, switch_char, TRUE);
+ FREE(pat1);
+ }
+ else {
+ Warning( "Incomplete macro expression [%s]", s );
+ }
+ s = p;
+ }
+ else if ( separator == '\"' ) {
+ /* we change the semantics to allow $(v:t")") */
+ for (p = s; *p && *p != separator; p++)
+ if (*p == '\\')
+ if (p[1] == '\\' || p[1] == '"')
+ p++;
+
+ if( *p == 0 )
+ Fatal( "Unterminated separator string" );
+ else {
+ pat1 = DmSubStr( s, p );
+ result = Tokenize( result, pat1, switch_char, TRUE);
+ FREE( pat1 );
+ }
+ s = p;
+ }
+ else {
+ Warning(
+ "Separator must be a quoted string or macro expression");
+ }
+
+ /* find the end of the macro spec, or the start of a new
+ * modifier list for further processing of the result */
+
+ for( ; (*s != edelim) && (*s != ':'); s++ );
+ if( *s == ':' ) s++;
+ }
+ break;
+
+ case ':':
+ if( modifier_list ) {
+ result = Apply_modifiers( modifier_list, result );
+ modifier_list = 0;
+ }
+ break;
+
+ default:
+ Warning( "Illegal modifier in macro, ignored" );
+ break;
+ }
+ }
+
+ if( modifier_list ) /* apply modifier */
+ result = Apply_modifiers( modifier_list, result );
+
+ s++;
+ }
+
+ *ps = s;
+ FREE( macro_name );
+ DB_RETURN( result );
+}
+
+
+static char*
+_scan_brace( s, ps, flag )/*
+============================
+ This routine scans for { token_list } pairs. It expands the value of
+ token_list by calling Expand on it. Token_list may be anything at all.
+ Note that the routine count's ballanced parentheses. This means you
+ cannot have something like { fred { joe }, if that is what you really
+ need the write it as { fred {{ joe }, flag is set to 1 if all ok
+ and to 0 if the braces were unballanced. */
+
+char *s;
+char **ps;
+int *flag;
+{
+ char *t;
+ char *start;
+ char *res;
+ int lev = 1;
+ int done = 0;
+
+ DB_ENTER( "_scan_brace" );
+
+ start = s;
+ while( !done )
+ switch( *s++ ) {
+ case '{':
+ if( *s == '{' ) break; /* ignore {{ */
+ lev++;
+ break;
+
+ case '}':
+ if( *s == '}' ) break; /* ignore }} */
+ if( lev )
+ if( --lev == 0 ) done = TRUE;
+ break;
+
+ case '$':
+ if( *s == '{' || *s == '}' ) {
+ if( (t = strchr(s,'}')) != NIL(char) )
+ s = t;
+ s++;
+ }
+ break;
+
+ case '\0':
+ if( lev ) {
+ done = TRUE;
+ s--;
+ /* error malformed macro expansion */
+ }
+ break;
+ }
+
+ start = DmSubStr( start, (lev) ? s : s-1 );
+
+ if( lev ) {
+ /* Braces were not ballanced so just return the string.
+ * Do not expand it. */
+
+ res = DmStrJoin( "{", start, -1, FALSE );
+ *flag = 0;
+ }
+ else {
+ *flag = 1;
+ res = Expand( start );
+
+ if( (t = DmStrSpn( res, " \t" )) != res ) {
+ size_t len = strlen(t)+1;
+ memmove( res, t, len );
+ }
+ }
+
+ FREE( start ); /* this is ok! start is assigned a DmSubStr above */
+ *ps = s;
+
+ DB_RETURN( res );
+}
+
+
+static char*
+_cross_prod( x, y )/*
+=====================
+ Given two strings x and y compute the cross-product of the tokens found
+ in each string. ie. if x = "a b" and y = "c d" return "ac ad bc bd".
+
+ NOTE: buf will continue to grow until it is big enough to handle
+ all cross product requests. It is never freed! (maybe I
+ will fix this someday) */
+
+char *x;
+char *y;
+{
+ static char *buf = NULL;
+ static int buf_siz = 0;
+ char *brkx;
+ char *brky;
+ char *cy;
+ char *cx;
+ char *res;
+ int i;
+
+ if( *x && *y ) {
+ res = DmStrDup( "" ); cx = x;
+ while( *cx ) {
+ cy = y;
+ brkx = DmStrPbrk( cx, " \t\n" );
+ if( (brkx-cx == 2) && *cx == '\"' && *(cx+1) == '\"' ) cx = brkx;
+
+ while( *cy ) {
+ brky = DmStrPbrk( cy, " \t\n" );
+ if( (brky-cy == 2) && *cy == '\"' && *(cy+1) == '\"' ) cy = brky;
+ i = brkx-cx + brky-cy + 2;
+
+ if( i > buf_siz ) { /* grow buf to the correct size */
+ if( buf != NIL(char) ) FREE( buf );
+ if( (buf = MALLOC( i, char )) == NIL(char)) No_ram();
+ buf_siz = i;
+ }
+
+ strncpy( buf, cx, (i = brkx-cx) );
+ buf[i] = '\0';
+ if (brky-cy > 0) strncat( buf, cy, brky-cy );
+ buf[i+(brky-cy)] = '\0';
+ strcat( buf, " " );
+ res = DmStrJoin( res, buf, -1, TRUE );
+ cy = DmStrSpn( brky, " \t\n" );
+ }
+ cx = DmStrSpn( brkx, " \t\n" );
+ }
+
+ FREE( x );
+ res[ strlen(res)-1 ] = '\0';
+ }
+ else
+ res = DmStrJoin( x, y, -1, TRUE );
+
+ FREE( y );
+ return( res );
+}
diff --git a/dmake/extern.h b/dmake/extern.h
new file mode 100644
index 000000000000..4149fe7b14b8
--- /dev/null
+++ b/dmake/extern.h
@@ -0,0 +1,192 @@
+/* $RCSfile: extern.h,v $
+-- $Revision: 1.13 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:28:27 $
+--
+-- SYNOPSIS
+-- External declarations for dmake functions.
+--
+-- DESCRIPTION
+-- ANSI is a macro that allows the proper handling of ANSI style
+-- function declarations.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef EXTERN_h
+#define EXTERN_h
+
+/* For MSVC++ needs to include windows.h first to avoid problems with
+ * type redefinitions. Include it also for MinGW for consistency. */
+#if defined(__MINGW32__) || defined(_MSC_VER)
+#include <windows.h>
+#endif
+
+#include "config.h"
+
+/* Define this for the RS/6000 if it breaks something then we have to put a
+ * #ifdef around it. */
+#if defined(rs6000)
+#define _POSIX_SOURCE
+#endif
+
+#include <stdio.h>
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <string.h>
+#include <ctype.h>
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#else
+# include <types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if HAVE_UTIME_H
+# include <utime.h>
+#endif
+
+#define DMPVOID void *
+
+#include <signal.h>
+#include "itypes.h"
+#include "stdmacs.h"
+#include "alloc.h"
+#include "db.h"
+#include "dstdarg.h"
+#include "dmake.h"
+#include "struct.h"
+#include "vextern.h"
+#include "public.h"
+
+/* Include this last as it invalidates some functions that are defined
+ * externally above and turns them into no-ops. Have to do this after
+ * the extern declarations however. */
+#include "posix.h"
+
+
+
+/* Common declarations
+ * ===================
+ * are better made here then in local public.h. So far dmake didn't follow
+ * this strategy but new functions will be added here. */
+
+/* Use our own implementation if no library function is present. */
+#ifndef HAVE_STRLWR
+/* from dmstring.c */
+char *strlwr(char *p);
+#endif
+
+/* from function.c */
+char *exec_normpath(char *args);
+
+/* from make.c */
+void Unmake(CELLPTR cp);
+
+/* from path.c */
+void Clean_path(char *path);
+char *normalize_path(char *path);
+
+/* from sysintf.c */
+/* cygdospath()/DO_WINPATH() are only needed for the .WINPATH attribute
+ * on cygwin. */
+#if __CYGWIN__
+char *cygdospath(char *src, int winpath);
+# define DO_WINPATH(p) cygdospath(p, UseWinpath)
+#else
+# define DO_WINPATH(p) p
+#endif
+
+
+/* Define some usefull macros. This is done here and not in config.h
+ * to keep this changes usefull even when not using the autotools based
+ * build, i.e. using config.h files that are local to the architecture. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(OS2) || defined(__EMX__)
+# define HAVE_DRIVE_LETTERS 1
+#endif
+
+#if defined(_WIN32) || defined(MSDOS) || defined(OS2) && !defined(__CYGWIN__)
+# define NULLDEV "NUL"
+#else
+# define NULLDEV "/dev/null"
+#endif
+
+/* For MSVC 6.0 and newer and MinGW use the CreateProcess() function. */
+#if defined(__MINGW32__) || defined(_MSC_VER) && _MSC_VER >= 1200
+# define USE_CREATEPROCESS 1
+#else
+/* #undef USE_CREATEPROCESS */
+#endif
+
+/* CreateProcess() is spawn-like. */
+#if ENABLE_SPAWN && ( HAVE_SPAWN_H || __CYGWIN__ || __EMX__) || defined(USE_CREATEPROCESS)
+# define USE_SPAWN 1
+#else
+/* #undef USE_SPAWN */
+#endif
+
+/* Work around some of the functions that may or may not exist */
+#if ! HAVE_TZSET
+#if HAVE_SETTZ
+# define tzset() settz()
+#else
+# warn "tzset is not supported, null out"
+# define tzset()
+#endif
+#endif
+
+/* Get the working directory fall back code */
+#if ! HAVE_GETCWD
+#if HAVE_GETWD
+# define getcwd(buf,len) getwd(buf)
+#else
+# error "You have no supported way of getting working directory"
+#endif
+#endif
+
+/* If setvbuf is not available set output to unbuffered */
+#if ! HAVE_SETVBUF
+# define setvbuf(fp,bp,type,len) setbuf(fp,NULL)
+#endif
+
+/* coreleft is used in some debug macros. Only Turbo C seems to provide
+ * this function. Define it here so that the code compiles. */
+#ifdef DBUG
+#define coreleft() 0L
+#endif
+
+#endif
diff --git a/dmake/function.c b/dmake/function.c
new file mode 100644
index 000000000000..c0942db09213
--- /dev/null
+++ b/dmake/function.c
@@ -0,0 +1,726 @@
+/* $RCSfile: function.c,v $
+-- $Revision: 1.12 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:28:45 $
+--
+-- SYNOPSIS
+-- GNU style functions for dmake.
+--
+-- DESCRIPTION
+-- All GNU style functions understood by dmake are implemented in this
+-- file. Currently the only such function is $(mktmp ...) which is
+-- not part of GNU-make is an extension provided by dmake.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+static char *_exec_mktmp ANSI((char *, char *, char *));
+static char *_exec_subst ANSI((char *, char *, char *));
+static char *_exec_iseq ANSI((char *, char *, char *, int));
+static char *_exec_sort ANSI((char *));
+static char *_exec_echo ANSI((char *));
+static char *_exec_uniq ANSI((char *));
+static char *_exec_shell ANSI((char *, int));
+static char *_exec_call ANSI((char *, char *));
+static char *_exec_assign ANSI((char *));
+static char *_exec_foreach ANSI((char *, char *, char *));
+static char *_exec_andor ANSI((char *, int));
+static char *_exec_not ANSI((char *));
+static int _mystrcmp ANSI((const DMPVOID, const DMPVOID));
+
+
+PUBLIC char *
+Exec_function(buf)/*
+====================
+ Execute the function given by the value of args.
+
+ So far mktmp is the only valid function, anything else elicits and error
+ message. It is my hope to support the GNU style functions in this portion
+ of the code at some time in the future. */
+char *buf;
+{
+ char *fname;
+ char *args;
+ char *mod1;
+ char *mod2 = NIL(char);
+ int mod_count = 0;
+ char *res = NIL(char);
+
+ /* This must succeed since the presence of ' ', \t or \n is what
+ * determines if this function is called in the first place.
+ * Unfortunately this prohibits the use of whitespaces in parameters
+ * for macro functions. */
+ /* ??? Using ScanToken to find the next ' ', \t or \n and discarding
+ * the returned, evaluated result is a misuse of that function. */
+ FREE(ScanToken(buf, &args, FALSE));
+ fname = DmSubStr(buf, args);
+ /* args points to the whitespace after the found token, this leads
+ * to leading whitespaces. */
+ if( *args ) {
+ args = DmStrSpn(args," \t"); /* strip whitespace before */
+ if( *args ) { /* ... and after value */
+ char *q;
+ for(q=args+strlen(args)-1; ((*q == ' ')||(*q == '\t')); q--);
+ *++q = '\0';
+ }
+ }
+
+ /* ??? Some function macros expect comma seperated parameters, but
+ * no decent parser is included. The desirable solution would be
+ * to parse fname for the correct number of parameters in fname
+ * when a function is recognized. We only count the parameters
+ * at the moment. Note "" is a valid parameter. */
+ if( (mod1 = strchr(fname,',')) != NIL(char) ){
+ *mod1 = '\0';
+ mod1++;
+ mod_count++;
+
+ if( (mod2 = strchr(mod1,',')) != NIL(char) ){
+ *mod2 = '\0';
+ mod2++;
+ mod_count++;
+ }
+ }
+
+ /* ??? At the moment only the leading part of fname compared if it
+ * matches a known function macro. For example assignXXX or even
+ * assign,,,, is also erroneously accepted. */
+ switch( *fname ) {
+ case 'a':
+ if(strncmp(fname,"assign",6) == 0)
+ res = _exec_assign(args);
+ else if(strncmp(fname,"and",3) == 0)
+ res = _exec_andor(args, TRUE);
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 'e':
+ if(strncmp(fname,"eq",2) == 0)
+ if( mod_count == 2 )
+ res = _exec_iseq(mod1,mod2,args,TRUE);
+ else
+ Fatal( "Two comma-seperated arguments expected in [%s].\n", buf );
+ else if (strncmp(fname,"echo",4) == 0)
+ res = _exec_echo(args);
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 'f':
+ if(strncmp(fname,"foreach",7) == 0)
+ if( mod_count == 2 )
+ res = _exec_foreach(mod1,mod2,args);
+ else
+ Fatal( "Two comma-seperated arguments expected in [%s].\n", buf );
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 'm':
+ if(strncmp(fname,"mktmp",5) == 0)
+ if( mod_count < 3 )
+ res = _exec_mktmp(mod1,mod2,args);
+ else
+ Fatal( "Maximal two comma-seperated arguments expected in [%s].\n", buf );
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 'n':
+ if( strncmp(fname,"null", 4) == 0 )
+ res = _exec_iseq(mod1,NIL(char),args,TRUE);
+ else if (strncmp(fname,"nil",3) == 0 ) {
+ FREE(Expand(args));
+ res = DmStrDup("");
+ }
+ else if (strncmp(fname,"not",3) == 0 )
+ res = _exec_not(args);
+ else if (strncmp(fname,"normpath",8) == 0 ) {
+ char *eargs = Expand(args);
+
+ if( mod_count == 0 ) {
+ res = exec_normpath(eargs);
+ }
+ else if( mod_count == 1 ) {
+ char *para = Expand(mod1);
+ int tmpUseWinpath = UseWinpath;
+
+ if( !*para || strcmp(para, "\"\"") == 0 ) {
+ UseWinpath = FALSE;
+ } else {
+ UseWinpath = TRUE;
+ }
+ res = exec_normpath(eargs);
+ UseWinpath = tmpUseWinpath;
+ FREE(para);
+ }
+ else
+ Fatal( "One or no comma-seperated arguments expected in [%s].\n", buf );
+
+ FREE(eargs);
+ }
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case '!':
+ if(strncmp(fname,"!null",5) == 0)
+ res = _exec_iseq(mod1,NIL(char),args,FALSE);
+ else if(strncmp(fname,"!eq",3) ==0)
+ if( mod_count == 2 )
+ res = _exec_iseq(mod1,mod2,args,FALSE);
+ else
+ Fatal( "Two comma-seperated arguments expected in [%s].\n", buf );
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 'o':
+ if(strncmp(fname,"or",2) == 0)
+ res = _exec_andor(args, FALSE);
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 's':
+ if(strncmp(fname,"sort",4) == 0)
+ res = _exec_sort(args);
+ else if(strncmp(fname,"shell",5)==0)
+ if( mod_count == 0 ) {
+ res = _exec_shell(args, FALSE);
+ }
+ else if( mod_count == 1 ) {
+ char *emod = Expand(mod1);
+ if(strncmp(emod,"expand",7)==0)
+ res = _exec_shell(args, TRUE);
+ else
+ Fatal( "Unknown argument [%s] to shell in [%s].\n", emod, buf );
+ FREE(emod);
+ }
+ else
+ Fatal( "One or no comma-seperated arguments expected in [%s].\n", buf );
+ else if(strncmp(fname,"strip",5)==0)
+ res = Tokenize(Expand(args)," ",'t',TRUE);
+ else if(strncmp(fname,"subst",5)==0) {
+ if( mod_count == 2 )
+ res = _exec_subst(mod1,mod2,args);
+ else
+ Fatal( "Two comma-seperated arguments expected in [%s].\n", buf );
+ }
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ case 'u':
+ if(strncmp(fname,"uniq",4) == 0)
+ res = _exec_uniq(args);
+ else
+ res = _exec_call(fname,args);
+ break;
+
+ default:
+ res = _exec_call(fname,args);
+ }
+
+ if( res == NIL(char) ) res = DmStrDup("");
+
+ FREE(fname);
+ return(res);
+}
+
+
+static char *
+_exec_assign( macrostring )
+char *macrostring;
+{
+ if ( !Parse_macro(macrostring, M_MULTI|M_FORCE) ) {
+ Error( "Dynamic macro assignment failed, while making [%s]\n",
+ Current_target ? Current_target->CE_NAME : "NIL");
+ return(DmStrDup(""));
+ }
+
+ return(DmStrDup(LastMacName));
+}
+
+
+static char *
+_exec_echo(data)
+char *data;
+{
+ return(DmStrDup(DmStrSpn(data," \t")));
+}
+
+
+static char *
+_exec_call( var, list )/*
+=========================
+ Return the (recursively expanded) value of macro var. Expand list and
+ discard the result.
+*/
+char *var; /* Name of the macro (until first whitespace). */
+char *list; /* Rest data (after the whitespace). */
+{
+ char *res = NIL(char);
+
+ /* the argument part is expanded. */
+ FREE(Expand(list));
+
+ /* Prepend '$(' and append ')' so that Expand will return the value
+ * of the 'var' macro. */
+ var = DmStrJoin(DmStrJoin("$(",var,-1,FALSE),")",-1,TRUE);
+ res = Expand(var);
+
+ FREE(var);
+ return(res);
+}
+
+
+static char *
+_exec_foreach( var, list, data )
+char *var;
+char *list;
+char *data;
+{
+ char *res = NIL(char);
+ char *s;
+ TKSTR tk;
+ HASHPTR hp;
+
+ var = Expand(var);
+ list = Expand(list);
+
+ data = DmStrSpn(data," \t\n");
+ SET_TOKEN(&tk,list);
+ /* push previous macro definition and redefine. */
+ hp = Def_macro(var,"",M_MULTI|M_NOEXPORT|M_FORCE|M_PUSH);
+
+ while( *(s=Get_token(&tk, "", FALSE)) != '\0' ) {
+ Def_macro(var,s,M_MULTI|M_NOEXPORT|M_FORCE);
+ res = DmStrAdd(res,Expand(data),TRUE);
+ }
+
+ CLEAR_TOKEN(&tk);
+ Pop_macro(hp); /* Get back old macro definition. */
+ FREE(hp->ht_name);
+ if(hp->ht_value) FREE(hp->ht_value);
+ FREE(hp);
+ FREE(var);
+ FREE(list);
+
+ return(res);
+}
+
+
+static char *
+_exec_mktmp( file, text, data )
+char *file;
+char *text;
+char *data;
+{
+ char *tmpname;
+ char *name;
+ FILE *tmpfile = NIL(FILE);
+
+ /* This is only a test of the recipe line so prevent the tempfile side
+ * effects. */
+ if( Suppress_temp_file ) return(NIL(char));
+
+ name = Current_target ? Current_target->CE_NAME:"makefile text";
+
+ if( file && *file ) {
+ /* Expand the file parameter to mktmp if present. */
+ tmpname = Expand(file);
+
+ if( *tmpname ) {
+#ifdef HAVE_MKSTEMP
+ /* Only use umask if we are also using mkstemp - this basically
+ * avoids using the incompatible implementation from MSVC. */
+ mode_t mask;
+
+ /* Create tempfile with 600 permissions. */
+ mask = umask(0066);
+#endif
+
+ if( (tmpfile = fopen(tmpname, "w")) == NIL(FILE) )
+ Open_temp_error( tmpname, name );
+#ifdef HAVE_MKSTEMP
+ umask(mask);
+#endif
+
+ Def_macro("TMPFILE", tmpname, M_EXPANDED|M_MULTI);
+ Link_temp( Current_target, tmpfile, tmpname );
+
+ /* Don't free tmpname if it is used. It is stored in a FILELIST
+ * member in Link_temp() and freed by Unlink_temp_files(). */
+ }
+ else
+ FREE(tmpname);
+ }
+
+ /* If file expanded to a non empty value tmpfile is already opened,
+ * otherwise open it now. */
+ if( !tmpfile )
+ tmpfile = Start_temp( "", Current_target, &tmpname );
+
+ /* If the text parameter is given return its expanded value
+ * instead of the used filename. */
+ if( !text || !*text ) {
+ /* tmpname is freed by Unlink_temp_files(). */
+ text = DmStrDup(DO_WINPATH(tmpname));
+ }
+ else {
+ text = Expand(text);
+ }
+
+ data = Expand(data);
+
+ Append_line( data, TRUE, tmpfile, name, FALSE, FALSE );
+ Close_temp( Current_target, tmpfile );
+ FREE(data);
+
+ return( text );
+}
+
+
+static char *
+_exec_iseq( lhs, rhs, data, eq )
+char *lhs;
+char *rhs;
+char *data;
+int eq;
+{
+ char *l = Expand(lhs);
+ char *r = Expand(rhs);
+ char *i = DmStrSpn(data, " \t\n");
+ char *e = strchr(i, ' ');
+ char *res = NIL(char);
+ int val = strcmp(l,r);
+
+ if( (!val && eq) || (val && !eq) ) {
+ if( e != NIL(char) ) *e = '\0';
+ res = Expand(i);
+ }
+ else if( e != NIL(char) ) {
+ e = DmStrSpn(e," \t\n");
+ if( *e ) res = Expand(e);
+ }
+
+ FREE(l);
+ FREE(r);
+ return(res);
+}
+
+
+static char *
+_exec_sort( args )
+char *args;
+{
+ char *res = NIL(char);
+ char *data = Expand(args);
+ char **tokens;
+ char *p;
+ char *white = " \t\n";
+ int j;
+ int i;
+
+ for(i=0,p=DmStrSpn(data,white);*p;p=DmStrSpn(DmStrPbrk(p,white),white),i++);
+
+ if( i != 0 ) {
+ TALLOC(tokens, i, char *);
+
+ for( i=0,p=DmStrSpn(data,white); *p; p=DmStrSpn(p,white),i++){
+ tokens[i] = p;
+ p = DmStrPbrk(p,white);
+ if( *p ) *p++ = '\0';
+ }
+
+ qsort( tokens, i, sizeof(char *), _mystrcmp );
+
+ for( j=0; j<i; j++ ) res = DmStrApp(res, tokens[j]);
+ FREE(data);
+ FREE(tokens);
+ }
+
+ return(res);
+}
+
+
+static char *
+_exec_uniq( args )
+char *args;
+{
+ char *res = NIL(char);
+ char *data = Expand(args);
+ char **tokens;
+ char **tokens_after;
+ char *p;
+ char *white = " \t\n";
+ int j;
+ int i;
+ char *last = "";
+ int k = 0;
+
+ for(i=0,p=DmStrSpn(data,white);*p;p=DmStrSpn(DmStrPbrk(p,white),white),i++);
+
+ if( i != 0 ) {
+ TALLOC(tokens, i, char *);
+ TALLOC(tokens_after, i, char *);
+
+ for( i=0,p=DmStrSpn(data,white); *p; p=DmStrSpn(p,white),i++){
+ tokens[i] = p;
+ p = DmStrPbrk(p,white);
+ if( *p ) *p++ = '\0';
+ }
+
+ qsort( tokens, i, sizeof(char *), _mystrcmp );
+
+ for( j=0; j<i; j++ ) {
+ if (strcmp(tokens[j], last) != 0) {
+ tokens_after[k++] = tokens[j];
+ last = tokens[j];
+ }
+ }
+
+ for( j=0; j<k; j++ ) res = DmStrApp(res, tokens_after[j]);
+ FREE(data);
+ FREE(tokens);
+ FREE(tokens_after);
+ }
+
+ return(res);
+}
+
+static int
+_mystrcmp( p, q )
+const DMPVOID p;
+const DMPVOID q;
+{
+ return(strcmp(*((const char **)p),*((const char **)q)));
+}
+
+
+static char *
+_exec_subst( pat, subst, data )
+char *pat;
+char *subst;
+char *data;
+{
+ char *res;
+
+ pat = Expand(pat);
+ subst = Expand(subst);
+
+ /* This implies FREE(Expand(data)) */
+ res = Apply_edit( Expand(data), pat, subst, TRUE, FALSE );
+ FREE(pat);
+ FREE(subst);
+
+ return(res);
+}
+
+
+static char *
+_exec_shell( data, expand )/*
+=============================
+ Capture the stdout of an execuded command.
+ If expand is TRUE expand the result. */
+char *data;
+int expand;
+{
+ extern char *tempnam();
+ int bsize;
+ char *buffer;
+ char *tmpnm;
+ FILE *old_stdout_redir = stdout_redir;
+
+ int wait = Wait_for_completion;
+ int old_is_exec_shell = Is_exec_shell;
+ CELLPTR old_Shell_exec_target = Shell_exec_target;
+ uint16 vflag = Verbose;
+ int tflag = Trace;
+ char *res = NIL(char);
+ CELL cell;
+ STRING rcp;
+ HASH cname;
+
+ if( Suppress_temp_file ) return(NIL(char));
+
+ /* Set the temp CELL used for building prerequisite candidates to
+ * all zero so that we don't have to keep initializing all the
+ * fields. */
+ {
+ register char *s = (char *) &cell;
+ register int n = sizeof(CELL);
+ while( n ) { *s++ = '\0'; n--; }
+ }
+ rcp.st_string = DmStrSpn(data, " \t+-%@");
+ rcp.st_attr = Rcp_attribute( data );
+ rcp.st_next = NIL(STRING);
+ cname.ht_name = "Shell escape";
+ cell.ce_name = &cname;
+ cell.ce_all.cl_prq = &cell;
+ cell.ce_all.cl_next = NIL(LINK);
+ cell.ce_all.cl_flag = 0;
+ cell.ce_fname = cname.ht_name;
+ cell.ce_recipe = &rcp;
+ cell.ce_flag = F_TARGET|F_RULES;
+ /* Setting A_SILENT supresses the recipe output from Print_cmnd(). */
+ cell.ce_attr = A_PHONY|A_SILENT|A_SHELLESC;
+
+ if( Measure & M_TARGET )
+ Do_profile_output( "s", M_TARGET, &cell );
+
+ /* Print the shell escape command. */
+ if( !(rcp.st_attr & A_SILENT) ) {
+ printf( "%s: Executing shell macro: %s\n", Pname, data );
+ fflush(stdout);
+ }
+
+ if( (stdout_redir = Get_temp(&tmpnm, "w+")) == NIL(FILE) )
+ Open_temp_error( tmpnm, cname.ht_name );
+
+ bsize = (Buffer_size < BUFSIZ)?BUFSIZ:Buffer_size;
+ buffer = MALLOC(bsize,char);
+
+ /* As this function redirects the output of stdout we have to make sure
+ * that only this single command is executed and all previous recipe lines
+ * that belong to the same target have finished. With Shell_exec_target and
+ * Wait_for_completion set this is realized. Current_target being NIL(CELL)
+ * outside of recipe lines makes sure that no waiting for previous recipe
+ * lines has to be done. */
+ Wait_for_completion = TRUE;
+ Is_exec_shell = TRUE;
+ Shell_exec_target = Current_target;
+ Verbose &= V_LEAVE_TMP;
+ Trace = FALSE;
+
+ /* The actual redirection happens in runargv(). */
+ Exec_commands( &cell );
+
+ Unlink_temp_files( &cell );
+
+ Trace = tflag;
+ Verbose = vflag;
+ Wait_for_completion = wait;
+ Is_exec_shell = old_is_exec_shell;
+ Shell_exec_target = old_Shell_exec_target;
+
+ /* Now we have to read the temporary file, get the tokens and return them
+ * as a string. */
+ rewind(stdout_redir);
+ while( fgets(buffer, bsize, stdout_redir) ) {
+ char *p = strchr(buffer, '\n');
+
+ if( p == NIL(char) )
+ res = DmStrJoin(res,buffer,-1,TRUE);
+ else {
+ *p = '\0';
+ /* You might encounter '\r\n' on windows, handle it. */
+ if( p > buffer && *(p-1) == '\r')
+ *(p-1) = '\0';
+ res = DmStrApp(res,buffer);
+ }
+ }
+
+ fclose(stdout_redir);
+ Remove_file(tmpnm);
+ FREE(tmpnm);
+ FREE(buffer);
+
+ stdout_redir = old_stdout_redir;
+
+ if ( expand ) {
+ char *exp_res;
+ exp_res = Expand(res);
+ FREE(res);
+ res = exp_res;
+ }
+
+ return(res);
+}
+
+
+static char *
+_exec_andor( args, doand )
+char *args;
+int doand;
+{
+ char *next;
+ char *p;
+ char *white = " \t\n";
+ int res=doand;
+
+ args = DmStrSpn(args,white);
+ do {
+ p=ScanToken(args, &next, TRUE);
+
+ if (doand ? !*p : *p) {
+ res = !doand;
+ FREE(p);
+ break;
+ }
+
+ FREE(p);
+ }
+ while (*(args=DmStrSpn(next,white)));
+
+ return(res ? DmStrDup("t") : DmStrDup(""));
+}
+
+
+static char *
+_exec_not( args )
+char *args;
+{
+ char *white = " \t\n";
+ char *p=Expand(args);
+ int res = (*DmStrSpn(p,white) == '\0');
+
+ FREE(p);
+ return(res ? DmStrDup("t") : DmStrDup(""));
+}
+
+
+char *
+exec_normpath( args )/*
+=======================
+ Normalize token-wise. The normalised filenames are returned in a new
+ string, the original string is not freed. Quoted tokens remain quoted
+ after the normalizaton. */
+char *args;
+{
+ TKSTR str;
+ char *s, *res;
+
+ /* This honors .WINPATH . */
+ SET_TOKEN( &str, args );
+ res = NIL(char);
+ while( *(s = Get_token( &str, "", FALSE )) != '\0' ) {
+ if(str.tk_quote == 0) {
+ /* Add leading quote. */
+ res = DmStrApp(res, "\"");
+ res = DmStrJoin(res, DO_WINPATH(normalize_path(s)), -1, TRUE);
+ /* Append the trailing quote. */
+ res = DmStrJoin(res, "\"", 1, TRUE);
+ } else {
+ res = DmStrApp(res, DO_WINPATH(normalize_path(s)));
+ }
+ }
+ return res;
+}
diff --git a/dmake/getinp.c b/dmake/getinp.c
new file mode 100644
index 000000000000..1ac312a53b59
--- /dev/null
+++ b/dmake/getinp.c
@@ -0,0 +1,854 @@
+/* RCS $Id: getinp.c,v 1.10 2007-10-15 15:39:23 ihi Exp $
+--
+-- SYNOPSIS
+-- Handle reading of input.
+--
+-- DESCRIPTION
+-- The code in this file reads the input from the specified stream
+-- into the provided buffer of size Buffer_size. In doing so it deletes
+-- comments. Comments are delimited by the #, and
+-- <nl> character sequences. An exception is \# which
+-- is replaced by # in the input. Line continuations are signalled
+-- at the end of a line and are recognized inside comments.
+-- The line continuation is always <\><nl>.
+--
+-- If the file to read is NIL(FILE) then the Get_line routine returns the
+-- next rule from the builtin rule table (Rule_tab from ruletab.c) if
+-- there is one.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+#define IS_WHITE(A) ((A == ' ') || (A == '\t') || (A == '\n') || (A == '\r'))
+#define SCAN_WHITE(A) \
+ while( IS_WHITE(*A) ) A++;
+
+static int _is_conditional ANSI((char*));
+static int _handle_conditional ANSI((int, TKSTRPTR));
+
+static int rule_ind = 0; /* index of rule when reading Rule_tab */
+static int skip = FALSE; /* if true the skip input */
+
+int partcomp( char* lhs, int opcode );
+int parse_complex_expression( char *expr, char **expr_end, int opcode );
+
+
+PUBLIC int
+Get_line( buf, fil )/*
+======================
+ Read a line of input from the file stripping off comments. The routine
+ returns TRUE if EOF. If fil equals NIL(FILE) then the next line from
+ *Rule_tab[] is used. Rule_tab is either the buildin rule table or points
+ to the current environment (used by ReadEnvironment()).
+ The function returns TRUE if the input file/buffer was read to the end
+ and FALSE otherwise. */
+char *buf;
+FILE *fil;
+{
+ extern char **Rule_tab;
+ register char *p;
+ register char *c;
+ char *q;
+ char *buf_org;
+ static int ignore = FALSE;
+ int cont = FALSE;
+ int pos = 0;
+ int res = 0;
+ register char *tmp = NIL(char);
+
+ DB_ENTER( "Get_line" );
+
+ if( Skip_to_eof ) {
+ Skip_to_eof = FALSE;
+ rule_ind = 0;
+
+ if( Verbose & V_MAKE )
+ Warning("Ignoring remainder of file %s", Filename());
+
+ DB_RETURN(TRUE);
+ }
+
+ if( fil == NIL(FILE) ) {
+ /* Reading the internal rule table. Set rule_ind to zero after the
+ * last entry so that ReadEnvironment() works as expected every time. */
+
+ while( (p = Rule_tab[ rule_ind++ ]) != NIL(char) ) {
+ /* The last test in this if *p != '~', handles the environment
+ * passing conventions used by MKS to pass arguments. We want to
+ * skip those environment entries. Also CYGWIN likes to export '!'
+ * prefixed environment variables that cause severe pain, axe them too.
+ * And finally it is possible to do "env 'GGG HHH'='some value' bash"
+ * which causes that there are env variables with spaces in the name
+ * defined which causes dmake to malfunction too */
+ char *equal = strchr(p,'=');
+ char *space = strchr(p,' ');
+ if( !Readenv || (Readenv && (equal != NIL(char)) && (space == NIL(char) || space > equal) && *p!='~' && *p!='!')){
+ strcpy( buf, p );
+
+ DB_PRINT( "io", ("Returning [%s]", buf) );
+ DB_RETURN( FALSE );
+ }
+ }
+
+ rule_ind = 0;
+
+ DB_PRINT( "io", ("Done Ruletab") );
+ DB_RETURN( TRUE );
+ }
+
+ buf_org = buf;
+
+do_again:
+ do {
+ p = buf+pos;
+ /* fgets() reads at most one less than Buffer_size-pos characters. */
+ if(feof( fil ) || (fgets( p, Buffer_size-pos, fil ) == NIL(char)))
+ DB_RETURN( TRUE );
+
+#ifdef _MPW
+ if ( p[0] == 10 && p[1] == COMMENT_CHAR)
+ p[0] = ' ';
+#endif
+
+ Line_number++;
+
+ /* Set q to the last char in p before the \n\0. */
+ q = p+strlen(p)-2;
+ if( q >= p ) { /* Only check for special cases if p points
+ * to a non-empty line. */
+
+ /* ignore each RETURN at the end of a line before any further
+ * processing */
+ if( q[0] == '\r' && q[1] == '\n' ) {
+ q[0] = '\n';
+ q[1] = '\0';
+ q--;
+ }
+ /* you also have to deal with END_OF_FILE chars to process raw
+ * DOS-Files. Normally they are the last chars in file, but after
+ * working on these file with vi, there is an additional NEWLINE
+ * after the last END_OF_FILE. So if the second last char in the
+ * actual line is END_OF_FILE, you can skip the last char. Then
+ * you can search the line back until you find no more END_OF_FILE
+ * and nuke each you found by string termination. */
+ if( q[0] == '\032' )
+ q--;
+ while( q[1] == '\032' ) {
+ q[1] = '\0';
+ q--;
+ }
+
+ /* ignore input if ignore flag set and line ends in a continuation
+ character. */
+
+ if( ignore ) {
+ if( q[0] != CONTINUATION_CHAR || q[1] != '\n' ) ignore = FALSE;
+ *p = '\0';
+ continue;
+ }
+
+ /* If a comment is found the line does not end in \n anymore. */
+ c = Do_comment(p, &q, Group || (*buf == '\t') || (Notabs && *buf ==' '));
+
+ /* Does the end of the line end in a continuation sequence? */
+
+ if( (q[0] == CONTINUATION_CHAR) && (q[1] == '\n')) {
+ /* If the continuation was at the end of a comment then ignore the
+ * next input line, (or lines until we get one ending in just <nl>)
+ * else it's a continuation, so build the input line from several
+ * text lines on input. The maximum size of this is governened by
+ * Buffer_size */
+ if( q != p && q[-1] == CONTINUATION_CHAR ) {
+ size_t len = strlen(q+1)+1;
+ memmove( q, q+1, len );
+ q--;
+ cont = FALSE;
+ }
+ else if( c != NIL(char) )
+ ignore = TRUE;
+ else
+ cont = TRUE; /* Keep the \<nl>. */
+ }
+ else {
+ cont = FALSE;
+ }
+
+ q = ( c == NIL(char) ) ? q+2 : c;
+ }
+ else { /* empty line or "" */
+ cont = FALSE;
+ ignore = FALSE;
+ q = p+strlen(p); /* strlen(p) is 1 or 0 */
+ }
+
+ pos += q-p;
+ }
+ while( (cont || !*buf) && (pos < Buffer_size-1) );
+
+ if( pos >= Buffer_size-1 )
+ Fatal( "Input line too long, increase MAXLINELENGTH" );
+
+ /* Lines that had comments don't contain \n anymore. */
+ /* ??? Continued lines that are followed by an empty or comment only
+ * line will end in \<nl>. */
+ if( (q > p) && (buf[ pos-1 ] == '\n') )
+ buf[ --pos ] = '\0'; /* Remove the final \n. */
+
+ /* STUPID AUGMAKE uses "include" at the start of a line as
+ * a signal to include a new file, so let's look for it.
+ * if we see it replace it by .INCLUDE: and stick this back
+ * into the buffer. We also allow GNU make if[n]eq/else/endif.
+ *
+ * These substitutions are made only if we are not parsing a group
+ * recipe. */
+ if( (p = DmStrSpn(buf, " \t\r\n")) == NIL(char) )
+ p = buf;
+
+ if (!Group) {
+ if( !strncmp( "include", p, 7 ) &&
+ (p[7] == ' ' || p[7] == '\t') )
+ tmp = DmStrJoin( ".INCLUDE:", p+7, -1, FALSE );
+ else if( !strncmp( "ifeq", p, 4 ) &&
+ (p[4] == ' ' || p[4] == '\t') )
+ tmp = DmStrJoin( ".IFEQ", p+4, -1, FALSE );
+ else if( !strncmp( "ifneq", p, 5 ) &&
+ (p[5] == ' ' || p[5] == '\t') )
+ tmp = DmStrJoin( ".IFNEQ", p+5, -1, FALSE );
+ else if( !strncmp( "elif", p, 4 ) &&
+ (p[4] == ' ' || p[4] == '\t') )
+ tmp = DmStrJoin( ".ELIF", p+4, -1, FALSE );
+ else if( !strncmp( "else", p, 4 ) &&
+ (p[4] == ' ' || p[4] == '\t' || p[4] == '\0') )
+ tmp = DmStrJoin( ".ELSE", p+4, -1, FALSE );
+ else if( !strncmp( "endif", p, 5 ) &&
+ (p[5] == ' ' || p[5] == '\t' || p[5] == '\0') )
+ tmp = DmStrJoin( ".END", p+5, -1, FALSE );
+ }
+
+ if( tmp != NIL(char)) {
+ strcpy( buf, tmp );
+ FREE( tmp );
+ tmp = NIL(char);
+ }
+
+ /* Now that we have the next line of input to make, we should check to
+ * see if it is a conditional expression. If it is then process it,
+ * otherwise pass it on to the parser. */
+
+ if( *(p = DmStrSpn(buf, " \t\r\n")) == CONDSTART ) {
+ TKSTR token;
+
+ SET_TOKEN( &token, p );
+
+ p = Get_token( &token, "", FALSE );
+
+ if( (res = _is_conditional(p)) != 0 ) /* ignore non-control special */
+ { /* targets */
+ res = _handle_conditional( res, &token );
+ skip = TRUE;
+ }
+ else {
+ CLEAR_TOKEN( &token );
+ res = TRUE;
+ }
+ }
+
+ if( skip ) {
+ buf = buf_org; /* ignore line just read in */
+ pos = 0;
+ skip = res;
+ goto do_again;
+ }
+
+ DB_PRINT( "io", ("Returning [%s]", buf) );
+ DB_RETURN( FALSE );
+}
+
+
+PUBLIC char *
+Do_comment(str, pend, keep)/*
+=============================
+ Search the input string looking for comment chars. If it contains
+ comment chars then NUKE the remainder of the line, if the comment
+ char is preceeded by \ then shift the remainder of the line left
+ by one char. */
+char *str;
+char **pend;
+int keep;
+{
+ char *c = str;
+
+ while( (c = strchr(c, COMMENT_CHAR)) != NIL(char) ) {
+ if( Comment || State == NORMAL_SCAN )
+ if( c != str && c[-1] == ESCAPE_CHAR ) {
+ size_t len = strlen(c)+1;
+ memmove( c-1, c, len ); /* copy it left, due to \# */
+ if( pend ) (*pend)--; /* shift tail pointer left */
+ }
+ else {
+ /* Check/execute if shebang command is present. */
+ if( !No_exec
+ && c == str
+ && c[1] == '!'
+ && Line_number == 1
+ && Nestlevel() == 1 ) {
+ char *cmnd;
+
+ cmnd = Expand(c+2);
+ cmnd[strlen(cmnd)-1] = '\0'; /* strip last newline */
+ Current_target = Root;
+#if defined(MSDOS)
+ Swap_on_exec = TRUE;
+#endif
+ Wait_for_completion = TRUE;
+ Do_cmnd(&cmnd, FALSE, TRUE, Current_target, A_DEFAULT, TRUE);
+#if defined(MSDOS)
+ Swap_on_exec = FALSE;
+#endif
+ Wait_for_completion = FALSE;
+ FREE(cmnd);
+ }
+
+ *c = '\0'; /* a true comment so break */
+ break;
+ }
+ else {
+ if( keep )
+ c = NIL(char);
+ else
+ *c = '\0';
+
+ break;
+ }
+ }
+
+ return(c);
+}
+
+
+PUBLIC char *
+Get_token( string, brk, anchor )/*
+==================================
+ Return the next token in string.
+
+ Returns empty string when no more tokens in string.
+ brk is a list of chars that also cause breaks in addition to space and
+ tab, but are themselves returned as tokens. if brk is NULL then the
+ remainder of the line is returned as a single token.
+
+ 'anchor' if 1, says break on chars in the brk list, but only if
+ the entire token begins with the first char of the brk list, if
+ 0 then any char of brk will cause a break to occurr.
+
+ If 'anchor' is 2, then break only seeing the first char in the break
+ list allowing only chars in the break list to form the prefix. */
+
+TKSTRPTR string;
+char *brk;
+int anchor;
+{
+ register char *s;
+ register char *curp = 0;
+ register char *t;
+ int done = FALSE;
+ char space[100];
+
+ DB_ENTER( "Get_token" );
+
+ s = string->tk_str; /* Get string parameters */
+ *s = string->tk_cchar; /* ... and strip leading w/s */
+
+ SCAN_WHITE( s );
+
+ DB_PRINT( "tok", ("What's left [%s]", s) );
+
+ if( !*s ) {
+ DB_PRINT( "tok", ("Returning NULL token") );
+ DB_RETURN( "" );
+ }
+
+
+ /* Build the space list. space contains all those chars that may possibly
+ * cause breaks. This includes the brk list as well as white space. */
+
+ if( brk != NIL(char) ) {
+ strcpy( space, " \t\r\n" );
+ strcat( space, brk );
+ }
+ else {
+ space[0] = 0xff; /* a char we know will not show up */
+ space[1] = 0;
+ }
+
+
+ /* Handle processing of quoted tokens. Note that this is disabled if
+ * brk is equal to NIL */
+
+ while( *s == '\"' && ((brk != NIL(char)) || !string->tk_quote) ) {
+ s++;
+ if( string->tk_quote ) {
+ curp = s-1;
+ do { curp = strchr( curp+1, '\"' ); }
+ while( (curp != NIL(char)) && (*(curp+1) == '\"'));
+
+ if( curp == NIL(char) ) Fatal( "Unmatched quote in token" );
+ string->tk_quote = !string->tk_quote;
+
+ /* Check for "" case, and if found ignore it */
+ if( curp == s ) continue;
+ goto found_token;
+ }
+ else
+ SCAN_WHITE( s );
+
+ string->tk_quote = !string->tk_quote;
+ }
+
+
+ /* Check for a token break character at the beginning of the token.
+ * If found return the next set of break chars as a token. */
+
+ if( anchor == 2 && brk != NIL(char) ) {
+ curp = s;
+ while( *curp && (strchr(brk,*curp)!=NIL(char)) && (*curp!=*brk) ) curp++;
+ done = (*brk == *curp++);
+ }
+ else if( (brk != NIL(char)) && (strchr( brk, *s ) != NIL(char)) ) {
+ curp = DmStrSpn( s, brk );
+ done = (anchor == 0) ? TRUE :
+ ((anchor == 1)?(*s == *brk) : (*brk == curp[-1]));
+ }
+
+
+ /* Scan for the next token in the list and return it less the break char
+ * that was used to terminate the token. It will possibly be returned in
+ * the next call to Get_token */
+
+ if( !done ) {
+ SCAN_WHITE( s );
+
+ t = s;
+ do {
+ done = TRUE;
+ curp = DmStrPbrk(t, space);
+
+ if( anchor && *curp && !IS_WHITE( *curp ) )
+ if( ((anchor == 1)?*curp:DmStrSpn(curp,brk)[-1]) != *brk ) {
+ t++;
+ done = FALSE;
+ }
+ }
+ while( !done );
+
+ if( (curp == s) && (strchr(brk, *curp) != NIL(char)) ) curp++;
+ }
+
+found_token:
+ string->tk_str = curp;
+ string->tk_cchar = *curp;
+ *curp = '\0';
+
+ DB_PRINT( "tok", ("Returning [%s]", s) );
+ DB_RETURN( s );
+}
+
+
+static int
+_is_conditional( tg )/*
+=======================
+ Look at tg and return it's value if it is a conditional identifier
+ otherwise return 0. */
+char *tg;
+{
+ DB_ENTER( "_is_conditional" );
+
+ tg++;
+ switch( *tg )
+ {
+ case 'I':
+ if( !strcmp( tg, "IF" )) DB_RETURN( ST_IF );
+ else if( !strcmp( tg, "IFEQ" )) DB_RETURN( ST_IFEQ );
+ else if( !strcmp( tg, "IFNEQ" )) DB_RETURN( ST_IFNEQ );
+ break;
+
+ case 'E':
+ if( !strcmp( tg, "END" )) DB_RETURN( ST_END );
+ else if( !strcmp( tg, "ENDIF")) DB_RETURN( ST_END );
+ else if( !strcmp( tg, "ELSE" )) DB_RETURN( ST_ELSE );
+ else if( !strcmp( tg, "ELIF" )) DB_RETURN( ST_ELIF );
+ break;
+ }
+
+ DB_RETURN( 0 );
+}
+
+
+
+#define SEEN_END 0x00
+#define SEEN_IF 0x01
+#define SEEN_ELSE 0x02
+#define SEEN_ELIF 0x04
+
+#define ACCEPT_IF 0x10
+#define ACCEPT_ELIF 0x20
+
+static int
+_handle_conditional( opcode, tg )
+ int opcode;
+ TKSTRPTR tg;
+{
+ static short action[MAX_COND_DEPTH];
+ static char ifcntl[MAX_COND_DEPTH];
+ char *cst;
+ char *lhs, *expr, *expr_end;
+ char *lop;
+ int result;
+
+ DB_ENTER( "_handle_conditional" );
+
+ switch( opcode ) {
+ case ST_ELIF:
+ if( !(ifcntl[Nest_level] & SEEN_IF) || (ifcntl[Nest_level]&SEEN_ELSE) )
+ Fatal(".ELIF without a preceeding .IF" );
+ /*FALLTHRU*/
+
+ case ST_IF:
+ case ST_IFEQ:
+ case ST_IFNEQ:
+ if( opcode != ST_ELIF && (Nest_level+1) == MAX_COND_DEPTH )
+ Fatal( ".IF .ELSE ... .END nesting too deep" );
+
+ If_expand = TRUE;
+ expr = Expand( Get_token( tg, NIL(char), FALSE ));
+ If_expand = FALSE;
+
+ /* Remove CONTINUATION_CHAR<nl> and replace with " " so that line
+ * continuations are recognized as whitespace. */
+ for( cst=strchr(expr,CONTINUATION_CHAR); cst != NIL(char); cst=strchr(cst,CONTINUATION_CHAR) )
+ if( cst[1] == '\n' ) {
+ *cst = ' ';
+ cst[1] = ' ';
+ }
+ else
+ cst++;
+
+ lhs = expr;
+ SCAN_WHITE( lhs );
+
+ /* Parse the expression and get its logical result */
+ if ( ((lop = DmStrStr(lhs, "||" )) != NIL(char)) || ((lop = DmStrStr(lhs, "&&" )) != NIL(char)) )
+ result = parse_complex_expression( lhs, &expr_end, opcode );
+ else
+ result = partcomp( lhs, opcode );
+
+ if( expr != NIL(char) ) FREE( expr );
+
+ if( opcode != ST_ELIF ) {
+ Nest_level++;
+ action[Nest_level] = 1;
+ }
+ ifcntl[Nest_level] |= (opcode==ST_ELIF)?SEEN_ELIF:SEEN_IF;
+
+ if( result ) {
+ if( !(ifcntl[Nest_level] & (ACCEPT_IF|ACCEPT_ELIF)) ) {
+ action[ Nest_level ] = action[ Nest_level-1 ];
+ ifcntl[Nest_level] |= (opcode==ST_ELIF)?ACCEPT_ELIF:ACCEPT_IF;
+ }
+ else
+ action[Nest_level] = 1;
+ }
+ else
+ action[Nest_level] = 1;
+ break;
+
+ case ST_ELSE:
+ if( Nest_level <= 0 ) Fatal( ".ELSE without .IF" );
+ if( ifcntl[Nest_level] & SEEN_ELSE )
+ Fatal( "Missing .IF or .ELIF before .ELSE" );
+
+ if( ifcntl[Nest_level] & (ACCEPT_IF|ACCEPT_ELIF) )
+ action[Nest_level] = 1;
+ else if( action[ Nest_level-1 ] != 1 )
+ action[ Nest_level ] ^= 0x1; /* flip between 0 and 1 */
+
+ ifcntl[Nest_level] |= SEEN_ELSE;
+ break;
+
+ case ST_END:
+ ifcntl[Nest_level] = SEEN_END;
+ Nest_level--;
+ if( Nest_level < 0 ) Fatal( "Unmatched .END[IF]" );
+ break;
+ }
+
+ DB_RETURN( action[ Nest_level ] );
+}
+
+/* uncomment to turn on expression debug statements */
+/*#define PARSE_DEBUG */
+#define PARSE_SKIP_WHITE(A) while( *A && ((*A==' ') || (*A=='\t')) ) A++;
+
+#define OP_NONE 0
+#define OP_AND 1
+#define OP_OR 2
+
+static int n = 1;
+
+int parse_complex_expression( char *expr, char **expr_end, int opcode )
+{
+ char *p = expr;
+ char *term_start = p;
+ char *term_end;
+ int local_term;
+ char *part;
+ int term_result = FALSE;
+ int final_result = TRUE;
+ unsigned int term_len;
+ unsigned int last_op = OP_NONE;
+
+ #ifdef PARSE_DEBUG
+ printf( "%d: parse_complex_expression( %s ): Opcode: %d\n", n, expr, opcode );
+ #endif
+
+ while ( 1 )
+ {
+ /* A new sub-expression */
+ local_term = TRUE;
+ if ( *p == '(' )
+ {
+ n++;
+ term_result = parse_complex_expression( p+1, &p, opcode );
+ n--;
+ PARSE_SKIP_WHITE( p );
+ term_start = p;
+ term_end = p;
+ local_term = FALSE;
+ }
+ else
+ term_end = p;
+
+ /* Lets do an operation!! */
+ if ( !(*p) /* at the end of the entire line */
+ || ((*p == '&') && (*(p+1) && (*(p+1)=='&'))) /* found an && */
+ || ((*p == '|') && (*(p+1) && (*(p+1)=='|'))) /* found an || */
+ || (*p == ')') ) /* at the end of our term */
+ {
+ /* Grab the sub-expression if we parsed it. Otherwise,
+ * it was a () subexpression and we don't need to evaluate
+ * it since that was already done.
+ */
+ if ( local_term == TRUE )
+ {
+ /* Back up 1 to the end of the actual term */
+ term_end--;
+
+ /* Evaluate the term */
+ PARSE_SKIP_WHITE( term_start );
+ term_len = term_end - term_start + 1;
+ part = MALLOC( term_len + 1, char );
+ strncpy( part, term_start, term_len );
+ *(part+term_len) = '\0';
+ #ifdef PARSE_DEBUG
+ printf( "%d: evaling '%s'\n", n, part );
+ #endif
+ term_result = partcomp( part, opcode );
+ #ifdef PARSE_DEBUG
+ printf( "%d: evaled, result %d\n", n, term_result );
+ #endif
+ FREE( part );
+ }
+
+ /* Do the actual logical operation using the _preceding_
+ * logical operator, NOT the one we just found.
+ */
+ if ( last_op == OP_AND )
+ final_result = final_result && term_result;
+ else if ( last_op == OP_OR )
+ final_result = final_result || term_result;
+ else
+ final_result = term_result;
+ #ifdef PARSE_DEBUG
+ printf( "%d: final_result:%d\n", n, final_result );
+ #endif
+
+ /* If we're not at the end of the line, just keep going */
+ if ( *p )
+ {
+ /* Recognize the operator we just found above */
+ if ( *p == '&' )
+ last_op = OP_AND;
+ else if ( *p == '|' )
+ last_op = OP_OR;
+ if ( *p != ')' )
+ p += 2;
+
+ /* Get the start of the next term */
+ PARSE_SKIP_WHITE( p );
+ term_start = p;
+
+ /* If this is the close of a term, we are done and return
+ * to our caller.
+ */
+ if ( *p == ')' )
+ {
+ p++;
+ break;
+ }
+ }
+ else break; /* At end of line, all done */
+ }
+ else if ( local_term == TRUE ) p++; /* Advance to next char in expression */
+ }
+ *expr_end = p;
+
+ #ifdef PARSE_DEBUG
+ printf( "%d: done, returning '%s', result %d\n", n, *expr_end, final_result );
+ #endif
+ return( final_result );
+}
+
+
+int partcomp( char* lhs, int opcode )
+{
+
+ char *tok, *rhs, *op = 0;
+ int result, opsind;
+ const int localopscount=4;
+ char* localops[] = { "==", "!=", "<=", ">=" };
+ int lint, rint;
+
+#define EQUAL 0
+#define NOTEQUAL 1
+#define LESS_EQUAL 2
+#define GREATER_EQUAL 3
+
+ #ifdef PARSE_DEBUG
+ printf( "eval: %s\n", lhs);
+ #endif
+
+ opsind = 0;
+ if( opcode == ST_IFEQ || opcode == ST_IFNEQ )
+ {
+ /* IF[N]EQ syntax is: .IF[N]EQ <1> <2>
+ * Here, step over first argument and get to <2> if it exists.
+ */
+ for( op = lhs; ((*op)&&(*op != ' ')&&(*op != '\t')); op++ );
+ if( *op ) op++; /* position op at start of <2> */
+ else op = NIL(char); /* only 1 argument given */
+ }
+ else
+ {
+ /* Find which logical operator we are to use for this expression,
+ * and jump to it */
+ while ( (opsind < localopscount) && ((op = DmStrStr(lhs, localops[opsind])) == NIL(char)) )
+ opsind++;
+
+ #ifdef PARSE_DEBUG
+ printf(" found op %d: %s\n", opsind, localops[opsind]);
+ #endif
+ }
+
+ /* If the opcode was IFEQ or IFNEQ and only 1 argument was given,
+ * or an unknown logical operator was encountered,
+ * return false if argument is empty string, true if !empty
+ */
+ if( op == NIL(char) )
+ result = (*lhs != '\0');
+ else
+ {
+ /* Make both characters of the operation the same, replacing the = in op[1]
+ * Its easier to deal with this way???
+ */
+ if( opcode != ST_IFEQ && opcode != ST_IFNEQ )
+ op[1] = op[0];
+
+ #ifdef PARSE_DEBUG
+ printf(" op:%s\n", op);
+ #endif
+
+ /* Isolate the left half of the expression */
+ if( lhs != op )
+ {
+ for( tok = op-1; (tok != lhs) && ((*tok == ' ')||(*tok == '\t')); tok-- );
+ tok[1] = '\0';
+ }
+ else
+ lhs = NIL(char); /* Left hand side is empty. */
+
+ /* Jump over the operation so we can grab the right half of the expression */
+ if( opcode == ST_IFEQ || opcode == ST_IFNEQ )
+ op--;
+ else
+ op++;
+
+ /* Isolate the right half of the expression */
+ rhs = DmStrSpn( op+1, " \t" );
+ if( !*rhs ) rhs = NIL(char);
+
+ #ifdef PARSE_DEBUG
+ printf(" lhs:%s, rhs:%s\n", lhs, rhs);
+ #endif
+
+ /* Do the actual logical operation on the expression */
+ if ( opsind > NOTEQUAL )
+ {
+ switch( opsind )
+ {
+ case LESS_EQUAL:
+ case GREATER_EQUAL:
+ /* Ignore quotes around the arguments */
+ if ( lhs && lhs[0] == '"' ) lhs++;
+ if ( rhs && rhs[0] == '"' ) rhs++;
+
+ /* Empty strings evaluate to zero. */
+ lint = lhs ? atoi( lhs ) : 0;
+ rint = rhs ? atoi( rhs ) : 0;
+ result = ( lint >= rint ) ? TRUE : FALSE;
+ if ( opsind == LESS_EQUAL && lint != rint )
+ result = !result;
+ break;
+ default:
+ result = FALSE;
+ }
+ }
+ else
+ {
+ /* Use a simple string compare to determine equality */
+ if( (rhs == NIL(char)) || (lhs == NIL(char)) )
+ result = (rhs == lhs) ? TRUE : FALSE;
+ else
+ {
+ /* String off whitespace at the end of the right half of the expression */
+ tok = rhs + strlen( rhs );
+ for( tok=tok-1; (tok != lhs) && ((*tok == ' ')||(*tok == '\t')); tok--);
+ tok[1] = '\0';
+
+ result = (strcmp( lhs, rhs ) == 0) ? TRUE : FALSE;
+ }
+
+ if( *op == '!' || opcode == ST_IFNEQ ) result = !result;
+ }
+ }
+
+ #ifdef PARSE_DEBUG
+ printf("partresult %d\n\n",result);
+ #endif
+ return result;
+}
+
diff --git a/dmake/hash.c b/dmake/hash.c
new file mode 100644
index 000000000000..a172995656ba
--- /dev/null
+++ b/dmake/hash.c
@@ -0,0 +1,54 @@
+/* RCS $Id: hash.c,v 1.2 2006-09-25 09:39:55 vg Exp $
+--
+-- SYNOPSIS
+-- Hashing function for hash tables.
+--
+-- DESCRIPTION
+-- Hash an identifier. The hashing function works by computing the sum
+-- of each char and the previous hash value multiplied by 129. Finally the
+-- length of the identifier is added in. This way the hash depends on the
+-- chars as well as the length, and appears to be sufficiently unique,
+-- and is FAST to COMPUTE, unlike the previous hash function...
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+PUBLIC uint16
+Hash( id, phv )/*
+=================
+ This function computes the identifier's hash value and returns the hash
+ value modulo the key size as well as the full hash value. The reason
+ for returning both is so that hash table searches can be sped up. You
+ compare hash keys instead and compare strings only for those whose 32-bit
+ hash keys match. (not many) */
+
+char *id; /* value */
+uint32 *phv; /* key */
+{
+ register char *p = id;
+ register uint32 hash = (uint32) 0;
+
+ while( *p ) hash = (hash << 7) + hash + (uint32) (*p++);
+ *phv = hash = hash + (uint32) (p-id);
+
+ /* return an index (for Macs[]) where all keys with the same remainder
+ * after integer division with HASH_TABLE_SIZE are stored. */
+ return( (uint16) (hash % HASH_TABLE_SIZE) );
+}
+
diff --git a/dmake/imacs.c b/dmake/imacs.c
new file mode 100644
index 000000000000..437a2a53c8a6
--- /dev/null
+++ b/dmake/imacs.c
@@ -0,0 +1,206 @@
+/* RCS $Id: imacs.c,v 1.9 2008-03-05 18:29:01 kz Exp $
+--
+-- SYNOPSIS
+-- Define default internal macros.
+--
+-- DESCRIPTION
+-- This file adds to the internal macro tables the set of default
+-- internal macros, and for those that are accessible internally via
+-- variables creates these variables, and initializes them to point
+-- at the default values of these macros.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+static void _set_int_var ANSI((char *, char *, int, int *));
+static void _set_string_var ANSI((char *, char *, int, char **));
+static void _set_bit_var ANSI((char *, char *, int));
+
+
+PUBLIC void
+Make_rules()/*
+==============
+ Parse the strings stored in Rule_tab (from ruletab.c). */
+{
+ Parse(NIL(FILE));
+}
+
+
+#define M_FLAG M_DEFAULT | M_EXPANDED
+
+/*
+** Add to the macro table all of the internal macro variables plus
+** create secondary variables which will give access to their values
+** easily, both when needed and when the macro value is modified.
+** The latter is accomplished by providing a flag in the macro and a field
+** which gives a pointer to the value if it is a char or string macro value
+** and a mask representing the bit of the global flag register that is affected
+** by this macro's value.
+*/
+PUBLIC void
+Create_macro_vars()
+{
+ static char* switchar;
+ static char* version;
+ char swchar[2];
+ char buf[20];
+
+ swchar[0] = Get_switch_char(), swchar[1] = '\0';
+ _set_string_var("SWITCHAR", swchar, M_PRECIOUS, &switchar);
+ if (*swchar == '/')
+ DirSepStr = "\\";
+ else
+#if (_MPW)
+ DirSepStr = ":";
+#elif defined( __EMX__)
+ /* Use '\' for OS/2 port. */
+ DirSepStr = "\\";
+#else
+ DirSepStr = "/";
+#endif
+ _set_string_var("DIRSEPSTR", DirSepStr, M_DEFAULT,&DirSepStr);
+ _set_string_var("DIRBRKSTR", DirBrkStr, M_DEFAULT, &DirBrkStr);
+ swchar[0] = DEF_ESCAPE_CHAR, swchar[1] = '\0';
+ _set_string_var(".ESCAPE_PREFIX", swchar, M_FLAG, &Escape_char);
+
+ /* Each one the following attributes corresponds to a bit of
+ * Glob_attr. */
+ _set_bit_var(".SILENT", "", A_SILENT );
+ _set_bit_var(".IGNORE", "", A_IGNORE );
+ _set_bit_var(".PRECIOUS", "", A_PRECIOUS);
+ _set_bit_var(".EPILOG", "", A_EPILOG );
+ _set_bit_var(".PROLOG", "", A_PROLOG );
+ _set_bit_var(".NOINFER", "", A_NOINFER );
+ _set_bit_var(".SEQUENTIAL","",A_SEQ );
+ _set_bit_var(".USESHELL", "", A_SHELL );
+ /* .SWAP (MSDOS) and .WINPATH (cygwin) share the same bit. */
+ _set_bit_var(".SWAP", "", A_SWAP );
+ _set_bit_var(".WINPATH", "", A_WINPATH );
+ _set_bit_var(".MKSARGS", "", A_MKSARGS );
+ _set_bit_var(".IGNOREGROUP","",A_IGNOREGROUP);
+
+ Glob_attr = A_DEFAULT; /* set all flags to NULL */
+
+ _set_string_var("SHELL", "", M_DEFAULT, &Shell );
+ _set_string_var("SHELLFLAGS", " ", M_DEFAULT, &Shell_flags );
+ _set_string_var("SHELLCMDQUOTE","", M_DEFAULT, &Shell_quote );
+ _set_string_var("GROUPSHELL", "", M_DEFAULT, &GShell );
+ _set_string_var("GROUPFLAGS", " ", M_DEFAULT, &GShell_flags);
+ _set_string_var("SHELLMETAS", "", M_DEFAULT, &Shell_metas );
+ _set_string_var("GROUPSUFFIX", "", M_DEFAULT, &Grp_suff );
+ _set_string_var("AUGMAKE",NIL(char), M_DEFAULT, &Augmake );
+ _set_string_var("OOODMAKEMODE", "", M_DEFAULT, &OOoDmMode );
+ _set_string_var(".KEEP_STATE", "", M_DEFAULT, &Keep_state );
+ _set_string_var(".NOTABS", "", M_MULTI, &Notabs );
+ _set_string_var(".DIRCACHE", "y", M_DEFAULT, &UseDirCache );
+
+#if CASE_INSENSITIVE_FS
+#define DIRCACHERESPCASEDEFAULT ""
+#else
+#define DIRCACHERESPCASEDEFAULT "y"
+#endif
+ _set_string_var(".DIRCACHERESPCASE", DIRCACHERESPCASEDEFAULT, M_DEFAULT, &DcacheRespCase);
+
+ _set_string_var("MAKEDIR",Get_current_dir(),M_PRECIOUS|M_NOEXPORT,
+ &Makedir_macval);
+ Makedir = DmStrDup(Makedir_macval); /* Later done by Def_macro(). */
+ _set_string_var("MAKEVERSION", VERSION, M_PRECIOUS, &version);
+ _set_string_var("PWD", Makedir, M_PRECIOUS|M_NOEXPORT, &Pwd_macval);
+ Pwd = DmStrDup(Pwd_macval); /* Later done by Def_macro(). */
+ _set_string_var("TMD", ".", M_PRECIOUS|M_NOEXPORT, &Tmd_macval);
+ Tmd = DmStrDup(Tmd_macval); /* Later done by _set_tmd(). */
+
+ Def_macro("NULL", "", M_PRECIOUS|M_NOEXPORT|M_FLAG);
+
+ /* Initialize a macro that contains a space. As leading and trailing
+ * spaces are stripped by Def_macro a little cheating is necessary. */
+ _set_string_var("SPACECHAR", "x", M_PRECIOUS|M_NOEXPORT|M_FLAG, &Spacechar );
+ Spacechar[0] = ' ';
+
+ _set_int_var( "MAXLINELENGTH", "0", M_DEFAULT|M_NOEXPORT, &Buffer_size );
+ _set_int_var( "PREP", "0", M_DEFAULT, &Prep );
+ (void) Def_macro("MAXLINELENGTH", "1024", M_FLAG | M_DEFAULT);
+
+ /* MAXPROCESSLIMIT is overwritten by the ruletab.c settings. Set its
+ * initial value high so that it allows MAXPROCESS to be changed
+ * from the command line. */
+ _set_int_var( "MAXPROCESSLIMIT", "100", M_DEFAULT|M_NOEXPORT,&Max_proclmt );
+#if defined(USE_CREATEPROCESS)
+ /* Set the OS early enough. */
+ Max_proclmt = MAXIMUM_WAIT_OBJECTS;
+#endif
+ _set_int_var( "MAXPROCESS", "1", M_DEFAULT|M_NOEXPORT, &Max_proc );
+ sprintf(buf,"%d",NAME_MAX);
+ _set_int_var( "NAMEMAX", buf, M_DEFAULT|M_NOEXPORT, &NameMax);
+}
+
+
+/*
+** Define an integer variable value, and set up the macro.
+*/
+static void
+_set_int_var(name, val, flag, var)
+char *name;
+char *val;
+int flag;
+int *var;
+{
+ HASHPTR hp;
+
+ hp = Def_macro(name, val, M_FLAG | flag);
+ hp->ht_flag |= M_VAR_INT | M_MULTI | M_INIT;
+ hp->MV_IVAR = var;
+ *var = atoi(val);
+}
+
+
+/*
+** Define a string variables value, and set up the macro.
+*/
+static void
+_set_string_var(name, val, flag, var)
+char *name;
+char *val;
+int flag;
+char **var;
+{
+ HASHPTR hp;
+
+ hp = Def_macro(name, val, M_FLAG | flag);
+ hp->ht_flag |= M_VAR_STRING | M_MULTI | M_INIT;
+ hp->MV_SVAR = var;
+ *var = hp->ht_value;
+}
+
+
+/* Define a bit variable value, and set up the macro. Each of the bits
+ * corresponds to an attribute bit of Glob_attr. */
+static void
+_set_bit_var(name, val, mask)
+char *name;
+char *val;
+int mask;
+{
+ HASHPTR hp;
+
+ hp = Def_macro(name, val, M_FLAG);
+ hp->ht_flag |= M_VAR_BIT | M_MULTI | M_INIT;
+ hp->MV_MASK = mask;
+ hp->MV_BVAR = &Glob_attr;
+}
diff --git a/dmake/infer.c b/dmake/infer.c
new file mode 100644
index 000000000000..e424b34fb201
--- /dev/null
+++ b/dmake/infer.c
@@ -0,0 +1,904 @@
+/* $RCSfile: infer.c,v $
+-- $Revision: 1.8 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:39:49 $
+--
+-- SYNOPSIS
+-- Infer how to make a target.
+--
+-- DESCRIPTION
+-- This file contains the code to infer a recipe, and possibly some new
+-- prerequisites for a target which dmake does not know how to make, or
+-- has no explicit recipe.
+--
+-- The inference fails if no path through the inference graph can be
+-- found by which we can make the target.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+/* attributes that get transfered from the % start cell to the inferred
+ * cells. */
+
+#define A_TRANSFER (A_EPILOG | A_PRECIOUS | A_SILENT | A_SHELL | A_SETDIR |\
+ A_SEQ | A_LIBRARY | A_IGNORE | A_PROLOG | A_SWAP |\
+ A_PHONY | A_NOSTATE )
+
+
+/* Define local static functions */
+static DFALINKPTR dfa_subset ANSI((DFALINKPTR, DFASETPTR));
+static void free_dfas ANSI((DFALINKPTR));
+static int count_dots ANSI((char *));
+static char * buildname ANSI((char *, char *, char *));
+static void free_icells ANSI((void));
+static ICELLPTR union_iset ANSI((ICELLPTR, ICELLPTR));
+static ICELLPTR add_iset ANSI((ICELLPTR,ICELLPTR,CELLPTR,DFALINKPTR,
+ CELLPTR,int,int,char *,char *, int));
+static ICELLPTR derive_prerequisites ANSI((ICELLPTR, ICELLPTR *));
+static char * dump_inf_chain ANSI((ICELLPTR, int, int));
+
+#ifdef DBUG
+static void _dump_dfa_stack ANSI((DFALINKPTR, DFASETPTR));
+static void _dump_iset ANSI(( char *, ICELLPTR ));
+#endif
+
+
+PUBLIC void
+Infer_recipe( cp, setdirroot )/*
+================================
+ Perform a breadth-first search of the inference graph and return if
+ possible an inferred set of prerequisites for making the current target. */
+CELLPTR cp;
+CELLPTR setdirroot;
+{
+ ICELLPTR nomatch, match;
+
+ DB_ENTER("Infer_recipe");
+
+ if( cp->ce_attr & A_NOINFER ) {DB_VOID_RETURN;}
+
+ DB_PRINT("inf", ("Inferring rule for [%s]", cp->CE_NAME));
+
+ match = NIL(ICELL);
+ nomatch = add_iset( NIL(ICELL), NIL(ICELL), NIL(CELL), NIL(DFALINK),
+ setdirroot, Prep+count_dots(cp->CE_NAME), 0,
+ DmStrDup(cp->CE_NAME), NIL(char),
+ cp->ce_time != (time_t)0L);
+
+ /* Make sure we try whole heartedly to infer at least one suffix */
+ if( nomatch->ic_dmax == 0 ) ++nomatch->ic_dmax;
+
+ DB_EXECUTE( "inf", _dump_iset("nomatch",nomatch); );
+
+ /* If nomatch is non-empty there was no match with an existing
+ * prerrequisite, try to derive one. */
+ while( nomatch != NIL(ICELL) ) {
+ ICELLPTR new_nomatch = NIL(ICELL);
+ ICELLPTR ic, pmatch, mmatch;
+ CELLPTR prereq;
+
+ for( ic=nomatch; ic != NIL(ICELL); ic=ic->ic_next ) {
+ int ipush = FALSE;
+
+ if( ic->ic_dir ) ipush = Push_dir(ic->ic_dir, ic->ic_name, FALSE);
+ match = union_iset(match, derive_prerequisites(ic, &new_nomatch));
+ if( ipush ) Pop_dir(FALSE);
+ }
+
+ DB_EXECUTE( "inf", _dump_iset("match",match); );
+ DB_EXECUTE( "inf", _dump_iset("nomatch",new_nomatch); );
+
+ /* We have now deduced the two sets MATCH and NOMATCH. MATCH holds the
+ * set of edges that we encountered that matched. If this set is empty
+ * then we can apply transitive closure (if enabled) to the elements of
+ * NOMATCH to see if we can find some other method to make the target.
+ *
+ * If MATCH is non-empty, we have found a method for making the target.
+ * It is the shortest method for doing so (ie. uses fewest number of
+ * steps). If MATCH contains more than one element then we have a
+ * possible ambiguity.
+ */
+ if( match == NIL(ICELL) ) {
+ nomatch = new_nomatch;
+
+ /* Skip the rest and try one level deeper. */
+ if( Transitive ) continue;
+
+ goto all_done;
+ }
+
+ /* Ok, we have a set of possible matches in MATCH, we should check the
+ * set for ambiguity. If more than one inference path exists of the
+ * same depth, then we may issue an ambiguous inference error message.
+ *
+ * The message is suppressed if MATCH contains two elements and one of
+ * them is the empty-prerequisite-rule. In this case we ignore the
+ * ambiguity and take the rule that infers the prerequisite.
+ *
+ * Also if there are any chains that rely on a non-existant prerequisite
+ * that may get made because it has a recipe then we prefer any that
+ * rely on existing final prerequisites over those that we have to make.
+ */
+
+ /* Split out those that have to be made from those that end in
+ * prerequisites that already exist. */
+ pmatch = mmatch = NIL(ICELL);
+ for(; match; match = ic ) {
+ /* This loop checks all possible matches. */
+ DB_PRINT("inf", ("Target [%s] : prerequisite [%s]",
+ match->ic_meta->CE_NAME, match->ic_name));
+
+ ic = match->ic_next;
+ match->ic_next = NIL(ICELL);
+
+ if( match->ic_exists )
+ pmatch = union_iset(pmatch, match);
+ else
+ mmatch = union_iset(mmatch, match);
+ }
+
+ /* Prefer %-targets with existing prerequisites. */
+ if( pmatch )
+ match = pmatch;
+ else
+ match = mmatch;
+
+ /* Make sure it is unique. It would be easy to check
+ * match->ic_meta->ce_prq for existence and prefer no prerequisites
+ * over prerequisites that are present, but we are currently not
+ * doing it. */
+ if( match->ic_next != NIL(ICELL) ) {
+ int count = 1;
+
+ Warning( "Ambiguous inference chains for target '%s'", cp->CE_NAME );
+ for( ic=match; ic; ic=ic->ic_next )
+ (void) dump_inf_chain(ic, TRUE, count++);
+ Warning( "First matching rule is chosen.");
+ }
+
+ /* MATCH now points at the derived prerequisite chain(s). We must now
+ * take cp, and construct the correct graph so that the make may
+ * proceed. */
+
+ /* The folowing shows only the first element, i.e. the last matching
+ * recipe that was found. */
+ if( Verbose & V_INFER ) {
+ char *tmp = dump_inf_chain(match, TRUE, FALSE);
+ printf("%s: Inferring prerequistes and recipes using:\n%s: ... %s\n",
+ Pname, Pname, tmp );
+ FREE(tmp); }
+
+ pmatch = NIL(ICELL);
+ prereq = NIL(CELL);
+
+ /* This loop treats the inferred targets last to first. */
+ while( match ) {
+ CELLPTR infcell=NIL(CELL);
+
+ /* Compute the inferred prerequisite first. */
+ if( match->ic_name ) {
+ if( match->ic_meta )
+ infcell = Def_cell( match->ic_name );
+ else
+ infcell = cp;
+
+ infcell->ce_flag |= F_TARGET;
+
+ if( infcell != cp ) {
+ infcell->ce_flag |= F_INFER|F_REMOVE;
+ DB_PRINT("remove", ("Mark for deletion [%s]",
+ infcell->CE_NAME));
+ }
+
+ if( !match->ic_flag )
+ infcell->ce_attr |= A_NOINFER;
+ }
+
+ /* Add global prerequisites from previous rule if there are any and
+ * the recipe. */
+ if( pmatch ) {
+ CELLPTR imeta = pmatch->ic_meta;
+ LINKPTR lp;
+
+ DB_PRINT("inf", ("%%-target [%s] - infered target [%s]\n",
+ imeta->CE_NAME, infcell->CE_NAME));
+
+ infcell->ce_per = pmatch->ic_dfa->dl_per;
+ infcell->ce_attr |= (imeta->ce_attr & A_TRANSFER);
+
+ /* The .PHONY mechanism relies on having phony targets not
+ * being STATed and having a zero time stamp. While inferring
+ * the this target it might have been created and stated
+ * therefore these values need to be reset. */
+ if( infcell->ce_attr & A_PHONY ){
+ infcell->ce_time = 0L;
+ infcell->ce_flag &= ~F_STAT;
+ }
+
+ if( !(infcell->ce_flag & F_RULES) ) {
+ infcell->ce_flag |= (imeta->ce_flag&(F_SINGLE|F_GROUP))|F_RULES;
+ infcell->ce_recipe = imeta->ce_recipe;
+ }
+
+ /* Add any conditional macro definitions that may be associated
+ * with the inferred cell. */
+ if (imeta->ce_cond != NIL(STRING)) {
+ STRINGPTR sp,last;
+
+ last = infcell->ce_cond;
+ for(sp=imeta->ce_cond; sp; sp=sp->st_next) {
+ STRINGPTR new;
+ TALLOC(new, 1, STRING);
+ new->st_string = DmStrDup(sp->st_string);
+ if(last)
+ last->st_next = new;
+ else
+ infcell->ce_cond = new;
+ last = new;
+ }
+ }
+
+ pmatch->ic_dfa->dl_per = NIL(char);
+
+ /* If infcell already had a .SETDIR directory set then modify it
+ * based on whether it was the original cell or some intermediary. */
+ if( imeta->ce_dir ) {
+ if( infcell->ce_dir && infcell == cp ) {
+ /* cp->ce_dir was set and we have pushed the directory prior
+ * to calling this routine.
+ * We build a new path by appending imeta->ce_dir to the
+ * current directory of the original cell.
+ * We should therefore pop it and push the new concatenated
+ * directory required by the inference.
+ * This leaks memory as cp->ce_dir is not freed before
+ * setting the new the new infcell->ce_dir value but as
+ * the pointer could be a `A_POOL` member we accept this. */
+ infcell->ce_dir = DmStrDup(Build_path(infcell->ce_dir,
+ imeta->ce_dir));
+ }
+ else {
+ /* Inherit a copy of the .SETDIR value. Use a copy because
+ * the original could have been freed in the meantime
+ * in Make() by the FREE() before _pool_lookup(). This can
+ * also leak if infcell->ce_dir was set before. */
+ infcell->ce_dir = DmStrDup(imeta->ce_dir);
+ }
+ }
+
+ for( lp=imeta->ce_indprq; lp != NIL(LINK); lp=lp->cl_next ) {
+ char *name = lp->cl_prq->CE_NAME;
+ CELLPTR tcp;
+
+ name = buildname( cp->CE_NAME, name, infcell->ce_per );
+ tcp = Def_cell( name );
+ tcp->ce_flag |= F_REMOVE;
+ Add_prerequisite( infcell, tcp, FALSE, FALSE );
+
+ if( Verbose & V_INFER )
+ printf( "%s: Inferred indirect prerequisite [%s]\n",
+ Pname, name );
+ FREE(name);
+ }
+ }
+
+ /* Add the previous cell as the prerequisite */
+ if( prereq )
+ (Add_prerequisite(infcell,prereq,FALSE,FALSE))->cl_flag |=F_TARGET;
+
+ pmatch = match; /* Previous member in inference chain ... */
+ prereq = infcell; /* is a prerequisite to the next match. */
+ /* ip->ic_parent is the next target in the inference chain to be
+ * build. If it is empty we are done. */
+ match = match->ic_parent;
+ }
+
+ DB_PRINT("inf", ("Terminated due to a match"));
+ break;
+ }
+
+all_done:
+ free_icells();
+
+ DB_VOID_RETURN;
+}
+
+
+static ICELLPTR
+derive_prerequisites( ic, nnmp )/*
+===================================
+ Take a cell and derive a set of prerequisites from the cell. Categorize
+ them into those that MATCH (ie. those that we found in the file system),
+ and those that do not match NOMATCH that we may possibly have a look at
+ later. When we process the next level of the breadth-first search.
+
+ Once MATCH is non-empty we will stop inserting elements into NOMATCH
+ since we know that either MATCH is successful and unique or it will
+ issue an ambiguity error. We will never go on to look at elements
+ in NOMATCH after wards. */
+ICELLPTR ic;
+ICELLPTR *nnmp;
+{
+ ICELLPTR match = NIL(ICELL);
+ DFALINKPTR pdfa;
+ DFALINKPTR dfas;
+
+ DB_ENTER("derive_prerequisites");
+
+ DB_PRINT("inf", ("for [%s]\n", ic->ic_name));
+
+ /* If none of the inference nodes match then forget about the inference.
+ * The user did not tell us how to make such a target. We also stop the
+ * Inference if the new set of DFA's is a proper subset of a previous
+ * subset and it's PREP counts exceed the value of Prep.
+ */
+ dfas = dfa_subset( Match_dfa(ic->ic_name), &ic->ic_dfastack );
+
+ DB_EXECUTE("inf", _dump_dfa_stack(dfas, &ic->ic_dfastack); );
+
+ /* Ok, we have nothing here to work with so return an empty cell. */
+ if( dfas == NIL(DFALINK) ) {
+ DB_PRINT( "mem", ("%s:<- mem %ld",ic->ic_name, (long)coreleft()));
+ DB_PRINT( "inf", ("<<< Exit, no dfas, cp = %04x", NIL(CELL)) );
+ DB_RETURN( NIL(ICELL) );
+ }
+
+ /* Save the dfas, we are going to use on the stack for this cell. */
+ ic->ic_dfastack.df_set = dfas;
+
+ /* Run through the %-meta cells, build the prerequisite cells. For each
+ * %-meta go through it's list of edges and try to use each in turn to
+ * deduce a likely prerequisite. We perform a breadth-first search
+ * matching the first path that results in a unique method for making the
+ * target. */
+ for( pdfa = dfas; pdfa != NIL(DFALINK); pdfa = pdfa->dl_next ) {
+ LINK tl;
+ LINKPTR edge;
+ CELLPTR pmeta;
+
+ pmeta = pdfa->dl_meta;
+ DB_PRINT( "inf", ("Using dfa: [%s]", pmeta->CE_NAME) );
+
+ /* If the %-meta is a singleton meta then deal with it differently from
+ * the case when it is a bunch of %-meta's found on the original entries
+ * prerequisite list. */
+ if( pmeta->ce_flag & F_MULTI )
+ edge = pmeta->ce_prq;
+ else {
+ tl.cl_prq = pmeta;
+ tl.cl_next = NIL(LINK);
+ edge = &tl;
+ }
+
+ /* Now run through the list of prerequisite edge's for the %-meta. */
+ for( ; edge != NIL(LINK); edge = edge->cl_next ) {
+ HASHPTR thp = 0; /* temporary hash table pointer */
+ HASH iprqh; /* hash cell for new prerequisite */
+ CELL iprq; /* inferred prerequisite to look for */
+ CELLPTR idirroot; /* Inferred prerequisite root */
+ CELLPTR nidirroot; /* Inferred prerequisite root */
+ STRINGPTR ircp = 0; /* Inferred prerequisites recipe */
+ char *idir; /* directory to CD to. */
+ int ipush = 0; /* flag for push on inferred prereq */
+ char *name = NIL(char); /* prerequisite name */
+ CELLPTR meta = edge->cl_prq;
+ int dmax_fix;
+ int trans;
+ int noinf;
+ int exists;
+
+ /* Name of the prerequisite, can be empty. */
+ if( meta->ce_prq )
+ name = meta->ce_prq->cl_prq->CE_NAME;
+
+ DB_PRINT( "inf", ("Trying edge from [%s] to [%s] for [%s]",
+ meta->CE_NAME, name?name:"(nil)", ic->ic_name) );
+
+ /* Set the temp CELL used for building prerequisite candidates to
+ * all zero so that we don't have to keep initializing all the
+ * fields. */
+ {
+ register char *s = (char *) &iprq;
+ register int n = sizeof(CELL);
+ while( n ) { *s++ = '\0'; n--; }
+ }
+
+ nidirroot = idirroot = ic->ic_setdirroot;
+ iprq.ce_name = &iprqh;
+
+ if( name ) {
+ /* Build the prerequisite name from the %-meta prerequisite given
+ * for the %-meta rule. */
+ iprqh.ht_name = buildname( ic->ic_name, name, pdfa->dl_per );
+ if((dmax_fix = (count_dots(name)-count_dots(meta->CE_NAME))) < 0)
+ dmax_fix = 0;
+
+ if( !strcmp(ic->ic_name, iprqh.ht_name) ||
+ (count_dots(iprqh.ht_name) > ic->ic_dmax + dmax_fix) ) {
+ FREE( iprqh.ht_name );
+ continue;
+ }
+
+ DB_PRINT( "inf", ("Checking prerequisite [%s]", iprqh.ht_name) );
+
+ /* See if the prerequisite CELL has been previously defined. If
+ * it has, then make a copy of it into iprq, and use it to try
+ * the inference. We make the copy so that we don't modify the
+ * stat of the inferred cell if the inference fails.
+ */
+ thp = Get_name( iprqh.ht_name, Defs, FALSE );
+ if(thp != NIL(HASH)) {
+ iprq = *thp->CP_OWNR;
+ /* Check if a recipe for this target exists. Targets with F_MULTI
+ * set need each cell checked for existing recipes.
+ */
+ if( iprq.ce_flag & F_MULTI ) {
+ /* Walk through all cells of this target. */
+ LINKPTR mtcp = iprq.ce_prq;
+ ircp = NIL(STRING);
+ for( ; mtcp != NIL(LINK); mtcp = mtcp->cl_next ) {
+ /* If a recipe is found stop searching and set ircp to that result.
+ * ircp is not used but only checked if it is set.
+ */
+ if( mtcp->cl_prq->ce_recipe != NIL(STRING) ) {
+ ircp = mtcp->cl_prq->ce_recipe;
+ break;
+ }
+ }
+ }
+ else
+ ircp = iprq.ce_recipe;
+ }
+ else
+ ircp = NIL(STRING);
+ }
+ else
+ iprqh.ht_name = NIL(char);
+
+
+ /* If the %-meta has a .SETDIR set then we change to the new
+ * directory prior to performing the stat of the new prerequisite.
+ * If the change of directory fails then the rule is droped from
+ * further consideration.
+ */
+ if( iprq.ce_dir ) {
+ if( (ipush = Push_dir(iprq.ce_dir, iprqh.ht_name, TRUE)) != 0 ) {
+ nidirroot = thp->CP_OWNR;
+ idir = Pwd;
+ }
+ else {
+ if( iprqh.ht_name ) FREE( iprqh.ht_name );
+ continue;
+ }
+ }
+ else
+ idir = NIL(char);
+
+
+ /* Stat the inferred prerequisite.
+ */
+ if( name ) {
+ if( Verbose & V_INFER )
+ printf( "%s: Trying prerequisite [%s] for [%s]\n", Pname,
+ iprqh.ht_name, ic->ic_name );
+
+ /* irpq is a temporary target cell, a stat will not be remembered. */
+ if( !(iprq.ce_flag & F_STAT) ) Stat_target(&iprq, FALSE, FALSE);
+ }
+
+
+ /* If the STAT succeeded or if the prerequisite has a recipe for
+ * making it then it's a match and a candidate for getting infered.
+ * Otherwise it is not a match, and we cannot yet tell if it is
+ * going to be a successful path to follow, so we save it for
+ * later consideration.
+ */
+ noinf = ((Glob_attr)&A_NOINFER);
+ if( meta->ce_prq )
+ noinf |= ((meta->ce_prq->cl_prq->ce_attr)&A_NOINFER);
+ trans = Transitive || !noinf;
+
+ /* If no prereq is given treat it as if it is existing. */
+ exists = (iprq.ce_time != (time_t)0L) || (name == NIL(char));
+
+ if( exists || (ircp != NIL(STRING)) || !name ) {
+ match = add_iset( match, ic, meta, pdfa, idirroot, ic->ic_dmax,
+ trans, iprq.ce_name->ht_name, idir, exists );
+ DB_PRINT("inf",("Added to MATCH %s",iprq.ce_name->ht_name));
+ }
+ else if( !noinf && match == NIL(ICELL) ) {
+ *nnmp = add_iset( *nnmp, ic, meta, pdfa, nidirroot, ic->ic_dmax,
+ trans, iprq.ce_name->ht_name, idir, exists );
+ DB_PRINT("inf",("Added to NOMATCH %s",iprq.ce_name->ht_name));
+ }
+
+ /* If we pushed a directory for the inferred prerequisite then
+ * pop it.
+ */
+ if( ipush ) Pop_dir(FALSE);
+ if( iprqh.ht_name ) FREE(iprqh.ht_name);
+ }
+ }
+
+ DB_RETURN(match);
+}
+
+
+static char *
+buildname( tg, meta, per )/*
+============================
+ Replace '%' with per in meta. Expand the result and return it. */
+char *tg; /* Current target name. */
+char *meta;
+char *per;
+{
+ char *name;
+
+ name = Apply_edit( meta, "%", per, FALSE, FALSE );
+ /* Handle infered dynamic prerequisites. */
+ if( strchr(name, '$') ) {
+ HASHPTR m_at;
+ char *tmp;
+
+ /* Set $@ so that a Expand() can use it and remove it afterwards. */
+ /* Is $@ already expanded? FIXME: Remove this check later. */
+ if( *DmStrPbrk( tg, "${}" ) != '\0' )
+ Fatal("$@ [%s] not fully expanded!", tg);
+ m_at = Def_macro( "@", DO_WINPATH(tg), M_MULTI|M_EXPANDED );
+ tmp = Expand( name );
+
+ if( m_at->ht_value != NIL(char) ) {
+ FREE( m_at->ht_value );
+ m_at->ht_value = NIL(char);
+ }
+
+ /* Free name if Apply_edit() did something. */
+ if( name != meta ) FREE( name );
+ name = tmp;
+ }
+ else if( name == meta )
+ name = DmStrDup( name );
+
+ return(name);
+}
+
+
+static DFALINKPTR
+dfa_subset( pdfa, stack )/*
+============================
+ This is the valid DFA subset computation. Whenever a CELL has a Match_dfa
+ subset computed this algorithm is run to see if any of the previously
+ computed sets on the DFA stack are proper subsets of the new set. If they
+ are, then any elements of the matching subset whose Prep counts exceed
+ the allowed maximum given by Prep are removed from the computed DFA set,
+ and hence from consideration, thereby cutting off the cycle in the
+ inference graph. */
+DFALINKPTR pdfa;
+register DFASETPTR stack;
+{
+ register DFALINKPTR element;
+ DFALINKPTR nelement;
+
+ DB_ENTER( "dfa_subset" );
+
+ DB_PRINT("inf",("Computing DFA subset, PREP = %d",Prep));
+ DB_EXECUTE("inf", _dump_dfa_stack(pdfa, stack); );
+
+ for(; pdfa != NIL(DFALINK) && stack != NIL(DFASET); stack = stack->df_next) {
+ int subset = TRUE;
+
+ for( element=stack->df_set; subset && element != NIL(DFALINK);
+ element=element->dl_next ) {
+ register DFALINKPTR subel;
+
+ for( subel = pdfa;
+ subel != NIL(DFALINK) && (subel->dl_meta != element->dl_meta);
+ subel = subel->dl_next );
+
+ DB_PRINT("inf",("Looking for %s, (%s)",element->dl_meta->CE_NAME,
+ (subel != NIL(DFALINK))?"succ":"fail"));
+
+ if( (subset = (subel != NIL(DFALINK))) != 0 )
+ element->dl_member = subel;
+ }
+
+ if( subset )
+ for( element=stack->df_set; element != NIL(DFALINK);
+ element=element->dl_next ) {
+ DFALINKPTR mem = element->dl_member;
+ int npr = element->dl_prep + 1;
+
+ if( npr > Prep )
+ mem->dl_delete++;
+ else
+ mem->dl_prep = npr;
+ }
+ }
+
+ for( element = pdfa; element != NIL(DFALINK); element = nelement ) {
+ nelement = element->dl_next;
+
+ if( element->dl_delete ) {
+ /* A member of the subset has a PREP count equal to PREP, so
+ * it should not be considered further in the inference, hence
+ * we remove it from the doubly linked set list */
+ if( element == pdfa )
+ pdfa = element->dl_next;
+ else
+ element->dl_prev->dl_next = element->dl_next;
+
+ if( element->dl_next != NIL(DFALINK) )
+ element->dl_next->dl_prev = element->dl_prev;
+
+ DB_PRINT("inf", ("deleting dfa [%s]", element->dl_meta->CE_NAME));
+ FREE( element->dl_per );
+ FREE( element );
+ }
+ }
+
+ DB_RETURN( pdfa );
+}
+
+
+
+static void
+free_dfas( chain )/*
+=====================
+ Free the list of DFA's constructed by Match_dfa, and linked together by
+ LINK cells. FREE the % value as well, as long as it isn't NIL. */
+DFALINKPTR chain;
+{
+ register DFALINKPTR tl;
+
+ DB_ENTER( "free_dfas" );
+
+ for( tl=chain; tl != NIL(DFALINK); chain = tl ) {
+ tl = tl->dl_next;
+
+ DB_PRINT( "inf", ("Freeing DFA [%s], %% = [%s]", chain->dl_meta->CE_NAME,
+ chain->dl_per) );
+
+ if( chain->dl_per != NIL(char) ) FREE( chain->dl_per );
+ FREE( chain );
+ }
+
+ DB_VOID_RETURN;
+}
+
+
+static int
+count_dots( name )/*
+=====================*/
+char *name;
+{
+ register char *p;
+ register int i = 0;
+
+ for( p = name; *p; p++ ) if(*p == '.') i++;
+
+ return( i );
+}
+
+
+static ICELLPTR _icells = NIL(ICELL);
+#ifdef DBUG
+static int _icell_cost = 0;
+#endif
+
+static ICELLPTR
+add_iset( iset, parent, meta, dfa, setdirroot, dmax, noinf, name, dir, exists)
+ICELLPTR iset;
+ICELLPTR parent;
+CELLPTR meta;
+DFALINKPTR dfa;
+CELLPTR setdirroot;
+int dmax;
+int noinf;
+char *name;
+char *dir;
+int exists;
+{
+ ICELLPTR icell;
+
+ DB_ENTER("add_iset");
+ TALLOC(icell, 1, ICELL);
+
+ DB_EXECUTE("inf", _icell_cost+=(sizeof(ICELL)+strlen(dir?dir:"")+strlen(name?name:"")+2););
+
+ icell->ic_meta = meta;
+ icell->ic_dfa = dfa;
+ icell->ic_setdirroot = setdirroot;
+
+ if( parent ) icell->ic_dfastack.df_next = &parent->ic_dfastack;
+
+ icell->ic_dmax = dmax;
+ icell->ic_dir = DmStrDup(dir);
+ icell->ic_name = DmStrDup(name);
+ icell->ic_parent = parent;
+ icell->ic_next = iset;
+ icell->ic_flag = noinf;
+ icell->ic_exists = exists;
+
+ icell->ic_link = _icells;
+ _icells = icell;
+
+ DB_RETURN(icell);
+}
+
+
+static void
+free_icells()
+{
+ register ICELLPTR ic;
+
+ DB_ENTER("free_icells");
+
+ for( ; _icells; _icells = ic ) {
+ ic = _icells->ic_link;
+
+ free_dfas(_icells->ic_dfastack.df_set);
+ if( _icells->ic_dir ) FREE(_icells->ic_dir);
+ if( _icells->ic_name) FREE(_icells->ic_name);
+ FREE(_icells);
+ }
+
+ DB_PRINT("inf",("Used %d memory for icells",_icell_cost));
+ DB_EXECUTE("inf", _icell_cost=0; );
+
+ DB_VOID_RETURN;
+}
+
+
+static ICELLPTR
+union_iset( iset, uset )
+ICELLPTR iset;
+ICELLPTR uset;
+{
+ register ICELLPTR ic;
+
+ if( iset == NIL(ICELL) ) return(uset);
+
+ for( ic=iset; ic->ic_next != NIL(ICELL); ic=ic->ic_next );
+ ic->ic_next = uset;
+
+ return(iset);
+}
+
+
+static char *
+dump_inf_chain( ip, flag, print )/*
+===================================
+Return string with infered prerequisites.
+flag == TRUE adds the top of the chain.
+print == TRUE prints to screen with number "print" and returns NULL. */
+ICELLPTR ip;
+int flag;
+int print;
+{
+ char *tmp;
+
+ if( ip == NIL(ICELL) ) return(NIL(char));
+
+ /* ip->ic_parent is the target to be build after ip. */
+ tmp = dump_inf_chain(ip->ic_parent, FALSE, FALSE);
+
+ if( ip->ic_meta ) {
+ tmp = DmStrJoin(tmp, "(", -1, TRUE);
+ tmp = DmStrJoin(tmp, ip->ic_meta->CE_NAME, -1, TRUE);
+
+ if( ip->ic_dir && !*ip->ic_dir ) {
+ tmp = DmStrJoin(tmp, "[", -1, TRUE);
+ if( strncmp(Makedir,ip->ic_dir, strlen(Makedir)) )
+ tmp = DmStrJoin(tmp, ip->ic_dir, -1, TRUE);
+ else
+ tmp = DmStrJoin(tmp, ip->ic_dir+strlen(Makedir)+1, -1, TRUE);
+ tmp = DmStrJoin(tmp, "]", -1, TRUE);
+ }
+ tmp = DmStrJoin(tmp, (ip->ic_name)?") -->":")", -1, TRUE);
+ }
+
+ if( ip->ic_name ) tmp = DmStrApp( tmp, ip->ic_name );
+
+ if( flag && ip->ic_meta->ce_prq) {
+ tmp = DmStrJoin(tmp, "(", -1, TRUE);
+ tmp = DmStrJoin(tmp, ip->ic_meta->ce_prq->cl_prq->CE_NAME, -1, TRUE);
+ tmp = DmStrJoin(tmp, ")", -1, TRUE);
+ }
+
+ if( print ) {
+ fprintf( stderr, "%s: %2d. %s\n", Pname, print, tmp );
+ FREE(tmp);
+ tmp = NIL(char);
+ }
+
+ return(tmp);
+}
+
+
+#ifdef DBUG
+static void
+_dump_dfa_stack(dfas, dfa_stack)
+DFALINKPTR dfas;
+DFASETPTR dfa_stack;
+{
+ register DFALINKPTR pdfa;
+ char *tmp = NIL(char);
+ DFASETPTR ds;
+
+ for( pdfa = dfas; pdfa != NIL(DFALINK); pdfa = pdfa->dl_next )
+ tmp = DmStrApp( tmp, pdfa->dl_meta->CE_NAME );
+
+ tmp = DmStrApp( tmp, ":: {" );
+ for( ds = dfa_stack; ds != NIL(DFASET); ds = ds->df_next ) {
+ tmp = DmStrApp( tmp, "[" );
+ for( pdfa = ds->df_set; pdfa != NIL(DFALINK); pdfa = pdfa->dl_next )
+ tmp = DmStrApp( tmp, pdfa->dl_meta->CE_NAME );
+ tmp = DmStrApp( tmp, "]" );
+ }
+ tmp = DmStrApp( tmp, "}" );
+
+ printf( "DFA set and stack contents:\n%s\n", tmp );
+ FREE(tmp);
+}
+
+
+static void
+_dump_iset( name, iset )
+char *name;
+ICELLPTR iset;
+{
+ int cell = 0;
+
+ printf( "**** ISET for %s\n", name );
+ for( ; iset != NIL(ICELL); iset = iset->ic_next ){
+ printf( "cell %d\n", cell++ );
+ if( iset->ic_meta )
+ printf( "edge: %s --> %s\n", iset->ic_meta->CE_NAME,
+ iset->ic_meta->ce_prq ?
+ iset->ic_meta->ce_prq->cl_prq->CE_NAME :
+ "(nil)" );
+ else
+ printf( "edge: (nil)\n" );
+
+ if( iset->ic_dfa )
+ printf( "dfa: %s\n", iset->ic_dfa->dl_meta->CE_NAME );
+ else
+ printf( "dfa: (nil)\n" );
+
+ printf( "sdr: %p\n", iset->ic_setdirroot );
+ _dump_dfa_stack(iset->ic_dfastack.df_set, &iset->ic_dfastack);
+
+ printf( "dmax: %d\n", iset->ic_dmax );
+ printf( "name: %s\n", iset->ic_name );
+ printf( "dir: %s\n", iset->ic_dir?iset->ic_dir:"(nil)" );
+
+ printf( "parent: " );
+ if( iset->ic_parent )
+ if( iset->ic_parent->ic_meta )
+ printf( "%s --> %s\n",
+ iset->ic_parent->ic_meta->CE_NAME,
+ iset->ic_parent->ic_meta->ce_prq ?
+ iset->ic_parent->ic_meta->ce_prq->cl_prq->CE_NAME :
+ "(nil)" );
+ else
+ printf( "(nil)\n" );
+ else
+ printf( "(nil)\n" );
+ }
+ printf( "==================================\n" );
+}
+#endif
diff --git a/dmake/install-sh b/dmake/install-sh
new file mode 100755
index 000000000000..4d4a9519eaf8
--- /dev/null
+++ b/dmake/install-sh
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
+done
+
+if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/dmake/itypes.h b/dmake/itypes.h
new file mode 100644
index 000000000000..86f7b54a5d65
--- /dev/null
+++ b/dmake/itypes.h
@@ -0,0 +1,82 @@
+/* RCS $Id: itypes.h,v 1.3 2004-04-21 14:10:32 svesik Exp $
+--
+-- SYNOPSIS
+-- Type declarations for common types
+--
+-- DESCRIPTION
+-- portable type declarations.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+
+#ifndef ITYPES_h
+#define ITYPES_h
+
+#ifndef HAVE_INT8
+ typedef unsigned char uint8;
+#endif
+
+#ifndef HAVE_INT8
+ typedef signed char int8;
+#endif
+
+#if SIZEOF_SHORT == 2
+# ifndef HAVE_UINT16
+ typedef unsigned short uint16;
+# endif
+
+# ifndef HAVE_INT16
+ typedef short int16;
+# endif
+
+#elif SIZEOF_INT == 2
+
+# ifndef HAVE_UNIT16
+ typedef unsigned int uint16;
+# endif
+
+# ifndef HAVE_INT16
+ typedef int int16;
+# endif
+#else
+# ifndef HAVE_INT16
+# error "No 2 byte type, you lose."
+# endif
+#endif
+#if SIZEOF_INT == 4
+# ifndef HAVE_UINT32
+ typedef unsigned int uint32;
+# endif
+# ifndef HAVE_INT32
+ typedef int int32;
+# endif
+#elif SIZEOF_LONG == 4
+# ifndef HAVE_UINT32
+ typedef unsigned long uint32;
+# endif
+# ifndef HAVE_INT32
+ typedef long int32;
+# endif
+#else
+# ifndef HAVE_INT32
+# error "No 4 byte type, you lose."
+# endif
+#endif
+
+#endif
+
diff --git a/dmake/macparse.c b/dmake/macparse.c
new file mode 100644
index 000000000000..88db1230ec84
--- /dev/null
+++ b/dmake/macparse.c
@@ -0,0 +1,232 @@
+/* RCS $Id: macparse.c,v 1.3 2007-10-15 15:40:02 ihi Exp $
+--
+-- SYNOPSIS
+-- Parse a macro definition
+--
+-- DESCRIPTION
+-- This file contains the code that parses a macro definition
+-- stored in a buffer. If the string in buffer is not a valid
+-- macro definition the routie Parse_macro returns 0, otherwise it
+-- returns 1 to indicate success.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+PUBLIC int
+Parse_macro( buffer, flag )/*
+=============================
+ Parse the string in buffer and define it as a macro if it is a valid macro.
+ Note especially the string .SETDIR= since it is an attribute, but looks a
+ lot like a macro definition. This would not be a problem if make used
+ white space as token separators, since this is not the case we must do
+ something about it. */
+char *buffer;
+int flag;
+{
+ char *result; /* temporary pointer for strings */
+ TKSTR input; /* place to scan the buffer from */
+ HASHPTR hv; /* pointer to hash table value */
+ int operator; /* what macro operator do we have */
+ char *tok1; /* temporary place to keep a token */
+ char *tok2; /* temporary place to keep a token */
+ int toklen; /* length of a token */
+
+ DB_ENTER( "Parse_macro" );
+
+ SET_TOKEN( &input, buffer );
+ tok1 = Get_token( &input, "=+:*!?", 0 );
+
+ operator=Macro_op(tok1);
+ if( operator ) {
+ CLEAR_TOKEN( &input );
+ Error( "Assignment without macro name: [%s].", buffer );
+ DB_RETURN( 1 );
+ }
+
+ tok1 = DmStrDup(tok1);
+ tok2 = Get_token( &input, "=+:*!?", 2 );
+ if( !(operator = Macro_op(tok2)) || !strcmp(tok1,".SETDIR") ) {
+ CLEAR_TOKEN( &input );
+ FREE(tok1);
+ DB_RETURN(0);
+ }
+
+ tok2 = Expand(tok1); FREE(tok1); tok1 = tok2;
+ if ( !(toklen = strlen(tok1)) ) {
+ Warning( "Empty macro name after expansion: [%s].", buffer );
+ }
+
+ /* Catch illegal single character macro names. */
+ if ( toklen == 1 && strchr("{()}", tok1[0]) ) {
+ CLEAR_TOKEN( &input );
+ Fatal( "Syntax error in macro assignment [%s]. The following characters cannot be used as single letter macro names: '{()}'.", buffer );
+ }
+
+ /* Catch ':' in macro names. */
+ if ( strchr(tok1, ':') ) {
+ CLEAR_TOKEN( &input );
+ Fatal( "Syntax error in macro assignment [%s]. The character ':' is not allowed in macro names.", buffer );
+ }
+
+ tok2 = Get_token(&input, NIL( char ), FALSE);
+
+ /* Make sure we can force the assignment. */
+ if ( operator & M_OP_SI ) {
+ flag |= M_FORCE|M_MULTI;
+ operator &= ~M_OP_SI;
+ }
+
+ switch( operator ) {
+ case M_OP_PLCL:
+ tok2 = Expand( tok2 );
+ /* Fall thru */
+
+ case M_OP_PL:
+ /* Add to an existing macro, if it is not defined, though, then
+ * just define a new macro */
+
+ if( (hv = GET_MACRO(tok1)) == NIL(HASH) || hv->ht_value == NIL(char) )
+ Def_macro( tok1, tok2, flag );
+ else {
+ result = DmStrAdd( hv->ht_value, tok2, FALSE );
+ Def_macro( tok1, result, flag );
+ FREE( result );
+ }
+ if( operator == M_OP_PLCL ) FREE(tok2);
+ break;
+
+ case M_OP_DF:
+ /* *= */
+ /* internal default macros or initialized empty macros set M_INIT. */
+ if( (hv = GET_MACRO(tok1)) != NIL(HASH) && !(hv->ht_flag & M_INIT) )
+ break;
+ /* else FALLTHRU */
+
+ case M_OP_EQ:
+ Def_macro( tok1, tok2, flag );
+ break;
+
+ case M_OP_DFCL:
+ /* *:= */
+ /* internal default macros or initialized empty macros set M_INIT. */
+ if( (hv = GET_MACRO(tok1)) != NIL(HASH) && !(hv->ht_flag & M_INIT) )
+ break;
+ /* else FALLTHRU */
+
+ case M_OP_CL:
+ tok2 = Expand( tok2 );
+ Def_macro( tok1, tok2, M_EXPANDED | flag );
+ FREE( tok2 );
+ break;
+
+ case M_OP_CM:{
+ CELLPTR cp;
+ STRINGPTR sp;
+
+ if (flag & M_PUSH) {
+ Error("Nested conditional definition [%s ?= %s] ignored",
+ tok1, tok2);
+ }
+ else {
+ cp = Def_cell(tok1);
+ if (cp->ce_flag & F_MULTI) {
+ LINKPTR lp;
+ for(lp=cp->ce_prq; lp->cl_next; lp=lp->cl_next);
+ cp = lp->cl_prq;
+ }
+ TALLOC(sp,1,STRING);
+ sp->st_string = DmStrDup(tok2);
+ sp->st_next = cp->ce_cond;
+ cp->ce_cond = sp;
+
+ tok1 = NIL(char);
+ }
+ }
+ break;
+ }
+
+ if (tok1) {
+ if ( LastMacName != NIL(char) )
+ FREE( LastMacName );
+
+ LastMacName = tok1;
+ }
+
+ DB_RETURN( 1 );
+}
+
+
+
+PUBLIC int
+Macro_op( op )/*
+================
+ Check the passed in op string and map it to one of the macro operators */
+char *op;
+{
+ int ret = 0;
+ DB_ENTER( "macro_op" );
+
+ if ( *op == '!' ) {
+ ret = M_OP_SI;
+ op++;
+ }
+
+ switch( *op ) {
+ case '=': ret |= M_OP_EQ; break;
+ case ':': ret |= M_OP_CL; op++; break;
+
+ case '+':
+ op++;
+ if( *op == ':' ) {
+ ret |= M_OP_PLCL;
+ op++;
+ }
+ else {
+ ret |= M_OP_PL;
+ }
+ break;
+
+ case '*':
+ op++;
+ if( *op == ':' ) {
+ ret |= M_OP_DFCL;
+ op++;
+ }
+ else {
+ ret |= M_OP_DF;
+ }
+ break;
+
+ case '?':
+ ret |= M_OP_CM;
+ op++;
+ break;
+ }
+
+ if( *op != '=' )
+ ret = 0;
+ else {
+ op++;
+
+ if( *op != '\0' )
+ ret = 0;
+ }
+
+ DB_RETURN( ret );
+}
diff --git a/dmake/make.bat b/dmake/make.bat
new file mode 100755
index 000000000000..a0e3fdea8bcf
--- /dev/null
+++ b/dmake/make.bat
@@ -0,0 +1,273 @@
+echo off
+cls
+rem *** This is the make batchfile that is used under MSDOS to make the
+rem *** first version of dmake. It isn't pretty but it does work, assuming
+rem *** the compilers have been correctly setup. See the warning below
+rem *** concerning tlink, if you are building any of the Borland compiler
+rem *** versions.
+rem
+
+if %0%1 == %0 goto error
+if %1 == tcc20swp goto mktccswp
+
+if %1 == bcc30swp goto mkbcc30swp
+if %1 == bcc40swp goto mkbcc40swp
+if %1 == bcc45swp goto mkbcc45swp
+if %1 == bcc50swp goto mkbcc50swp
+
+if %1 == msc51 goto mkms51
+if %1 == msc51swp goto mkms51swp
+if %1 == msc60 goto mkms60
+if %1 == msc60swp goto mkms60swp
+
+if %1 == win95-bcc50 goto mkw32b50
+if %1 == win95-vpp40 goto mkw32vp40
+
+rem label the possible DOS variations for dmake here.
+:error
+echo MSDOS: You must specify 'make target' where target is one of:
+echo -------------
+echo tcc20swp - Turbo C 2.0 compile of swapping dmake..
+
+echo bcc30swp - Borland C++ 3.0 compile of swapping dmake.
+echo bcc40swp - Borland C++ 4.0 compile of swapping dmake.
+echo bcc45swp - Borland C++ 4.5 compile of swapping dmake.
+echo bcc50swp - Borland C++ 5.0 compile of swapping dmake.
+
+echo msc51 - Microsoft C 5.1 compile.
+echo msc51swp - Microsoft C 5.1, MASM 5.1 compile of swapping dmake.
+echo msc60 - Microsoft C 6.0 compile.
+echo msc60swp - Microsoft C 6.0, MASM 5.1 compile of swapping dmake.
+
+echo win95-bcc50 - Borland C++ 5.0 32-bit compile of dmake.
+echo win95-vpp40 - Microsoft VC++ 4.0 32-bit compile of dmake.
+goto end
+
+rem This is the script that makes dmake using Microsoft C 5.1
+:mkms51
+msdos\microsft\msc51\mk.bat
+goto end
+
+:mkms51swp
+msdos\microsft\msc51\mkswp.bat
+goto end
+
+rem This is the script that makes dmake using Microsoft C 6.0
+:mkms60
+msdos\microsft\msc60\mk.bat
+goto end
+
+:mkms60swp
+msdos\microsft\msc60\mkswp.bat
+goto end
+
+:mkw32vp40
+win95\microsft\vpp40\mk.bat
+goto end
+
+rem This is the script that makes dmake using Turbo C 2.0 or higher.
+:mktcc
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\tcc20\obj.rsp
+echo msdos\borland\tcc20\lib.rsp
+echo contain absolute paths to TURBO-C runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Turbo-C before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\tcc20\mk.bat
+goto end
+
+:mktccswp
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\tcc20\objswp.rsp
+echo msdos\borland\tcc20\libswp.rsp
+echo contain absolute paths to TURBO-C runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Turbo-C before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\tcc20\mkswp.bat
+goto end
+
+rem This is the script that makes dmake using Borland C++ 3.0.
+:mkbcc30
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc30\obj.rsp
+echo msdos\borland\bcc30\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc30\mk.bat
+goto end
+
+:mkbcc30swp
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc30\objswp.rsp
+echo msdos\borland\bcc30\libswp.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc30\mkswp.bat
+goto end
+
+rem This is the script that makes dmake using Borland C++ 4.0.
+:mkbcc40
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc40\obj.rsp
+echo msdos\borland\bcc40\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc40\mk.bat
+goto end
+
+:mkbcc40swp
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc40\objswp.rsp
+echo msdos\borland\bcc40\libswp.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc40\mkswp.bat
+goto end
+
+rem This is the script that makes dmake using Borland C++ 4.5.
+:mkbcc45
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc45\obj.rsp
+echo msdos\borland\bcc45\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc45\mk.bat
+goto end
+
+:mkbcc45swp
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc45\objswp.rsp
+echo msdos\borland\bcc45\libswp.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc45\mkswp.bat
+goto end
+
+rem This is the script that makes dmake using Borland C++ 5.0.
+:mkbcc50
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc50\obj.rsp
+echo msdos\borland\bcc50\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc50\mk.bat
+goto end
+
+:mkbcc50swp
+cls
+echo WARNING:
+echo The default response files:
+echo msdos\borland\bcc50\objswp.rsp
+echo msdos\borland\bcc50\libswp.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+msdos\borland\bcc50\mkswp.bat
+goto end
+
+rem This is the script that makes 32-bit dmake using Borland C++ 5.0.
+:mkw32b50
+cls
+echo WARNING:
+echo The default response files:
+echo win95\borland\bcc50\obj.rsp
+echo win95\borland\bcc50\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+win95\borland\bcc50\mk.bat
+goto end
+
+rem All done!
+:end
diff --git a/dmake/make.c b/dmake/make.c
new file mode 100644
index 000000000000..67af0653d35f
--- /dev/null
+++ b/dmake/make.c
@@ -0,0 +1,1774 @@
+/* $RCSfile: make.c,v $
+-- $Revision: 1.12 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:29:19 $
+--
+-- SYNOPSIS
+-- Perform the update of all outdated targets.
+--
+-- DESCRIPTION
+-- This is where we traverse the make graph looking for targets that
+-- are out of date, and we try to infer how to make them if we can.
+-- The usual make macros are understood, as well as some new ones:
+--
+-- $$ - expands to $
+-- $@ - full target name
+-- $* - target name with no suffix, same as $(@:db)
+-- or, the value of % in % meta rule recipes
+-- $? - list of out of date prerequisites
+-- $< - all prerequisites associated with rules line
+-- $& - all prerequisites associated with target
+-- $> - library name for target (if any)
+-- $^ - out of date prerequisites taken from value of $<
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+#include "sysintf.h"
+
+typedef struct cell {
+ char *datum;
+ struct cell *next;
+ size_t len;
+} LISTCELL, *LISTCELLPTR;
+
+typedef struct {
+ LISTCELLPTR first;
+ LISTCELLPTR last;
+ size_t len;
+} LISTSTRING, *LISTSTRINGPTR;
+
+
+static void _drop_mac ANSI((HASHPTR));
+static void _set_recipe ANSI((char*, int));
+static void _set_tmd ANSI(());
+static void _append_file ANSI((STRINGPTR, FILE*, char*, int));
+static LINKPTR _dup_prq ANSI((LINKPTR));
+static LINKPTR _expand_dynamic_prq ANSI(( LINKPTR, LINKPTR, char * ));
+static char* _prefix ANSI((char *, char *));
+static char* _pool_lookup ANSI((char *));
+static int _explode_graph ANSI((CELLPTR, LINKPTR, CELLPTR));
+
+
+#define RP_GPPROLOG 0
+#define RP_RECIPE 1
+#define RP_GPEPILOG 2
+#define NUM_RECIPES 3
+
+static STRINGPTR _recipes[NUM_RECIPES];
+static LISTCELLPTR _freelist=NULL;
+
+static LISTCELLPTR
+get_cell()
+{
+ LISTCELLPTR cell;
+
+ if (!_freelist) {
+ if ((cell=MALLOC(1,LISTCELL)) == NULL)
+ No_ram();
+ }
+ else {
+ cell = _freelist;
+ _freelist = cell->next;
+ }
+
+ return(cell);
+}
+
+
+static void
+free_cell(LISTCELLPTR cell)
+{
+ cell->next = _freelist;
+ _freelist = cell;
+}
+
+
+static void
+free_list(LISTCELLPTR c)
+{
+ if(c) {
+ free_list(c->next);
+ free_cell(c);
+ }
+}
+
+
+static void
+list_init(LISTSTRINGPTR s)
+{
+ s->first = NULL;
+ s->last = NULL;
+ s->len = 0;
+}
+
+
+static void
+list_add(LISTSTRINGPTR s, char *str)
+{
+ LISTCELLPTR p;
+ int l;
+
+ if ((l = strlen(str)) == 0)
+ return;
+
+ p = get_cell();
+ p->datum = str;
+ p->next = NULL;
+ p->len = l;
+
+ if(s->first == NULL)
+ s->first = p;
+ else
+ s->last->next = p;
+
+ s->last = p;
+ s->len += l+1;
+}
+
+
+static char *
+gen_path_list_string(LISTSTRINGPTR s)/*
+=======================================
+ Take a list of filepaths and create a string from it separating
+ the filenames by a space.
+ This function honors the cygwin specific .WINPATH attribute. */
+{
+ LISTCELLPTR next, cell;
+ int len;
+ int slen, slen_rest;
+ char *result;
+ char *p, *tpath;
+
+ if( (slen_rest = slen = s->len) == 0)
+ return(NIL(char));
+
+ /* reserve enough space to hold the concated original filenames. */
+ if((p = result = MALLOC(slen, char)) == NULL) No_ram();
+
+ for (cell=s->first; cell; cell=next) {
+#if !defined(__CYGWIN__)
+ tpath = cell->datum;
+ len=cell->len;
+#else
+ /* For cygwin with .WINPATH set the lenght of the converted
+ * filepaths might be longer. Extra checking is needed ... */
+ tpath = DO_WINPATH(cell->datum);
+ if( tpath == cell->datum ) {
+ len=cell->len;
+ }
+ else {
+ /* ... but only if DO_WINPATH() did something. */
+ len = strlen(tpath);
+ }
+ if( len >= slen_rest ) {
+ /* We need more memory. As DOS paths are usually shorter than the
+ * original cygwin POSIX paths (exception mounted paths) this should
+ * rarely happen. */
+ int p_offset = p - result;
+ /* Get more than needed. */
+ slen = slen + len - slen_rest + 128;
+ if((result = realloc( result, slen ) ) == NULL)
+ No_ram();
+ p = result + p_offset;
+ }
+#endif
+
+ memcpy((void *)p, (void *)tpath, len);
+ p += len;
+ *p++ = ' ';
+
+#if defined(__CYGWIN__)
+ /* slen_rest is only used in the cygwin / .WINPATH case. */
+ slen_rest = slen - (p - result);
+#endif
+
+ next = cell->next;
+ free_cell(cell);
+ }
+
+ *--p = '\0';
+ list_init(s);
+
+ return(result);
+}
+
+
+PUBLIC int
+Make_targets()/*
+================
+ Actually go and make the targets on the target list */
+{
+ LINKPTR lp;
+ int done = 0;
+
+ DB_ENTER( "Make_targets" );
+
+ Read_state();
+ _set_recipe( ".GROUPPROLOG", RP_GPPROLOG );
+ _set_recipe( ".GROUPEPILOG", RP_GPEPILOG );
+
+ /* Prevent recipe inference for .ROOT */
+ if ( Root->ce_recipe == NIL(STRING) ) {
+ TALLOC( Root->ce_recipe, 1, STRING );
+ Root->ce_recipe->st_string = "";
+ }
+
+ /* Prevent recipe inference for .TARGETS */
+ if ( Targets->ce_recipe == NIL(STRING) ) {
+ TALLOC( Targets->ce_recipe, 1, STRING );
+ Targets->ce_recipe->st_string = "";
+ }
+
+ /* Make sure that user defined targets are marked as root targets */
+ for( lp = Targets->ce_prq; lp != NIL(LINK); lp = lp->cl_next )
+ lp->cl_prq->ce_attr |= A_ROOT;
+
+ while( !done ) {
+ int rval;
+
+ if( (rval = Make(Root, NIL(CELL))) == -1 )
+ DB_RETURN(1);
+ else
+ done = Root->ce_flag & F_MADE;
+
+ if( !rval && !done ) Wait_for_child( FALSE, -1 );
+ }
+
+ for( lp = Targets->ce_prq; lp != NIL(LINK); lp = lp->cl_next ) {
+ CELLPTR tgt = lp->cl_prq;
+ if( !(tgt->ce_attr & A_UPDATED)
+ && (Verbose & V_MAKE) )
+ printf( "`%s' is up to date\n", tgt->CE_NAME );
+ }
+
+ DB_RETURN( 0 );
+}
+
+
+
+PUBLIC int
+Make( cp, setdirroot )/*
+========================
+ Make target cp. Make() is also called on prerequisites that have no rule
+ associated (F_TARGET is not set) to verify that they exist. */
+CELLPTR cp;
+CELLPTR setdirroot;
+{
+ register LINKPTR dp, prev,next;
+ register CELLPTR tcp;
+ CELLPTR nsetdirroot;
+ char *name, *lib;
+ HASHPTR m_at, m_q, m_b, m_g, m_l, m_bb, m_up;
+ LISTSTRING all_list, imm_list, outall_list, inf_list;
+ char *all = NIL(char);
+ char *inf = NIL(char);
+ char *outall = NIL(char);
+ char *imm = NIL(char);
+ int rval = 0; /* 0==ready, 1==target still running, -1==error */
+ int push = 0;
+ int made = F_MADE;
+ int ignore;
+ time_t otime = (time_t) 1L; /* Hold time of newest prerequisite. */
+ int mark_made = FALSE;
+
+#if defined(__CYGWIN__)
+ /* static variable to hold .WINPATH status of previously made target.
+ * 0, 1 are .WINPATH states, -1 indicates the first target. */
+ static int prev_winpath_attr = -1;
+#endif
+
+ DB_ENTER( "Make" );
+ DB_PRINT( "mem", ("%s:-> mem %ld", cp->CE_NAME, (long) coreleft()) );
+
+ /* Initialize the various temporary storage */
+ m_q = m_b = m_g = m_l = m_bb = m_up = NIL(HASH);
+ list_init(&all_list);
+ list_init(&imm_list);
+ list_init(&outall_list);
+ list_init(&inf_list);
+
+ if (cp->ce_set && cp->ce_set != cp) {
+ if( Verbose & V_MAKE )
+ printf( "%s: Building .UPDATEALL representative [%s]\n", Pname,
+ cp->ce_set->CE_NAME );
+ cp = cp->ce_set;
+ }
+
+ /* If we are supposed to change directories for this target then do so.
+ * If we do change dir, then modify the setdirroot variable to reflect
+ * that fact for all of the prerequisites that we will be making. */
+
+ nsetdirroot = setdirroot;
+ ignore = (((cp->ce_attr|Glob_attr)&A_IGNORE) != 0);
+
+ /* Set the UseWinpath variable to reflect the (global/local) .WINPATH
+ * attribute. The variable is used by DO_WINPATH() and in some other
+ * places. */
+ UseWinpath = (((cp->ce_attr|Glob_attr)&A_WINPATH) != 0);
+
+ /* m_at needs to be defined before going to a "stop_making_it" where
+ * a _drop_mac( m_at ) would try to free it. */
+ /* FIXME: m_at can most probably not be changed before the next
+ * Def_macro("@", ...) command. Check if both this and the next
+ * call are needed. */
+ m_at = Def_macro("@", DO_WINPATH(cp->ce_fname), M_MULTI);
+
+ if( cp->ce_attr & A_SETDIR ) {
+ /* Change directory only if the previous .SETDIR is a different
+ * directory from the current one. ie. all cells with the same .SETDIR
+ * attribute are assumed to come from the same directory. */
+
+ if( (setdirroot == NIL(CELL) || setdirroot->ce_dir != cp->ce_dir) &&
+ (push = Push_dir(cp->ce_dir,cp->CE_NAME,ignore)) != 0 )
+ setdirroot = cp;
+ }
+
+ DB_PRINT( "mem", ("%s:-A mem %ld", cp->CE_NAME, (long) coreleft()) );
+
+ /* FIXME: F_MULTI targets don't have cp->ce_recipe set but the recipes
+ * are known nevertheless. It is not necessary to infer them.
+ * If (cp->ce_flag & F_MULTI) is true the recipes of the corresponding
+ * subtargets can be used. */
+ if( cp->ce_recipe == NIL(STRING) ) {
+ char *dir = cp->ce_dir;
+
+ if( Verbose & V_MAKE )
+ printf( "%s: Infering prerequisite(s) and recipe for [%s]\n", Pname,
+ cp->CE_NAME );
+
+ Infer_recipe( cp, setdirroot );
+
+ /* See if the directory has changed, if it has then make sure we
+ * push it. */
+ if( dir != cp->ce_dir ) {
+ if( push ) Pop_dir(FALSE);
+ push = Push_dir( cp->ce_dir, cp->CE_NAME, ignore );
+ setdirroot = cp;
+ }
+ }
+
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp = dp->cl_prq;
+ if( push ) {
+ /* If we changed the directory because of .SETDIR write Pwd into
+ * tcp->ce_dir so that it holds an absolute path. */
+ if( !(tcp->ce_attr & A_POOL) && tcp->ce_dir ) FREE( tcp->ce_dir );
+ tcp->ce_dir = _pool_lookup(Pwd);
+ tcp->ce_attr |= A_SETDIR|A_POOL;
+ }
+ tcp->ce_setdir = nsetdirroot;
+ }
+
+ DB_PRINT( "mem", ("%s:-A mem %ld", cp->CE_NAME, (long) coreleft()) );
+ /* If we have not yet statted the target then do so. */
+ if( !(cp->ce_flag & F_STAT) && !(cp->ce_attr&A_PHONY) ) {
+ if (cp->ce_parent && (cp->ce_parent->ce_flag & F_MULTI)) {
+ /* Inherit the stat info from the F_MULTI parent. */
+ cp->ce_time = cp->ce_parent->ce_time;
+ cp->ce_flag |= F_STAT;
+ /* Propagate the A_PRECIOUS attribute from the parent. */
+ cp->ce_attr |= cp->ce_parent->ce_attr & A_PRECIOUS;
+ }
+ else {
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp = dp->cl_prq;
+ /* Check if target already exists. */
+ Stat_target( tcp, 1, FALSE );
+
+ if( tcp->ce_time != (time_t)0L ) {
+ /* File exists so don't remove it later. */
+ tcp->ce_attr |= A_PRECIOUS;
+ }
+
+ if( Verbose & V_MAKE )
+ printf("%s: Time stamp of [%s] is %ld\n",Pname,tcp->CE_NAME,
+ tcp->ce_time);
+ }
+ }
+ }
+
+ DB_PRINT( "make", ("(%s, %ld, 0x%08x, 0x%04x)", cp->CE_NAME,
+ cp->ce_time, cp->ce_attr, cp->ce_flag) );
+
+ /* Handle targets without rule and without existing file. */
+ if( !(cp->ce_flag & F_TARGET) && (cp->ce_time == (time_t) 0L) ) {
+ if( Makemkf ) {
+ rval = -1;
+ goto stop_making_it;
+ }
+ else if( cp->ce_prq != NIL(LINK)
+ || (STOBOOL(Augmake) && (cp->ce_flag&F_EXPLICIT)))
+ /* Assume an empty recipe for a target that we have run inference on
+ * but do not have a set of rules for but for which we have inferred
+ * a list of prerequisites. */
+ cp->ce_flag |= F_RULES;
+ else
+ Fatal( "`%s' not found, and can't be made", cp->CE_NAME );
+ }
+
+ DB_PRINT( "mem", ("%s:-A mem %ld", cp->CE_NAME, (long) coreleft()) );
+
+ /* set value of $* if we have not infered a recipe, in this case $* is
+ * the same as $(@:db), this allows us to be compatible with BSD make */
+ if( cp->ce_per == NIL(char) ) cp->ce_per = "$(@:db)";
+
+ /* Search the prerequisite list for dynamic prerequisites and if we find
+ * them copy the list of prerequisites for potential later re-use. */
+ if ( cp->ce_prqorg == NIL(LINK) ) {
+ for( dp = cp->ce_prq; dp != NIL(LINK); dp = dp->cl_next )
+ if ( strchr(dp->cl_prq->CE_NAME, '$') != NULL )
+ break;
+
+ if (dp != NIL(LINK)) {
+ cp->ce_prqorg = _dup_prq(cp->ce_prq);
+ }
+ }
+
+ /* Define $@ macro. The only reason for defining it here (that I see ATM)
+ * is that $@ is already defined in conditional macros. */
+ /* FIXME: check if both this and the previous Def_macro("@", ...) call
+ * are needed. */
+ m_at = Def_macro("@", DO_WINPATH(cp->ce_fname), M_MULTI);
+
+ /* Define conditional macros if any, note this is done BEFORE we process
+ * prerequisites for the current target. Thus the making of a prerequisite
+ * is done using the current value of the conditional macro. */
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp=dp->cl_prq;
+ if (tcp->ce_cond != NIL(STRING)) {
+ STRINGPTR sp;
+
+ tcp->ce_pushed = NIL(HASH);
+ for(sp=tcp->ce_cond; sp; sp=sp->st_next) {
+ if(Parse_macro(sp->st_string,M_MULTI|M_PUSH)) {
+ HASHPTR hp;
+
+ hp = GET_MACRO(LastMacName);
+ hp->ht_link = tcp->ce_pushed;
+ tcp->ce_pushed = hp;
+ }
+ else {
+ Error("Invalid conditional macro expression [%s]",sp->st_string);
+ }
+ }
+ }
+ }
+
+ /* First round, will be repeated a second time below. */
+ for( prev=NULL,dp=cp->ce_prq; dp != NIL(LINK); prev=dp, dp=next ) {
+ int seq;
+
+ /* This loop executes Make() to build prerequisites if needed.
+ * The only macro that needs to be reset after a Make() was executed
+ * is $@ as it might be used when expanding potential dynamic
+ * prerequisites. As UseWinpath is a global variable we also
+ * need to restore it. */
+ if (m_at->ht_value == NIL(char)) {
+ /* This check effectively tests if Make() was run before because
+ * Make() frees all dynamic macro values at the end. */
+ UseWinpath = (((cp->ce_attr|Glob_attr)&A_WINPATH) != 0);
+ m_at = Def_macro("@", DO_WINPATH(cp->ce_fname), M_MULTI);
+ }
+
+ /* Make the prerequisite, note that if the current target has the
+ * .LIBRARY attribute set we pass on to the prerequisite the .LIBRARYM
+ * attribute and pass on the name of the current target as the library
+ * name, and we take it away when we are done. */
+ next = dp->cl_next;
+
+ tcp = dp->cl_prq;
+ if( Verbose & V_MAKE )
+ printf("Checking prerequisite [%s]\n", tcp->CE_NAME);
+
+ seq = (((cp->ce_attr | Glob_attr) & A_SEQ) != 0);
+
+ /* This checks if this prerequisite is still in the making, if yes
+ * come back later. */
+ if( tcp->ce_flag & F_VISITED ) {
+ /* Check if this currently or fully made target has the same
+ * .SETDIR setting. If yes, continue if it was made or come
+ * back later otherwise. */
+ if( _explode_graph(tcp, dp, setdirroot) == 0 ) {
+ /* didn't blow it up so see if we need to wait for it. */
+ if( tcp->ce_flag & F_MADE ) {
+ /* Target was made. */
+ continue;
+ }
+ else
+ /* Target is still in the making ... */
+ goto stop_making_it;
+ }
+ else
+ /* Use the new prerequisite with the new .SETDIR value. */
+ tcp = dp->cl_prq;
+ }
+
+ /* If the previous target (prereq) is not yet ready return if
+ * seq is TRUE. */
+ if( seq && !made ) goto stop_making_it;
+
+ /* Expand dynamic prerequisites. The F_MARK flag is guarging against
+ * possible double expandion of dynamic prerequisites containing more
+ * than one prerequisite. */
+ /* A new A_DYNAMIC attribute could save a lot of strchr( ,'$') calls. */
+ if ( tcp && !(tcp->ce_flag & F_MARK) && strchr(tcp->CE_NAME, '$') ) {
+ /* Replace this dynamic prerequisite with the the real prerequisite,
+ * and add the additional prerequisites if there are more than one.*/
+
+ name = Expand( tcp->CE_NAME );
+ if( strcmp(name,cp->CE_NAME) == 0 )
+ Fatal("Detected circular dynamic dependency; generated '%s'",name);
+
+ /* Call helper for dynamic prerequisite expansion to replace the
+ * prerequisite with the expanded version and add the new
+ * prerequisites, if the macro expanded to more than one, after
+ * the current list element. */
+ dp = _expand_dynamic_prq( cp->ce_prq, dp, name );
+ FREE( name );
+
+ /* _expand_dynamic_prq() probably changed dp->cl_prq. */
+ tcp = dp->cl_prq;
+ if ( tcp ) {
+ next = dp->cl_next;
+ }
+ }
+
+ /* Dynamic expansion results in a NULL cell only when the the new
+ * prerequisite is already in the prerequisite list or empty. In this
+ * case delete the cell and continue. */
+ if ( tcp == NIL(CELL) ) {
+ FREE(dp);
+ if ( prev == NIL(LINK) ) {
+ cp->ce_prq = next;
+ dp = NULL; /* dp will be the new value of prev. */
+ }
+ else {
+ prev->cl_next = next;
+ dp = prev;
+ }
+ continue;
+ }
+
+ /* Clear F_MARK flag that could have been set by _expand_dynamic_prq(). */
+ tcp->ce_flag &= ~(F_MARK);
+
+ if( cp->ce_attr & A_LIBRARY ) {
+ tcp->ce_attr |= A_LIBRARYM;
+ tcp->ce_lib = cp->ce_fname;
+ }
+
+ /* Propagate the parent's F_REMOVE and F_INFER flags to the
+ * prerequisites. */
+ tcp->ce_flag |= cp->ce_flag & (F_REMOVE|F_INFER);
+
+ /* Propagate parents A_ROOT attribute to a child if the parent is a
+ * F_MULTI target. */
+ if( (cp->ce_flag & F_MULTI) && (cp->ce_attr & A_ROOT) )
+ tcp->ce_attr |= A_ROOT;
+
+ tcp->ce_parent = cp;
+ rval |= Make(tcp, setdirroot);
+
+ if( cp->ce_attr & A_LIBRARY )
+ tcp->ce_attr ^= A_LIBRARYM;
+
+ /* Return on error or if Make() is still running and A_SEQ is set.
+ * (All F_MULTI targets have the A_SEQ attribute.) */
+ if( rval == -1 || (seq && (rval==1)) )
+ goto stop_making_it;
+
+ /* If tcp is ready, set made = F_MADE. */
+ made &= tcp->ce_flag & F_MADE;
+ }
+
+
+ /* Do the loop again. We are most definitely going to make the current
+ * cell now. NOTE: doing this loop here also results in a reduction
+ * in peak memory usage by the algorithm. */
+
+ for( dp = cp->ce_prq; dp != NIL(LINK); dp = dp->cl_next ) {
+ int tgflg;
+ tcp = dp->cl_prq;
+ if( tcp == NIL(CELL) )
+ Fatal("Internal Error: Found prerequisite list cell without prerequisite!");
+
+ name = tcp->ce_fname;
+
+ /* make certain that all prerequisites are made prior to advancing. */
+ if( !(tcp->ce_flag & F_MADE) ) goto stop_making_it;
+
+ /* If the target is a library, then check to make certain that a member
+ * is newer than an object file sitting on disk. If the disk version
+ * is newer then set the time stamps so that the archived member is
+ * replaced. */
+ if( cp->ce_attr & A_LIBRARY )
+ if( tcp->ce_time <= cp->ce_time ) {
+ time_t mtime = Do_stat( name, tcp->ce_lib, NIL(char *), FALSE );
+ if( mtime < tcp->ce_time ) tcp->ce_time = cp->ce_time+1L;
+ }
+
+ /* Set otime to the newest time stamp of all prereqs or 1 if there
+ * are no prerequisites. */
+ if( tcp->ce_time > otime ) otime = tcp->ce_time;
+
+ list_add(&all_list, name);
+ if( (tgflg = (dp->cl_flag & F_TARGET)) != 0 )
+ list_add(&inf_list, name);
+
+ if((cp->ce_time<tcp->ce_time) || ((tcp->ce_flag & F_TARGET) && Force)) {
+ list_add(&outall_list, name);
+ if( tgflg )
+ list_add(&imm_list, name);
+ }
+ }
+
+ /* If we are building a F_MULTI target inherit the time from
+ * its children. */
+ if( (cp->ce_flag & F_MULTI) )
+ cp->ce_time = otime;
+
+ /* All prerequisites are made, now make the current target. */
+
+ /* Restore UseWinpath and $@ if needed, see above for an explanation. */
+ if (m_at->ht_value == NIL(char)) {
+ /* This check effectively tests if Make() was run before because
+ * Make() frees all dynamic macro values at the end. */
+ UseWinpath = (((cp->ce_attr|Glob_attr)&A_WINPATH) != 0);
+ m_at = Def_macro("@", DO_WINPATH(cp->ce_fname), M_MULTI);
+ }
+
+ /* Create a string with all concatenate filenames. The function
+ * respects .WINPATH. Note that gen_path_list_string empties its
+ * parameter :( */
+ all = gen_path_list_string(&all_list);
+ imm = gen_path_list_string(&imm_list);
+ outall = gen_path_list_string(&outall_list);
+ inf = gen_path_list_string(&inf_list);
+
+ DB_PRINT( "mem", ("%s:-C mem %ld", cp->CE_NAME, (long) coreleft()) );
+ DB_PRINT( "make", ("I make '%s' if %ld > %ld", cp->CE_NAME, otime,
+ cp->ce_time) );
+
+ if( Verbose & V_MAKE ) {
+ printf( "%s: >>>> Making ", Pname );
+ /* Also print the F_MULTI master target. */
+ if( cp->ce_flag & F_MULTI )
+ printf( "(::-\"master\" target) " );
+ if( cp->ce_count != 0 )
+ printf( "[%s::{%d}]\n", cp->CE_NAME, cp->ce_count );
+ else
+ printf( "[%s]\n", cp->CE_NAME );
+ }
+
+
+ /* Only PWD, TMD, MAKEDIR and the dynamic macros are affected by
+ * .WINPATH. $@ is handled earlier, do the rest now. */
+#if defined(__CYGWIN__)
+ /* This is only relevant for cygwin. */
+ if( UseWinpath != prev_winpath_attr ) {
+ Def_macro( "MAKEDIR", Makedir, M_FORCE | M_EXPANDED );
+ /* If push is TRUE (Push_dir() was used) PWD and TMD are already
+ * set. */
+ if( !push ) {
+ Def_macro( "PWD", Pwd, M_FORCE | M_EXPANDED );
+ _set_tmd();
+ }
+ }
+ prev_winpath_attr = UseWinpath;
+#endif
+
+ /* Set the remaining dynamic macros $*, $>, $?, $<, $& and $^. */
+
+ /* $* is either expanded as the result of a % inference or defined to
+ * $(@:db) and hence unexpanded otherwise. The latter doesn't start
+ * with / and will therefore not be touched by DO_WINPATH(). */
+ m_bb = Def_macro( "*", DO_WINPATH(cp->ce_per), M_MULTI );
+
+ /* This is expanded. */
+ m_g = Def_macro( ">", DO_WINPATH(cp->ce_lib), M_MULTI|M_EXPANDED );
+ /* These strings are generated with gen_path_list_string() and honor
+ * .WINPATH */
+ m_q = Def_macro( "?", outall, M_MULTI|M_EXPANDED );
+ m_b = Def_macro( "<", inf, M_MULTI|M_EXPANDED );
+ m_l = Def_macro( "&", all, M_MULTI|M_EXPANDED );
+ m_up = Def_macro( "^", imm, M_MULTI|M_EXPANDED );
+
+ _recipes[ RP_RECIPE ] = cp->ce_recipe;
+
+ /* We attempt to make the target if
+ * 1. it has a newer prerequisite
+ * 2. It is a target and Force is set
+ * 3. It's set of recipe lines has changed.
+ */
+ if( Check_state(cp, _recipes, NUM_RECIPES )
+ || (cp->ce_time < otime)
+ || ((cp->ce_flag & F_TARGET) && Force)
+ ) {
+
+ if( Measure & M_TARGET )
+ Do_profile_output( "s", M_TARGET, cp );
+
+ /* Only checking so stop as soon as we determine we will make
+ * something */
+ if( Check ) {
+ rval = -1;
+ goto stop_making_it;
+ }
+
+ if( Verbose & V_MAKE )
+ printf( "%s: Updating [%s], (%ld > %ld)\n", Pname,
+ cp->CE_NAME, otime, cp->ce_time );
+
+ /* In order to check if a targets time stamp was properly updated
+ * after the target was made and to keep the dependency chain valid
+ * for targets without recipes we store the minimum required file
+ * time. If the target time stamp is older than the newest
+ * prerequisite use that time, otherwise the current time. (This
+ * avoids the call to Do_time() for every target, still checks
+ * if the target time is new enough for the given prerequisite and
+ * mintime is also the newest time of the given prerequisites and
+ * can be used for targets without recipes.)
+ * We reuse the ce_time member to store this minimum time until
+ * the target is finished by Update_time_stamp(). This function
+ * checks if the file time was updated properly and warns if it was
+ * not. (While making a target this value does not change.) */
+ cp->ce_time = ( cp->ce_time < otime ? otime : Do_time() );
+ DB_PRINT( "make", ("Set ce_time (mintime) to: %ld", cp->ce_time) );
+
+ if( Touch ) {
+ name = cp->ce_fname;
+ lib = cp->ce_lib;
+
+ if( (!(Glob_attr & A_SILENT) || !Trace) && !(cp->ce_attr & A_PHONY) ) {
+ if( lib == NIL(char) )
+ printf("touch(%s)", name );
+ else if( cp->ce_attr & A_SYMBOL )
+ printf("touch(%s((%s)))", lib, name );
+ else
+ printf("touch(%s(%s))", lib, name );
+ }
+
+ if( !Trace && !(cp->ce_attr & A_PHONY) )
+ if( Do_touch( name, lib,
+ (cp->ce_attr & A_SYMBOL) ? &name : NIL(char *) ) != 0 )
+ printf( " not touched - non-existant" );
+
+ if( (!(Glob_attr & A_SILENT) || !Trace) && !(cp->ce_attr & A_PHONY) )
+ printf( "\n" );
+
+ Update_time_stamp( cp );
+ }
+ else if( cp->ce_recipe != NIL(STRING) ) {
+ /* If a recipe is found use it. Note this misses F_MULTI targets. */
+ if( !(cp->ce_flag & F_SINGLE) ) /* Execute the recipes once ... */
+ rval = Exec_commands( cp );
+ /* Update_time_stamp() is called inside Exec_commands() after the
+ * last recipe line is finished. (In _finished_child()) */
+ else { /* or for every out of date dependency
+ * if the ruleop ! was used. */
+ TKSTR tk;
+
+ /* We will redefine $? to be the prerequisite that the recipes
+ * are currently evaluated for. */
+ _drop_mac( m_q );
+
+ /* Execute recipes for each out out of date prerequisites.
+ * WARNING! If no prerequisite is given the recipes are not
+ * executed at all! */
+ if( outall && *outall ) {
+ /* Wait for each prerequisite to finish, save the status
+ * of Wait_for_completion. */
+ int wait_for_completion_status = Wait_for_completion;
+ Wait_for_completion = TRUE;
+
+ SET_TOKEN( &tk, outall );
+
+ /* No need to update the target timestamp/removing temporary
+ * prerequisites (Update_time_stamp() in _finished_child())
+ * until all prerequisites are done. */
+ Doing_bang = TRUE;
+ name = Get_token( &tk, "", FALSE );
+ /* This loop might fail if outall contains filenames with
+ * spaces. */
+ do {
+ /* Set $? to current prerequisite. */
+ m_q->ht_value = name;
+
+ rval = Exec_commands( cp );
+ /* Thanks to Wait_for_completion = TRUE we are allowed
+ * to remove the temp files here. */
+ Unlink_temp_files(cp);
+ }
+ while( *(name = Get_token( &tk, "", FALSE )) != '\0' );
+ Wait_for_completion = wait_for_completion_status;
+ Doing_bang = FALSE;
+ }
+
+ Update_time_stamp( cp );
+ /* Erase $? again. Don't free the pointer, it was part of outall. */
+ m_q->ht_value = NIL(char);
+ }
+ }
+ else if( !(cp->ce_flag & F_RULES) && !(cp->ce_flag & F_STAT) &&
+ (!(cp->ce_attr & A_ROOT) || !(cp->ce_flag & F_EXPLICIT)) &&
+ !(cp->ce_count) )
+ /* F_MULTI subtargets should evaluate its parents F_RULES value
+ * but _make_multi always sets the F_RULES value of the master
+ * target. Assume F_RULES is set for subtargets. This might not
+ * be true if there are no prerequisites and no recipes in any
+ * of the subtargets. (FIXME) */
+ Fatal( "Don't know how to make `%s'",cp->CE_NAME );
+ else {
+ /* Empty recipe, set the flag as MADE and update the time stamp */
+ /* This might be a the master cell of a F_MULTI target. */
+ Update_time_stamp( cp );
+ }
+ }
+ else {
+ if( Verbose & V_MAKE )
+ printf( "%s: Up to date [%s], prq time = %ld , target time = %ld)\n", Pname,
+ cp->CE_NAME, otime, cp->ce_time );
+ mark_made = TRUE;
+ }
+
+ /* If mark_made == TRUE the target is up-to-date otherwise it is
+ * currently in the making. */
+
+ /* Update all targets in .UPDATEALL rule / only target cp. */
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp=dp->cl_prq;
+
+ /* Set the time stamp of those prerequisites without rule to the current
+ * time if Force is TRUE to make sure that targets depending on those
+ * prerequisites get remade. */
+ if( !(tcp->ce_flag & F_TARGET) && Force ) tcp->ce_time = Do_time();
+ if( mark_made ) {
+ tcp->ce_flag |= F_MADE;
+ if( tcp->ce_flag & F_MULTI ) {
+ LINKPTR tdp;
+ for( tdp = tcp->ce_prq; tdp != NIL(LINK); tdp = tdp->cl_next )
+ tcp->ce_attr |= tdp->cl_prq->ce_attr & A_UPDATED;
+ }
+ }
+
+ /* Note that the target is in the making. */
+ tcp->ce_flag |= F_VISITED;
+
+ /* Note: If the prerequisite was made using a .SETDIR= attribute
+ * directory then we will include the directory in the fname
+ * of the target. */
+ if( push ) {
+ char *dir = nsetdirroot ? nsetdirroot->ce_dir : Makedir;
+ /* get relative path from current SETDIR to new SETDIR. */
+ /* Attention, even with .WINPATH set this has to be a POSIX
+ * path as ce_fname neeed to be POSIX. */
+ char *pref = _prefix( dir, tcp->ce_dir );
+ char *nname = Build_path(pref, tcp->ce_fname);
+
+ FREE(pref);
+ if( (tcp->ce_attr & A_FFNAME) && (tcp->ce_fname != NIL(char)) )
+ FREE( tcp->ce_fname );
+
+ tcp->ce_fname = DmStrDup(nname);
+ tcp->ce_attr |= A_FFNAME;
+ }
+ }
+
+stop_making_it:
+ _drop_mac( m_g );
+ _drop_mac( m_q );
+ _drop_mac( m_b );
+ _drop_mac( m_l );
+ _drop_mac( m_bb );
+ _drop_mac( m_up );
+ _drop_mac( m_at );
+
+ /* undefine conditional macros if any */
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp=dp->cl_prq;
+
+ while (tcp->ce_pushed != NIL(HASH)) {
+ HASHPTR cur = tcp->ce_pushed;
+ tcp->ce_pushed = cur->ht_link;
+
+ Pop_macro(cur);
+ FREE(cur->ht_name);
+ if(cur->ht_value)
+ FREE(cur->ht_value);
+ FREE(cur);
+ }
+ }
+
+ if( push )
+ Pop_dir(FALSE);
+
+ /* Undefine the strings that we used for constructing inferred
+ * prerequisites. */
+ if( inf != NIL(char) ) FREE( inf );
+ if( all != NIL(char) ) FREE( all );
+ if( imm != NIL(char) ) FREE( imm );
+ if( outall != NIL(char) ) FREE( outall );
+ free_list(all_list.first);
+ free_list(imm_list.first);
+ free_list(outall_list.first);
+ free_list(inf_list.first);
+
+ DB_PRINT( "mem", ("%s:-< mem %ld", cp->CE_NAME, (long) coreleft()) );
+ DB_RETURN(rval);
+}
+
+
+static char *
+_prefix( pfx, pat )/*
+=====================
+ Return the relative path from pfx to pat. Both paths have to be absolute
+ paths. If the paths are on different resources or drives (if applicable)
+ or only share a relative path going up to the root dir and down again
+ return pat. */
+char *pfx;
+char *pat;
+{
+ char *cmp1=pfx;
+ char *cmp2=pat;
+ char *tpat=pat; /* Keep pointer to original pat. */
+ char *result;
+ char *up;
+ int first = 1;
+ int samerootdir = 1; /* Marks special treatment for the root dir. */
+#ifdef HAVE_DRIVE_LETTERS
+ int pfxdl = 0;
+ int patdl = 0;
+#endif
+
+ /* Micro optimization return immediately if pfx and pat are equal. */
+ if( strcmp(pfx, pat) == 0 )
+ return(DmStrDup(""));
+
+#ifdef HAVE_DRIVE_LETTERS
+ /* remove the drive letters to avoid getting them into the relative
+ * path later. */
+ if( *pfx && pfx[1] == ':' && isalpha(*pfx) ) {
+ pfxdl = 1;
+ cmp1 = DmStrSpn(pfx+2, DirBrkStr);
+ }
+ if( *pat && pat[1] == ':' && isalpha(*pat) ) {
+ patdl = 1;
+ cmp2 = DmStrSpn(pat+2, DirBrkStr);
+ }
+ /* If the drive letters are different use the abs. path. */
+ if( pfxdl && patdl && (tolower(*pfx) != tolower(*pat)) )
+ return(DmStrDup(pat));
+
+ /* If only one has a drive letter also use the abs. path. */
+ if( pfxdl != patdl )
+ return(DmStrDup(pat));
+ else if( pfxdl )
+ /* If both are the same drive letter, disable the special top
+ * dir treatment. */
+ samerootdir = 0;
+
+ /* Continue without the drive letters. (Either none was present,
+ * or both were the same. This also solves the problem that the
+ * case of the drive letters sometimes depends on the shell.
+ * (cmd.exe vs. cygwin bash) */
+ pfx = cmp1;
+ pat = cmp2;
+#endif
+
+ /* Cut off equal leading parts of pfx, pat. Both have to be abs. paths. */
+ while(*pfx && *pat) {
+ /* skip leading dir. separators. */
+ pfx = DmStrSpn(cmp1, DirBrkStr);
+ pat = DmStrSpn(cmp2, DirBrkStr);
+
+ /* Only check in the first run of the loop. Leading slashes can only
+ * mean POSIX paths or Windows resources (two) slashes. Drive letters
+ * have no leading slash. In any case, if the number of slashes are
+ * not equal there can be no relative path from one two the other.
+ * In this case return the absolute path. */
+ if( first ) {
+ if( cmp1-pfx != cmp2-pat ) {
+ return(DmStrDup(tpat));
+ }
+ first = 0;
+ }
+
+ /* find next dir. separator (or ""). */
+ cmp1 = DmStrPbrk(pfx, DirBrkStr);
+ cmp2 = DmStrPbrk(pat, DirBrkStr);
+
+ /* if length of directory name is equal compare the strings. If equal
+ * go into next loop. If not equal and directory names in the root
+ * dir are compared return the absolut path otherwise break the loop
+ * and construct the relative path from pfx to pat. */
+ if ( (cmp1-pfx) != (cmp2-pat) || strncmp(pfx,pat,cmp1-pfx) != 0 ) {
+ if( samerootdir ) {
+ return(DmStrDup(tpat));
+ }
+ break;
+ }
+
+ if( samerootdir ) {
+#if __CYGWIN__
+ /* If the toplevel directory is /cygdrive (or the equivalent prefix)
+ * treat the following level also as rootdir. If we are here cmp1-pfx
+ * cannot be zero so we won't compare with an empty cygdrive prefix. */
+ if ( (cmp1-pfx) == CygDrvPreLen && strncmp(pfx,CygDrvPre,CygDrvPreLen) == 0 )
+ samerootdir = 1;
+ else
+#endif
+ samerootdir = 0;
+ }
+ }
+
+ result = DmStrDup("");
+ up = DmStrJoin("..",DirSepStr,-1,FALSE);
+ cmp1 = pfx;
+ /* Add "../" for each directory in pfx */
+ while ( *(pfx=DmStrSpn(cmp1,DirBrkStr)) != '\0' ) {
+ cmp1 = DmStrPbrk(pfx,DirBrkStr);
+ result = DmStrJoin(result,up,-1,TRUE);
+ }
+
+ pat = DmStrSpn(pat,DirBrkStr);
+ /* Append pat to result. */
+ if( *pat != '\0' ) {
+ cmp2 = DmStrDup(Build_path(result, pat));
+ FREE(result);
+ result = cmp2;
+ } else {
+ /* if pat is empty and result exists remove the trailing slash
+ * from the last "../". */
+ if( *result ) {
+ result[strlen(result)-1] = '\0';
+ }
+ }
+
+ return(result);
+}
+
+
+static LINKPTR
+_dup_prq( lp )
+LINKPTR lp;
+{
+ LINKPTR tlp;
+
+ if( lp == NIL(LINK) ) return(lp);
+
+ TALLOC(tlp, 1, LINK);
+ tlp->cl_prq = lp->cl_prq;
+ tlp->cl_flag = lp->cl_flag;
+ tlp->cl_next = _dup_prq( lp->cl_next );
+
+ return(tlp);
+}
+
+
+static LINKPTR
+_expand_dynamic_prq( head, lp, name )/*
+=======================================
+ The string name can contain one or more target names. Check if these are
+ already a prerequisite for the current target. If not add them to the list
+ of prerequisites. If no prerequisites were added set lp->cl_prq to NULL.
+ Set the F_MARK flag to indicate that the prerequisite was expanded.
+ Use cl_flag instead?? */
+LINKPTR head;
+LINKPTR lp;
+char *name;
+{
+ CELLPTR cur = lp->cl_prq;
+
+ if( !(*name) ) {
+ /* If name is empty this leaves lp->cl_prq unchanged -> No prerequisite added. */
+ ;
+ }
+ else if ( strchr(name, ' ') == NIL(char) ) {
+ /* If condition above is true, no space is found. */
+ CELLPTR prq = Def_cell(name);
+ LINKPTR tmp;
+
+ /* Check if prq already exists. */
+ for(tmp=head;tmp != NIL(LINK) && tmp->cl_prq != prq;tmp=tmp->cl_next);
+
+ /* If tmp is NULL then the prerequisite is new and is added to the list. */
+ if ( !tmp ) {
+ /* replace the prerequisite with the expanded version. */
+ lp->cl_prq = prq;
+ lp->cl_prq->ce_flag |= F_MARK;
+ }
+ }
+ else {
+ LINKPTR tlp = lp;
+ LINKPTR next = lp->cl_next;
+ TKSTR token;
+ char *p;
+ int first=TRUE;
+
+ /* Handle more than one prerequisite. */
+ SET_TOKEN(&token, name);
+ while (*(p=Get_token(&token, "", FALSE)) != '\0') {
+ CELLPTR prq = Def_cell(p);
+ LINKPTR tmp;
+
+ for(tmp=head;tmp != NIL(LINK) && tmp->cl_prq != prq;tmp=tmp->cl_next);
+
+ /* If tmp is not NULL the prerequisite already exists. */
+ if ( tmp ) continue;
+
+ /* Add list elements behind the first if more then one new
+ * prerequisite is found. */
+ if ( first ) {
+ first = FALSE;
+ }
+ else {
+ TALLOC(tlp->cl_next,1,LINK);
+ tlp = tlp->cl_next;
+ tlp->cl_flag |= F_TARGET;
+ tlp->cl_next = next;
+ }
+
+ tlp->cl_prq = prq;
+ tlp->cl_prq->ce_flag |= F_MARK;
+ }
+ CLEAR_TOKEN( &token );
+ }
+
+ /* If the condition is true no new prerequisits were found. */
+ if ( lp->cl_prq == cur ) {
+ lp->cl_prq = NIL(CELL);
+ lp->cl_flag = 0;
+ }
+
+ /* Is returned unchanged. */
+ return(lp);
+}
+
+
+static void
+_drop_mac( hp )/*
+================ set a macro value to zero. */
+HASHPTR hp;
+{
+ if( hp && hp->ht_value != NIL(char) ) {
+ FREE( hp->ht_value );
+ hp->ht_value = NIL(char);
+ }
+}
+
+
+
+static int
+_explode_graph( cp, parent, setdirroot )/*
+==========================================
+ Check to see if we have made the node already. If so then don't do
+ it again, except if the cell's ce_setdir field is set to something other
+ than the value of setdirroot. If they differ then, and we have made it
+ already, then make it again and set the cell's stat bit to off so that
+ we do the stat again. */
+CELLPTR cp;
+LINKPTR parent;
+CELLPTR setdirroot;
+{
+ static CELLPTR removecell = NIL(CELL);
+
+ if ( removecell == NIL(CELL) )
+ removecell = Def_cell(".REMOVE");
+
+ /* we may return if we made it already from the same setdir location,
+ * or if it is not a library member whose lib field is non NULL. (if
+ * it is such a member then we have a line of the form:
+ * lib1 lib2 .LIBRARY : member_list...
+ * and we have to make sure all members are up to date in both libs. */
+
+ if ( setdirroot == removecell )
+ return( 0 );
+
+ if( cp->ce_setdir == setdirroot &&
+ !((cp->ce_attr & A_LIBRARYM) && (cp->ce_lib != NIL(char))) )
+ return( 0 );
+
+ /* We check to make sure that we are comming from a truly different
+ * directory, ie. ".SETDIR=joe : a.c b.c d.c" are all assumed to come
+ * from the same directory, even though setdirroot is different when
+ * making dependents of each of these targets. */
+
+ if( cp->ce_setdir != NIL(CELL) &&
+ setdirroot != NIL(CELL) &&
+ cp->ce_dir &&
+ setdirroot->ce_dir &&
+ !strcmp(cp->ce_dir, setdirroot->ce_dir) )
+ return( 0 );
+
+ if( Max_proc > 1 ) {
+ LINKPTR dp;
+
+ TALLOC(parent->cl_prq, 1, CELL);
+ *parent->cl_prq = *cp;
+ cp = parent->cl_prq;
+ cp->ce_prq = _dup_prq(cp->ce_prqorg);
+ cp->ce_all.cl_prq = cp;
+ CeNotMe(cp) = _dup_prq(CeNotMe(cp));
+
+ for(dp=CeNotMe(cp);dp;dp=dp->cl_next) {
+ CELLPTR tcp = dp->cl_prq;
+ TALLOC(dp->cl_prq,1,CELL);
+ *dp->cl_prq = *tcp;
+ dp->cl_prq->ce_flag &= ~(F_STAT|F_VISITED|F_MADE);
+ dp->cl_prq->ce_set = cp;
+ }
+ }
+ cp->ce_flag &= ~(F_STAT|F_VISITED|F_MADE);
+
+ /* Indicate that we exploded the graph and that the current node should
+ * be made. */
+ return(1);
+}
+
+
+
+PUBLIC int
+Exec_commands( cp )/*
+=====================
+ Execute the commands one at a time that are pointed to by the rules pointer
+ of the target cp if normal (non-group) recipes are defined. If a group recipe
+ is found all commands are written into a temporary file first and this
+ (group-) shell script is executed all at once.
+ If a group is indicated, then the ce_attr determines .IGNORE and .SILENT
+ treatment for the group.
+
+ The function returns 0, if the command is executed and has successfully
+ returned, and it returns 1 if the command is executing but has not yet
+ returned or -1 if an error occured (Return value from Do_cmnd()).
+
+ Macros that are found in recipe lines are expanded in this function, in
+ parallel builds this can mean they are expanded before the previous recipe
+ lines are finished. (Exception: $(shell ..) waits until all previous recipe
+ lines are done.)
+
+ The F_MADE bit in the cell is guaranteed set when the command has
+ successfully completed. */
+CELLPTR cp;
+{
+ static HASHPTR useshell = NIL(HASH);
+ static HASHPTR command = NIL(HASH);
+ static int read_cmnd = 0;
+ register STRINGPTR rp;
+ STRINGPTR orp;
+ char *cmnd;
+ char *groupfile;
+ FILE *tmpfile = 0;
+ int do_it;
+ t_attr attr;
+ int group;
+ int trace;
+ int rval = 0;
+
+ DB_ENTER( "Exec_commands" );
+
+ if( cp->ce_recipe == NIL(STRING) )
+ Fatal("Internal Error: No recipe found!");
+
+ attr = Glob_attr | cp->ce_attr;
+ trace = Trace || !(attr & A_SILENT);
+ group = cp->ce_flag & F_GROUP;
+
+ /* Do it again here for those that call us from places other than Make()
+ * above. */
+ orp = _recipes[ RP_RECIPE ];
+ _recipes[ RP_RECIPE ] = cp->ce_recipe;
+
+ if( group ) {
+ /* Leave this assignment of Current_target here. It is needed just
+ * incase the user hits ^C after the tempfile for the group recipe
+ * has been opened. */
+ Current_target = cp;
+ trace = Trace || !(attr & A_SILENT);
+
+ if( !Trace ) tmpfile = Start_temp( Grp_suff, cp, &groupfile );
+ if( trace ) fputs( "[\n", stdout );
+
+ /* Emit group prolog */
+ if( attr & A_PROLOG )
+ _append_file( _recipes[RP_GPPROLOG], tmpfile, cp->CE_NAME, trace );
+ }
+
+ if( !useshell )
+ useshell=Def_macro("USESHELL",NIL(char),M_MULTI|M_EXPANDED);
+
+ if( !read_cmnd ) {
+ command = GET_MACRO("COMMAND");
+ read_cmnd = 1;
+ }
+
+ /* Process commands in recipe. If in group, merely append to file.
+ * Otherwise, run them. */
+ for( rp=_recipes[RP_RECIPE]; rp != NIL(STRING); rp=rp->st_next) {
+ t_attr a_attr = A_DEFAULT;
+ t_attr l_attr;
+ char *p;
+ int new_attr = FALSE;
+ int shell; /* True if the recipe shall run in shell. */
+
+ /* Reset it for each recipe line otherwise tempfiles don't get removed.
+ * Since processing of $(mktmp ...) depends on Current_target being
+ * correctly set. */
+ Current_target = cp;
+
+ /* Only check for +,-,%,@ if the recipe line begins with a '$' macro
+ * expansion. Otherwise there is no way it is going to find these
+ * now. */
+ if( *rp->st_string == '$' && !group ) {
+ t_attr s_attr = Glob_attr;
+ Glob_attr |= A_SILENT;
+ Suppress_temp_file = TRUE;
+ cmnd = Expand(rp->st_string);
+ Suppress_temp_file = FALSE;
+ a_attr |= Rcp_attribute(cmnd);
+ FREE(cmnd);
+ ++new_attr;
+ Glob_attr = s_attr;
+ }
+
+ l_attr = attr|a_attr|rp->st_attr;
+ shell = ((l_attr & A_SHELL) != 0);
+ useshell->ht_value = (group||shell)?"yes":"no";
+
+ /* All macros are expanded before putting them in the "process queue".
+ * Nothing in Expand() should be able to change dynamic macros. */
+ cmnd = Expand( rp->st_string );
+
+ if( new_attr && (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) {
+ size_t len = strlen(p)+1;
+ memmove(cmnd,p,len);
+ }
+
+ /* COMMAND macro is set to "$(CMNDNAME) $(CMNDARGS)" by default, it is
+ * possible for the user to reset it to, for example
+ * COMMAND = $(CMNDNAME) @$(mktmp $(CMNDARGS))
+ * in order to get a different interface for his command execution. */
+ if( command != NIL(HASH) && !group ) {
+ char *cname = cmnd;
+ char cmndbuf[30];
+
+ if ( *(p=DmStrPbrk(cmnd," \t\n")) != '\0' ) {
+ *p = '\0';
+ (void)Def_macro("CMNDARGS",DmStrSpn(p+1," \t\n"),M_MULTI|M_EXPANDED);
+ }
+ else
+ (void) Def_macro("CMNDARGS","",M_MULTI|M_EXPANDED);
+
+ (void) Def_macro("CMNDNAME",cname,M_MULTI|M_EXPANDED);
+
+ strcpy(cmndbuf, "$(COMMAND)");
+ cmnd = Expand(cmndbuf);
+ FREE(cname); /* cname == cmnd at this point. */
+
+ /* Collect up any new attributes */
+ l_attr |= Rcp_attribute(cmnd);
+ shell = ((l_attr & A_SHELL) != 0);
+
+ /* clean up the attributes that we may have just added. */
+ if( (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) {
+ size_t len = strlen(p)+1;
+ memmove(cmnd,p,len);
+ }
+ }
+
+#if defined(MSDOS)
+ Swap_on_exec = ((l_attr & A_SWAP) != 0); /* Swapping for DOS only */
+#endif
+ do_it = !Trace;
+
+ /* We force execution of the recipe if we are tracing and the .EXECUTE
+ * attribute was given or if the it is not a group recipe and the
+ * recipe line contains the string $(MAKE). Wait_for_completion might
+ * be changed gobaly but this is without consequences as we wait for
+ * every recipe with .EXECUTE and don't start anything else. */
+ if( Trace
+ && ((l_attr & A_EXECUTE)||(!group && DmStrStr(rp->st_string,"$(MAKE)")))
+ ) {
+ Wait_for_completion |= Trace;
+ do_it = TRUE;
+ }
+
+ if( group )
+ /* Append_line() calls Print_cmnd(). */
+ Append_line( cmnd, TRUE, tmpfile, cp->CE_NAME, trace, 0 );
+ else {
+ /* Don't print empty recipe lines. .ROOT and .TARGETS
+ * deliberately might have empty "" recipes and we don't want
+ * to output empty recipe lines for them. */
+ if ( *cmnd ) {
+ /* Print command and remove continuation sequence from cmnd. */
+ Print_cmnd(cmnd, !(do_it && (l_attr & A_SILENT)), 0);
+ }
+ rval=Do_cmnd(&cmnd,FALSE,do_it,cp,l_attr,
+ rp->st_next == NIL(STRING) );
+ }
+
+ FREE(cmnd);
+ }
+
+ /* If it is a group then output the EPILOG if required and possibly
+ * execute the command */
+ if( group && !(cp->ce_attr & A_ERROR) ) {
+ if( attr & A_EPILOG ) /* emit epilog */
+ _append_file( _recipes[RP_GPEPILOG], tmpfile, cp->CE_NAME, trace );
+
+ if( trace ) fputs("]\n", stdout);
+
+ do_it = !Trace;
+ if( do_it )
+ {
+ Close_temp( cp, tmpfile );
+#if defined(UNIX)
+
+ chmod(groupfile,0700);
+#endif
+ }
+ rval = Do_cmnd(&groupfile, TRUE, do_it, cp, attr | A_SHELL, TRUE);
+ }
+
+ _recipes[ RP_RECIPE ] = orp;
+ cp->ce_attr &= ~A_ERROR;
+ DB_RETURN( rval );
+}
+
+
+PUBLIC void
+Print_cmnd( cmnd, echo, map )/*
+================================
+ This routine is called to print out the command to stdout. If echo is
+ false the printing to stdout is supressed.
+ The routine is also used to remove the line continuation sequence
+ \<nl> from the command string and convert escape sequences if the
+ map flag is set.
+ The changed string is used later to actually to execute the command. */
+char *cmnd;
+int echo;
+int map;
+{
+ register char *p;
+ register char *n;
+ char tmp[3];
+
+ DB_ENTER( "Print_cmnd" );
+
+ if( echo ) {
+ printf( "%s\n", cmnd );
+ fflush(stdout);
+ }
+
+ tmp[0] = ESCAPE_CHAR;
+ tmp[1] = CONTINUATION_CHAR;
+ tmp[2] = '\0';
+
+ for( p=cmnd; *(n = DmStrPbrk(p,tmp)) != '\0'; )
+ /* Remove the \<nl> sequences. */
+ if(*n == CONTINUATION_CHAR && n[1] == '\n') {
+ size_t len = strlen(n+2)+1;
+ DB_PRINT( "make", ("fixing [%s]", p) );
+ memmove( n, n+2, len );
+ p = n;
+ }
+ /* Look for an escape sequence and replace it by it's corresponding
+ * character value. */
+ else {
+ if( *n == ESCAPE_CHAR && map ) Map_esc( n );
+ p = n+1;
+ }
+
+ DB_VOID_RETURN;
+}
+
+
+
+/* These routines are used to maintain a stack of directories when making
+ * the targets. If a target cd's to the directory then it is assumed that
+ * it will undo it when it is finished making itself. */
+
+static STRINGPTR dir_stack = NIL(STRING);
+
+PUBLIC int
+Push_dir( dir, name, ignore )/*
+===============================
+ Change the current working directory to dir and save the current
+ working directory on the stack so that we can come back.
+
+ If ignore is TRUE then do not complain about _ch_dir if not possible.
+
+ Return 1 if the directory change was successfull and 0 otherwise. */
+char *dir;
+char *name;
+int ignore;
+{
+ STRINGPTR new_dir;
+ int freedir=FALSE;
+
+ DB_ENTER( "Push_dir" );
+
+ if( dir == NIL(char) || *dir == '\0' ) dir = Pwd;
+ if( *dir == '\'' && dir[strlen(dir)-1] == '\'' ) {
+ dir = DmStrDup(dir+1);
+ dir[strlen(dir)-1]='\0';
+ freedir=TRUE;
+ }
+ else if (strchr(dir,'$') != NIL(char)) {
+ dir = Expand(dir);
+ freedir=TRUE;
+ }
+ else
+ dir = DmStrDup(dir);
+
+ if( Set_dir(dir) ) {
+ if( !ignore )
+ Fatal( "Unable to change to directory `%s', target is [%s]",
+ dir, name );
+ if (freedir) FREE(dir);
+ DB_RETURN( 0 );
+ }
+
+ DB_PRINT( "dir", ("Push: [%s]", dir) );
+ if( Verbose & V_DIR_SET )
+ printf( "%s: Changed to directory [%s]\n", Pname, dir );
+
+ if (freedir) FREE( dir );
+ TALLOC( new_dir, 1, STRING );
+ new_dir->st_next = dir_stack;
+ dir_stack = new_dir;
+ new_dir->st_string = DmStrDup( Pwd );
+
+ Def_macro( "PWD", Get_current_dir(), M_FORCE | M_EXPANDED );
+ _set_tmd();
+
+ DB_RETURN( 1 );
+}
+
+
+
+PUBLIC void
+Pop_dir(ignore)/*
+=================
+ Change the current working directory to the previous saved dir. */
+int ignore;
+{
+ STRINGPTR old_dir;
+ char *dir;
+
+ DB_ENTER( "Pop_dir" );
+
+ if( dir_stack == NIL(STRING) ) {
+ if( ignore ) {
+ DB_VOID_RETURN;
+ }
+ else
+ Error( "Directory stack empty for return from .SETDIR" );
+ }
+
+ if( Set_dir(dir = dir_stack->st_string) )
+ Fatal( "Could not change to directory `%s'", dir );
+
+ Def_macro( "PWD", dir, M_FORCE | M_EXPANDED );
+ DB_PRINT( "dir", ("Pop: [%s]", dir) );
+ if( Verbose & V_DIR_SET )
+ printf( "%s: Changed back to directory [%s]\n", Pname, dir);
+
+ old_dir = dir_stack;
+ dir_stack = dir_stack->st_next;
+
+ FREE( old_dir->st_string );
+ FREE( old_dir );
+ _set_tmd();
+
+ DB_VOID_RETURN;
+}
+
+
+
+static void
+_set_tmd()/*
+============
+ Set the TMD Macro and the Tmd global variable. TMD stands for "To MakeDir"
+ and is the path from the present directory (value of $(PWD)) to the directory
+ dmake was started up in (value of $(MAKEDIR)). As _prefix() can return absolute
+ paths some special .WINPATH treatment is needed.
+*/
+{
+ char *tmd;
+
+ if( Tmd )
+ FREE(Tmd);
+
+ tmd = _prefix(Pwd, Makedir);
+ if( *tmd ) {
+ Def_macro( "TMD", DO_WINPATH(tmd), M_FORCE | M_EXPANDED );
+ Tmd = DmStrDup(tmd);
+ } else {
+ Def_macro( "TMD", ".", M_FORCE | M_EXPANDED );
+ Tmd = DmStrDup(".");
+ }
+ FREE( tmd );
+}
+
+
+static void
+_set_recipe( target, ind )/*
+============================
+ Set up the _recipes static variable so that the slot passed in points
+ at the rules corresponding to the target supplied. */
+char *target;
+int ind;
+{
+ CELLPTR cp;
+ HASHPTR hp;
+
+ if( (hp = Get_name(target, Defs, FALSE)) != NIL(HASH) ) {
+ cp = hp->CP_OWNR;
+ _recipes[ ind ] = cp->ce_recipe;
+ }
+ else
+ _recipes[ ind ] = NIL(STRING);
+}
+
+
+
+PUBLIC void
+Append_line( cmnd, newline, tmpfile, name, printit, map )
+char *cmnd;
+int newline;
+FILE *tmpfile;
+char *name;
+int printit;
+int map;
+{
+ Print_cmnd( cmnd, printit, map );
+
+ if( Trace ) return;
+
+ fputs(cmnd, tmpfile);
+ if( newline ) fputc('\n', tmpfile);
+ fflush(tmpfile);
+
+ if( ferror(tmpfile) )
+ Fatal("Write error on temporary file, while processing `%s'", name);
+}
+
+
+
+static void
+_append_file( rp, tmpfile, name, printit )
+register STRINGPTR rp;
+FILE *tmpfile;
+char *name;
+int printit;
+{
+ char *cmnd;
+
+ while( rp != NIL(STRING) ) {
+ Append_line(cmnd = Expand(rp->st_string), TRUE, tmpfile, name, printit,0);
+ FREE(cmnd);
+ rp = rp->st_next;
+ }
+}
+
+
+#define NUM_BUCKETS 20
+
+typedef struct strpool {
+ char *string; /* a pointer to the string value */
+ uint32 keyval; /* the strings hash value */
+ struct strpool *next; /* hash table link pointer */
+} POOL, *POOLPTR;
+
+static POOLPTR strings[ NUM_BUCKETS ];
+
+static char *
+_pool_lookup( str )/*
+=====================
+ Scan down the list of chained strings and see if one of them matches
+ the string we are looking for. */
+char *str;
+{
+ register POOLPTR key;
+ uint32 keyval;
+ uint16 hv;
+ uint16 keyindex;
+ char *string;
+
+ DB_ENTER( "_pool_lookup" );
+
+ if( str == NIL(char) ) DB_RETURN("");
+
+ hv = Hash(str, &keyval);
+ key = strings[ keyindex = (hv % NUM_BUCKETS) ];
+
+ while( key != NIL(POOL) )
+ if( (key->keyval != keyval) || strcmp(str, key->string) )
+ key = key->next;
+ else
+ break;
+
+ if( key == NIL(POOL) ) {
+ DB_PRINT( "pool", ("Adding string [%s]", str) );
+ TALLOC( key, 1, POOL ); /* not found so add string */
+
+ key->string = string = DmStrDup(str);
+ key->keyval = keyval;
+
+ key->next = strings[ keyindex ];
+ strings[ keyindex ] = key;
+ }
+ else {
+ DB_PRINT( "pool", ("Found string [%s], key->string") );
+ string = key->string;
+ }
+
+ DB_RETURN( string );
+}
+
+
+void
+Unmake( cp )/*
+==============
+ Remove flags indicating that a target was previously made. This
+ is used for infered makefiles. */
+CELLPTR cp;
+{
+ LINKPTR dp, ep;
+ CELLPTR tcp, pcp;
+
+ DB_ENTER( "Unmake" );
+
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp = dp->cl_prq;
+
+ /* Unmake the prerequisites. */
+ for( ep = tcp->ce_prq; ep != NIL(LINK); ep = ep->cl_next ) {
+ pcp = ep->cl_prq;
+
+ Unmake(pcp);
+ }
+ DB_PRINT( "unmake", ("Unmake [%s]", tcp->CE_NAME) );
+
+ tcp->ce_flag &= ~(F_MADE|F_VISITED|F_STAT);
+ tcp->ce_time = (time_t)0L;
+ }
+
+ DB_VOID_RETURN;
+}
diff --git a/dmake/make.cmd b/dmake/make.cmd
new file mode 100755
index 000000000000..c0d490ddd969
--- /dev/null
+++ b/dmake/make.cmd
@@ -0,0 +1,115 @@
+echo off
+
+REM * This script is deprecated for OS/2 libc 06x building! Use the configure
+REM * mechanism. Run the following commands your OS/2 shell:
+REM *
+REM * set CFLAGS=-g -Zomf -O3 -march=pentium -mcpu=pentium4
+REM * set CXXFLAGS=-g -Zomf -O3 -march=pentium -mcpu=pentium4
+REM * set LDFLAGS=-s -Zsym -Zmap -Zhigh-mem -Zomf -Zexe -Zargs-wild -Zargs-resp
+REM * set LN_CP_F=cp.exe
+REM * set RANLIb=echo
+REM * set AR=emxomfar -p128
+REM * sh -c "./configure --enable-spawn"
+REM * make.exe
+
+cls
+rem *** This is the make command file that is used under OS/2 to make the
+rem *** first version of dmake. It isn't pretty but it does work, assuming
+rem *** the compilers have been correctly setup.
+rem
+
+if %0%1 == %0 goto error
+
+if %1 == os2-ibm goto mkibm
+if %1 == os2-ibm3 goto mkibm3
+if %1 == winnt-bcc40 goto mkwntb40
+if %1 == winnt-bcc45 goto mkwntb45
+if %1 == winnt-bcc50 goto mkwntb50
+if %1 == winnt-vpp40 goto mkwntv40
+
+
+rem label the possible DOS variations for dmake here.
+:error
+echo OS/2 INDEX: You must specify one of:
+echo ------------------
+echo os2-ibm - IBM OS/2 ICC compile.
+echo os2-ibm3 - IBM OS/2 ICC3 compile.
+echo winnt-bcc40 - Windows-NT Borland C++ 4.0 Compile
+echo winnt-bcc45 - Windows-NT Borland C++ 4.5 Compile
+echo winnt-bcc50 - Windows-NT Borland C++ 5.0 Compile
+echo winnt-vpp40 - Windows-NT Microsoft VC++ 4.0 Compile
+goto end
+
+rem This is the script that bilds OS/2 dmake using IBM ICC Compiler
+:mkibm
+os2\ibm\icc\mk.cmd
+goto end
+
+:mkibm3
+os2\ibm\icc3\mk.cmd
+goto end
+
+rem This is the script that makes 32-bit dmake using Borland C++ 4.0.
+:mkwntb40
+cls
+echo WARNING:
+echo The default response files:
+echo winnt\borland\bcc40\obj.rsp
+echo winnt\borland\bcc40\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+winnt\borland\bcc40\mk.bat
+goto end
+
+rem This is the script that makes 32-bit dmake using Borland C++ 4.5.
+:mkwntb45
+cls
+echo WARNING:
+echo The default response files:
+echo winnt\borland\bcc45\obj.rsp
+echo winnt\borland\bcc45\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+winnt\borland\bcc45\mk.bat
+goto end
+
+rem All done!
+rem This is the script that makes 32-bit dmake using Borland C++ 5.0.
+:mkwntb50
+cls
+echo WARNING:
+echo The default response files:
+echo winnt\borland\bcc50\obj.rsp
+echo winnt\borland\bcc50\lib.rsp
+echo contain absolute paths to Borland C++ runtime startup objects, and to
+echo the standard libraries. You should check that these files contain
+echo the correct path names for your installation of Borland C++ before
+echo proceeding further. Also check that the mkdir command at the start
+echo of the response file and the copy command at the end of the response
+echo file will work on your system.
+echo --
+echo Continue if ok, or abort and edit the response files.
+pause
+winnt\borland\bcc50\mk.bat
+goto end
+
+:mkwntv40
+winnt\microsft\vpp40\mk.bat
+goto end
+
+rem All done!
+:end
diff --git a/dmake/makefile.mk b/dmake/makefile.mk
new file mode 100644
index 000000000000..528a79f7c021
--- /dev/null
+++ b/dmake/makefile.mk
@@ -0,0 +1,432 @@
+# //// Makefile for DMAKE. \\\\
+# The target system is characterized by the following macros imported from
+# the environment.
+#
+# OS - gives the class of operating system
+# OSRELEASE - optionally specifies the particular release of the OS
+# OSENVIRONMENT - optionally specifies the environment under which the
+# OS and OSENVIRONMENT are running.
+#
+# For valid values for the above macros consult the readme/* files or type
+# 'make' by itself to get a summary of what is available.
+
+# First target in the makefile, do this so that targets declared in the
+# included files are never marked as being the first *default* target.
+first : all ;
+
+#Enable keeping of state for future compiles
+.KEEP_STATE *:= _state.mk
+
+# Define $(PUBLIC)
+_osenv := $(OSENVIRONMENT)$/
+_osre := $(OSRELEASE)$/$(!null,$(OSENVIRONMENT) $(_osenv))
+.IF "$(OS)"=="LINUX"
+OS=linux
+.ENDIF
+ENVDIR = $(OS)$/$(!null,$(OSRELEASE) $(_osre))
+PUBLIC = $(ENVDIR)public.h
+MKCONFIG := startup/config.mk
+
+# Define the source files
+SRC =\
+ infer.c make.c stat.c expand.c dmstring.c hash.c dag.c dmake.c\
+ path.c imacs.c sysintf.c parse.c getinp.c quit.c state.c\
+ dmdump.c macparse.c rulparse.c percent.c function.c
+
+# Common Include files.
+HDR = dmake.h extern.h struct.h vextern.h
+
+# Define the TARGET we are making, and where the OBJECT files go.
+OBJDIR := objects
+TARGET = dmake$E
+CFLAGS += $(SWITCHAR)I.
+
+# Meta rule for making .o's from .c's (give our own so we can move object
+# to objects directory in a portable, compiler independent way)
+# Define it before the .INCLUDE so that different OS combinations can redefine
+# it.
+%$O : %.c
+.IF $(SHELL) == mpw
+ %$(CC) $(CFLAGS) -o :$(OBJDIR:s,/,:,):$@ $<
+.ELSE
+ %$(CC) $(SWITCHAR)c $(CFLAGS) $<
+.IF $(SHELL) != $(COMSPEC)
+ mv $(@:f) $(OBJDIR)
+.ELSE
+ +copy $(@:f) $(OBJDIR)
+ +del $(@:f)
+.ENDIF
+.ENDIF
+
+# Pull in the proper configuration files, based on the value of OS.
+.INCLUDE : $(OS)/config.mk
+.INCLUDE : dbug/dbug.mk
+
+# Set the .SOURCE targets so that we look for things in the right place.
+.SOURCE.c :^ .NULL
+.SOURCE.h :^ .NULL
+.SOURCE$O :^ $(OBJDIR)
+.PRECIOUS : $(HDR)
+
+# Must come after the above INCLUDE so that it gets ALL objects.
+OBJECTS := {$(ASRC:b) $(SRC:b)}$O
+
+# The main target, make sure the objects directory exists first.
+# LDARGS is defined in config.mk file of each OS/OSRELEASE combination.
+all : $(TARGET) $(MKCONFIG);
+$(TARGET) : $(OBJDIR)
+$(TARGET) : $(OBJECTS);$(LD) $(LDARGS)
+
+# Use this for install targets
+.IF $(SHELL) == mpw
+$(MKCONFIG) : template.mk
+ duplicate :$(<:s,/,:,) $@
+.ELSE
+$(MKCONFIG) : template.mk
+ $(eq,$(SHELL),$(COMSPEC) +copy cp) $< $(eq,$(SHELL),$(COMSPEC) $(@:s,/,\,) $@)
+.ENDIF
+
+# how to make public.h
+public .PHONY : $(PUBLIC);
+$(PUBLIC) .GROUP .NOSTATE: $(SRC)
+ genpub -n DMAKE $< >$@
+# drcsclean ./rcsclean.awk $@ > /dev/null
+
+# Other obvious targets...
+.IF $(SHELL) == mpw
+ $(OBJDIR):;-newfolder $@
+.ELSE
+ $(OBJDIR):;-$(eq,$(SHELL),$(COMSPEC) +md mkdir) $@
+.ENDIF
+
+# remaining dependencies should be automatically generated
+sysintf$O : sysintf.h
+ruletab$O : startup.h #khc 01NOV90 - dependency was missing
+$(OBJECTS) : $(HDR)
+
+clean:;+- $(RM:f) -rf dmake$E dbdmake$E objects* _*state*.mk startup/config.mk
+
+# Rules for making the manual pages.
+man .SETDIR=man : dmake.nc dmake.uue ;
+dmake.nc : dmake.p ; scriptfix < $< > $@
+dmake.p : dmake.tf; groff -man -Tascii $< > $@
+dmake.uue : dmake.p
+ compress -b 12 dmake.p
+ mv dmake.p.Z dmake.Z
+ uuencode dmake.Z dmake.Z >dmake.uue
+ /bin/rm -f dmake.Z
+
+template.mk ".SETDIR=$(ENVDIR)" .USESHELL : $$(TMD)/startup/template.mk
+ cat $< |\
+ sed -e 's/xxOSxx/$(OS)/' |\
+ sed -e 's/xxOSRELEASExx/$(OSRELEASE)/' |\
+ sed -e 's/xxOSENVIRONMENTxx/$(OSENVIRONMENT)/' > $@
+
+#--------------------------------------------------------------------------
+# Make the various archives for shipping the thing around.
+#
+archives : zip tar
+ $(RM) -rf src-list dmake
+
+zip .PHONY : dmake.zip ;
+shar .PHONY : dmake.shar;
+tar .PHONY : dmake.tar;
+
+dmake.zip : dir-copy
+ zip -r $(@:b) $(@:b)
+
+dmake.shar : dir-copy
+ find dmake -type f -print >src-list
+ xshar -vc -o$@ -L40 `cat src-list`
+
+dmake.tar : dir-copy
+ tar cf $@ dmake
+
+dir-copy .PHONY : src-list
+[
+ echo 'tmp.tar .SILENT :$$(ALLSRC) ;tar -cf tmp.tar $$(ALLSRC)' >> $<
+ $(MAKECMD) -f $< tmp.tar
+ mkdir dmake
+ cd dmake
+ tar xf ../tmp.tar; chmod -R u+rw .
+ cd ..
+ /bin/rm -f tmp.tar
+]
+
+src-list : clean
+ echo 'MAXLINELENGTH := 65536' > $@
+ echo 'ALLSRC = \' >>$@
+ find . -type f -print |\
+ sed -e 's/,v//'\
+ -e 's/$$/\\/'\
+ -e 's/^\.\// /'|\
+ sort -u |\
+ grep -v tst | grep -v $@ | grep -v license |\
+ grep -v CVS | grep -v RCS |\
+ grep -v '\.zip' | grep -v '\.tar'| grep -v '\.shar' >> $@
+ echo ' readme/license.txt' >> $@
+
+#--------------------------------------------------------------------------
+# This section can be used to make the necessary script files so that dmake
+# can be bootstrapped.
+#
+# dmake scripts -- makes all the script files at once.
+#
+FIX-SH = $(SH:s,fix/,,)
+FIX95-SH = $(SH:s,fix95nt/,,)
+SH = $(SH_n:s/c40d/cd/:s/c50d/cd/:s/c51d/cd/:s/c60d/cd/)
+SH_n = $(@:s/swp-/-/:s,-,/,:s/scripts/${SCRIPTFILE}/)
+MS = MAKESTARTUP=startup/startup.mk
+FS := "SHELL := $(SHELL)" "SHELLFLAGS := -ce"
+SET-TMP:= TMPDIR:=/tmp
+
+scripts: unix-scripts\
+ atari-tos-scripts apple-mac-scripts qssl-qnx-scripts\
+ msdos-scripts win95-scripts os2-scripts;
+
+# To add a new environment for UNIX, simply create the appropriate entry
+# in the style below for the macro which contains the OS, OSRELEASE and
+# OSENVIRONMENT flags. Then add the entry as a recipe line for the target
+# unix-scripts.
+#
+unix-bsd43-scripts-flags = OS=unix OSRELEASE=bsd43 OSENVIRONMENT=
+unix-linux-gnu-scripts-flags = OS=unix OSRELEASE=linux OSENVIRONMENT=gnu
+unix-solaris-scripts-flags = OS=unix OSRELEASE=solaris OSENVIRONMENT=
+unix-solaris-gnu-scripts-flags = OS=unix OSRELEASE=solaris OSENVIRONMENT=gnu
+unix-bsd43-uw-scripts-flags= OS=unix OSRELEASE=bsd43 OSENVIRONMENT=uw
+unix-bsd43-vf-scripts-flags= OS=unix OSRELEASE=bsd43 OSENVIRONMENT=vf
+unix-sysvr4-scripts-flags = OS=unix OSRELEASE=sysvr4 OSENVIRONMENT=
+unix-sysvr3-scripts-flags = OS=unix OSRELEASE=sysvr3 OSENVIRONMENT=
+unix-sysvr3-pwd-scripts-flags = OS=unix OSRELEASE=sysvr3 OSENVIRONMENT=pwd
+unix-xenix-scripts-flags = OS=unix OSRELEASE=xenix OSENVIRONMENT=
+unix-xenix-pwd-scripts-flags = OS=unix OSRELEASE=xenix OSENVIRONMENT=pwd
+unix-sysvr1-scripts-flags = OS=unix OSRELEASE=sysvr1 OSENVIRONMENT=
+unix-386ix-scripts-flags = OS=unix OSRELEASE=386ix OSENVIRONMENT=
+unix-coherent-ver40-scripts-flags= OS=unix OSRELEASE=coherent OSENVIRONMENT=ver40
+unix-coherent-ver42-scripts-flags= OS=unix OSRELEASE=coherent OSENVIRONMENT=ver42
+unix-macosx-gnu-scripts-flags = OS=unix OSRELEASE=macosx OSENVIRONMENT=gnu
+qssl--scripts-flags = OS=qssl OSRELEASE= OSENVIRONMENT=
+tos--scripts-flags = OS=tos OSRELEASE= OSENVIRONMENT=
+mac--scripts-flags = OS=mac OSRELEASE= OSENVIRONMENT=
+
+unix-scripts .SWAP : clean
+ $(MAKE) SCRIPTFILE=make.sh unix-bsd43-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-bsd43-uw-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-bsd43-vf-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-linux-gnu-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-solaris-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-solaris-gnu-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-sysvr4-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-sysvr3-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-sysvr3-pwd-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-xenix-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-xenix-pwd-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-sysvr1-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-386ix-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-coherent-ver40-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-coherent-ver42-scripts
+ $(MAKE) SCRIPTFILE=make.sh unix-macosx-gnu-scripts
+
+atari-tos-scripts .SWAP : clean
+ $(MAKE) SCRIPTFILE=make.sh tos--scripts
+
+qssl-qnx-scripts .SWAP : clean
+ $(MAKE) SCRIPTFILE=make.sh qssl--scripts
+
+apple-mac-scripts .SWAP : clean
+ $(MAKE) SCRIPTFILE=make.sh mac--scripts
+
+unix-%-scripts .SWAP :
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >/tmp/dmscr
+ dfold </tmp/dmscr >$(SH)
+
+qssl-%-scripts .SWAP :
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >/tmp/dmscr
+ dfold </tmp/dmscr >$(SH)
+
+tos-%-scripts .SWAP :
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >/tmp/dmscr
+ dfold </tmp/dmscr >$(SH)
+
+mac-%-scripts .SWAP :
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
+ sed 's/ mac\/\(.*\)$$/ :mac:\1/' <$(SH) | dfold >/tmp/dmscr
+ /bin/mv /tmp/dmscr $(SH)
+
+# We make the standard dos scripts here, but we have to go and fix up the
+# mkXX.bat file since it contains names of temporary files for the response
+# files required by the linker. We need to also construct the response file
+# contents. These two functions are performed by the fix-msdos-%-scripts
+# meta-target.
+#
+# To add a new DOS environment just do what is described for adding a new
+# unix environment, and then make certain that the fix-msdos-%-scripts target
+# performs the correct function for the new environment.
+msdos-cf = OS=msdos
+win95-cf = OS=win95
+winnt-cf = OS=winnt
+
+msdos-borland-tcc20swp-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=tcc20
+msdos-borland-bcc30-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=bcc30 SWAP=n
+msdos-borland-bcc30swp-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=bcc30
+msdos-borland-bcc40swp-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=bcc40
+msdos-borland-bcc45swp-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=bcc45
+msdos-borland-bcc50swp-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=bcc50
+msdos-borland-bcc32-scripts-flags = $(msdos-cf) OSRELEASE=borland OSENVIRONMENT=bcc32 SWAP=n
+msdos-microsft-msc51-scripts-flags= $(msdos-cf) OSRELEASE=microsft SWAP=n MSC_VER=5.1 OSENVIRONMENT=msc51
+msdos-microsft-msc51swp-scripts-flags = $(msdos-cf) OSRELEASE=microsft MSC_VER=5.1 OSENVIRONMENT=msc51
+msdos-microsft-msc60-scripts-flags= $(msdos-cf) OSRELEASE=microsft SWAP=n MSC_VER=6.0 OSENVIRONMENT=msc60
+msdos-microsft-msc60swp-scripts-flags = $(msdos-cf) OSRELEASE=microsft MSC_VER=6.0 OSENVIRONMENT=msc60
+msdos-zortech-scripts-flags= $(msdos-cf) OSRELEASE=zortech SWAP=n OSENVIRONMENT=
+msdos-zortechswp-scripts-flags= $(msdos-cf) OSRELEASE=zortech OSENVIRONMENT=
+win95-borland-bcc50-scripts-flags = $(win95-cf) OSRELEASE=borland OSENVIRONMENT=bcc50 SWAP=n
+win95-microsft-vpp40-scripts-flags = $(win95-cf) OSRELEASE=microsft OSENVIRONMENT=vpp40 SWAP=n
+
+winnt-borland-bcc50-scripts-flags = $(winnt-cf) OSRELEASE=borland OSENVIRONMENT=bcc50 SWAP=n
+winnt-microsft-vpp40-scripts-flags = $(winnt-cf) OSRELEASE=microsft OSENVIRONMENT=vpp40 SWAP=n
+
+
+msdos-scripts: clean\
+ msdos-borland-turbo-scripts\
+ msdos-borland-c++-scripts\
+ msdos-microsoft-scripts;
+
+win95-scripts: clean\
+ win95-borland-c++-scripts\
+ win95-microsft-vc++-scripts;
+
+winnt-scripts: clean\
+ winnt-borland-c++-scripts\
+ winnt-microsft-vc++-scripts;
+
+msdos-borland-turbo-scripts .SWAP :
+ $(MAKECMD) SCRIPTFILE=mkswp.bat msdos-borland-tcc20swp-scripts
+
+msdos-borland-c++-scripts .SWAP :! 30 40 45 50
+ $(MAKECMD) SCRIPTFILE=mkswp.bat msdos-borland-bcc$?swp-scripts
+
+msdos-microsoft-scripts .SWAP :! 51 60
+ $(MAKECMD) SCRIPTFILE=mk.bat msdos-microsft-msc$?-scripts
+ $(MAKECMD) SCRIPTFILE=mkswp.bat msdos-microsft-msc$?swp-scripts
+
+msdos-zortech-scripts .SWAP :
+ $(MAKECMD) SCRIPTFILE=mk.bat msdos-zortech-scripts
+ $(MAKECMD) SCRIPTFILE=mkswp.bat msdos-zortechswp-scripts
+
+win95-borland-c++-scripts .SWAP :! 50
+ $(MAKECMD) SCRIPTFILE=mk.bat win95-borland-bcc$?-scripts
+
+win95-microsft-vc++-scripts .SWAP :! 40
+ $(MAKECMD) SCRIPTFILE=mk.bat win95-microsft-vpp$?-scripts
+
+winnt-borland-c++-scripts .SWAP :! 50
+ $(MAKECMD) SCRIPTFILE=mk.cmd winnt-borland-bcc$?-scripts
+
+winnt-microsft-vc++-scripts .SWAP :! 40
+ $(MAKECMD) SCRIPTFILE=mk.cmd winnt-microsft-vpp$?-scripts
+
+msdos-%-scripts .SWAP .SILENT:
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns DIRSEPSTR:=$(DIRSEPSTR) SHELL=command.com COMSPEC=command.com .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
+ $(MAKECMD) -s $(MAKEMACROS) $(MS) $($@-flags) $(SET-TMP) fix-msdos-$*-scripts
+
+win95-borland-%-scripts .SWAP .SILENT:
+ $(MAKECMD) -u $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -n DIRSEPSTR:=$(DIRSEPSTR) SHELL=command.com COMSPEC=command.com .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
+ $(MAKECMD) -s $(MAKEMACROS) $(MS) $($@-flags) $(SET-TMP) fix-win95-borland-$*-scripts
+
+win95-microsft-%-scripts .SWAP .SILENT:
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns DIRSEPSTR:=$(DIRSEPSTR) SHELL=command.com COMSPEC=command.com .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
+ $(MAKECMD) -s $(MAKEMACROS) $(MS) $($@-flags) $(SET-TMP) fix95nt-win95-microsft-$*-scripts
+
+winnt-borland-%-scripts .SWAP .SILENT:
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns DIRSEPSTR:=$(DIRSEPSTR) SHELL=cmd.exe COMSPEC=cmd.exe .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
+ $(MAKECMD) -s $(MAKEMACROS) $(MS) $($@-flags) $(SET-TMP) fix-winnt-borland-$*-scripts
+
+winnt-microsft-%-scripts .SWAP .SILENT:
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns DIRSEPSTR:=$(DIRSEPSTR) SHELL=cmd.exe COMSPEC=cmd.exe .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
+ $(MAKECMD) -s $(MAKEMACROS) $(MS) $($@-flags) $(SET-TMP) fix95nt-winnt-microsft-$*-scripts
+
+
+# We make the standard OS/2 scripts here, but we have to go and fix up the
+# mkXX.cmd file since it contains names of temporary files for the response
+# files required by the linker. We need to also construct the response file
+# contents. These two functions are performed by the fix-msdos-%-scripts
+# meta-target.
+#
+# To add a new OS/2 environment just do what is described for adding a new
+# unix environment, and then make certain that the fix-msdos-%-scripts target
+# performs the correct function for the new environment.
+os2-cf = OS=os2
+os2-ibm-icc-scripts-flags= $(os2-cf) OSRELEASE=ibm OSENVIRONMENT=icc
+
+os2-scripts: clean os2-ibm-scripts;
+
+os2-ibm-scripts .SWAP :! icc
+ $(MAKECMD) SCRIPTFILE=mk.cmd os2-ibm-$?-scripts
+
+os2-%-scripts .SWAP :
+ $(MAKECMD) -su $($@-flags) .KEEP_STATE:= $(FS) public template.mk
+ $(MAKECMD) -ns DIRSEPSTR:=$(DIRSEPSTR) SHELL=cmd.exe COMSPEC=cmd.exe .KEEP_STATE:= $(MS) SWITCHAR:=- $($@-flags) >$(SH)
+ $(MAKECMD) -s $(MAKEMACROS) $(MS) $($@-flags) $(SET-TMP) fix-os2-$*-scripts
+ cat $(SH) | sed -e 's, -, /,g' >tmp-out
+ mv tmp-out $(SH)
+
+# Signify NULL targets for the various Compiler versions.
+icc 30 40 45 50 51 60 .PHONY:;
+
+# Go over the created script file and make sure all the '/' that are in
+# filenames are '\', and make sure the final link command line looks
+# reasonable.
+MAPOBJ = obj$(SWAP:s/y/swp/:s/n//).rsp
+MAPLIB = lib$(SWAP:s/y/swp/:s/n//).rsp
+OBJRSP = $(SH:s,fix/,,:s,${SCRIPTFILE},${MAPOBJ},)
+LIBRSP = $(SH:s,fix/,,:s,${SCRIPTFILE},${MAPLIB},)
+OBJRSP95 = $(SH:s,fix95nt/,,:s,${SCRIPTFILE},${MAPOBJ},)
+LIBRSP95 = $(SH:s,fix95nt/,,:s,${SCRIPTFILE},${MAPLIB},)
+DOSOBJ = $(CSTARTUP) $(OBJDIR)/{$(OBJECTS)}
+
+# Use group recipes, as SHELL has an invalid value in some platform instances.
+fix-%-scripts .GROUP:
+ tac $(FIX-SH) >tmp-sh-r
+ tail +3 tmp-sh-r | sed -e 's,/,\\,g' >tmp-out
+ tac tmp-out|\
+ sed -e 's,\\nologo,/nologo,g' >$(FIX-SH)
+ head -2 tmp-sh-r |\
+ sed -e 's,\\tmp\\mkA[a-zA-Z0-9]*,$(OBJRSP:s,/,\\),'\
+ -e 's,\\tmp\\mkB[a-zA-Z0-9]*,$(LIBRSP:s,/,\\),'\
+ -e 's,\\tmp\\mk[0-9]*a[a-z]*,$(OBJRSP:s,/,\\),'\
+ -e 's,\\tmp\\mk[0-9]*b[a-z]*,$(LIBRSP:s,/,\\),'\
+ -e 's,/,\\,g'\
+ -e 's,\\nologo,/nologo,g'\
+ -e 's,-,/,g' |\
+ tac >>$(FIX-SH)
+ rm -f tmp-sh-r tmp-out
+ mv <+$(DOSOBJ:s,/,\\,:t"+\n")\n+> $(OBJRSP)
+ mv <+$(LDLIBS:s,/,\\,:t"+\n")\n+> $(LIBRSP)
+
+# Use group recipes, as SHELL has an invalid value in some platform instances.
+fix95nt-%-scripts .GROUP:
+ tac $(FIX95-SH) >tmp-sh-r
+ tail +3 tmp-sh-r | sed -e 's,/,\\,g' >tmp-out
+ tac tmp-out|\
+ sed -e 's,\\nologo,/nologo,g' >$(FIX95-SH)
+ head -2 tmp-sh-r |\
+ sed -e 's,\\tmp\\mkA[a-zA-Z0-9]*,$(OBJRSP95:s,/,\\),'\
+ -e 's,\\tmp\\mkB[a-zA-Z0-9]*,$(LIBRSP95:s,/,\\),'\
+ -e 's,\\tmp\\mk[0-9]*a[a-z]*,$(OBJRSP95:s,/,\\),'\
+ -e 's,\\tmp\\mk[0-9]*b[a-z]*,$(LIBRSP95:s,/,\\),'\
+ -e 's,/,\\,g'\
+ -e 's,\\nologo,/nologo,g'\
+ -e 's,-,/,g' |\
+ tac >>$(FIX95-SH)
+ rm -f tmp-sh-r tmp-out
+ mv <+$(DOSOBJ:s,/,\\,:t"\n")\n+> $(OBJRSP95)
+ mv <+$(LDLIBS:s,/,\\,:t"\n")\n+> $(LIBRSP95)
diff --git a/dmake/man/dmake.nc b/dmake/man/dmake.nc
new file mode 100644
index 000000000000..9961119ddf6b
--- /dev/null
+++ b/dmake/man/dmake.nc
@@ -0,0 +1,3644 @@
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+NAME
+ dmake - maintain program groups, or interdependent files
+
+SYNOPSIS
+ dmake [-P#] [-{f|C|K} file] [-{w|W} target ...]
+ [macro[[!][*][+][:]]=value ...] [-ABcdeEghiknpqrsStTuVxX]
+ [-v[cdfimrtw]] [-m[trae]] [target ...]
+
+DESCRIPTION
+ dmake is a re-implementation of the UNIX Make utility with significant
+ enhancements. dmake executes commands found in an external file called
+ a makefile to update one or more target names. Each target may depend
+ on zero or more prerequisite targets. If any of the target's prerequi-
+ sites is newer than the target or if the target itself does not exist,
+ then dmake will attempt to make the target.
+
+ If no -f command line option is present then dmake searches for an
+ existing makefile from the list of prerequisites specified for the spe-
+ cial target .MAKEFILES (see the STARTUP section for more details). If
+ "-" is the name of the file specified to the -f flag then dmake uses
+ standard input as the source of the makefile text.
+
+ Any macro definitions (arguments with embedded "=" signs) that appear
+ on the command line are processed first and supercede definitions for
+ macros of the same name found within the makefile. In general it is
+ impossible for definitions found inside the makefile to redefine a
+ macro defined on the command line, see the MACROS section for excep-
+ tions.
+
+ If no target names are specified on the command line, then dmake uses
+ the first non-special target found in the makefile as the default tar-
+ get. See the SPECIAL TARGETS section for the list of special targets
+ and their function. Makefiles written for most previous versions of
+ Make will be handled correctly by dmake. Known differences between
+ dmake and other versions of make are discussed in the COMPATIBILITY
+ section found at the end of this document. dmake returns 0 if no
+ errors were detected and a non-zero result if an error occurred.
+
+OPTIONS
+ -A Enable AUGMAKE special inference rule transformations (see the
+ "PERCENT(%) RULES" and "AUGMAKE META RULES" sections), these are
+ set to off by default.
+
+ -B Enable the use of spaces instead of <tabs> to begin recipe
+ lines. This flag equivalent to the .NOTABS special macro and is
+ further described below.
+
+ -c Use non-standard comment stripping. If you specify -c then
+ dmake will treat any # character as a start of comment character
+ wherever it may appear unless it is escaped by a \.
+
+ -C [+]file
+ This option writes to file a copy of standard output and stan-
+ dard error from any child processes and from the dmake process
+
+
+
+Dmake Version 4.12 2008-02-26 1
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ itself. If you specify a + prior to the file name then the text
+ is appended to the previous contents of file. This option is
+ active in the MSDOS implementation only and is ignored by non-
+ MSDOS versions of dmake.
+
+ -d Disable the use of the directory cache. Normally dmake caches
+ directories as it checks file timestamps. Giving this flag is
+ equivalent to the .DIRCACHE attribute or macro being set to no.
+
+ -E Read the environment and define all strings of the form
+ 'ENV-VAR=evalue' defined within as macros whose name is ENV-VAR,
+ and whose value is 'evalue'. The environment is processed prior
+ to processing the user specified makefile thereby allowing defi-
+ nitions in the makefile to override definitions in the environ-
+ ment.
+
+ -e Same as -E, except that the environment is processed after the
+ user specified makefile has been processed (thus definitions in
+ the environment override definitions in the makefile). The -e
+ and -E options are mutually exclusive. If both are given the
+ latter takes effect.
+
+ -f file
+ Use file as the source for the makefile text. Only one -f
+ option is allowed.
+
+ -g Globally disable group recipe parsing, equivalent to the
+ .IGNOREGROUP attribute or macro being set to yes at the start of
+ the makefile.
+
+ -h Print the command summary for dmake.
+
+ -i Tells dmake to ignore errors, and continue making other targets.
+ This is equivalent to the .IGNORE attribute or macro.
+
+ -K file
+ Turns on .KEEP_STATE state tracking and tells dmake to use file
+ as the state file.
+
+ -k Causes dmake to ignore errors caused by command execution and to
+ make all targets not depending on targets that could not be
+ made. Ordinarily dmake stops after a command returns a non-zero
+ status, specifying -k causes dmake to ignore the error and con-
+ tinue to make as much as possible.
+
+ -m[trae]
+ Measure timing information. Print the time when targets and/or
+ recipes are started and finished to stdout. The following format
+ is used:
+
+ {s|e} {target|recipe} time maketarget
+
+ s or e stands for started or ended, target or recipe denotes if
+ this line refers to the whole target or a recipe. time is
+
+
+
+Dmake Version 4.12 2008-02-26 2
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ displayed in Unix time format, i.e. the number of seconds since
+ an epoch. (Since 1970-01-01T00:00:00Z). maketarget obviously
+ represents the target the timing information is given for. The
+ optional flags [trae] can be used to change the information that
+ is displayed. If no optional flags are given only the t flag is
+ assumed to be selected, ie. -mt. The optional flags stand for:
+
+ t Display the start and end time of each target.
+
+ r Display the start and end time of each recipe.
+
+ a Display the target as an absolute path, i.e. prepend the
+ current working directory.
+
+ e Also display the start and end time of the $(shell com-
+ mand) function (aka. shell escape) macros.
+
+ -n Causes dmake to print out what it would have executed, but does
+ not actually execute the commands. A special check is made for
+ the string "$(MAKE)" inside a recipe line, if it is found, the
+ line is expanded and invoked, thereby enabling recursive makes
+ to give a full description of all that they will do. This check
+ is disabled inside group recipes.
+
+ -p Print out a version of the digested makefile in human readable
+ form. (useful for debugging, but cannot be re-read by dmake)
+
+ -P# On systems that support multi-processing cause dmake to use #
+ concurrent child processes to make targets. See the "MULTI PRO-
+ CESSING" section for more information.
+
+ -q Check and see if the target is up to date. Exits with code 0 if
+ up to date, 1 otherwise.
+
+ -r Tells dmake not to read the initial startup makefile, see
+ STARTUP section for more details.
+
+ -s Tells dmake to do all its work silently and not echo the com-
+ mands it is executing to stdout (also suppresses warnings).
+ This is equivalent to the .SILENT attribute or macro.
+
+ -S Force sequential execution of recipes on architectures which
+ support concurrent makes. For backward compatibility with old
+ makefiles that have nasty side-effect prerequisite dependencies.
+ (Implies -P1)
+
+ -t Causes dmake to touch the targets and bring them up to date
+ without executing any commands. Note that targets will not be
+ created if they do not already exist.
+
+ -T Tells dmake to not perform transitive closure on the inference
+ graph.
+
+ -u Force an unconditional update. (ie. do everything that would be
+ done if everything that a target depended on was out of date)
+
+
+
+Dmake Version 4.12 2008-02-26 3
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ -v[cdfimrtw]
+ Verbose flag, when making targets print to stdout what we are
+ going to make and what we think its time stamp is. The optional
+ flags [cdfimrtw] can be used to restrict the information that is
+ displayed. In the absence of any optional flags all are assumed
+ to be given (ie. -v is equivalent to -vcdfimrtw). The meanings
+ of the optional flags are:
+
+ c Notify of directory cache operations only.
+
+ d Notify of change directory operations only.
+
+ f Notify of file I/O operations only.
+
+ i Notify of inference algorithm operation only.
+
+ m Notify of target update operations only.
+
+ r Force output of recipe lines, warnings and executed com-
+ mands. This switch is usefull when debugging makefiles
+ that disable the output using the @ or @@ property for
+ recipe lines or the .SILENT target/attribute. It also
+ overrides the -s flag.
+
+ t Keep any temporary files created; normally they are auto-
+ matically deleted.
+
+ w Notify of non-essential warnings (these are historical).
+
+ -V Print the version of dmake, and values of builtin macros.
+
+ -W target
+ Run dmake pretending that target is out of date.
+
+ -w target
+ What if? Show what would be made if target were out of date.
+
+ -x Upon processing the user makefile export all non-internally
+ defined macros to the user's environment. This option together
+ with the -e option allows SYSV AUGMAKE recursive makes to func-
+ tion as expected.
+
+ -X Inhibit the execution of #! lines found at the beginning of a
+ makefile. The use of this flag prevents non-termination of
+ recursive make invocations.
+
+INDEX
+ Here is a list of the sections that follow and a short description of
+ each. Perhaps you won't have to read the entire man page to find what
+ you need.
+
+ STARTUP Describes dmake initialization.
+
+ SYNTAX Describes the syntax of makefile expressions.
+
+
+
+
+Dmake Version 4.12 2008-02-26 4
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ ATTRIBUTES Describes the notion of attributes and how they are
+ used when making targets.
+
+ MACROS Defining and expanding macros.
+
+ RULES AND TARGETS How to define targets and their prerequisites.
+
+ RECIPES How to tell dmake how to make a target.
+
+ BUILTIN COMMANDS Internal dmake commands.
+
+ TEXT DIVERSIONS How to use text diversions in recipes and macro
+ expansions.
+
+ VIRTUAL TARGETS Targets that only enforce dependencies, but which
+ can not create a target file.
+
+ SPECIAL TARGETS Some targets are special.
+
+ SPECIAL MACROS Macros used by dmake to alter the processing of the
+ makefile, and those defined by dmake for the user.
+
+ CONTROL MACROS Itemized list of special control macros.
+
+ RUNTIME MACROS Discussion of special run-time macros such as $@ and
+ $<.
+
+ FUNCTION MACROS Description of functional macros.
+
+ CONDITIONAL MACROS Target specific conditional macros.
+
+ DYNAMIC PREREQUISITES
+ Processing of prerequisites which contain macro
+ expansions in their name.
+
+ BINDING TARGETS The rules that dmake uses to bind a target to an
+ existing file in the file system.
+
+ PERCENT(%) RULES Specification of recipes to be used by the inference
+ algorithm.
+
+ MAKING INFERENCES The rules that dmake uses when inferring how to make
+ a target which has no explicit recipe. This and the
+ previous section are really a single section in the
+ text.
+
+ AUGMAKE META RULES A subclass of the PERCENT(%) RULES.
+
+ MAKING TARGETS How dmake makes targets other than libraries.
+
+ MAKING LIBRARIES How dmake makes libraries.
+
+ KEEP STATE A discussion of how .KEEP_STATE works.
+
+ MULTI PROCESSING Discussion of dmake's parallel make facilities for
+ architectures that support them.
+
+
+
+Dmake Version 4.12 2008-02-26 5
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ CONDITIONALS Conditional expressions which control the processing
+ of the makefile.
+
+ EXAMPLES Some hopefully useful examples.
+
+ COMPATIBILITY How dmake compares with previous versions of make.
+
+ LIMITS Limitations of dmake.
+
+ PORTABILITY Comments on writing portable makefiles.
+
+ FILES Files used by dmake.
+
+ SEE ALSO Other related programs, and man pages.
+
+ AUTHOR The guy responsible for this thing.
+
+ BUGS Hope not.
+
+STARTUP
+ When dmake begins execution it first processes the command line and
+ then processes an initial startup-makefile. This is followed by an
+ attempt to locate and process a user supplied makefile. The startup
+ file defines the default values of all required control macros and the
+ set of default rules for making targets and inferences. When searching
+ for the startup makefile, dmake searches the following locations, in
+ the order specified, until a startup file is located:
+
+
+ 1. The location given as the value of the macro MAKESTARTUP
+ defined on the command line.
+
+ 2. The location given as the value of the environment vari-
+ able MAKESTARTUP defined in the current environment.
+
+ 3. The location given as the value of the macro MAKESTARTUP
+ defined internally within dmake. In this version, the
+ internal definition of MAKESTARTUP is "$(DMAKE-
+ ROOT)/startup.mk", so you can set the environment vari-
+ able DMAKEROOT to the location of your startup directory.
+
+ If DMAKEROOT is not changed, for native Windows dmake
+ versions its value defaults to "$(ABSMAKECMD:d)startup"
+ (see definition of ABSMAKECMD for details). For unix
+ like versions build with the autotools build system it
+ defaults to the value of "${prefix}/share/startup" at
+ build time. The actual value, usually something like
+ /usr/local/share/startup can be checked with the -V com-
+ mand line switch.
+
+ The above search is disabled by specifying the -r option on the command
+ line. An error is issued if a startup makefile cannot be found and the
+ -r option was not specified. A user may substitute a custom startup
+ file by defining the MAKESTARTUP environment variable or by redefining
+ the MAKESTARTUP macro on the command line. To determine where dmake
+ looks for the default startup file, check your environment or issue the
+
+
+
+Dmake Version 4.12 2008-02-26 6
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ command "dmake -V".
+
+ A similar search is performed to locate a default user makefile when no
+ -f command line option is specified. By default, the prerequisite list
+ of the special target .MAKEFILES specifies the names of possible make-
+ files and the search order that dmake should use to determine if one
+ exists. A typical definition for this target is:
+
+ .MAKEFILES : makefile.mk Makefile makefile
+
+ dmake will first look for makefile.mk and then the others. If a pre-
+ requisite cannot be found dmake will try to make it before going on to
+ the next prerequisite. For example, makefile.mk can be checked out of
+ an RCS file if the proper rules for doing so are defined in the startup
+ file.
+
+ If the first line of the user makefile is of the form:
+
+ #!command command_args
+
+ then dmake will expand and run the command prior to reading any addi-
+ tional input. If the return code of the command is zero then dmake
+ will continue on to process the remainder of the user makefile, if the
+ return code is non-zero then dmake will exit.
+
+ dmake builds the internal dependency graph as it parses a user speci-
+ fied makefile. The graph is rooted at the special target .ROOT. .ROOT
+ is the top level target that dmake builds when it starts to build tar-
+ gets. All user specified targets (those from the command line or taken
+ as defaults from the makefile) are made prerequisites of the special
+ target .TARGETS. dmake by default creates the relationship that .ROOT
+ depends on .TARGETS and as a result everything is made. This approach
+ allows the user to customize, within their makefile, the order and
+ which, target, is built first. For example the default makefiles come
+ with settings for .ROOT that specify:
+
+ .ROOT .PHONY .NOSTATE .SEQUENTIAL : .INIT .TARGETS .DONE
+
+ with .INIT and .DONE defined as:
+
+ .INIT .DONE .PHONY:;
+
+ which nicely emulates the behaviour of Sun's make extensions. The
+ building of .ROOT's prerequisites is always forced to be sequential.
+ However, this definition is trivially changed by supplying the defini-
+ tion:
+
+ .ROOT : .TARGETS
+
+ which skips the preamble and postamble phases of building .TARGETS.
+
+ Please note that even though .INIT and .DONE are special exceptions,
+ see section SPECIAL TARGETS, the use of self defined targets starting
+ with `.' should be avoided as they would be handled as .<suffix> meta
+ targets. The target names _INIT and _DONE for example would work
+ equally well without the .<suffix> drawback.
+
+
+
+Dmake Version 4.12 2008-02-26 7
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+SYNTAX
+ This section is a summary of the syntax of makefile statements. The
+ description is given in a style similar to BNF, where { } enclose items
+ that may appear zero or more times, and [ ] enclose items that are
+ optional. Alternative productions for a left hand side are indicated
+ by '->', and newlines are significant. All symbols in bold type are
+ text or names representing text supplied by the user.
+
+
+
+
+ Makefile -> { Statement }
+
+
+ Statement -> Macro-Definition
+ -> Conditional-Macro-Definition
+ -> Conditional
+ -> Rule-Definition
+ -> Attribute-Definition
+
+
+ Macro-Definition -> MACRO = LINE
+ -> MACRO [!]*= LINE
+ -> MACRO [!]:= LINE
+ -> MACRO [!]*:= LINE
+ -> MACRO [!]+= LINE
+ -> MACRO [!]+:= LINE
+
+
+ Conditional-Macro-Definition -> TARGET ?= Macro-Definition
+
+
+ Conditional -> .IF expression
+ Makefile
+ [ .ELIF expression
+ Makefile ]
+ [ .ELSE
+ Makefile ]
+ .END
+
+
+ expression -> LINE
+ -> STRING
+ -> expression == expression
+ -> expression != expression
+ -> expression <= expression
+ -> expression >= expression
+ -> ( expression )
+ -> expression || expression
+ -> expression && expression
+
+
+ Rule-Definition -> target-definition
+ [ recipe ]
+
+ target-definition -> targets [attrs] op { PREREQUISITE } [; rcp-line]
+
+
+
+Dmake Version 4.12 2008-02-26 8
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ targets -> target { targets }
+ -> "target" { targets }
+
+
+ target -> special-target
+ -> TARGET
+
+
+ attrs -> attribute { attrs }
+ -> "attribute" { attrs }
+
+
+ op -> : { modifier }
+
+
+ modifier -> :
+ -> ^
+ -> !
+ -> -
+ -> |
+
+
+ recipe -> { TAB rcp-line }
+ -> [@[@]][%][-] [
+ { LINE }
+ ]
+
+
+ rcp-line -> [@[@]][%][-][+] LINE
+
+
+ Attribute-Definition -> attrs : targets
+
+
+ attribute -> .EPILOG
+ -> .ERRREMOVE
+ -> .EXECUTE
+ -> .GROUP
+ -> .IGNORE
+ -> .IGNOREGROUP
+ -> .LIBRARY
+ -> .MKSARGS
+ -> .NOINFER
+ -> .NOSTATE
+ -> .PHONY
+ -> .PRECIOUS
+ -> .PROLOG
+ -> .SETDIR=path
+ -> .SILENT
+ -> .SEQUENTIAL
+ -> .SWAP
+ -> .USESHELL
+ -> .SYMBOL
+ -> .UPDATEALL
+ -> .WINPATH
+
+
+
+
+Dmake Version 4.12 2008-02-26 9
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ special-target -> .ERROR
+ -> .EXIT
+ -> .EXPORT
+ -> .GROUPEPILOG
+ -> .GROUPPROLOG
+ -> .IMPORT
+ -> .INCLUDE
+ -> .INCLUDEDIRS
+ -> .MAKEFILES
+ -> .REMOVE
+ -> .ROOT
+ -> .SOURCE
+ -> .SOURCE.suffix
+ -> .SUFFIXES (deprecated)
+ -> .TARGETS
+ -> .INIT
+ -> .DONE
+ -> .suffix
+ -> .suffix1.suffix2
+
+
+ Where, TAB represents a <tab> character, STRING represents an arbitrary
+ sequence of characters, and LINE represents a possibly empty sequence
+ of characters terminated by a non-escaped (not immediately preceded by
+ a backslash '\') new-line character. MACRO, PREREQUISITE, and TARGET
+ each represent a string of characters not including space or tab which
+ respectively form the name of a macro, prerequisite or target. The
+ name may itself be a macro expansion expression. A LINE can be contin-
+ ued over several physical lines by terminating it with a single back-
+ slash character. Comments are initiated by the pound # character and
+ extend to the end of line. All comment text is discarded, a '#' may be
+ placed into the makefile text by escaping it with '\' (ie. \# trans-
+ lates to # when it is parsed). An exception to this occurs when a # is
+ seen inside a recipe line that begins with a <tab> or is inside a group
+ recipe. If you specify the -c command line switch then this behavior
+ is disabled and dmake will treat all # characters as start of comment
+ indicators unless they are escaped by \. A set of continued lines may
+ be commented out by placing a single # at the start of the first line.
+ A continued line cannot span more than one makefile.
+
+ white space is defined to be any combination of <space>, <tab>, and the
+ sequence \<nl> when \<nl> is used to terminate a LINE. Note the special
+ treatment of \<nl> in macro definion and recipe lines below. When pro-
+ cessing macro definition lines, any amount of white space is allowed on
+ either side of the macro operator and white space is stripped from both
+ before and after the macro value string. A \<nl> sequence in a macro
+ definition is deleted from the macro value before assigning this value.
+ During recipe expansion the sequence \<nl> is treated as white space
+ but is deleted from the final recipe string. You must escape the \<nl>
+ with another \ in order to get a \ at the end of a recipe or macro def-
+ inition line.
+
+ When processing target definition lines, the recipe for a target must,
+ in general, follow the first definition of the target (See the RULES
+ AND TARGETS section for an exception), and the recipe may not span
+ across multiple makefiles. Any targets and prerequisites found on a
+
+
+
+Dmake Version 4.12 2008-02-26 10
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ target definition line are taken to be white space separated tokens.
+ The rule operator (op in SYNTAX section) is also considered to be a
+ token but does not require white space to precede or follow it. Since
+ the rule operator begins with a `:', traditional versions of make do
+ not allow the `:' character to form a valid target name. dmake allows
+ `:' to be present in target/prerequisite names as long as the entire
+ target/prerequisite name is quoted. For example:
+
+ a:fred : test
+
+ would be parsed as TARGET = a, PREREQUISITES={fred, :, test}, which is
+ not what was intended. To fix this you must write:
+
+ "a:fred" : test
+
+ Which will be parsed as expected. Quoted target and prerequisite spec-
+ ifications may also contain white space thereby allowing the use of
+ complex function macro expressions.. See the EXAMPLES section for how
+ to apply " quoting to a list of targets.
+
+ATTRIBUTES
+ dmake defines several target attributes. Attributes may be assigned to
+ a single target, a group of targets, or to all targets in the makefile.
+ Attributes are used to modify dmake actions during target update. The
+ recognized attributes are:
+
+
+ .EPILOG Insert shell epilog code when executing a group recipe
+ associated with any target having this attribute set.
+
+ .ERRREMOVE Always remove any target having this attribute if an error
+ is encountered while making them. Setting this attribute
+ overrides the .PRECIOUS attribute.
+
+ .EXECUTE If the -n flag was given then execute the recipe associated
+ with any target having this attribute set.
+
+ .FIRST Used in conjunction with .INCLUDE. Terminates the inclu-
+ sion with the first successfully included prerequisite.
+
+ .GROUP Force execution of a target's recipe as a group recipe.
+
+ .IGNORE Ignore an error when trying to make any target with this
+ attribute set.
+
+ .IGNOREGROUP
+ Disable the special meaning of '[' to initiate a group
+ recipe.
+
+ .LIBRARY Target is a library.
+
+ .MKSARGS If running in an MSDOS environment then use MKS extended
+ argument passing conventions to pass arguments to commands.
+ Non-MSDOS environments ignore this attribute.
+
+ .NOINFER Any target with this attribute set will not be subjected to
+ transitive closure if it is inferred as a prerequisite of a
+
+
+
+Dmake Version 4.12 2008-02-26 11
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ target whose recipe and prerequisites are being inferred.
+ (i.e. the inference algorithm will not use any prerequisite
+ with this attribute set, as a target) If specified as
+ '.NOINFER:' (ie. with no prerequisites or targets) then the
+ effect is equivalent to specifying -T on the command line.
+
+ .NOSTATE Any target with this attribute set will not have command
+ line flag information stored in the state file if
+ .KEEP_STATE has been enabled.
+
+ .PHONY Any target with this attribute set will have its recipe
+ executed each time the target is made even if a file match-
+ ing the target name can be located. Any targets that have
+ a .PHONY attributed target as a prerequisite will be made
+ each time the .PHONY attributed prerequisite is made.
+
+ .PRECIOUS Do not remove associated target under any circumstances.
+ Set by default for any targets whose corresponding files
+ exist in the file system prior to the execution of dmake.
+
+ .PROLOG Insert shell prolog code when executing a group recipe
+ associated with any target having this attribute set.
+
+ .SEQUENTIAL Force a sequential make of the associated target's prereq-
+ uisites. If set as a global attribute this implies setting
+ MAXPROCESS=1.
+
+ .SETDIR Change current working directory to specified directory
+ when making the associated target. You must specify the
+ directory at the time the attribute is specified. To do
+ this simply give .SETDIR=path as the attribute. path is
+ expanded and the result is used as the value of the direc-
+ tory to change to. If path contains $$@ then the name of
+ the target to be built is used in computing the path to
+ change directory to. If path is surrounded by single
+ quotes then path is not expanded, and is used literally as
+ the directory name. If the path contains any `:' charac-
+ ters then the entire attribute string must be quoted using
+ ". If a target having this attribute set also has the
+ .IGNORE attribute set then if the change to the specified
+ directory fails it will be ignored, and no error message
+ will be issued.
+
+ .SILENT Do not echo the recipe lines when making any target with
+ this attribute set, and do not issue any warnings.
+
+ .SWAP Under MSDOS when making a target with this attribute set
+ swap the dmake executable to disk prior to executing the
+ recipe line. Also see the '%' recipe line flag defined in
+ the RECIPES section.
+
+ .SYMBOL Target is a library member and is an entry point into a
+ module in the library. This attribute is used only when
+ searching a library for a target. Targets of the form
+ lib((entry)) have this attribute set automatically.
+
+ .USESHELL Force each recipe line of a target to be executed using a
+ shell. Specifying this attribute is equivalent to
+
+
+
+Dmake Version 4.12 2008-02-26 12
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ specifying the '+' character at the start of each line of a
+ non-group recipe.
+
+ .UPDATEALL Indicates that all the targets listed in this rule are
+ updated by the execution of the accompanying recipe. A
+ common example is the production of the y.tab.c and y.tab.h
+ files by yacc when it is run on a grammar. Specifying
+ .UPDATEALL in such a rule prevents the running of yacc
+ twice, once for the y.tab.c file and once for the y.tab.h
+ file. .UPDATEALL targets that are specified in a single
+ rule are treated as a single target and all timestamps are
+ updated whenever any target in the set is made. As a side-
+ effect, dmake internally sorts such targets in ascending
+ alphabetical order and the value of $@ is always the first
+ target in the sorted set.
+
+ .WINPATH Switch between default (POSIX) and Windows style path rep-
+ resentation. (This attribute is specific for cygwin dmake
+ executables and non-cygwin environments ignore this
+ attribute.)
+
+ Under Cygwin it can be useful to generate Windows style
+ paths (with regular slashes) instead of the default cygwin
+ style (POSIX) paths for dmake's dynamic macros. The
+ affected macros are $@, $*, $>, $?, $<, $&, $^ and
+ $(MAKEDIR), $(PWD), $(TMD), $(TMPFILE) and the $(mktmp ...)
+ function macro. This feature can be used to create DOS
+ style path parameters for native W32 programs from dynamic
+ macros.
+
+ Note that the Windows style paths use regular slashes ('/')
+ instead of the usual Windows backslash ('\') as directory
+ separator to avoid quoting problems (after all it is still
+ a cygwin dmake!) and cygwin, as well as native Windows,
+ programs should have no problems using this (c:/foo/bar)
+ path representation.
+
+ Example: Assuming the current target to be /tmp/mytarget
+ the $@ macro without .WINPATH active expands to:
+
+ /tmp/mytarget
+
+ With .WINPATH set it expands to:
+
+ C:/cygwin/tmp/mytarget
+
+ All attributes are user setable and except for .UPDATEALL and .MKSARGS
+ may be used in one of two forms. The .MKSARGS attribute is restricted
+ to use as a global attribute, and the use of the .UPDATEALL attribute
+ is restricted to rules of the second form only.
+
+ ATTRIBUTE_LIST : targets
+
+ assigns the attributes specified by ATTRIBUTE_LIST to each target in
+ targets or
+
+ targets ATTRIBUTE_LIST : ...
+
+
+
+
+Dmake Version 4.12 2008-02-26 13
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ assigns the attributes specified by ATTRIBUTE_LIST to each target in
+ targets. In the first form if targets is empty (ie. a NULL list), then
+ the list of attributes will apply to all targets in the makefile (this
+ is equivalent to the common Make construct of ".IGNORE :" but has been
+ modified to the notion of an attribute instead of a special target).
+ Not all of the attributes have global meaning. In particular,
+ .LIBRARY, .NOSTATE, .PHONY, .SETDIR, .SYMBOL and .UPDATEALL have no
+ assigned global meaning.
+
+ Any attribute may be used with any target, even with the special tar-
+ gets. Some combinations are useless (e.g. .INCLUDE .PRECIOUS: ... ),
+ while others are useful (e.g. .INCLUDE .IGNORE : "file.mk" will not
+ complain if file.mk cannot be found using the include file search
+ rules, see the section on SPECIAL TARGETS for a description of
+ .INCLUDE). If a specified attribute will not be used with the special
+ target a warning is issued and the attribute is ignored.
+
+MACROS
+ dmake supports six forms of macro assignment.
+
+
+ MACRO = LINE This is the most common and familiar form of macro
+ assignment. It assigns LINE literally as the value of
+ MACRO. Future expansions of MACRO recursively expand
+ its value.
+
+ MACRO *= LINE This form behaves exactly as the simple '=' form with
+ the exception that if MACRO already has a value then
+ the assignment is not performed.
+
+ MACRO := LINE This form differs from the simple '=' form in that it
+ expands LINE prior to assigning it as the value of
+ MACRO. Future expansions of MACRO do not recursively
+ expand its value.
+
+ MACRO *:= LINE This form behaves exactly as the ':=' form with the
+ exception that if MACRO already has a value then the
+ assignment and expansion are not performed.
+
+ MACRO += LINE This form of macro assignment allows macro values to
+ grow. It takes the literal value of LINE and appends
+ it to the previous value of MACRO separating the two by
+ a single space. Future expansions of MACRO recursively
+ expand its value.
+
+ MACRO +:= LINE This form is similar to the '+=' form except that the
+ value of LINE is expanded prior to being added to the
+ value of MACRO.
+
+ Macro expressions specified on the command line allow the macro value
+ to be redefined within the makefile only if the macro is defined using
+ the '+=' and '+:=' operators. Other operators will define a macro that
+ cannot be further modified.
+
+ Each of the preceeding macro assignment operators may be prefixed by !
+ to indicate that the assignment should be forced and that no warnings
+ should be issued. Thus, specifying ! has the effect of silently forc-
+ ing the specified macro assignment.
+
+
+
+Dmake Version 4.12 2008-02-26 14
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ When dmake defines a non-environment macro it strips leading and trail-
+ ing white space from the macro value. Macros imported from the envi-
+ ronment via either the .IMPORT special target (see the SPECIAL TARGETS
+ section), or the -e, or -E flags are an exception to this rule. Their
+ values are always taken literally and white space is never stripped.
+ In addition, named macros defined using the .IMPORT special target do
+ not have their values expanded when they are used within a makefile.
+ In contrast, environment macros that are imported due to the specifica-
+ tion of the -e or -E flags are subject to expansion when used.
+
+ To specify a macro expansion enclose the name in () or {} and precede
+ it with a dollar sign $. Thus $(TEST) represents an expansion of the
+ macro variable named TEST. If TEST is defined then $(TEST) is replaced
+ by its expanded value. If TEST is not defined then $(TEST) expands to
+ the NULL string (this is equivalent to defining a macro as 'TEST=' ).
+ A short form may be used for single character named macros. In this
+ case the parentheses are optional, and $(I) is equivalent to $I. Macro
+ expansion is recursive, hence, if the value string contains an expres-
+ sion representing a macro expansion, the expansion is performed. Cir-
+ cular macro expansions are detected and cause an error to be issued.
+
+ When defining a macro the given macro name is first expanded before
+ being used to define the macro. Thus it is possible to define macros
+ whose names depend on values of other macros. For example, suppose CWD
+ is defined as
+
+ CWD = $(PWD:b)
+
+ then the value of $(CWD) is the name of the current directory. This
+ can be used to define macros specific to this directory, for example:
+
+ _$(CWD).prt = list of files to print...
+
+ The actual name of the defined macro is a function of the current
+ directory. A construct such as this is useful when processing a hier-
+ archy of directories using .SETDIR attributed targets and a collection
+ of small distributed makefile stubs.
+
+ Macro variables may be defined within the makefile, on the command
+ line, or imported from the environment.
+
+ dmake supports several non-standard macro expansions: The first is of
+ the form:
+
+ $(macro_name:modifier_list:modifier_list:...)
+
+ where modifier_list may be a combination of:
+
+ b or B - file (not including suffix) portion of path names
+ d or D - directory portion of all path names
+ e or E - suffix portion of path names
+ f or F - file (including suffix) portion of path names
+ i or I - inferred names of targets
+ n or N - normalized path names
+ l or L - macro value in lower case
+ u or U - macro value in upper case
+ 1 - return the first white space separated token from value
+
+
+
+
+Dmake Version 4.12 2008-02-26 15
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ or a single one of:
+
+ m or M - map escape codes found in macro to their ASCII value
+ s or S - simple pattern substitution
+ t or T - tokenization.
+ ^ - prepend a prefix to each token
+ + - append a suffix to each token
+
+ Thus if we have the example:
+ test = d1/d2/d3/a.out f.out d1/k.out
+ The following macro expansions produce the values on the right of '->'
+ after expansion.
+
+ $(test:d) -> d1/d2/d3/ d1/
+ $(test:b) -> a f k
+ $(test:f) -> a.out f.out k.out
+ ${test:db} -> d1/d2/d3/a f d1/k
+ ${test:s/out/in/:f} -> a.in f.in k.in
+ $(test:f:t"+") -> a.out+f.out+k.out
+ $(test:e) -> .out .out .out
+ $(test:u) -> D1/D2/D3/A.OUT F.OUT D1/K.OUT
+ $(test:1) -> d1/d2/d3/a.out
+
+ For this macro
+ test = d1/d2/../a.out "d1/file name.ext"
+ the following results are returned:
+
+ $(test:n) -> d1/a.out "d1/file name.ext"
+
+ If a token ends in a string composed from the value of the macro
+ DIRBRKSTR (ie. ends in a directory separator string, e.g. '/' in UNIX)
+ and you use the :d modifier then the expansion returns the directory
+ name less the final directory separator string. Thus successive pairs
+ of :d modifiers each remove a level of directory in the token string.
+
+ The infered names of targets :i modifier returnes the actual filename
+ associated to the target, see BINDING TARGETS. If the value is not a
+ target or prerequisite the value is returned unchanged. For the follow-
+ ing example:
+ test = aprog bprog
+ If aprog and bprog are targets or prerequisits and they are bound to
+ /tmp/aprog and bprog (see .SOURCE special target) the macro expansion
+ has the following effect:
+
+ $(test:i) -> /tmp/aprog bprog
+
+ The normalized path names :n modifier honors the setting of .WINPATH to
+ determine the output format of the result.
+
+ The map escape codes modifier changes the following escape codes \a =>
+ <bel>, \b => <backspace>, \f => <formfeed>, \n => <nl>, \r => <cr>, \t
+ => <tab>, \v => <vertical tab>, \" => ", and \xxx => <xxx> where xxx is
+ the octal representation of a character into the corresponding ASCII
+ value.
+
+ The tokenization, prepend and append modifier may use the same escape
+ codes that are supported by the map escape codes modifier in the string
+ that is inserted, prepended or added by the respective macro modifier.
+
+
+
+Dmake Version 4.12 2008-02-26 16
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ These modifiers may quote this string to include otherwise problematic
+ characters. E.g. spaces, colons and parentheses.
+
+ The tokenization modifier takes all white space separated tokens from
+ the macro value and separates them by the separator string. Thus the
+ expansion:
+
+ $(test:f:t"+\n")
+ produces:
+ a.out+
+ f.out+
+ k.out
+
+ The prefix operator ^ takes all white space separated tokens from the
+ macro value and prepends string to each.
+
+ $(test:f:^mydir/)
+ produces:
+ mydir/a.out mydir/f.out mydir/k.out
+
+ The suffix operator + takes all white space separated tokens from the
+ macro value and appends string to each.
+
+ $(test:b:+.c)
+ produces:
+ a.c f.c k.c
+
+ The next non-standard form of macro expansion allows for recursive
+ macros. It is possible to specify a $(macro_name) or ${macro_name}
+ expansion where macro_name contains more $( ... ) or ${ ... } macro
+ expansions itself.
+
+ For example $(CC$(_HOST)$(_COMPILER)) will first expand
+ CC$(_HOST)$(_COMPILER) to get a result and use that result as the name
+ of the macro to expand. This is useful for writing a makefile for more
+ than one target environment. As an example consider the following
+ hypothetical case. Suppose that _HOST and _COMPILER are imported from
+ the environment and are set to represent the host machine type and the
+ host compiler respectively.
+
+ CFLAGS_VAX_CC = -c -O # _HOST == "_VAX", _COMPILER == "_CC"
+ CFLAGS_PC_MSC = -c -ML # _HOST == "_PC", _COMPILER == "_MSC"
+
+ # redefine CFLAGS macro as:
+
+ CFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
+
+ This causes CFLAGS to take on a value that corresponds to the environ-
+ ment in which the make is being invoked.
+
+ The final non-standard macro expansion is of the form:
+
+ string1{token_list}string2
+
+ where string1, string2 and token_list are expanded. After expansion,
+ string1 is prepended to each token found in token_list and string2 is
+ appended to each resulting token from the previous prepend. string1
+ and string2 are not delimited by white space whereas the tokens in
+
+
+
+Dmake Version 4.12 2008-02-26 17
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ token_list are. A null token in the token list is specified using "".
+ Thus using another example we have:
+
+ test/{f1 f2}.o --> test/f1.o test/f2.o
+ test/ {f1 f2}.o --> test/ f1.o f2.o
+ test/{f1 f2} .o --> test/f1 test/f2 .o
+ test/{"f1" ""}.o --> test/f1.o test/.o
+
+ and
+
+ test/{d1 d2}/{f1 f2}.o --> test/d1/f1.o test/d1/f2.o
+ test/d2/f1.o test/d2/f2.o
+
+ This last expansion is activated only when the first characters of
+ token_list appear immediately after the opening '{' with no intervening
+ white space. The reason for this restriction is the following incom-
+ patibility with Bourne Shell recipes. The line
+
+ { echo hello;}
+
+ is valid /bin/sh syntax; while
+
+ {echo hello;}
+
+ is not. Hence the latter triggers the enhanced macro expansion while
+ the former causes it to be suppressed. See the SPECIAL MACROS section
+ for a description of the special macros that dmake defines and under-
+ stands.
+
+RULES AND TARGETS
+ A makefile contains a series of entries that specify dependencies.
+ Such entries are called target/prerequisite or rule definitions. Each
+ rule definition is optionally followed by a set of lines that provide a
+ recipe for updating any targets defined by the rule. Whenever dmake
+ attempts to bring a target up to date and an explicit recipe is pro-
+ vided with a rule defining the target, that recipe is used to update
+ the target. A rule definition begins with a line having the following
+ syntax:
+
+ <targets> [<attributes>] <ruleop> [<prerequisites>] [;<recipe>]
+
+ targets is a non-empty list of targets. If the target is a special
+ target (see SPECIAL TARGETS section below) then it must appear alone on
+ the rule line. For example:
+
+ .IMPORT .ERROR : ...
+
+ is not allowed since both .IMPORT and .ERROR are special targets. Spe-
+ cial targets are not used in the construction of the dependency graph
+ and will not be made.
+
+ attributes is a possibly empty list of attributes. Any attribute
+ defined in the ATTRIBUTES section above may be specified. All
+ attributes will be applied to the list of named targets in the rule
+ definition. No other targets will be affected.
+
+
+ NOTE: As stated earlier, if both the target list and prerequisite
+ list are empty but the attributes list is not, then the
+
+
+
+Dmake Version 4.12 2008-02-26 18
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ specified attributes affect all targets in the makefile.
+
+
+ ruleop is a separator which is used to identify the targets from the
+ prerequisites. Optionally it also provides a facility for modifying
+ the way in which dmake handles the making of the associated targets.
+ In its simplest form the operator is a single ':', and need not be sep-
+ arated by white space from its neighboring tokens. It may additionally
+ be followed by any of the modifiers { !, ^, -, :, | }, where:
+
+
+ ! says execute the recipe for the associated targets once for each
+ out of date prerequisite. (The meaning of the runtime macro $?
+ is changed, see below in the RUNTIME MACROS section.) Ordinarily
+ the recipe is executed once for all out of date prerequisites at
+ the same time.
+
+ ^ says to insert the specified prerequisites, if any, before any
+ other prerequisites already associated with the specified tar-
+ gets. In general, it is not useful to specify ^ with an empty
+ list of prerequisites.
+
+ - says to clear the previous list of prerequisites before adding
+ the new prerequisites. Thus,
+
+ foo :
+ foo : bar baz
+
+ can be replaced by
+
+ foo :- bar baz
+
+ however the old form still works as expected.
+
+ : When the rule operator is not modified by a second ':' only one
+ set of rules may be specified for making a target. Multiple
+ definitions may be used to add to the list of prerequisites that
+ a target depends on. However, if a target is multiply defined
+ only one definition may specify a recipe for making the target.
+
+ When a target's rule operator is modified by a second ':' (::
+ for example) then this definition may not be the only definition
+ with a recipe for the target. There may be other :: target def-
+ inition lines that specify a different set of prerequisites with
+ a different recipe for updating the target. Any such target is
+ made if any of the definitions find it to be out of date with
+ respect to the related prerequisites and the corresponding
+ recipe is used to update the target. By definition all '::'
+ recipes that are found to be out of date for are executed.
+
+ In the following simple example, each rule has a `::' ruleop.
+ In such an operator we call the first `:' the operator, and the
+ second `:' the modifier.
+
+ a.o :: a.c b.h
+ first recipe for making a.o
+
+ a.o :: a.y b.h
+ second recipe for making a.o
+
+
+
+Dmake Version 4.12 2008-02-26 19
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ If a.o is found to be out of date with respect to a.c then the
+ first recipe is used to make a.o. If it is found out of date
+ with respect to a.y then the second recipe is used. If a.o is
+ out of date with respect to b.h then both recipes are invoked to
+ make a.o. In the last case the order of invocation corresponds
+ to the order in which the rule definitions appear in the make-
+ file.
+
+ | Is defined only for PERCENT rule target definitions. When spec-
+ ified it indicates that the following construct should be parsed
+ using the old semantinc meaning:
+
+ %.o :| %.c %.r %.f ; some rule
+
+ is equivalent to:
+
+ %.o : %.c ; some rule
+ %.o : %.r ; some rule
+ %.o : %.f ; some rule
+
+ Targets defined using a single `:' operator with a recipe may be rede-
+ fined again with a new recipe by using a `:' operator with a `:' modi-
+ fier. This is equivalent to a target having been initially defined
+ with a rule using a `:' modifier. Once a target is defined using a `:'
+ modifier it may not be defined again with a recipe using only the `:'
+ operator with no `:' modifier. In both cases the use of a `:' modifier
+ creates a new list of prerequisites and makes it the current prerequi-
+ site list for the target. The `:' operator with no recipe always modi-
+ fies the current list of prerequisites. Thus assuming each of the fol-
+ lowing definitions has a recipe attached, then:
+
+ joe : fred ... (1)
+ joe :: more ... (2)
+
+ and
+
+ joe :: fred ... (3)
+ joe :: more ... (4)
+
+ are legal and mean: add the recipe associated with (2), or (4) to the
+ set of recipes for joe, placing them after existing recipes for making
+ joe. The constructs:
+
+ joe :: fred ... (5)
+ joe : more ... (6)
+
+ and
+
+ joe : fred ... (7)
+ joe : more ... (8)
+
+ are errors since we have two sets of perfectly good recipes for making
+ the target.
+
+ prerequisites is a possibly empty list of targets that must be brought
+ up to date before making the current target.
+
+ recipe is a short form and allows the user to specify short rule defi-
+ nitions on a single line. It is taken to be the first recipe line in a
+
+
+
+Dmake Version 4.12 2008-02-26 20
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ larger recipe if additional lines follow the rule definition. If the
+ semi-colon is present but the recipe line is empty (ie. null string)
+ then it is taken to be an empty rule. Any target so defined causes
+ target to be treated as a virtual target, see VIRTUAL TARGETS below.
+
+RECIPES
+ The traditional format used by most versions of Make defines the recipe
+ lines as arbitrary strings that may contain macro expansions. They
+ follow a rule definition line and may be spaced apart by comment or
+ blank lines. The list of recipe lines defining the recipe is termi-
+ nated by a new target definition, a macro definition, or end-of-file.
+ Each recipe line MUST begin with a <TAB> character (or spaces, see
+ .NOTABS) which may optionally be followed with one or all the following
+ recipe property characters '@%+-' which affect the recipe execution:
+
+ '-' indicates that non-zero exit values (ie. errors) are to be
+ ignored when this recipe line is executed.
+
+ '+' indicates that the current recipe line is to be executed using
+ the shell. Group recipes implicitely ignore this property.
+
+ '%' indicates that dmake should swap itself out to secondary storage
+ (MSDOS only) before running the recipe.
+
+ '@' indicates that the recipe line should NOT be echoed to the ter-
+ minal prior to being executed.
+
+ '@@' is a stronger version of the previous property. The recipe line
+ and the output (stdout and stderr) of the executed recipe are
+ NOT shown on the terminal.
+
+ Each property is off by default (ie. by default, errors are signifi-
+ cant, commands are echoed, no swapping is done and a shell is used only
+ if the recipe line contains a character found in the value of the
+ SHELLMETAS macro). Global settings activated via command line options
+ or special attribute or target names may also affect these settings.
+ An example recipe:
+
+ target :
+ first recipe line
+ second recipe line, executed independent of first.
+ @a recipe line that is not echoed
+ -and one that has errors ignored
+ %and one that causes dmake to swap out
+ +and one that is executed using a shell.
+
+ The second and new format of the recipe block begins the block with the
+ character '[' (the open group character) in the last non-white space
+ position of a line, and terminates the block with the character ']'
+ (the close group character) in the first non-white space position of a
+ line. In this form each recipe line need not have a leading TAB. This
+ is called a recipe group. Groups so defined are fed intact as a single
+ unit to a shell for execution whenever the corresponding target needs
+ to be updated. If the open group character '[' is preceded by one or
+ all of the recipe properties (-, %, @ and @@) then they apply to the
+ entire group in the same way that they apply to single recipe lines.
+ You may also specify '+' but it is redundant as a shell is already
+ being used to run the recipe. See the MAKING TARGETS section for a
+ description of how dmake invokes recipes. Here is an example of a
+
+
+
+Dmake Version 4.12 2008-02-26 21
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ group recipe:
+
+ target :
+ [
+ first recipe line
+ second recipe line
+ tall of these recipe lines are fed to a
+ single copy of a shell for execution.
+ ]
+
+
+BUILTIN COMMANDS
+ dmake supports some builtin commands. An optional leading '+' describes
+ that the builtin can be used also when being executed in a shell other-
+ wise it is only implemented when used directly. Remember that if a
+ character of the recipe is found in the SHELLMETAS macro the execution
+ of the recipe in a shell is forced.
+
+ [+]noop [something]
+ The noop internal command always returns success if used but it
+ is not executed even though the rest of the commandline is eval-
+ uated. This command can be used to evaluate macro expansions at
+ the runtime of the recipe without starting a real commmand.
+
+ [+]<empty recipe>
+ If an empty recipe line is encountered it is not executed. This
+ sounds more trivial than it really is because the recipe could
+ consist of macros that evaluated to empty or whitespace only
+ strings.
+
+ echo [-n] data
+ This internal command prints data (with all leading whitespace
+ removed, but otherwise literally) to stdout. If the '-n' switch
+ is given no trailing newline is printed. Note that no quoting is
+ removed nor that escape sequences are handled.
+
+ No special treatment of buildin commands for group recipes is imple-
+ mented even though the <empty recipe> will most propably also not be
+ evaluated by most shells that can be used to handle the recipe groups.
+
+TEXT DIVERSIONS
+ dmake supports the notion of text diversions. If a recipe line con-
+ tains the macro expression
+
+ $(mktmp[,[file][,text]] data)
+
+ then all text contained in the data expression is expanded and is writ-
+ ten to a temporary file. The data in the file will always be termi-
+ nated from a new line character. The file parameter can be used to
+ override the name of the temporary file. If its expanded value is not
+ empty it will be used instead of the unique and thread safe file name
+ that otherwise would be generated internally. The return value of the
+ macro is the name of the temporary file unless the text parameter is
+ defined. In this case the return value is the expanded value of text.
+
+ data can be any text and must be separated from the 'mktmp' portion of
+ the macro name by white-space. The only restriction on the data text
+ is that it must contain a balanced number of parentheses of the same
+ kind as are used to initiate the $(mktmp ...) expression. For example:
+
+
+
+Dmake Version 4.12 2008-02-26 22
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ $(mktmp $(XXX))
+
+ is legal and works as expected, but:
+
+ $(mktmp text (to dump to file)
+
+ is not legal. You can achieve what you wish by either defining a macro
+ that expands to '(' or by using {} in the macro expression; like this:
+
+ ${mktmp text (to dump to file}
+
+ Since the temporary file is opened when the macro containing the text
+ diversion expression is expanded, diversions may be nested and any
+ diversions that are created as part of ':=' macro expansions persist
+ for the duration of the dmake run. If the data text is to contain new
+ lines the map escape codes macro expasion can be used. For example the
+ expression:
+
+ mytext:=this is a\ntest of the text diversion
+ all:
+ cat $(mktmp $(mytext:m))
+
+ is replaced by:
+
+ cat /tmp/mk12294AA
+
+ where the temporary file contains two lines both of which are termi-
+ nated by a new-line. A second more illustrative example generates a
+ response file to an MSDOS link command:
+
+ OBJ = fred.obj mary.obj joe.obj
+ all : $(OBJ)
+ link @$(mktmp $(^:t"+\n"))
+
+ The result of making `all' in the second example is the command:
+
+ link @/tmp/mk02394AA
+
+ where the temporary file contains:
+
+ fred.obj+
+ mary.obj+
+ joe.obj
+
+ The last line of the file is terminated by a new-line which is always
+ inserted at the end of the data string.
+
+ If the optional file specifier is present it can be used to specify the
+ name of the temporary file to create. An example that would be useful
+ for MSDOS users with a Turbo-C compiler
+
+ $(mktmp,turboc.cfg $(CFLAGS))
+
+ will place the contents of CFLAGS into a local turboc.cfg file. The
+ second optional argument, text, if present alters the name of the value
+ returned by the $(mktmp ...) macro.
+
+ Under MS-DOS text diversions may be a problem. Many DOS tools require
+ that path names which contain directories use the \ character to
+
+
+
+Dmake Version 4.12 2008-02-26 23
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ delimit the directories. Some users however wish to use the '/' to
+ delimit pathnames and use environments that allow them to do so. The
+ macro USESHELL is set to "yes" if the current recipe is forced to use a
+ shell via the .USESHELL or '+' directives, otherwise its value is "no".
+ The dmake startup files define the macro DIVFILE whose value is either
+ the value of TMPFILE or the value of TMPFILE edited to replace any '/'
+ characters to the appropriate value based on the current shell and
+ whether it will be used to execute the recipe.
+
+ Previous versions of dmake defined text diversions using <+, +>
+ strings, where <+ started a text diversion and +> terminated one.
+ dmake is backward compatible with this construct only if the <+ and +>
+ appear literally on the same recipe line or in the same macro value
+ string. In such instances the expression:
+
+ <+data+>
+
+ is mapped to:
+
+ $(mktmp data)
+
+ which is fully output compatible with the earlier construct. <+, +>
+ constructs whose text spans multiple lines must be converted by hand to
+ use $(mktmp ...).
+
+ If the environment variable TMPDIR is defined then the temporary file
+ is placed into the directory specified by that variable. A makefile
+ can modify the location of temporary files by defining a macro named
+ TMPDIR and exporting it using the .EXPORT special target.
+
+VIRTUAL TARGETS
+ Dmake allows to define targets with the sole purpose to enforce a
+ dependency chain that are unable to create the target, hence virtual
+ targets. When dmake tries to make a target, but only finds a target
+ definition without recipe lines, it would normally issues a "Don't know
+ how to make ..." error message, but if a target rule is terminated by a
+ semicolon and has no following recipe lines, or if it has no recipe
+ lines, but defines prerequisites, or if the AUGMAKE mode is enabled
+ (see the COMPATIBILITY section for details), the target is treated as a
+ virtual target and the error is suppressed. In addition to this, if the
+ default target does not have recipe lines it is also treated as a vir-
+ tual target.
+
+ Virtual targets should not have a corresponding file therefore they
+ inherit the time of their newest prerequisite if they have prerequi-
+ sites, otherwise they get the current time assigned when being made.
+ If the virtual target has a corresponding file a warning is issued, but
+ the time stamp of that file is taken into account. The virtual target
+ uses the time stamp of the corresponding file if it is newer than the
+ one determined by the previous rule.
+
+SPECIAL TARGETS
+ This section describes the special targets that are recognized by
+ dmake. Some are affected by attributes and others are not.
+
+ .ERROR If defined then the recipe associated with this target is
+ executed whenever an error condition is detected by
+ dmake. All attributes that can be used with any other
+ target may be used with this target. Any prerequisites
+
+
+
+Dmake Version 4.12 2008-02-26 24
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ of this target will be brought up to date during its pro-
+ cessing. NOTE: errors will be ignored while making this
+ target, in extreme cases this may cause some problems.
+
+ .EXIT If this target is encountered while parsing a makefile
+ then the parsing of the makefile is immediately termi-
+ nated at that point.
+
+ .EXPORT All prerequisites associated with this target are assumed
+ to correspond to macro names and they and their values
+ are exported to the environment as environment strings at
+ the point in the makefile at which this target appears.
+ Any attributes specified with this target are ignored.
+ Only macros which have been assigned a value in the make-
+ file prior to the export directive are exported, macros
+ as yet undefined or macros whose value contains any of
+ the characters "+=:*" are not exported.
+
+ Note that macros that are not expanded during the macro
+ assignment and contain other macros will be written into
+ the environment containing these other macros in the form
+ of $(macroname).
+
+ .IMPORT Prerequisite names specified for this target are searched
+ for in the environment and defined as macros with their
+ value taken from the environment. If the special name
+ .EVERYTHING is used as a prerequisite name then all envi-
+ ronment variables defined in the environment are
+ imported. The functionality of the -E flag can be forced
+ by placing the construct .IMPORT : .EVERYTHING at the
+ start of a makefile. Similarly, by placing the construct
+ at the end, one can emulate the effect of the -e command
+ line flag. If a prerequisite name cannot be found in the
+ environment an error message is issued. .IMPORT accepts
+ the .IGNORE attribute. When given, it causes dmake to
+ ignore the above error. See the MACROS section for a
+ description of the processing of imported macro values.
+
+ .INCLUDE Parse another makefile just as if it had been located at
+ the point of the .INCLUDE in the current makefile. The
+ list of prerequisites gives the list of makefiles to try
+ to read. If the list contains multiple makefiles then
+ they are read in order from left to right. The following
+ search rules are used when trying to locate the file. If
+ the filename is surrounded by " or just by itself then it
+ is searched for in the current directory. If it is not
+ found it is then searched for in each of the directories
+ specified as prerequisites of the .INCLUDEDIRS special
+ target. If the file name is surrounded by < and >, (ie.
+ <my_spiffy_new_makefile>) then it is searched for only in
+ the directories given by the .INCLUDEDIRS special target.
+ In both cases if the file name is a fully qualified name
+ starting at the root of the file system then it is only
+ searched for once, and the .INCLUDEDIRS list is ignored.
+ If .INCLUDE fails to find the file it invokes the infer-
+ ence engine to try to infer and hence make the file to be
+ included. In this way the file can be checked out of an
+ RCS repository for example. .INCLUDE accepts the
+ .IGNORE, .SETDIR, and .NOINFER attributes. If the
+
+
+
+Dmake Version 4.12 2008-02-26 25
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ .IGNORE attribute is given and the file cannot be found
+ then dmake continues processing, otherwise an error mes-
+ sage is generated. If the .NOINFER attribute is given
+ and the file cannot be found then dmake will not attempt
+ to infer and make the file. The .SETDIR attribute causes
+ dmake to change directories to the specified directory
+ prior to attempting the include operation. If all fails
+ dmake attempts to make the file to be included. If mak-
+ ing the file fails then dmake terminates unless the
+ .INCLUDE directive also specified the .IGNORE attribute.
+ If .FIRST is specified along with .INCLUDE then dmake
+ attempts to include each named prerequisite and will ter-
+ minate the inclusion with the first prerequisite that
+ results in a successful inclusion.
+
+ .INCLUDEDIRS The list of prerequisites specified for this target
+ defines the set of directories to search when trying to
+ include a makefile.
+
+ .KEEP_STATE This special target is a synonym for the macro definition
+
+ .KEEP_STATE := _state.mk
+
+ It's effect is to turn on STATE keeping and to define
+ _state.mk as the state file.
+
+ .MAKEFILES The list of prerequisites is the set of files to try to
+ read as the default makefile. By default this target is
+ defined as:
+
+ .MAKEFILES : makefile.mk Makefile makefile
+
+
+ .REMOVE The recipe of this target is used whenever dmake needs to
+ remove intermediate targets that were made but do not
+ need to be kept around. Such targets result from the
+ application of transitive closure on the dependency
+ graph.
+
+ .ROOT The internal root of the dependency graph, see section
+ STARTUP for details.
+
+ .SOURCE The prerequisite list of this target defines a set of
+ directories to check when trying to locate a target file
+ name. See the section on BINDING of targets for more
+ information.
+
+ .SOURCE.suff The same as .SOURCE, except that the .SOURCE.suff list is
+ searched first when trying to locate a file matching the
+ a target whose name ends in the suffix .suff.
+
+ .SUFFIXES This deprecated special target has no special meaning.
+ Avoid its use.
+
+ .TARGETS The internal targets that all user defined targets are
+ prerequisites of, see section STARTUP for details.
+
+ There are a few targets that are "slightly" special:
+
+
+
+
+Dmake Version 4.12 2008-02-26 26
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ .INIT
+ .DONE
+
+ These targets exist because of historical reasons, see the usage of
+ .INIT and .DONE in section "STARTUP", they can be used and defined as
+ ordinary targets but are special in the sense that even though they
+ start with a `.' they are not treated as a .<suffix> meta target (See
+ the AUGMAKE META RULES section for details).
+
+ Please note that self defined targets shouldn't use the prefix `.' as
+ they would be handled as .<suffix> meta targets and dmake most propably
+ would complain about this.
+
+ In addition to the special targets above, several other forms of tar-
+ gets are recognized and are considered special, their exact form and
+ use is defined in the sections that follow.
+
+SPECIAL MACROS
+ dmake defines a number of special macros. They are divided into three
+ classes: control macros, run-time macros, and function macros. The
+ control macros are used by dmake to configure its actions, and are the
+ preferred method of doing so. In the case when a control macro has the
+ same function as a special target or attribute they share the same name
+ as the special target or attribute. The run-time macros are defined
+ when dmake makes targets and may be used by the user inside recipes.
+ The function macros provide higher level functions dealing with macro
+ expansion and diversion file processing.
+
+CONTROL MACROS
+ To use the control macros simply assign them a value just like any
+ other macro. The control macros are divided into three groups: string
+ valued macros, character valued macros, and boolean valued macros.
+
+ The following are all of the string valued macros. This list is
+ divided into two groups. The first group gives the string valued
+ macros that are defined internally and cannot be directly set by the
+ user.
+
+ ABSMAKECMD Warning! This macro's value is differently defined for
+ a native Windows dmake executable (compiled with MS
+ Visual C++ or MinGW) and dmake for other operating sys-
+ tems or build with other compilers.
+
+ In the first case its value is the absolute filename of
+ the executable of the current dmake process, otherwise
+ it is defined as the NULL string.
+
+ INCDEPTH This macro's value is a string of digits representing
+ the current depth of makefile inclusion. In the first
+ makefile level this value is zero.
+
+ MFLAGS Is the list of flags that were given on the command
+ line including a leading switch character. The -f flag
+ is not included in this list.
+
+ MAKECMD Is the name with which dmake was invoked.
+
+ MAKEDIR Is the full path to the initial directory in which
+ dmake was invoked.
+
+
+
+Dmake Version 4.12 2008-02-26 27
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ MAKEFILE Contains the string "-f makefile" where, makefile is
+ the name of initial user makefile that was first read.
+
+ MAKEFLAGS Is the same as $(MFLAGS) but has no leading switch
+ character. (ie. MFLAGS = -$(MAKEFLAGS))
+
+ MAKEMACROS Contains the complete list of macro expressions that
+ were specified on the command line.
+
+ MAKETARGETS Contains the name(s) of the target(s), if any, that
+ were specified on the command line.
+
+ MAKEVERSION Contains a string indicating the current dmake version
+ number.
+
+ MAXPROCESSLIMIT Is a numeric string representing the maximum number of
+ processes that dmake can use when making targets using
+ parallel mode.
+
+ NULL Is permanently defined to be the NULL string. This is
+ useful when comparing a conditional expression to an
+ NULL value.
+
+ PWD Is the full path to the current directory in which make
+ is executing.
+
+ SPACECHAR Is permanently defined to contain one space character.
+ This is useful when using space characters in function
+ macros, e.g. subst, that otherwise would get deleted
+ (leading/trailing spaces) or for using spaces in func-
+ tion macro parameters.
+
+ TMPFILE Is set to the name of the most recent temporary file
+ opened by dmake. Temporary files are used for text
+ diversions and for group recipe processing.
+
+ TMD Stands for "To Make Dir", and is the path from the
+ present directory (value of $(PWD)) to the directory
+ that dmake was started up in (value of $(MAKEDIR)). If
+ the present directory is the directory that dmake was
+ started up in TMD will be set to the relative path ".".
+ This allows to create valid paths by prepending
+ $(TMD)$(DIRSEPSTR) to a relative path. This macro is
+ modified when .SETDIR attributes are processed. TMD
+ will usually be a relative path with the following two
+ exceptions. If the relative path would go up until the
+ root directory or if different drive letters (DOS file
+ system) make a relative path impossible the absolute
+ path from MAKEDIR is used.
+
+ USESHELL The value of this macro is set to "yes" if the current
+ recipe is forced to use a shell for its execution via
+ the .USESHELL or '+' directives, its value is "no" oth-
+ erwise.
+
+
+ The second group of string valued macros control dmake behavior and may
+ be set by the user.
+
+
+
+
+Dmake Version 4.12 2008-02-26 28
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ .DIRCACHE If set to "yes" enables the directory cache (this is
+ the default). If set to "no" disables the directory
+ cache (equivalent to -d command-line flag).
+
+ .DIRCACHERESPCASE
+ If set to "yes" causes the directory cache, if enabled,
+ to respect file case, if set to "no" files are cached
+ case insensitive. By default it is set to "no" on Win-
+ dows as the filesystems on this operating system are
+ case insensitive and set to "yes" for all other operat-
+ ing systems. The default can be overriden, if desired.
+
+ Note: Using case insensitive directory caching on case
+ sensitive file systems is a BAD idea. If in doubt use
+ case sensitive directory caching even on case insensi-
+ tive file systems as the worst case in this scenario is
+ that /foo/bar/ and /foo/BAR/ are cached separately
+ (with the same content) even though they are the same
+ directory. This would only happen if different targets
+ use different upper/lower case spellings for the same
+ directory and that is never a good idea.
+
+ NAMEMAX Defines the maximum length of a filename component.
+ The value of the variable is initialized at startup to
+ the value of the compiled macro NAME_MAX. On some sys-
+ tems the value of NAME_MAX is too short by default.
+ Setting a new value for NAMEMAX will override the com-
+ piled value.
+
+ .NOTABS When set to "yes" enables the use of spaces as well as
+ <tabs> to begin recipe lines. By default a non-group
+ recipe is terminated by a line without any leading
+ white-space or by a line not beggining with a <tab>
+ character. Enabling this mode modifies the first con-
+ dition of the above termination rule to terminate a
+ non-group recipe with a line that contains only
+ white-space. This mode does not effect the parsing of
+ group recipes bracketed by [].
+
+ AUGMAKE If set to "yes" value will enable the transformation of
+ special meta targets to support special AUGMAKE infer-
+ ences (See the "AUGMAKE META RULES" and "COMPATIBILITY"
+ sections).
+
+ DIRBRKSTR Contains the string of chars used to terminate the name
+ of a directory in a pathname. Under UNIX its value is
+ "/", under MSDOS its value is "/\:".
+
+ DIRSEPSTR Contains the string that is used to separate directory
+ components when path names are constructed. It is
+ defined with a default value at startup.
+
+ DIVFILE Is defined in the startup file and gives the name that
+ should be returned for the diversion file name when
+ used in $(mktmp ...) expansions, see the TEXT DIVERSION
+ section for details.
+
+ .KEEP_STATE Assigning this macro a value tells dmake the name of
+ the state file to use and turns on the keeping of state
+
+
+
+Dmake Version 4.12 2008-02-26 29
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ information for any targets that are brought up to date
+ by the make.
+
+ GROUPFLAGS This macro gives the set of flags to pass to the shell
+ when invoking it to execute a group recipe. The value
+ of the macro is the list of flags with a leading switch
+ indicator. (ie. `-' under UNIX)
+
+ GROUPSHELL This macro defines the full path to the executable
+ image to be used as the shell when processing group
+ recipes. This macro must be defined if group recipes
+ are used. It is assigned a default value in the
+ startup makefile. Under UNIX this value is /bin/sh.
+
+ GROUPSUFFIX If defined, this macro gives the string to use as a
+ suffix when creating group recipe files to be handed to
+ the command interpreter. For example, if it is defined
+ as .sh, then all temporary files created by dmake will
+ end in the suffix .sh. Under MSDOS if you are using
+ command.com as your GROUPSHELL, then this suffix must
+ be set to .bat in order for group recipes to function
+ correctly. The setting of GROUPSUFFIX and GROUPSHELL
+ is done automatically for command.com in the startup.mk
+ files.
+
+ MAKE Is defined in the startup file by default. Initially
+ this macro is defined to have the value "$(MAKECMD)
+ $(MFLAGS)". The string $(MAKE) is recognized when
+ using the -n switch.
+
+ MAKESTARTUP This macro defines the full path to the initial startup
+ makefile. Use the -V command line option to discover
+ its initial value.
+
+ MAXLINELENGTH This macro defines the maximum size of a single line of
+ makefile input text. The size is specified as a num-
+ ber, the default value is defined internally and is
+ shown via the -V option. A buffer of this size plus 2
+ is allocated for reading makefile text. The buffer is
+ freed before any targets are made, thereby allowing
+ files containing long input lines to be processed with-
+ out consuming memory during the actual make. This
+ macro can only be used to extend the line length beyond
+ it's default minimum value.
+
+ MAXPROCESS Specify the maximum number of child processes to use
+ when making targets. The default value of this macro
+ is "1" and its value cannot exceed the value of the
+ macro MAXPROCESSLIMIT. Setting the value of MAXPROCESS
+ on the command line or in the makefile is equivalent to
+ supplying a corresponding value to the -P flag on the
+ command line. If the global .SEQUENTIAL attribute is
+ set (or the -S command line switch is used) the value
+ of MAXPROCESS is fixed to "1" and cannot be changed.
+
+ OOODMAKEMODE This macro enables a special compatibility mode needed
+ by the OpenOffice.org build system. If set, the switch
+ disables the removal of leading './' path elements dur-
+ ing target filename normalization (See BINDING
+
+
+
+Dmake Version 4.12 2008-02-26 30
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ TARGETS). If './' appear in the pathname, but not at
+ the beginning of it, they are still removed by the nor-
+ malization. Please note that targets that are given on
+ the command line are going to be registered as default
+ targets after the startup file is read.
+
+ PREP This macro defines the number of iterations to be
+ expanded automatically when processing % rule defini-
+ tions of the form:
+
+ % : %.suff
+
+ See the sections on PERCENT(%) RULES for details on how
+ PREP is used.
+
+ SHELL This macro defines the full path to the executable
+ image to be used as the shell when processing single
+ line recipes. This macro must be defined if recipes
+ requiring the shell for execution are to be used. It
+ is assigned a default value in the startup makefile.
+ Under UNIX this value is /bin/sh.
+
+ SHELLCMDQUOTE This macro can be used to add additional characters
+ before and after the command string that is passed to
+ the shell defined by the SHELL macro. If needed, like
+ for cmd.exe and command.com, it is assigned a value in
+ the startup file.
+
+ SHELLFLAGS This macro gives the set of flags to pass to the shell
+ when invoking it to execute a single line recipe. The
+ value of the macro is the list of flags with a leading
+ switch indicator. (ie. `-' under UNIX)
+
+ SHELLMETAS Each time dmake executes a single recipe line (not a
+ group recipe) the line is searched for any occurrence
+ of a character defined in the value of SHELLMETAS. If
+ such a character is found the recipe line is defined to
+ require a shell to ensure its correct execution. In
+ such instances a shell is used to invoke the recipe
+ line. If no match is found the recipe line is executed
+ without the use of a shell.
+
+
+ There is only one character valued macro defined by dmake: SWITCHAR
+ contains the switch character used to introduce options on command
+ lines. For UNIX its value is `-', and for MSDOS its value may be `/'
+ or `-'. The macro is internally defined and is not user setable. The
+ MSDOS version of dmake attempts to first extract SWITCHAR from an envi-
+ ronment variable of the same name. If that fails it then attempts to
+ use the undocumented getswitchar system call, and returns the result of
+ that. Under MSDOS version 4.0 you must set the value of the environ-
+ ment macro SWITCHAR to '/' to obtain predictable behavior.
+
+ All boolean macros currently understood by dmake correspond directly to
+ the previously defined attributes. These macros provide a second way
+ to apply global attributes, and represent the preferred method of doing
+ so. They are used by assigning them a value. If the value is not a
+ NULL string then the boolean condition is set to on. If the value is a
+ NULL string then the condition is set to off. There are five
+
+
+
+Dmake Version 4.12 2008-02-26 31
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ conditions defined and they correspond directly to the attributes of
+ the same name. Their meanings are defined in the ATTRIBUTES section
+ above. The macros are: .EPILOG, .IGNORE, .MKSARGS, .NOINFER, .PRE-
+ CIOUS, .PROLOG, .SEQUENTIAL, .SILENT, .SWAP, and .USESHELL. Assigning
+ any of these a non NULL value will globally set the corresponding
+ attribute to on.
+
+RUNTIME MACROS
+ These macros are defined when dmake is making targets, and may take on
+ different values for each target. $@ is defined to be the full target
+ name, $? is the list of all out of date prerequisites, except for the !
+ ruleop, in which case it is set to the current build prerequisite
+ instead. $& is the list of all prerequisites, $> is the name of the
+ library if the current target is a library member, and $< is the list
+ of prerequisites specified in the current rule. If the current target
+ had a recipe inferred then $< is the name of the inferred prerequisite
+ even if the target had a list of prerequisites supplied using an
+ explicit rule that did not provide a recipe. In such situations $&
+ gives the full list of prerequisites.
+
+ $* is defined as $(@:db) when making targets with explicit recipes and
+ is defined as the value of % when making targets whose recipe is the
+ result of an inference. In the first case $* is the target name with
+ no suffix, and in the second case, is the value of the matched % pat-
+ tern from the associated %-rule. $^ expands to the set of out of date
+ prerequisites taken from the current value of $<. In addition to
+ these, $$ expands to $, {{ expands to {, }} expands to }, and the
+ strings <+ and +> are recognized as respectively starting and terminat-
+ ing a text diversion when they appear literally together in the same
+ input line.
+
+ The difference between $? and $^ can best be illustrated by an example,
+ consider:
+
+ fred.out : joe amy hello
+ rules for making fred
+
+ fred.out : my.c your.h his.h her.h # more prerequisites
+
+ Assume joe, amy, and my.c are newer then fred.out. When dmake executes
+ the recipe for making fred.out the values of the following macros will
+ be:
+
+ $@ --> fred.out
+ $* --> fred
+ $? --> joe amy my.c # note output of $? vs $^
+ $^ --> joe amy
+ $< --> joe amy hello
+ $& --> joe amy hello my.c your.h his.h her.h
+
+
+FUNCTION MACROS
+ dmake supports a full set of functional macros. One of these, the
+ $(mktmp ...) macro, is discussed in detail in the TEXT DIVERSION sec-
+ tion and is not covered here. The names of function macros must appear
+ literally after the opening $( or ${. They are not recognized if they
+ are the result of a recursive expansion.
+
+ Note that some of these macros take comma separated parameters but that
+
+
+
+Dmake Version 4.12 2008-02-26 32
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ these parameters must not contain literal whitespaces. Whitespaces in
+ macros used in these parameters are allowed.
+
+
+ $(and macroterm ...)
+ expands each macroterm in turn until there are no more or
+ one of them returns an empty string. If all expand to
+ non-empty strings the macro returs the string "t" other-
+ wise it returns an empty string.
+
+
+ $(assign expression)
+ Causes expression to be parsed as a macro assignment
+ expression and results in the specified assignment being
+ made. An error is issued if the assignment is not
+ syntatically correct. expression may contain white
+ space. This is in effect a dynamic macro assignment
+ facility and may appear anywhere any other macro may
+ appear. The result of the expanding a dynamic macro
+ assignment expression is the name of the macro that was
+ assigned and $(NULL) if the expression is not a valid
+ macro assignment expression. Some examples are:
+
+ $(assign foo := fred)
+ $(assign $(ind_macro_name) +:= $(morejunk))
+
+ $(echo list)
+ Echo's the value of list. list is not expanded.
+
+ $(eq,text_a,text_b true false)
+ expands text_a and text_b and compares their results. If
+ equal it returns the result of the expansion of the true
+ term, otherwise it returns the expansion of the false
+ term.
+
+ $(!eq,text_a,text_b true false)
+ Behaves identically to the previous macro except that the
+ true string is chosen if the expansions of the two
+ strings are not equal
+
+ $(foreach,var,list data)
+ Implements iterative macro expansion over data using var
+ as the iterator taking on values from list. var and list
+ are expanded and the result is the concatenation of
+ expanding data with var being set to each whitespace sep-
+ arated token from list. For example:
+
+ list = a b c
+ all :; echo [$(foreach,i,$(list) [$i])]
+
+ will output
+
+ [[a] [b] [c]]
+
+ The iterator variable is defined as a local variable to
+ this foreach instance. The following expression illus-
+ trates this:
+
+ $(foreach,i,$(foreach,i,$(sort c a b) root/$i) [$i/f.h])
+
+
+
+Dmake Version 4.12 2008-02-26 33
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ when evaluated the result is:
+
+ [root/a/f.h] [root/b/f.h] [root/c/f.h]
+
+ The specification of list must be a valid macro expres-
+ sion, such as:
+
+ $($(assign list=a b c))
+ $(sort d a b c)
+ $(echo a b c)
+
+ and cannot just be the list itself. That is, the follow-
+ ing foreach expression:
+
+ $(foreach,i,a b c [$i])
+
+ yields:
+
+ "b c [a]"
+
+ when evaluated.
+
+ $(nil expression)
+ Always returns the value of $(NULL) regardless of what
+ expression is. This function macro can be used to dis-
+ card results of expanding macro expressions.
+
+ $(normpath list)
+ Will return the normalized path names of all white-space
+ separated tokens in list. Quotes can be used to normalize
+ path names that contain white-space characters. On cygwin
+ the result honors the setting of .WINPATH to determine
+ the output format of the returned path names.
+
+ $(normpath,para list)
+ Same as above except that the expanded value of para is
+ used to override the .WINPATH setting.
+
+ $(not macroterm)
+ expands macroterm and returs the string "t" if the result
+ of the expansion is the empty string; otherwise, it
+ returns the empty string.
+
+ $(null,text true false)
+ expands the value of text. If it is NULL then the macro
+ returns the value of the expansion of true and the expan-
+ sion of false otherwise. The terms true, and false must
+ be strings containing no white-space.
+
+ $(!null,text true false)
+ Behaves identically to the previous macro except that the
+ true string is chosen if the expansion of text is not
+ NULL.
+
+ $(or macroterm ...)
+ expands each macroterm in turn and returs the empty
+ string if each term expands to the empty string; other-
+ wise, it returs the string "t".
+
+
+
+
+Dmake Version 4.12 2008-02-26 34
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ $(shell command)
+ is a shell escape macro. It runs command as if it were
+ part of a recipe and returns, separated by a single
+ space, all the non-white space terms written to stdout by
+ the command. For example:
+
+ $(shell ls *.c)
+
+ will return "a.c b.c c.c d.c" if the files exist in the
+ current directory. The recipe modification flags [+@%-]
+ are honored if they appear as the first characters in the
+ command. For example:
+
+ $(shell +ls *.c)
+
+ will run the command using the current shell.
+
+ Note that if the macro is part of a recipe it will be
+ evaluated after all previous recipe lines have been exe-
+ cuted. For obvious reasons it will be evaluated before
+ the current recipe line or group recipe is executed.
+
+ $(shell,expand command)
+ Is an extension to the $(shell command) function macro
+ that expands the result of running command.
+
+ $(sort list)
+ Will take all white-space separated tokens in list and
+ will return their sorted equivalent list.
+
+ $(strip data)
+ Will replace all strings of white-space in data by a sin-
+ gle space.
+
+ $(subst,pat,replacement data)
+ Will search for pat in data and will replace any occur-
+ rence of pat with the replacement string. The expansion
+
+ $(subst,.o,.c $(OBJECTS))
+
+ is equivalent to:
+
+ $(OBJECTS:s/.o/.c/)
+
+
+ $(uniq list)
+ Will take all white-space separated tokens in list and
+ will return their sorted equivalent list containing no
+ duplicates.
+
+ For historic reasons dmake treats the following case slightly special:
+
+ $(name something)
+
+ If it encounters a macro with a whitespace after name and name is not
+ literally one of the above mentioned function macro identifiers then
+ dmake will return the recursively expanded value of $(name). The
+ remaining something part will be expanded but the result will be dis-
+ carded. The use of this special feature is deprecated and should not be
+
+
+
+Dmake Version 4.12 2008-02-26 35
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ used.
+
+
+CONDITIONAL MACROS
+ dmake supports conditional macros. These allow the definition of tar-
+ get specific macro values. You can now say the following:
+
+ target ?= MacroName MacroOp Value
+
+ This creates a definition for MacroName whose value is Value only when
+ target is being made. You may use a conditional macro assignment any-
+ where that a regular macro assignment may appear, including as the
+ value of a $(assign ...) macro.
+
+ The new definition is associated with the most recent cell definition
+ for target. If no prior definition exists then one is created. The
+ implications of this are immediately evident in the following example:
+
+ foo := hello
+
+ all : cond;@echo "all done, foo=[$(foo)] bar=[$(bar)]"
+
+ cond ?= bar := global decl
+
+ cond .SETDIR=unix::;@echo $(foo) $(bar)
+ cond ?= foo := hi
+
+ cond .SETDIR=msdos::;@echo $(foo) $(bar)
+ cond ?= foo := hihi
+
+ The first conditional assignment creates a binding for 'bar' that is
+ activated when 'cond' is made. The bindings following the :: defini-
+ tions are activated when their respective recipe rules are used. Thus
+ the first binding serves to provide a global value for 'bar' while any
+ of the cond :: rules are processed, and the local bindings for 'foo'
+ come into effect when their associated :: rule is processed.
+
+ Conditionals for targets of .UPDATEALL are all activated before the
+ target group is made. Assignments are processed in order. Note that
+ the value of a conditional macro assignment is NOT AVAILABLE until the
+ associated target is made, thus the construct
+
+ mytarget ?= bar := hello
+ mytarget ?= foo := $(bar)
+
+ results in $(foo) expanding to "", if you want the result to be "hello"
+ you must use:
+
+ mytarget ?= bar := hello
+ mytarget ?= foo = $(bar)
+
+ Once a target is made any associated conditional macros are deactivated
+ and their values are no longer available. Activation occurrs after all
+ inference, and .SETDIR directives have been processed and after $@ is
+ assigned, but before prerequisites are processed; thereby making the
+ values of conditional macro definitions available during construction
+ of prerequisites.
+
+ If a %-meta rule target has associated conditional macro assignments,
+
+
+
+Dmake Version 4.12 2008-02-26 36
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ and the rule is chosen by the inference algorithm then the conditional
+ macro assignments are inferred together with the associated recipe.
+
+DYNAMIC PREREQUISITES
+ dmake looks for prerequisites whose names contain macro expansions dur-
+ ing target processing. Any such prerequisites are expanded and the
+ result of the expansion is used as the prerequisite name. As an exam-
+ ple the line:
+
+ fred : $$@.c
+
+ causes the $$@ to be expanded when dmake is making fred, and it
+ resolves to the target fred. This enables dynamic prerequisites to be
+ generated. The value of @ may be modified by any of the valid macro
+ modifiers. So you can say for example:
+
+ fred.out : $$(@:b).c
+
+ where the $$(@:b) expands to fred. Note the use of $$ instead of $ to
+ indicate the dynamic expansion, this is due to the fact that the rule
+ line is expanded when it is initially parsed, and $$ then returns $
+ which later triggers the dynamic prerequisite expansion. Dynamic macro
+ expansion is performed in all user defined rules, and the special tar-
+ gets .SOURCE*, and .INCLUDEDIRS.
+
+ NOTE: The use of a $ as part of a prerequisite or target name is
+ strongly discouraged as the runtime macros (like $@) are expanded when
+ used in a recipe line so that the $ is interpreted as a macro identi-
+ fier and not as a character of the filename leading to invalid runtime
+ macros. In addition to this no filename normalization is done for pre-
+ requisites and targets that contain $ characters. Nevertheless it is
+ possible to use $ in prerequisites by using $$$$ but this is not recom-
+ mended and can lead to surprising results.
+
+ If dynamic macro expansion results in multiple white space separated
+ tokens then these are inserted into the prerequisite list inplace of
+ the dynamic prerequisite. Due to the recursive nature of macro expan-
+ sion the prerequisite list is fully expanded even if the dynamic pre-
+ requisite contained other runtime macros.
+
+BINDING TARGETS
+ This operation takes a target name and binds it to an existing file, if
+ possible. dmake makes a distinction between the internal target name
+ of a target and its associated external file name. Thus it is possible
+ for a target's internal name and its external file name to differ. To
+ perform the binding, the following set of rules is used. Assume that
+ we are trying to bind a target whose name is of the form X.suff, where
+ .suff is the suffix and X is the stem portion (ie. that part which con-
+ tains the directory and the basename). dmake takes this target name
+ and performs a series of search operations that try to find a suitably
+ named file in the external file system. The search operation is user
+ controlled via the settings of the various .SOURCE targets.
+
+ 1. If target has the .SYMBOL attribute set then look for it
+ in the library. If found, replace the target name with
+ the library member name and continue with step 2. If the
+ name is not found then return.
+
+ 2. Extract the suffix portion (that following the `.') of
+ the target name. If the suffix is not null, look up the
+
+
+
+Dmake Version 4.12 2008-02-26 37
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ special target .SOURCE.<suff> (<suff> is the suffix). If
+ the special target exists then search each directory
+ given in the .SOURCE.<suff> prerequisite list for the
+ target. If the target's suffix was null (ie. .suff was
+ empty) then perform the above search but use the special
+ target .SOURCE.NULL instead. If at any point a match is
+ found then terminate the search. If a directory in the
+ prerequisite list is the special name `.NULL ' perform a
+ search for the full target name without prepending any
+ directory portion (ie. prepend the NULL directory).
+
+ 3. The search in step 2. failed. Repeat the same search but
+ this time use the special target .SOURCE. (a default
+ target of '.SOURCE : .NULL' is defined by dmake at
+ startup, and is user redefinable)
+
+ 4. The search in step 3. failed. If the target has the
+ library member attribute (.LIBMEMBER) set then try to
+ find the target in the library which was passed along
+ with the .LIBMEMBER attribute (see the MAKING LIBRARIES
+ section). The bound file name assigned to a target which
+ is successfully located in a library is the same name
+ that would be assigned had the search failed (see 5.).
+
+ 5. The search failed. Either the target was not found in
+ any of the search directories or no applicable .SOURCE
+ special targets exist. If applicable .SOURCE special
+ targets exist, but the target was not found, then dmake
+ assigns the first name searched as the bound file name.
+ If no applicable .SOURCE special targets exist, then the
+ full original target name becomes the bound file name.
+
+ There is potential here for a lot of search operations. The trick is
+ to define .SOURCE.x special targets with short search lists and leave
+ .SOURCE as short as possible. The search algorithm has the following
+ useful side effect. When a target having the .LIBMEMBER (library mem-
+ ber) attribute is searched for, it is first searched for as an ordinary
+ file. When a number of library members require updating it is desir-
+ able to compile all of them first and to update the library at the end
+ in a single operation. If one of the members does not compile and
+ dmake stops, then the user may fix the error and make again. dmake
+ will not remake any of the targets whose object files have already been
+ generated as long as none of their prerequisite files have been modi-
+ fied as a result of the fix.
+
+ When dmake constructs target (and prerequisite) pathnames they are nor-
+ malized to the shortest (or most natural, see below for the cygwin
+ case) representation. Substrings like './' or of the form 'baz/..' are
+ removed and multiple slashes are collapsed to one unless they are at
+ the beginning of the pathname. Leading slashes are normalized according
+ to POSIX rules, i.e. more than two leading slashes are reduced to one
+ slash and a leading '//' is kept as it might have a special meaning.
+ For example "./foo", "bar/../foo" and foo are recognized as the same
+ file. This may result in somewhat unexpected values of the macro
+ expansion of runtime macros like $@, but is infact the corect result.
+
+ NOTE: A cygwin dmake executable will accept DOS like pathnames with
+ drive letters and cygwin POSIX pathnames and normalize them into its
+ natural POSIX representation. This might result in even more surpris-
+ ing values of runtime macros.
+
+
+
+Dmake Version 4.12 2008-02-26 38
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ When defining .SOURCE and .SOURCE.x targets the construct
+
+ .SOURCE :
+ .SOURCE : fred gery
+
+ is equivalent to
+
+ .SOURCE :- fred gery
+
+ dmake correctly handles the UNIX Make variable VPATH. By definition
+ VPATH contains a list of ':' separated directories to search when look-
+ ing for a target. dmake maps VPATH to the following special rule:
+
+ .SOURCE :^ $(VPATH:s/:/ /)
+
+ Which takes the value of VPATH and sets .SOURCE to the same set of
+ directories as specified in VPATH.
+
+PERCENT(%) RULES AND MAKING INFERENCES
+ When dmake makes a target, the target's set of prerequisites (if any)
+ must exist and the target must have a recipe which dmake can use to
+ make it. If the makefile does not specify an explicit recipe for the
+ target then dmake uses special rules to try to infer a recipe which it
+ can use to make the target. Previous versions of Make perform this
+ task by using rules that are defined by targets of the form .<suf-
+ fix>.<suffix> (this is still supported, see "AUGMAKE META RULES") or by
+ using the not supported by dmake .SUFFIXES list of suffixes (see "SPE-
+ CIAL TARGETS" for more details about .SUFFIXES). The exact workings of
+ this mechanism were sometimes difficult to understand and often limit-
+ ing in their usefulness. Instead, dmake supports the concept of %-meta
+ rules. The syntax and semantics of these rules differ from standard
+ rule lines as follows:
+
+ <%-targets> [<attributes>] <ruleop> [<%-prereqs>] [;<recipe>]
+
+ where %-targets are one or more targets containing exactly a single `%'
+ sign, attributes is a list (possibly empty) of attributes, ruleop is
+ the standard set of rule operators, %-prereqs , if present, is a list
+ of prerequisites containing zero or more `%' signs, and recipe, if
+ present, is the first line of the recipe.
+
+ If more than one %-target is present this line is equivalent to a repe-
+ tition of the whole [<attributes>] <ruleop> [<%-prereqs>] [;<recipe>]
+ sequence for each %-target, i.e. it is possible to specify the same
+ rule for multiple %-targets. Because of this following only speaks
+ about <%-target> as %-targets are divided into multiple definitions
+ with a single %-target.
+
+ NOTE: As multiple %-targets didn't work reliably with dmake versions
+ prior to 4.5 unless the rule operator `|:' was used we currently issue
+ a warning stating that it now works.
+
+ The %-target defines a pattern against which a target whose recipe is
+ being inferred gets matched. The pattern match goes as follows: all
+ chars are matched exactly from left to right up to but not including
+ the % sign in the pattern, % then matches the longest string from the
+ actual target name not ending in the suffix given after the % sign in
+ the pattern. Consider the following examples:
+
+ %.c matches fred.c but not joe.c.Z
+ dir/%.c matches dir/fred.c but not dd/fred.c
+ fred/% matches fred/joe.c but not f/joe.c
+ % matches anything
+
+
+
+
+Dmake Version 4.12 2008-02-26 39
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ In each case the part of the target name that matched the % sign is
+ retained and is substituted for any % signs in the prerequisite list of
+ the %-meta rule when the rule is selected during inference and dmake
+ constructs the new dependency.
+
+ Please note, that only the first, non-indirect, prerequisite of the
+ list is used for the inference mechanism. If more than one non-indirect
+ prerequisite is given a warning is issued and all but the first non-
+ indirect prerequisites are ignored. See below for a description of
+ indirect prerequisites.
+
+ As an example the following %-meta rules describe the following:
+
+ %.c : %.y ; recipe...
+
+ describes how to make any file ending in .c if a corresponding file
+ ending in .y can be found.
+
+ foo%.o : fee%.k ; recipe...
+
+ is used to describe how to make fooxxxx.o from feexxxx.k.
+
+ %.a :; recipe...
+
+ describes how to make a file whose suffix is .a without inferring any
+ prerequisites.
+
+ %.c : %.y 'yaccsrc/%.y' ; recipe...
+
+ matches the corresponding .y file as prerequisite and additionally
+ another .y file in the yaccsrc subdirectory as indirect prerequisite.
+ Another interesting example is:
+
+ % : RCS/%,v ; co $<
+
+ which describes how to take any target and check it out of the RCS
+ directory if the corresponding file exists in the RCS directory. The
+ equivalent SCCS rule would be:
+
+ % : s.% ; get $<
+
+
+ The previous RCS example defines an infinite rule, because it says how
+ to make anything from RCS/%,v, and anything also includes RCS/fred.c,v.
+ To limit the size of the graph that results from such rules dmake uses
+ the macro variable PREP (stands for % repetition). By default the
+ value of this variable is 0, which says that no repetitions of a %-rule
+ are to be generated. If it is set to something greater than 0, then
+ that many repetitions of any infinite %-rule are allowed. If in the
+ above example PREP was set to 1, then dmake would generate the depen-
+ dency graph:
+
+ % --> RCS/%,v --> RCS/RCS/%,v,v
+
+ Where each link is assigned the same recipe as the first link. PREP
+ should be used only in special cases, since it may result in a large
+ increase in the number of possible prerequisites tested. dmake further
+ assumes that any target that has no suffix can be made from a prerequi-
+ site that has at least one suffix.
+
+ dmake supports dynamic prerequisite generation for prerequisites of
+ %-meta rules. This is best illustrated by an example. The RCS rule
+ shown above can infer how to check out a file from a corresponding RCS
+ file only if the target is a simple file name with no directory
+
+
+
+Dmake Version 4.12 2008-02-26 40
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ information. That is, the above rule can infer how to find
+ RCS/fred.c,v from the target fred.c, but cannot infer how to find
+ srcdir/RCS/fred.c,v from srcdir/fred.c because the above rule will
+ cause dmake to look for RCS/srcdir/fred.c,v; which does not exist
+ (assume that srcdir has its own RCS directory as is the common case).
+
+ A more versatile formulation of the above RCS check out rule is the
+ following:
+
+ % : $$(@:d)RCS/$$(@:f),v : co $@
+
+ This rule uses the dynamic macro $@ to specify the prerequisite to try
+ to infer. During inference of this rule the macro $@ is set to the
+ value of the target of the %-meta rule and the appropriate prerequisite
+ is generated by extracting the directory portion of the target name (if
+ any), appending the string RCS/ to it, and appending the target file
+ name with a trailing ,v attached to the previous result.
+
+ dmake can also infer indirect prerequisites. An inferred target can
+ have a list of prerequisites added that will not show up in the value
+ of $< but will show up in the value of $? and $&. Indirect prerequi-
+ sites are specified in an inference rule by quoting the prerequisite
+ with single quotes. For example, if you had the explicit dependency:
+
+ fred.o : fred.c ; rule to make fred.o
+ fred.o : local.h
+
+ then this can be inferred for fred.o from the following inference rule:
+
+ %.o : %.c 'local.h' ; makes a .o from a .c
+
+ You may infer indirect prerequisites that are a function of the value
+ of '%' in the current rule. The meta-rule:
+
+ %.o : %.c '$(INC)/%.h' ; rule to make a .o from a .c
+
+ infers an indirect prerequisite found in the INC directory whose name
+ is the same as the expansion of $(INC), and the prerequisite name
+ depends on the base name of the current target. The set of indirect
+ prerequisites is attached to the meta rule in which they are specified
+ and are inferred only if the rule is used to infer a recipe for a tar-
+ get. They do not play an active role in driving the inference algo-
+ rithm. The construct:
+
+ %.o :| %.c %.f 'local.h'; recipe
+
+ is equivalent to:
+
+ %.o : %.c 'local.h' ; recipe
+ %.o : %.f 'local.h' ; recipe
+
+
+ If any of the attributes .EPILOG, .IGNORE, .LIBRARY, .NOSTATE, .PHONY,
+ .PRECIOUS, .PROLOG, .SETDIR, .SILENT, .SWAP, .USESHELL and .WINPATH are
+ given for a %-rule then when that rule is bound to a target as the
+ result of an inference, the target's set of attributes is augmented by
+ the attributes from the above set that are specified in the bound
+ %-rule. Other attributes specified for %-meta rules are not inherited
+ by the target. The .SETDIR attribute is treated in a special way. If
+ the target already had a .SETDIR attribute set then dmake changes to
+ that directory prior to performing the inference. During inference any
+ .SETDIR attributes for the inferred prerequisite are honored. The
+ directories must exist for a %-meta rule to be selected as a possible
+ inference path. If the directories do not exist no error message is
+
+
+
+Dmake Version 4.12 2008-02-26 41
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ issued, instead the corresponding path in the inference graph is
+ rejected.
+
+ dmake bases all of its inferences on the inference graph constructed
+ from the %-rules defined in the makefile. It knows exactly which tar-
+ gets can be made from which prerequisites by making queries on the
+ inference graph.
+
+ For a %-meta rule to be inferred as the rule whose recipe will be used
+ to make a target, the target's name must match the %-target pattern,
+ and any inferred %-prerequisite must already exist or have an explicit
+ recipe so that the prerequisite can be made. Without transitive clo-
+ sure on the inference graph the above rule describes precisely when an
+ inference match terminates the search. If transitive closure is
+ enabled (the usual case), and a prerequisite does not exist or cannot
+ be made, then dmake invokes the inference algorithm recursively on the
+ prerequisite to see if there is some way the prerequisite can be manu-
+ factured. For, if the prerequisite can be made then the current target
+ can also be made using the current %-meta rule. This means that there
+ is no longer a need to give a rule for making a .o from a .y if you
+ have already given a rule for making a .o from a .c and a .c from a .y.
+ In such cases dmake can infer how to make the .o from the .y via the
+ intermediary .c and will remove the .c when the .o is made. Transitive
+ closure can be disabled by giving the -T switch on the command line.
+
+ A word of caution. dmake bases its transitive closure on the %-meta
+ rule targets. When it performs transitive closure it infers how to
+ make a target from a prerequisite by performing a pattern match as if
+ the potential prerequisite were a new target. The set of rules:
+
+ %.o : %.c ; rule for making .o from .c
+ %.c : %.y ; rule for making .c from .y
+ % : RCS/%,v ; check out of RCS file
+
+ will, by performing transitive closure, allow dmake to infer how to
+ make a .o from a .y using a .c as an intermediate temporary file.
+ Additionally it will be able to infer how to make a .y from an RCS
+ file, as long as that RCS file is in the RCS directory and has a name
+ which ends in .y,v. The transitivity computation is performed dynami-
+ cally for each target that does not have a recipe. This has potential
+ to be costly if the %-meta rules are not carefully specified. The
+ .NOINFER attribute is used to mark a %-meta node as being a final tar-
+ get during inference. Any node with this attribute set will not be
+ used for subsequent inferences. As an example the node RCS/%,v is
+ marked as a final node since we know that if the RCS file does not
+ exist there likely is no other way to make it. Thus the standard
+ startup makefile contains an entry similar to:
+ .NOINFER : RCS/%,v
+ Thereby indicating that the RCS file is the end of the inference chain.
+ Whenever the inference algorithm determines that a target can be made
+ from more than one prerequisite and the inference chains for the two
+ methods are the same length the algorithm reports an ambiguity and
+ prints the ambiguous inference chains.
+
+ dmake tries to remove intermediate files resulting from transitive clo-
+ sure if the file is not marked as being PRECIOUS, or the -u flag was
+ not given on the command line, and if the inferred intermediate did not
+ previously exist. Intermediate targets that existed prior to being
+ made are never removed. This is in keeping with the philosophy that
+ dmake should never remove things from the file system that it did not
+ add. If the special target .REMOVE is defined and has a recipe then
+ dmake constructs a list of the intermediate files to be removed and
+ makes them prerequisites of .REMOVE. It then makes .REMOVE thereby
+ removing the prerequisites if the recipe of .REMOVE says to. Typically
+
+
+
+Dmake Version 4.12 2008-02-26 42
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ .REMOVE is defined in the startup file as:
+
+ .REMOVE :; $(RM) $<
+
+AUGMAKE META RULES
+ As a subclass of the meta targets that is actually mapped to %-meta
+ rules dmake understands several SYSV AUGMAKE targets transformations.
+ This .<suffix> special target construct transforms into the following
+ %-meta rules:
+
+ .suff :; recipe
+
+ gets mapped into:
+
+ % : %.suff; recipe
+
+
+ dmake also supports the old format special target .<suffix>.<suffix> by
+ identifying any rules of this form and mapping them to the appropriate
+ %-rule. So for example if an old makefile contains the construct:
+
+ .c.o :; cc -c $< -o $@
+
+ dmake maps this into the following %-rule:
+
+ %.o : %.c; cc -c $< -o $@
+
+ The following SYSV AUGMAKE special targets transformation must be
+ enabled by providing the -A flag on the command line or by setting the
+ value of AUGMAKE to non-NULL. The construct
+
+ .c~.o :; recipe
+
+ gets mapped into:
+
+ %.o : s.%.c ; recipe
+
+ In general, a special target of the form .<str>~ is replaced by the
+ %-rule construct s.%.<str>, thereby providing support for the syntax
+ used by SYSV AUGMAKE for providing SCCS support. When enabled, these
+ mappings allow processing of existing SYSV makefiles without modifica-
+ tions.
+
+MAKING TARGETS
+ In order to update a target dmake must execute a recipe. When a recipe
+ needs to be executed it is first expanded so that any macros in the
+ recipe text are expanded, and it is then either executed directly or
+ passed to a shell. dmake supports two types of recipes. The regular
+ recipes and group recipes.
+
+ When a regular recipe is invoked dmake executes each line of the recipe
+ separately using a new copy of a shell if a shell is required. Thus
+ effects of commands do not generally persist across recipe lines (e.g.
+ cd requests in a recipe line do not carry over to the next recipe
+ line). This is true even in environments such as MSDOS, where dmake
+ internally sets the current working director to match the directory it
+ was in before the command was executed.
+
+ The decision on whether a shell is required to execute a command is
+ based on the value of the macro SHELLMETAS or on the specification of
+ '+' or .USESHELL for the current recipe or target respectively. If any
+ character in the value of SHELLMETAS is found in the expanded recipe
+ text-line or the use of a shell is requested explicitly via '+' or
+ .USESHELL then the command is executed using a shell, otherwise the
+
+
+
+Dmake Version 4.12 2008-02-26 43
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ command is executed directly. The shell that is used for execution is
+ given by the value of the macro SHELL. The flags that are passed to
+ the shell are given by the value of SHELLFLAGS. Thus dmake constructs
+ the command line:
+
+ $(SHELL) $(SHELLFLAGS) $(expanded_recipe_command)
+
+ If the $(SHELLCMDQUOTE) macro is set its value is inserted before and
+ after the $(expanded_recipe_command) string.
+
+ Normally dmake writes the command line that it is about to invoke to
+ standard output. If the .SILENT attribute is set for the target or for
+ the recipe line (via @), then the recipe line is not echoed.
+
+ Group recipe processing is similar to that of regular recipes, except
+ that a shell is always invoked. The shell that is invoked is given by
+ the value of the macro GROUPSHELL, and its flags are taken from the
+ value of the macro GROUPFLAGS. If a target has the .PROLOG attribute
+ set then dmake prepends to the shell script the recipe associated with
+ the special target .GROUPPROLOG, and if the attribute .EPILOG is set as
+ well, then the recipe associated with the special target .GROUPEPILOG
+ is appended to the script file. This facility can be used to always
+ prepend a common header and common trailer to group recipes. Group
+ recipes are echoed to standard output just like standard recipes, but
+ are enclosed by lines beginning with [ and ].
+
+ The recipe flags [+,-,%,@] are recognized at the start of a recipe line
+ even if they appear in a macro. For example:
+
+ SH = +
+ all:
+ $(SH)echo hi
+
+ is completely equivalent to writing
+
+ SH = +
+ all:
+ +echo hi
+
+
+ The last step performed by dmake prior to running a recipe is to set
+ the macro CMNDNAME to the name of the command to execute (determined by
+ finding the first white-space ending token in the command line). It
+ then sets the macro CMNDARGS to be the remainder of the line. dmake
+ then expands the macro COMMAND which by default is set to
+
+ COMMAND = $(CMNDNAME) $(CMNDARGS)
+
+ The result of this final expansion is the command that will be exe-
+ cuted. The reason for this expansion is to allow for a different
+ interface to the argument passing facilities (esp. under DOS) than that
+ provided by dmake. You can for example define COMMAND to be
+
+ COMMAND = $(CMNDNAME) @$(mktmp $(CMNDARGS))
+
+ which dumps the arguments into a temporary file and runs the command
+
+ $(CMNDNAME) @/tmp/ASAD23043
+
+ which has a much shorter argument list. It is now up to the command to
+ use the supplied argument as the source for all other arguments. As an
+ optimization, if COMMAND is not defined dmake does not perform the
+ above expansion. On systems, such as UNIX, that handle long command
+ lines this provides a slight saving in processing the makefiles.
+
+
+
+Dmake Version 4.12 2008-02-26 44
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+MAKING LIBRARIES
+ Libraries are easy to maintain using dmake. A library is a file con-
+ taining a collection of object files. Thus to make a library you sim-
+ ply specify it as a target with the .LIBRARY attribute set and specify
+ its list of prerequisites. The prerequisites should be the object mem-
+ bers that are to go into the library. When dmake makes the library
+ target it uses the .LIBRARY attribute to pass to the prerequisites the
+ .LIBMEMBER attribute and the name of the library. This enables the
+ file binding mechanism to look for the member in the library if an
+ appropriate object file cannot be found. dmake now supports Elf
+ libraries on systems that support Elf and hence supports, on those sys-
+ tems, long member file names. A small example best illustrates this.
+
+ mylib.a .LIBRARY : mem1.o mem2.o mem3.o
+ rules for making library...
+ # remember to remove .o's when lib is made
+
+ # equivalent to: '%.o : %.c ; ...'
+ .c.o :; rules for making .o from .c say
+
+ dmake will use the .c.o rule for making the library members if appro-
+ priate .c files can be found using the search rules. NOTE: this is
+ not specific in any way to C programs, they are simply used as an exam-
+ ple.
+
+ dmake tries to handle the old library construct format in a sensible
+ way. The construct lib(member.o) is separated and the lib portion is
+ declared as a library target. The new target is defined with the
+ .LIBRARY attribute set and the member.o portion of the construct is
+ declared as a prerequisite of the lib target. If the construct
+ lib(member.o) appears as a prerequisite of a target in the makefile,
+ that target has the new name of the lib assigned as its prerequisite.
+ Thus the following example:
+
+ a.out : ml.a(a.o) ml.a(b.o); $(CC) -o $@ $<
+
+ .c.o :; $(CC) -c $(CFLAGS) -o $@ $<
+ %.a:
+ ar rv $@ $?
+ ranlib $@
+ rm -rf $?
+
+ constructs the following dependency graph.
+
+ a.out : ml.a; $(CC) -o $@ $<
+ ml.a .LIBRARY : a.o b.o
+
+ %.o : %.c ; $(CC) -c $(CFLAGS) -o $@ $<
+ %.a :
+ ar rv $@ $?
+ ranlib $@
+ rm -rf $?
+
+ and making a.out then works as expected.
+
+ The same thing happens for any target of the form lib((entry)). These
+ targets have an additional feature in that the entry target has the
+ .SYMBOL attribute set automatically.
+
+ NOTE: If the notion of entry points is supported by the archive and by
+ dmake (currently not the case) then dmake will search the archive for
+ the entry point and return not only the modification time of the member
+ which defines the entry but also the name of the member file. This
+ name will then replace entry and will be used for making the member
+
+
+
+Dmake Version 4.12 2008-02-26 45
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ file. Once bound to an archive member the .SYMBOL attribute is removed
+ from the target. This feature is presently disabled as there is little
+ standardization among archive formats, and we have yet to find a make-
+ file utilizing this feature (possibly due to the fact that it is unim-
+ plemented in most versions of UNIX Make).
+
+ Finally, when dmake looks for a library member it must first locate the
+ library file. It does so by first looking for the library relative to
+ the current directory and if it is not found it then looks relative to
+ the current value of $(TMD). This allows commonly used libraries to be
+ kept near the root of a source tree and to be easily found by dmake.
+
+KEEP STATE
+ dmake supports the keeping of state information for targets that it
+ makes whenever the macro .KEEP_STATE is assigned a value. The value of
+ the macro should be the name of a state file that will contain the
+ state information. If state keeping is enabled then each target that
+ does not poses the .NOSTATE attribute will have a record written into
+ the state file indicating the target's name, the current directory, the
+ command used to update the target, and which, if any, :: rule is being
+ used. When you make this target again if any of this information does
+ not match the previous settings and the target is not out dated it will
+ still be re-made. The assumption is that one of the conditions above
+ has changed and that we wish to remake the target. For example, state
+ keeping is used in the maintenance of dmake to test compile different
+ versions of the source using different compilers. Changing the com-
+ piler causes the compilation flags to be modified and hence all sources
+ to be recompiled.
+
+ The state file is an ascii file and is portable, however it is not in
+ human readable form as the entries represent hash keys of the above
+ information.
+
+ The Sun Microsystem's Make construct
+
+ .KEEP_STATE :
+
+ is recognized and is mapped to .KEEP_STATE:=_state.mk. The dmake ver-
+ sion of state keeping does not include scanning C source files for
+ dependencies like Sun Make. This is specific to C programs and it was
+ felt that it does not belong in make. dmake instead provides the tool,
+ cdepend, to scan C source files and to produce depedency information.
+ Users are free to modify cdepend to produce other dependency files.
+ (NOTE: cdepend does not come with the distribution at this time, but
+ will be available in a patch in the near future)
+
+MULTI PROCESSING
+ If the architecture supports it then dmake is capable of making a tar-
+ get's prerequisites in parallel. dmake will make as much in parallel
+ as it can and use a number of child processes up to the maximum speci-
+ fied by MAXPROCESS or by the value supplied to the -P command line
+ flag. A parallel make is enabled by setting the value of MAXPROCESS
+ (either directly or via -P option) to a value which is > 1. dmake
+ guarantees that all dependencies as specified in the makefile are hon-
+ ored. A target will not be made until all of its prerequisites have
+ been made. Note that when you specify -P 4 then four child processes
+ are run concurrently but dmake actually displays the fifth command it
+ will run immediately upon a child process becomming free. This is an
+ artifact of the method used to traverse the dependency graph and cannot
+ be removed. If a parallel make is being performed then the following
+ restrictions on parallelism are enforced.
+
+ 1. Individual recipe lines in a non-group recipe are per-
+ formed sequentially in the order in which they are
+
+
+
+Dmake Version 4.12 2008-02-26 46
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ specified within the makefile and in parallel with the
+ recipes of other targets.
+
+ 2. If a target contains multiple recipe definitions (cf. ::
+ rules) then these are performed sequentially in the order
+ in which the :: rules are specified within the makefile
+ and in parallel with the recipes of other targets.
+
+ 3. If a target rule contains the `!' modifier, then the
+ recipe is performed sequentially for the list of outdated
+ prerequisites and in parallel with the recipes of other
+ targets.
+
+ 4. If a target has the .SEQUENTIAL attribute set then all of
+ its prerequisites are made sequentially relative to one
+ another (as if MAXPROCESS=1), but in parallel with other
+ targets in the makefile.
+
+ Note: If you specify a parallel make then the order of target update
+ and the order in which the associated recipes are invoked will not cor-
+ respond to that displayed by the -n flag.
+
+CONDITIONALS
+ dmake supports a makefile construct called a conditional. It allows
+ the user to conditionally select portions of makefile text for input
+ processing and to discard other portions. This becomes useful for
+ writing makefiles that are intended to function for more than one tar-
+ get host and environment. The conditional expression is specified as
+ follows:
+
+ .IF expression
+ ... if text ...
+ .ELIF expression
+ ... if text ...
+ .ELSE
+ ... else text ...
+ .END
+
+ The .ELSE and .ELIF portions are optional, and the conditionals may be
+ nested (ie. the text may contain another conditional). .IF, .ELSE,
+ and .END may appear anywhere in the makefile, but a single conditional
+ expression may not span multiple makefiles.
+
+ expression can be one of the following forms:
+
+ String evaluation
+ <text> | <text> == <text> | <text> != <text>
+
+ Numeric evaluation
+ <text> <= <text> | <text> >= <text>
+
+ Boolean evaluation
+ ( <text> ) | <text> || <text> | <text> && <text>
+
+ where text is either text or a macro expression. In any case, before
+ the comparison is made, the expression is expanded. The text portions
+ are then selected and compared. In the case of the numeric comparisons
+ enclosing quotes are removed after expanding the expressions and the
+ leading numerical parts are converted to an integer number. If no
+ numerical part is found this results to 0 (zero). The string "12ab" for
+ example evaluates to the number 12. Expressions can be nested with ()
+ and the use of || or &&. White space at the start and end of the text
+ portion is discarded before the comparison. This means that a macro
+ that evaluates to nothing but white space is considered a NULL value
+
+
+
+Dmake Version 4.12 2008-02-26 47
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ for the purpose of the comparison. In the first case the expression
+ evaluates TRUE if the text is not NULL otherwise it evaluates FALSE.
+ The remaining two cases both evaluate the expression on the basis of a
+ string comparison. If a macro expression needs to be equated to a NULL
+ string then compare it to the value of the macro $(NULL). You can use
+ the $(shell ...) macro to construct more complex test expressions.
+
+EXAMPLES
+ # A simple example showing how to use make
+ #
+ prgm : a.o b.o
+ cc a.o b.o -o prgm
+ a.o : a.c g.h
+ cc a.c -o $@
+ b.o : b.c g.h
+ cc b.c -o $@
+
+ In the previous example prgm is remade only if a.o and/or b.o is out of
+ date with respect to prgm. These dependencies can be stated more con-
+ cisely by using the inference rules defined in the standard startup
+ file. The default rule for making .o's from .c's looks something like
+ this:
+
+ %.o : %.c; cc -c $(CFLAGS) -o $@ $<
+
+ Since there exists a rule (defined in the startup file) for making .o's
+ from .c's dmake will use that rule for manufacturing a .o from a .c and
+ we can specify our dependencies more concisely.
+
+ prgm : a.o b.o
+ cc -o prgm $<
+ a.o b.o : g.h
+
+ A more general way to say the above using the new macro expansions
+ would be:
+
+ SRC = a b
+ OBJ = {$(SRC)}.o
+
+ prgm : $(OBJ)
+ cc -o $@ $<
+
+ $(OBJ) : g.h
+
+ If we want to keep the objects in a separate directory, called objdir,
+ then we would write something like this.
+
+ SRC = a b
+ OBJ = {$(SRC)}.o
+
+ prgm : $(OBJ)
+ cc $< -o $@
+
+ $(OBJ) : g.h
+ %.o : %.c
+ $(CC) -c $(CFLAGS) -o $(@:f) $<
+ mv $(@:f) objdir
+
+ .SOURCE.o : objdir # tell dmake to look here for .o's
+
+ An example of building library members would go something like this:
+ (NOTE: The same rules as above will be used to produce .o's from .c's)
+
+ SRC= a b
+
+
+
+Dmake Version 4.12 2008-02-26 48
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ LIB= lib
+ LIBm= { $(SRC) }.o
+
+ prgm: $(LIB)
+ cc -o $@ $(LIB)
+
+ $(LIB) .LIBRARY : $(LIBm)
+ ar rv $@ $<
+ rm $<
+
+ Finally, suppose that each of the source files in the previous example
+ had the `:' character in their target name. Then we would write the
+ above example as:
+
+ SRC= f:a f:b
+ LIB= lib
+ LIBm= "{ $(SRC) }.o" # put quotes around each token
+
+ prgm: $(LIB)
+ cc -o $@ $(LIB)
+
+ $(LIB) .LIBRARY : $(LIBm)
+ ar rv $@ $<
+ rm $<
+
+COMPATIBILITY
+ There are two notable differences between dmake and the standard ver-
+ sion of BSD UNIX 4.2/4.3 Make.
+
+ 1. BSD UNIX 4.2/4.3 Make supports wild card filename expansion
+ for prerequisite names. Thus if a directory contains a.h,
+ b.h and c.h, then a line like
+
+ target: *.h
+
+ will cause UNIX make to expand the *.h into "a.h b.h c.h".
+ dmake does not support this type of filename expansion.
+
+ 2. Unlike UNIX make, touching a library member causes dmake to
+ search the library for the member name and to update the
+ library time stamp. This is only implemented in the UNIX
+ version. MSDOS and other versions may not have librarians
+ that keep file time stamps, as a result dmake touches the
+ library file itself, and prints a warning.
+
+ dmake is not compatible with GNU Make. In particular it does not
+ understand GNU Make's macro expansions that query the file system.
+
+ dmake is fully compatible with SYSV AUGMAKE, and supports the following
+ AUGMAKE features:
+
+ 1. GNU Make style include, and if/else/endif directives are
+ allowed in non-group recipes. Thus, the word include appear-
+ ing at the start of a line that is not part of a gruop recipe
+ will be mapped to the ".INCLUDE" directive that damke uses.
+ Similarly, the words ifeq,ifneq,elif,else, and endif are
+ mapped to their corresponding dmake equivalents.
+
+ 2. The macro modifier expression $(macro:str=sub) is understood
+ and is equivalent to the expression $(macro:s/str/sub), with
+ the restriction that str must match the following regular
+ expression:
+
+ str[ |\t][ |\t]*
+
+
+
+Dmake Version 4.12 2008-02-26 49
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ (ie. str only matches at the end of a token where str is a
+ suffix and is terminated by a space, a tab, or end of line)
+ Normally sub is expanded before the substitution is made, if
+ you specify -A on the command line then sub is not expanded.
+
+ 3. The macro % is defined to be $@ (ie. $% expands to the same
+ value as $@).
+
+ 4. The AUGMAKE notion of libraries is handled correctly.
+
+ 5. Directories are always made if you specify -A. This is con-
+ sistent with other UNIX versions of Make.
+
+ 6. Makefiles that utilize virtual targets to force making of
+ other targets work as expected if AUGMAKE special target han-
+ dling is enabled. For example:
+
+ FRC:
+ myprog.o : myprog.c $(FRC) ; ...
+
+ Works as expected if you issue the command
+
+ 'dmake -A FRC=FRC'
+
+ but fails with a 'don't know how to make FRC' error message
+ if you do not specify AUGMAKE special target handling via the
+ -A flag (or by setting AUGMAKE:=yes internally).
+
+LIMITS
+ In some environments the length of an argument string is restricted.
+ (e.g. MSDOS command line arguments cannot be longer than 128 bytes if
+ you are using the standard command.com command interpreter as your
+ shell, dmake text diversions may help in these situations.)
+
+PORTABILITY
+ To write makefiles that can be moved from one environment to another
+ requires some forethought. In particular you must define as macros all
+ those things that may be different in the new environment. dmake has
+ two facilities that help to support writing portable makefiles, recur-
+ sive macros and conditional expressions. The recursive macros, allow
+ one to define environment configurations that allow different environ-
+ ments for similar types of operating systems. For example the same
+ make script can be used for SYSV and BSD but with different macro defi-
+ nitions.
+
+ To write a makefile that is portable between UNIX and MSDOS requires
+ both features since in almost all cases you will need to define new
+ recipes for making targets. The recipes will probably be quite differ-
+ ent since the capabilities of the tools on each machine are different.
+ Different macros will be needed to help handle the smaller differences
+ in the two environments.
+
+FILES
+ Makefile, makefile, startup.mk (use dmake -V to tell you where the
+ startup file is)
+
+SEE ALSO
+ sh(1), csh(1), touch(1), f77(1), pc(1), cc(1)
+ S.I. Feldman Make - A Program for Maintaining Computer Programs
+
+AUTHOR
+ Dennis Vadura, dvadura@wticorp.com
+ Many thanks to Carl Seger for his helpful suggestions, and to Trevor
+ John Thompson for his many excellent ideas and informative bug reports.
+
+
+
+Dmake Version 4.12 2008-02-26 50
+
+
+
+
+
+DMAKE(1) DMAKE(1)
+
+
+ Many thanks also go to those on the NET that have helped in making
+ dmake one of the best Make tools available.
+
+BUGS
+ Some system commands return non-zero status inappropriately. Use -i
+ (`-' within the makefile) to overcome the difficulty.
+
+ Some systems do not have easily accessible time stamps for library mem-
+ bers (MSDOS, AMIGA, etc) for these dmake uses the time stamp of the
+ library instead and prints a warning the first time it does so. This
+ is almost always ok, except when multiple makefiles update a single
+ library file. In these instances it is possible to miss an update if
+ one is not careful.
+
+ This man page is way too long.
+
+WARNINGS
+ Rules supported by make(1) may not work if transitive closure is turned
+ off (-T, .NOINFER).
+
+ PWD from csh/ksh will cause problems if a cd operation is performed and
+ -e or -E option is used.
+
+ Using internal macros such as COMMAND, may wreak havoc if you don't
+ understand their functionality.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Dmake Version 4.12 2008-02-26 51
+
+
diff --git a/dmake/man/dmake.tf b/dmake/man/dmake.tf
new file mode 100644
index 000000000000..981d82fc0609
--- /dev/null
+++ b/dmake/man/dmake.tf
@@ -0,0 +1,3480 @@
+.\" Copyright (c) 1990,...,1995 Dennis Vadura, All rights reserved.
+.\"
+.\" You must use groff to format this man page!!!
+.\"
+.ds TB "0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.5i +0.5i +2.0i
+.de Ip
+.sp \\n[PD]u
+.nf
+.nr dmake-indent \w@\\$1 @u
+.IP "\\$1" \\n[dmake-indent]u
+\\$2
+..
+.de Is
+.nr dmake-indent \w@\\$1@u
+.nf
+..
+.de Ii
+.PD 0
+.IP "\\$1" \\n[dmake-indent]u
+.it 1 PD
+..
+.TH DMAKE 1 "2008-02-26" "Dmake Version 4.12"
+.SH NAME
+\fBdmake\fR \- maintain program groups, or interdependent files
+.SH SYNOPSIS
+.nh
+.B dmake
+[\-P#] [\-{f|C|K} file] [\-{w|W} target ...]
+[macro[[!][*][+][:]]=\fIvalue\fP ...]
+[\-ABcdeEghiknpqrsStTuVxX] [\-v[cdfimrtw]] [\-m[trae]] [target ...]
+.hy 14
+.SH DESCRIPTION
+.PP
+.B dmake
+is a re-implementation of the UNIX Make utility with significant enhancements.
+.B dmake
+executes commands found in an external file called a
+.I makefile
+to update one or more target names.
+Each target may depend on zero or more prerequisite targets.
+If any of the target's prerequisites is newer than the target or if the target
+itself does not exist, then
+.B dmake
+will attempt to make the target.
+.PP
+If no
+.B \-f
+command line option is present then
+.B dmake
+searches for an existing
+.I makefile
+from the list of prerequisites specified for the special target \fI.MAKEFILES\fR
+(see the STARTUP section for more details).
+If "\-" is the name of the file specified to the
+.B \-f
+flag then \fBdmake\fR uses standard input as the source of the makefile text.
+.PP
+Any macro definitions (arguments with embedded "="
+signs) that appear on the command line are processed first
+and supercede definitions for macros of the same name found
+within the makefile. In general it is impossible for definitions found
+inside the makefile to redefine a macro defined on the command line, see the
+MACROS section for exceptions.
+.PP
+If no
+.I target
+names are specified on the command line, then \fBdmake\fR uses the first
+non-special target found in the makefile as the default target.
+See the
+.B "SPECIAL TARGETS"
+section for the list of special targets and their function.
+Makefiles written for most previous
+versions of
+.I Make
+will be handled correctly by
+.B dmake.
+Known differences between \fBdmake\fR and other versions of make
+are discussed in the
+.B COMPATIBILITY
+section found at the end of this document.
+.B dmake
+returns 0 if no errors were detected and a non-zero result if an error
+occurred.
+.SH OPTIONS
+.IP "\fB\-A\fR"
+Enable AUGMAKE special inference rule transformations
+(see the "PERCENT(%) RULES" and "AUGMAKE META RULES" sections), these are
+set to off by default.
+.IP "\fB\-B\fR"
+Enable the use of spaces instead of <tabs> to begin recipe lines.
+This flag equivalent to the .NOTABS special macro and is further described
+below.
+.IP "\fB\-c\fR"
+Use non-standard comment stripping. If you specify \fB\-c\fP then
+.B dmake
+will treat any \fB#\fP character as a start of comment character wherever it
+may appear unless it is escaped by a \e.
+.IP "\fB\-C [+]file\fR"
+This option writes to \fIfile\fP a copy of standard output and
+standard error from any child processes and from the
+.B dmake
+process itself. If you specify a \fB+\fP prior to the file name then
+the text is appended to the previous contents of \fIfile\fP.
+This option is active in the MSDOS implementation only and is ignored
+by non-MSDOS versions of
+.B dmake.
+.IP "\fB\-d\fR"
+Disable the use of the directory cache. Normally \fBdmake\fP caches directories
+as it checks file timestamps. Giving this flag is equivalent to the
+\&.DIRCACHE attribute or macro being set to \fIno\fP.
+.IP "\fB\-E\fR"
+Read the environment and define all strings of the
+form '\fBENV\-VAR\fP=\fIevalue\fP'
+defined within as macros whose name is \fBENV\-VAR\fP,
+and whose value is '\fIevalue\fP'.
+The environment is processed prior to processing the user
+specified makefile thereby allowing definitions in the makefile to override
+definitions in the environment.
+.IP "\fB\-e\fR"
+Same as \-E, except that the environment is processed after the
+user specified makefile has been processed
+(thus definitions in the environment override definitions in the makefile).
+The \-e and \-E options are mutually exclusive.
+If both are given the latter takes effect.
+.IP "\fB\-f file\fR"
+Use \fBfile\fR as the source for the makefile text.
+Only one \fB\-f\fR option is allowed.
+.IP "\fB\-g\fR"
+Globally disable group recipe parsing, equivalent to the .IGNOREGROUP
+attribute or macro being set to \fIyes\fP at the start of the makefile.
+.IP "\fB\-h\fR"
+Print the command summary for \fBdmake\fR.
+.IP "\fB\-i\fR"
+Tells \fBdmake\fR to ignore errors, and continue making other targets.
+This is equivalent to the .IGNORE attribute or macro.
+.IP "\fB\-K file\fR"
+Turns on \fB.KEEP_STATE\fP state tracking and tells \fBdmake\fP to use
+\fIfile\fP as the state file.
+.IP "\fB\-k\fR"
+Causes \fBdmake\fR to ignore errors caused by command execution and to make
+all targets not depending on targets that could not be made.
+Ordinarily \fBdmake\fR stops after a command returns a non-zero status,
+specifying \fB\-k\fR causes \fBdmake\fR to ignore the error
+and continue to make as much as possible.
+.IP "\fB\-m[trae]\fR"
+Measure timing information. Print the time when targets and/or recipes
+are started and finished to stdout. The following format is used:
+.IP ""
+\fB{s|e} {target|recipe} time maketarget\fP
+.IP ""
+\fBs\fP or \fBe\fP stands for started or ended, \fBtarget\fP or
+\fBrecipe\fP denotes if this line refers to the whole target or a
+recipe. \fBtime\fP is displayed in Unix time format, i.e. the number
+of seconds since an epoch. (Since 1970-01-01T00:00:00Z). \fBmaketarget\fP
+obviously represents the target the timing information is given for.
+The optional flags \fB[trae]\fP can be used to change the information that
+is displayed. If no optional flags are given only the \fBt\fP flag
+is assumed to be selected, ie. \fB\-mt\fP. The optional flags stand for:
+.RS
+.IP "\fBt\fP"
+Display the start and end time of each target.
+.IP "\fBr\fP"
+Display the start and end time of each recipe.
+.IP "\fBa\fP"
+Display the target as an absolute path, i.e. prepend the current working
+directory.
+.IP "\fBe\fP"
+Also display the start and end time of the \fB$(shell command)\fP function
+(aka. shell escape) macros.
+.RE
+.IP "\fB\-n\fR"
+Causes \fBdmake\fR to print out what it would have executed,
+but does not actually execute the commands. A special check is made for
+the string "$(MAKE)" inside a recipe line, if it is found,
+the line is expanded and invoked, thereby enabling recursive makes to give a
+full description of all that they will do.
+This check is disabled inside group recipes.
+.IP "\fB\-p\fR"
+Print out a version of the digested makefile in human readable form.
+(useful for debugging, but cannot be re-read by \fBdmake\fP)
+.IP "\fB\-P#\fR"
+On systems that support multi-processing cause \fBdmake\fP to use \fI#\fP
+concurrent child processes to make targets.
+See the "MULTI PROCESSING" section for more information.
+.IP "\fB\-q\fR"
+Check and see if the target is up to date. Exits with code 0 if up to date,
+1 otherwise.
+.IP "\fB\-r\fR"
+Tells \fBdmake\fR not to read the initial startup makefile, see STARTUP
+section for more details.
+.IP "\fB\-s\fR"
+Tells \fBdmake\fR to do all its work silently and not echo the commands it is
+executing to stdout (also suppresses warnings).
+This is equivalent to the .SILENT attribute or macro.
+.IP "\fB\-S\fR"
+Force sequential execution of recipes on architectures which support
+concurrent makes. For backward compatibility with old makefiles that have
+nasty side-effect prerequisite dependencies. (Implies -P1)
+.IP "\fB\-t\fR"
+Causes \fBdmake\fR to touch the targets and bring them up to date
+without executing any commands.
+Note that targets will not be created if they do not already exist.
+.IP "\fB\-T\fR"
+Tells \fBdmake\fP to not perform transitive closure on the inference graph.
+.IP "\fB\-u\fR"
+Force an unconditional update. (ie. do everything that would
+be done if everything that a target depended on was out of date)
+.IP "\fB\-v[cdfimrtw]\fR"
+Verbose flag, when making targets print to stdout what we are going to make
+and what we think its time stamp is. The optional flags \fB[cdfimrtw]\fP can be
+used to restrict the information that is displayed. In the absence of any
+optional flags all are assumed to be given (ie. \fB\-v\fP is equivalent to
+\fB\-vcdfimrtw\fP). The meanings of the optional flags are:
+.RS
+.IP "\fBc\fP"
+Notify of directory cache operations only.
+.IP "\fBd\fP"
+Notify of change directory operations only.
+.IP "\fBf\fP"
+Notify of file I/O operations only.
+.IP "\fBi\fP"
+Notify of inference algorithm operation only.
+.IP "\fBm\fP"
+Notify of target update operations only.
+.IP "\fBr\fP"
+Force output of recipe lines, warnings and executed commands. This switch
+is usefull when debugging makefiles that disable the output using the @
+or @@ property for recipe lines or the .SILENT target/attribute.
+It also overrides the -s flag.
+.IP "\fBt\fP"
+Keep any temporary files created; normally they are automatically deleted.
+.IP "\fBw\fP"
+Notify of non-essential warnings (these are historical).
+.RE
+.IP "\fB\-V\fR"
+Print the version of \fBdmake\fR, and values of builtin macros.
+.IP "\fB\-W target\fR"
+Run \fBdmake\fP pretending that \fItarget\fP is out of date.
+.IP "\fB\-w target\fR"
+\fIWhat if?\fP Show what would be made if \fItarget\fP were out of date.
+.IP "\fB\-x\fR"
+Upon processing the user makefile export all non-internally defined macros
+to the user's environment. This option together with the \-e option
+allows SYSV AUGMAKE recursive makes to function as expected.
+.IP "\fB\-X\fR"
+Inhibit the execution of \fB#!\fP lines found at the beginning of a makefile.
+The use of this flag prevents non-termination of recursive make invocations.
+.SH INDEX
+Here is a list of the sections that follow and a short description of each.
+Perhaps you won't have to read the entire man page to find
+what you need.
+.IP \fBSTARTUP\fP 1.9i
+Describes \fBdmake\fP initialization.
+.IP \fBSYNTAX\fP 1.9i
+Describes the syntax of makefile expressions.
+.IP \fBATTRIBUTES\fP 1.9i
+Describes the notion of attributes and how they are used when
+making targets.
+.IP \fBMACROS\fP 1.9i
+Defining and expanding macros.
+.IP "\fBRULES AND TARGETS" 1.9i
+How to define targets and their prerequisites.
+.IP \fBRECIPES\fP 1.9i
+How to tell \fBdmake\fP how to make a target.
+.IP "\fBBUILTIN COMMANDS\fP" 1.9i
+Internal dmake commands.
+.IP "\fBTEXT DIVERSIONS\fP" 1.9i
+How to use text diversions in recipes and macro expansions.
+.IP "\fBVIRTUAL TARGETS\fP" 1.9i
+Targets that only enforce dependencies, but which can not create a target file.
+.IP "\fBSPECIAL TARGETS\fP" 1.9i
+Some targets are special.
+.IP "\fBSPECIAL MACROS\fP" 1.9i
+Macros used by \fBdmake\fP to alter the processing of the makefile,
+and those defined by \fBdmake\fP for the user.
+.IP "\fBCONTROL MACROS\fP" 1.9i
+Itemized list of special control macros.
+.IP "\fBRUNTIME MACROS\fP" 1.9i
+Discussion of special run-time macros such as $@ and $<.
+.IP "\fBFUNCTION MACROS\fP" 1.9i
+Description of functional macros.
+.IP "\fBCONDITIONAL MACROS\fP" 1.9i
+Target specific conditional macros.
+.IP "\fBDYNAMIC PREREQUISITES\fP" 1.9i
+Processing of prerequisites which contain macro expansions in their name.
+.IP "\fBBINDING TARGETS\fP" 1.9i
+The rules that \fBdmake\fP uses to bind
+a target to an existing file in the file system.
+.IP "\fBPERCENT(%) RULES\fP" 1.9i
+Specification of recipes to be used by the inference algorithm.
+.IP "\fBMAKING INFERENCES\fP" 1.9i
+The rules that \fBdmake\fP uses when inferring how to make a target which
+has no explicit recipe. This and the previous section are really a single
+section in the text.
+.IP "\fBAUGMAKE META RULES\fP" 1.9i
+A subclass of the \fBPERCENT(%) RULES\fP.
+.IP "\fBMAKING TARGETS\fP" 1.9i
+How \fBdmake\fP makes targets other than libraries.
+.IP "\fBMAKING LIBRARIES\fP" 1.9i
+How \fBdmake\fP makes libraries.
+.IP "\fBKEEP STATE\fP" 1.9i
+A discussion of how .KEEP_STATE works.
+.IP "\fBMULTI PROCESSING\fP" 1.9i
+Discussion of \fBdmake's\fP parallel make facilities for architectures that
+support them.
+.IP "\fBCONDITIONALS\fP" 1.9i
+Conditional expressions which control the processing of the makefile.
+.IP "\fBEXAMPLES\fP" 1.9i
+Some hopefully useful examples.
+.IP "\fBCOMPATIBILITY\fP" 1.9i
+How \fBdmake\fP compares with previous versions of make.
+.IP "\fBLIMITS\fP" 1.9i
+Limitations of \fBdmake\fP.
+.IP \fBPORTABILITY\fP 1.9i
+Comments on writing portable makefiles.
+.IP \fBFILES\fP 1.9i
+Files used by \fBdmake\fP.
+.IP "\fBSEE ALSO\fP" 1.9i
+Other related programs, and man pages.
+.IP "\fBAUTHOR\fP" 1.9i
+The guy responsible for this thing.
+.IP \fBBUGS\fP 1.9i
+Hope not.
+.SH STARTUP
+When
+.B dmake
+begins execution it first processes the command line and then processes
+an initial startup-makefile.
+This is followed by an attempt to locate and process a user supplied makefile.
+The startup file defines the default values of all required control macros
+and the set of default rules for making targets and inferences.
+When searching for the startup makefile,
+.B dmake
+searches the following locations, in the order specified,
+until a startup file is located:
+.LP
+.RS
+.IP 1.
+The location given as the value of the macro
+MAKESTARTUP defined on the command line.
+.IP 2.
+The location given as the value of the environment variable MAKESTARTUP
+defined in the current environment.
+.IP 3.
+The location given as the value of the macro
+MAKESTARTUP defined internally within \fBdmake\fP. In this version, the
+internal definition of MAKESTARTUP is "$(DMAKEROOT)/startup.mk", so you
+can set the environment variable DMAKEROOT to the location of your startup
+directory.
+.sp
+If DMAKEROOT is not changed, for native Windows dmake versions its value
+defaults to "$(ABSMAKECMD:d)startup" (see definition of ABSMAKECMD for
+details).
+For unix like versions build with the autotools build system it defaults
+to the value of "${prefix}/share/startup" at build time. The actual value,
+usually something like /usr/local/share/startup can be checked with the \-V
+command line switch.
+.RE
+.LP
+The above search is disabled by specifying the \-r option on the command line.
+An error is issued if a startup makefile cannot be found and the \-r
+option was not specified.
+A user may substitute a custom startup file by defining
+the MAKESTARTUP environment variable or by redefining the
+MAKESTARTUP macro on the command line.
+To determine where
+.B dmake
+looks for the default startup file, check your environment or issue the command
+\fI"dmake \-V"\fP.
+.PP
+A similar search is performed to locate a default user makefile when no
+\fB\-f\fP command line option is specified.
+By default, the prerequisite list of the special target .MAKEFILES
+specifies the names of possible makefiles and the search order that
+\fBdmake\fP should use to determine if one exists.
+A typical definition for this target is:
+.RS
+.sp
+\&.MAKEFILES : makefile.mk Makefile makefile
+.sp
+.RE
+\fBdmake\fP will first look for makefile.mk and then the others.
+If a prerequisite
+cannot be found \fBdmake\fP will try to make it before going on to the next
+prerequisite. For example, makefile.mk can be checked out of an RCS file
+if the proper rules for doing so are defined in the startup file.
+.PP
+If the first line of the user makefile is of the form:
+.RS
+.sp
+#!command command_args
+.sp
+.RE
+then \fBdmake\fP will expand and run the command prior to reading any
+additional input. If the return code of the command is zero then \fBdmake\fP
+will continue on to process the remainder of the user makefile, if the return
+code is non-zero then dmake will exit.
+.PP
+\fBdmake\fP builds the internal dependency graph as it parses a user specified
+makefile. The graph is rooted at the special target \fB.ROOT\fP. .ROOT is the
+top level target that dmake builds when it starts to build targets. All user
+specified targets (those from the command line or taken as defaults from
+the makefile) are made prerequisites of the special target \fB.TARGETS\fP.
+\fBdmake\fP by default creates the relationship that .ROOT depends on .TARGETS
+and as a result everything is made. This approach allows the user to customize, within
+their makefile, the order and which, target, is built first. For example the
+default makefiles come with settings for .ROOT that specify:
+.sp
+.RS
+\&.ROOT .PHONY .NOSTATE .SEQUENTIAL : .INIT .TARGETS .DONE
+.RE
+.sp
+with .INIT and .DONE defined as:
+.sp
+.RS
+\&.INIT .DONE .PHONY:;
+.RE
+.sp
+which nicely emulates the behaviour of Sun's make extensions. The building of
+\&.ROOT's prerequisites is always forced to be sequential. However, this
+definition is trivially changed by supplying the definition:
+.sp
+.RS
+\&.ROOT : .TARGETS
+.RE
+.sp
+which skips the preamble and postamble phases of building .TARGETS.
+.PP
+.B Please note
+that even though .INIT and .DONE are special exceptions, see section SPECIAL
+TARGETS, the use of self defined targets starting with `.' should be avoided
+as they would be handled as .<suffix> meta targets. The target names _INIT
+and _DONE for example would work equally well without the .<suffix>
+drawback.
+.SH SYNTAX
+This section is a summary of the syntax of makefile statements.
+The description is given in a style similar to BNF, where { } enclose
+items that may appear zero or more times, and [ ] enclose items that
+are optional. Alternative productions for a left hand side are indicated
+by '\(->', and newlines are significant. All symbols in \fBbold\fP type
+are text or names representing text supplied by the user.
+.sp 2
+.RS
+.Ip "Makefile" "\(-> { Statement }"
+.Ip "Statement" "\(-> Macro-Definition"
+\(-> Conditional-Macro-Definition
+\(-> Conditional
+\(-> Rule-Definition
+\(-> Attribute-Definition
+.Ip "Macro-Definition" "\(-> \fBMACRO = LINE\fP"
+\(-> \fBMACRO [\fB!\fR]*= LINE\fP
+\(-> \fBMACRO [\fB!\fR]:= LINE\fP
+\(-> \fBMACRO [\fB!\fR]*:= LINE\fP
+\(-> \fBMACRO [\fB!\fR]+= LINE\fP
+\(-> \fBMACRO [\fB!\fR]+:= LINE\fP
+.Ip "Conditional-Macro-Definition \(-> " "\fBTARGET\fP ?= Macro-Definition"
+.Ip "Conditional \(-> " "\fB\&.IF\fR expression"
+ Makefile
+[ \fB.ELIF\fR expression
+ Makefile ]
+[ \fB.ELSE\fR
+ Makefile ]
+\fB\&.END\fR
+.Ip "expression" "\(-> \fBLINE\fR"
+\(-> \fBSTRING\fR
+\(-> expression \fB==\fR expression
+\(-> expression \fB!=\fR expression
+\(-> expression \fB<=\fR expression
+\(-> expression \fB>=\fR expression
+\(-> \fB(\fR expression \fB)\fR
+\(-> expression \fB||\fR expression
+\(-> expression \fB&&\fR expression
+.Ip "Rule-Definition \(-> " "target-definition"
+ [ recipe ]
+.PP
+target-definition \(-> targets [attrs] op { \fBPREREQUISITE\fP } [\fB;\fR rcp-line]
+.Ip "targets" "\(-> target { targets }"
+\(-> \fB"\fRtarget\fB"\fR { targets }
+.Ip "target" "\(-> special-target"
+\(-> \fBTARGET\fR
+.Ip "attrs" "\(-> attribute { attrs }"
+\(-> \fB"\fRattribute\fB"\fR { attrs }
+.Ip "op" "\(-> \fB:\fR { modifier }"
+.Ip "modifier" "\(-> \fB:\fR"
+\(-> \fB^\fR
+\(-> \fB!\fR
+\(-> \fB\-\fR
+\(-> \fB|\fR
+.Ip "recipe" "\(-> { \fBTAB\fR rcp-line }"
+\(-> [\fB@\fR[\fB@\fR]][\fB%\fR][\fB\-\fR] \fB[
+.Is "recipe \(-> "
+.Ii " "
+ \fR{ \fBLINE\fR }
+.Ii " "
+\fB]\fR
+.Ip "rcp-line" "\(-> [\fB@\fR[\fB@\fR]][\fB%\fR][\fB\-\fR][\fB+\fR] \fBLINE\fR"
+.Ip Attribute-Definition "\(-> attrs \fB:\fR targets"
+.Ip attribute "\(-> \fB.EPILOG\fR"
+\(-> \fB.ERRREMOVE\fR
+\(-> \fB.EXECUTE\fR
+\(-> \fB.GROUP\fR
+\(-> \fB.IGNORE\fR
+\(-> \fB.IGNOREGROUP\fR
+\(-> \fB.LIBRARY\fR
+\(-> \fB.MKSARGS\fR
+\(-> \fB.NOINFER\fR
+\(-> \fB.NOSTATE\fR
+\(-> \fB.PHONY\fR
+\(-> \fB.PRECIOUS\fR
+\(-> \fB.PROLOG\fR
+\(-> \fB.SETDIR=\fIpath\fP\fR
+\(-> \fB.SILENT\fR
+\(-> \fB.SEQUENTIAL\fR
+\(-> \fB.SWAP\fR
+\(-> \fB.USESHELL\fR
+\(-> \fB.SYMBOL\fR
+\(-> \fB.UPDATEALL\fR
+\(-> \fB.WINPATH\fR
+.Ip "special-target" "\(-> \fB.ERROR\fR"
+\(-> \fB.EXIT\fR
+\(-> \fB.EXPORT\fR
+\(-> \fB.GROUPEPILOG\fR
+\(-> \fB.GROUPPROLOG\fR
+\(-> \fB.IMPORT\fR
+\(-> \fB.INCLUDE\fR
+\(-> \fB.INCLUDEDIRS\fR
+\(-> \fB.MAKEFILES\fR
+\(-> \fB.REMOVE\fR
+\(-> \fB.ROOT\fR
+\(-> \fB.SOURCE\fR
+\(-> \fB.SOURCE.\fIsuffix\fR
+\(-> \fB.SUFFIXES (deprecated)\fR
+\(-> \fB.TARGETS\fR
+\(-> \fB.INIT\fR
+\(-> \fB.DONE\fR
+\(-> .\fIsuffix\fR
+\(-> .\fIsuffix1\fR.\fIsuffix2\fR
+.fi
+.RE
+.sp 1
+.PP
+Where, \fBTAB\fP represents a <tab> character, \fBSTRING\fP represents an
+arbitrary sequence of characters, and
+\fBLINE\fP represents a
+possibly empty sequence of characters terminated by a non-escaped
+(not immediately preceded by a backslash '\e') new-line character.
+\fBMACRO\fP, \fBPREREQUISITE\fP,
+and \fBTARGET\fP each represent a string of characters not
+including space or tab which respectively form the name of a macro,
+prerequisite or target.
+The name may itself be a macro expansion expression.
+A \fBLINE\fP can be continued over several physical lines by terminating it with
+a single backslash character. Comments are initiated by the
+pound \fB#\fR character and extend to the end of line.
+All comment text is discarded, a '#' may be placed into the makefile text
+by escaping it with '\e' (ie. \e# translates to # when it is parsed).
+An exception to this occurs when a # is seen inside
+a recipe line that begins with a <tab> or is inside a group recipe.
+If you specify the \fB\-c\fP command line switch then this behavior is
+disabled and
+.B dmake
+will treat all # characters as start of comment indicators unless they
+are escaped by \e.
+A set of continued lines may be commented out by placing a single # at the
+start of the first line.
+A continued line cannot span more than one makefile.
+.PP
+\fBwhite space\fP is defined to be any combination of
+<space>, <tab>, and the sequence \e<nl> when \e<nl> is used to terminate a
+LINE. \fBNote\fP the special treatment of \e<nl> in macro definion and recipe
+lines below.
+When processing \fBmacro definition\fP lines,
+any amount of white space is allowed on either side of the macro operator
+and white space is stripped from both before and after the macro
+value string. A \e<nl> sequence in a macro definition is deleted from the
+macro value before assigning this value.
+During \fBrecipe expansion\fP the sequence \e<nl> is treated as white space
+but is deleted from the final recipe string.
+You must escape the \e<nl> with another \e in order to get a \e at the end
+of a recipe or macro definition line.
+.PP
+When processing \fBtarget\fP definition lines,
+the recipe for a target must, in general, follow the first definition
+of the target (See the RULES AND TARGETS section for an exception), and
+the recipe may not span across multiple makefiles.
+Any targets and prerequisites found on a target definition line are taken
+to be white space separated tokens.
+The rule operator (\fIop\fP in SYNTAX section) is also considered
+to be a token but does not require
+white space to precede or follow it. Since the rule operator begins with a `:',
+traditional versions of make do not allow the `:' character to
+form a valid target name. \fBdmake\fP allows `:' to be present in
+target/prerequisite names as long as the entire target/prerequisite name is
+quoted. For example:
+.sp
+\ta:fred : test
+.sp
+would be parsed as TARGET = a, PREREQUISITES={fred, :, test}, which
+is not what was intended. To fix this you must write:
+.sp
+\t"a:fred" : test
+.sp
+Which will be parsed as expected. Quoted target and prerequisite
+specifications may also contain white space thereby allowing the use of
+complex function macro expressions..
+See the EXAMPLES section for how to apply \fB"\fP quoting
+to a list of targets.
+.SH ATTRIBUTES
+.B dmake
+defines several target attributes. Attributes may be
+assigned to a single target, a group of targets, or to all targets in the
+makefile. Attributes are used to modify
+\fBdmake\fP actions during target update.
+The recognized attributes are:
+.sp
+.IP \fB.EPILOG\fP 1.2i
+Insert shell epilog code when executing a group recipe associated with
+any target having this attribute set.
+.IP \fB.ERRREMOVE\fP 1.2i
+Always remove any target having this attribute if an error is encountered
+while making them. Setting this attribute overrides the .PRECIOUS attribute.
+.IP \fB.EXECUTE\fP 1.2i
+If the \-n flag was given then execute the recipe associated with any
+target having this attribute set.
+.IP \fB.FIRST\fP 1.2i
+Used in conjunction with .INCLUDE. Terminates the inclusion with the first
+successfully included prerequisite.
+.IP \fB.GROUP\fP 1.2i
+Force execution of a target's recipe as a group recipe.
+.IP \fB.IGNORE\fP 1.2i
+Ignore an error when trying to make any target with this attribute set.
+.IP \fB.IGNOREGROUP\fP 1.2i
+Disable the special meaning of '[' to initiate a group recipe.
+.IP \fB.LIBRARY\fP 1.2i
+Target is a library.
+.IP \fB.MKSARGS\fP 1.2i
+If running in an MSDOS environment then use MKS extended argument passing
+conventions to pass arguments to commands. Non-MSDOS
+environments ignore this attribute.
+.IP \fB.NOINFER\fP 1.2i
+Any target with this attribute set will not be subjected
+to transitive closure if it is inferred as a prerequisite
+of a target whose recipe and prerequisites are being inferred.
+(i.e. the inference algorithm will not use any prerequisite with this attribute
+set, as a target)
+If specified as '.NOINFER:' (ie. with no prerequisites or targets) then the
+effect is equivalent to specifying \fB\-T\fP on the command line.
+.IP \fB.NOSTATE\fP 1.2i
+Any target with this attribute set will not have command line flag
+information stored in the state file if .KEEP_STATE has been enabled.
+.IP \fB.PHONY\fP 1.2i
+Any target with this attribute set will have its recipe executed
+each time the target is made even if a file matching the target name can
+be located. Any targets that have a .PHONY attributed target as a
+prerequisite will be made each time the .PHONY attributed prerequisite is
+made.
+.IP \fB.PRECIOUS\fP 1.2i
+Do not remove associated target under any circumstances.
+Set by default for any targets whose corresponding files exist in the file
+system prior to the execution of \fBdmake\fP.
+.IP \fB.PROLOG\fP 1.2i
+Insert shell prolog code when executing a group recipe associated with
+any target having this attribute set.
+.IP \fB.SEQUENTIAL\fP 1.2i
+Force a sequential make of the associated target's prerequisites. If set
+as a global attribute this implies setting MAXPROCESS=1.
+.IP \fB.SETDIR\fP 1.2i
+Change current working directory to specified directory when making the
+associated target. You must
+specify the directory at the time the attribute is specified. To do this
+simply give \fI.SETDIR=path\fP as the attribute. \fIpath\fP is expanded and
+the result is used as the value of the directory to change to.
+If \fIpath\fP contains \fB$$@\fP then the name of the target to be built is
+used in computing the path to change directory to.
+If path is surrounded by single quotes then path is not expanded, and is used
+literally as the directory name.
+If the \fIpath\fP contains any `:' characters then the entire attribute string
+must be quoted using ".
+If a target having this attribute set also has the .IGNORE
+attribute set then if the change to the specified directory fails it will be
+ignored, and no error message will be issued.
+.IP \fB.SILENT\fP 1.2i
+Do not echo the recipe lines when making any target with this attribute set,
+and do not issue any warnings.
+.IP \fB.SWAP\fP 1.2i
+Under MSDOS
+when making a target with this attribute set swap the \fBdmake\fP executable
+to disk prior to executing the recipe line. Also see the '%' recipe line
+flag defined in the RECIPES section.
+.IP \fB.SYMBOL\fP 1.2i
+Target is a library member and is an entry point into a module in the
+library. This attribute is used only when searching a library for a target.
+Targets of the form lib((entry)) have this attribute set automatically.
+.IP \fB.USESHELL\fP 1.2i
+Force each recipe line of a target to be executed using a shell.
+Specifying this attribute is equivalent to specifying the '+' character at the
+start of each line of a non-group recipe.
+.IP \fB.UPDATEALL\fP 1.2i
+Indicates that all the targets listed in this rule are updated by the
+execution of the accompanying recipe.
+A common example is the production of the
+.I y.tab.c
+and
+.I y.tab.h
+files by
+.B yacc
+when it is run on a grammar. Specifying .UPDATEALL in such a rule
+prevents the running of yacc twice, once for the y.tab.c file and once
+for the y.tab.h file. .UPDATEALL targets that are specified in a single rule
+are treated as a single target and all timestamps are updated whenever any
+target in the set is made. As a side-effect, \fBdmake\fP internally sorts
+such targets in ascending alphabetical order and the value of $@ is always
+the first target in the sorted set.
+.IP \fB.WINPATH\fP 1.2i
+Switch between default (POSIX) and Windows style path representation.
+(This attribute is specific for cygwin dmake executables and non-cygwin
+environments ignore this attribute.)
+.sp
+Under Cygwin it can be useful to generate Windows style paths (with
+regular slashes) instead of the default cygwin style (POSIX) paths
+for dmake's dynamic macros.
+The affected macros are $@, $*, $>, $?, $<, $&, $^ and $(MAKEDIR), $(PWD),
+$(TMD), $(TMPFILE) and the $(mktmp ...) function macro.
+This feature can be used to create DOS style path parameters
+for native W32 programs from dynamic macros.
+.sp
+\fBNote\fP that the Windows style paths use regular slashes ('/') instead
+of the usual Windows backslash ('\\') as directory separator to avoid quoting
+problems (after all it is still a cygwin \fBdmake\fP!) and cygwin, as well
+as native Windows, programs should have no problems using this (c:/foo/bar)
+path representation.
+.sp
+Example: Assuming the current target to be /tmp/mytarget the $@ macro
+without .WINPATH active expands to:
+.RS
+.sp
+.RS
+/tmp/mytarget
+.sp
+.RE
+With .WINPATH set it expands to:
+.sp
+.RS
+C:/cygwin/tmp/mytarget
+.RE
+.RE
+.LP
+All attributes are user setable and except for .UPDATEALL and .MKSARGS
+may be used in one of two forms.
+The .MKSARGS attribute is restricted to use as a global attribute, and
+the use of the .UPDATEALL attribute is restricted to rules
+of the second form only.
+.sp
+\tATTRIBUTE_LIST : \fItargets\fP
+.sp
+assigns the attributes specified by ATTRIBUTE_LIST to each target in
+.I targets
+or
+.sp
+\t\fItargets\fP ATTRIBUTE_LIST : ...
+.sp
+assigns the attributes specified by ATTRIBUTE_LIST to each target in
+.I targets.
+In the first form if
+.I targets
+is empty (ie. a NULL list), then the
+list of attributes will apply to all targets in the makefile
+(this is equivalent to the common Make construct of \fI".IGNORE :"\fP
+but has been modified to the notion of an attribute instead of
+a special target).
+Not all of the attributes have global meaning.
+In particular, .LIBRARY, .NOSTATE, .PHONY, .SETDIR, .SYMBOL and .UPDATEALL
+have no assigned global meaning.
+.PP
+Any attribute may be used with any target, even with the special targets.
+Some combinations are useless (e.g. .INCLUDE .PRECIOUS: ... ),
+while others are useful (e.g. .INCLUDE .IGNORE : "file.mk" will not complain
+if file.mk cannot be found using the include file search rules,
+see the section on SPECIAL TARGETS for a description of .INCLUDE).
+If a specified attribute will not be used with the special target a warning
+is issued and the attribute is ignored.
+.SH MACROS
+.B dmake
+supports six forms of macro assignment.
+.sp
+.IP "\fBMACRO = LINE\fP" 1.55i
+This is the most common and familiar form of macro assignment. It assigns
+LINE literally as the value of MACRO.
+Future expansions of MACRO recursively expand its value.
+.IP "\fBMACRO *= LINE\fP" 1.55i
+This form behaves exactly as the simple '=' form with the exception that if
+MACRO already has a value then the assignment is not performed.
+.IP "\fBMACRO := LINE\fP" 1.55i
+This form differs from the simple '=' form in that it expands LINE
+prior to assigning it as the value of MACRO.
+Future expansions of MACRO do not recursively expand its value.
+.IP "\fBMACRO *:= LINE\fP" 1.55i
+This form behaves exactly as the ':=' form with the exception that if
+MACRO already has a value then the assignment and expansion are not performed.
+.IP "\fBMACRO += LINE\fP" 1.55i
+This form of macro assignment allows macro values to grow. It takes the
+literal value of LINE and appends it to the previous value of MACRO separating
+the two by a single space.
+Future expansions of MACRO recursively expand its value.
+.IP "\fBMACRO +:= LINE\fP" 1.55i
+This form is similar to the '+=' form except that the value of LINE is expanded
+prior to being added to the value of MACRO.
+.PP
+Macro expressions specified on the command line allow the macro value
+to be redefined within the makefile only if the macro is defined using
+the '+=' and '+:=' operators. Other operators will define a macro that cannot
+be further modified.
+.PP
+Each of the preceeding macro assignment operators may be prefixed by \fB!\fP
+to indicate that the assignment should be forced and that no warnings should
+be issued. Thus, specifying \fB!\fP has the effect of silently forcing the
+specified macro assignment.
+.PP
+When \fBdmake\fP defines a non-environment macro it strips leading and
+trailing white space from the macro value.
+Macros imported from the environment via either the .IMPORT special
+target (see the SPECIAL TARGETS section), or the \fB\-e\fP, or \fB\-E\fP flags
+are an exception to this rule. Their values are
+always taken literally and white space is never stripped.
+In addition, named macros defined using the .IMPORT special target do
+not have their values expanded when they are used within a makefile.
+In contrast, environment macros that are imported
+due to the specification of the \fB\-e\fP or \fB\-E\fP flags
+are subject to expansion when used.
+.PP
+To specify a macro expansion
+enclose the name in () or {} and precede it with a dollar sign $.
+Thus $(TEST) represents an expansion of the macro variable named TEST.
+If TEST is
+defined then $(TEST) is replaced by its expanded value. If TEST is not
+defined then $(TEST) expands to the NULL string (this is equivalent to
+defining a macro as 'TEST=' ). A short form may be used for single character
+named macros. In this case the parentheses are optional, and $(I) is
+equivalent to $I.
+Macro expansion is recursive, hence, if the value string contains an expression
+representing a macro expansion, the expansion is performed. Circular macro
+expansions are detected and cause an error to be issued.
+.PP
+When defining a macro the given macro name is first expanded before being used
+to define the macro. Thus it is possible to define macros whose names
+depend on values of other macros. For example, suppose CWD is defined as
+.sp
+\tCWD = $(PWD:b)
+.sp
+then the value of $(CWD) is the name of the current directory.
+This can be used to define macros specific to this directory, for
+example:
+.sp
+\t_$(CWD).prt = list of files to print...
+.sp
+The actual name of the defined macro is a function of the current directory.
+A construct such as this is useful when processing a hierarchy of directories
+using .SETDIR attributed targets and a collection of small distributed
+makefile stubs.
+.PP
+Macro variables may be defined within the makefile, on the command
+line, or imported from the environment.
+.PP
+.B \fBdmake\fR
+supports several non-standard macro expansions:
+The first is of the form:
+.RS
+.IP \fI$(macro_name:modifier_list:modifier_list:...)\fR
+.RE
+.LP
+where
+.I modifier_list
+may be a combination of:
+.RS
+.sp
+.Is "b or B "
+.Ii "b or B"
+\- file (not including suffix) portion of path names
+.Ii "d or D"
+\- directory portion of all path names
+.Ii "e or E"
+\- suffix portion of path names
+.Ii "f or F"
+\- file (including suffix) portion of path names
+.Ii "i or I"
+\- inferred names of targets
+.Ii "n or N"
+\- normalized path names
+.Ii "l or L"
+\- macro value in lower case
+.Ii "u or U"
+\- macro value in upper case
+.Ii "1"
+\- return the first white space separated token from value
+.RE
+.sp
+or a single one of:
+.RS
+.sp
+.Ii "m or M"
+\- map escape codes found in macro to their ASCII value
+.Ii "s or S"
+\- simple pattern substitution
+.Ii "t or T"
+\- tokenization.
+.Ii "^"
+\- prepend a prefix to each token
+.Ii "+"
+\- append a suffix to each token
+.sp
+.RE
+.fi
+Thus if we have the example:
+.RS
+test = d1/d2/d3/a.out f.out d1/k.out
+.RE
+The following macro expansions produce the values on the right of '\(->' after
+expansion.
+.RS
+.sp
+.Is "$(test:s/out/in/:f) "
+.Ii "$(test:d)"
+\(-> d1/d2/d3/ d1/
+.Ii "$(test:b)"
+\(-> a f k
+.Ii "$(test:f)"
+\(-> a.out f.out k.out
+.Ii "${test:db}"
+\(-> d1/d2/d3/a f d1/k
+.Ii "${test:s/out/in/:f}"
+\(-> a.in f.in k.in
+.Ii $(test:f:t"+")
+\(-> a.out+f.out+k.out
+.Ii $(test:e)
+\(-> .out .out .out
+.Ii $(test:u)
+\(-> D1/D2/D3/A.OUT F.OUT D1/K.OUT
+.Ii $(test:1)
+\(-> d1/d2/d3/a.out
+.RE
+.fi
+.PP
+For this macro
+.RS
+test = d1/d2/../a.out "d1/file name.ext"
+.RE
+the following results are returned:
+.RS
+.sp
+.Is "$(test:s/out/in/:f) "
+.Ii "$(test:n)"
+\(-> d1/a.out "d1/file name.ext"
+.RE
+.fi
+.PP
+If a token ends in a string composed from the value of the macro DIRBRKSTR
+(ie. ends in a directory separator string, e.g. '/' in UNIX) and you use the
+\fB:d\fP modifier then the expansion returns the directory name less the
+final directory separator string. Thus successive pairs of :d modifiers
+each remove a level of directory in the token string.
+.PP
+The infered names of targets \fB:i\fP modifier returnes the actual filename
+associated to the target, see BINDING TARGETS. If the value is not a target or
+prerequisite the value is returned unchanged. For the following example:
+.RS
+test = aprog bprog
+.RE
+If aprog and bprog are targets or prerequisits and they are bound
+to /tmp/aprog and bprog (see .SOURCE special target) the macro expansion
+has the following effect:
+.RS
+.sp
+.Is "$(test:s/out/in/:f) "
+.Ii "$(test:i)"
+\(-> /tmp/aprog bprog
+.RE
+.fi
+.PP
+The normalized path names \fB:n\fP modifier honors the setting of .WINPATH to
+determine the output format of the result.
+.PP
+The map escape codes modifier changes the following escape codes \ea => <bel>,
+\&\eb => <backspace>, \ef => <formfeed>, \en => <nl>, \er => <cr>,
+\&\et => <tab>, \ev => <vertical tab>, \e" => ", and \exxx => <xxx> where
+xxx is the octal representation of a character into the corresponding ASCII
+value.
+.PP
+The tokenization, prepend and append modifier may use the same escape codes
+that are supported by the map escape codes modifier in the string that is
+inserted, prepended or added by the respective macro modifier.
+These modifiers may quote this string to include otherwise problematic
+characters. E.g. spaces, colons and parentheses.
+.PP
+The tokenization modifier takes all white space separated tokens from the
+macro value and separates them by the separator string. Thus the
+expansion:
+.LP
+.RS
+.nf
+$(test:f:t"+\en")
+.RE
+produces:
+.RS
+a.out+
+f.out+
+k.out
+.fi
+.RE
+.PP
+The prefix operator \fB^\fP takes all white space separated tokens from the
+macro value and prepends \fIstring\fP to each.
+.LP
+.RS
+.nf
+$(test:f:^mydir/)
+.RE
+produces:
+.RS
+mydir/a.out mydir/f.out mydir/k.out
+.fi
+.RE
+.PP
+The suffix operator \fB+\fP takes all white space separated tokens from the
+macro value and appends \fIstring\fP to each.
+.LP
+.RS
+.nf
+$(test:b:+.c)
+.RE
+produces:
+.RS
+a.c f.c k.c
+.fi
+.RE
+.PP
+The next non-standard form of macro expansion allows for recursive macros.
+It is possible to specify a $(\fImacro_name\fR) or ${\fImacro_name\fR} expansion
+where \fImacro_name\fR contains more $( ... ) or ${ ... } macro expansions
+itself.
+.PP
+For example $(CC$(_HOST)$(_COMPILER)) will first expand CC$(_HOST)$(_COMPILER)
+to get a result and use that result as the name of the macro to expand.
+This is useful for writing a makefile for more than one target
+environment. As an example consider the following hypothetical case.
+Suppose that _HOST and _COMPILER are imported from the environment
+and are set to represent the host machine type and the host compiler
+respectively.
+.RS
+.sp
+.nf
+CFLAGS_VAX_CC = \-c \-O # _HOST == "_VAX", _COMPILER == "_CC"
+CFLAGS_PC_MSC = \-c \-ML # _HOST == "_PC", _COMPILER == "_MSC"
+.sp
+# redefine CFLAGS macro as:
+.sp
+CFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
+.fi
+.sp
+.RE
+This causes CFLAGS to take on a value that corresponds to the
+environment in which the make is being invoked.
+.PP
+The final non-standard macro expansion is of the form:
+.RS
+.sp
+string1{token_list}string2
+.RE
+.LP
+where string1, string2 and token_list are expanded. After expansion,
+string1 is prepended to each token found in token_list and
+string2 is appended to each resulting token from the previous prepend.
+string1 and string2 are not delimited by white space
+whereas the tokens in token_list are.
+A null token in the token list
+is specified using "".
+Thus using another example we have:
+.RS
+.sp
+.Is "test/{f1 f2}.o "
+.Ii "test/{f1 f2}.o"
+--> test/f1.o test/f2.o
+.Ii "test/ {f1 f2}.o"
+--> test/ f1.o f2.o
+.Ii "test/{f1 f2} .o"
+--> test/f1 test/f2 .o
+.Ii "test/{""f1"" """"}.o"
+--> test/f1.o test/.o
+.sp
+.Ii and
+.sp
+.Is "test/{d1 d2}/{f1 f2}.o --> "
+.Ii "test/{d1 d2}/{f1 f2}.o --> "
+test/d1/f1.o test/d1/f2.o
+test/d2/f1.o test/d2/f2.o
+.sp
+.RE
+.fi
+This last expansion is activated only when the first characters of
+\fItoken_list\fP
+appear immediately after the opening '{' with no intervening white space.
+The reason for this restriction is the following incompatibility with
+Bourne Shell recipes. The line
+.RS
+.sp
+{ echo hello;}
+.sp
+.RE
+is valid /bin/sh syntax; while
+.RS
+.sp
+{echo hello;}
+.sp
+.RE
+.fi
+is not. Hence the latter triggers the enhanced macro expansion while the former
+causes it to be suppressed.
+See the SPECIAL MACROS section for a description of the special macros that
+\fBdmake\fP defines and understands.
+.SH "RULES AND TARGETS"
+A makefile contains a series of entries that specify dependencies.
+Such entries are called \fItarget/prerequisite\fP or \fIrule\fP definitions.
+Each rule definition
+is optionally followed by a set of lines that provide a recipe for updating
+any targets defined by the rule.
+Whenever
+.B dmake
+attempts to bring a target up to date and an explicit recipe is provided with
+a rule defining the target, that recipe is used to update the
+target. A rule definition begins with a line having the following syntax:
+.sp
+.RS
+.nf
+\fI<targets>\fP [\fI<attributes>\fP] \fI<ruleop>\fP [\fI<prerequisites>\fP] [;\fI<recipe>\fP]
+.fi
+.RE
+.sp
+.I targets
+is a non-empty list of targets. If the target is a
+special target (see SPECIAL TARGETS section below) then it must appear alone
+on the rule line. For example:
+.sp
+.RS
+\&.IMPORT .ERROR : ...
+.RE
+.sp
+is not allowed since both .IMPORT and .ERROR are special targets.
+Special targets are not used in the construction of the dependency graph and
+will not be made.
+.PP
+.I attributes
+is a possibly empty list of attributes. Any attribute defined in the
+ATTRIBUTES section above may be specified. All attributes will be applied to
+the list of named targets in the rule definition. No other targets will
+be affected.
+.sp
+.IP NOTE: 0.75i
+As stated earlier,
+if both the target list and prerequisite list are empty but the attributes
+list is not, then the specified attributes affect all targets in the makefile.
+.sp
+.PP
+.I ruleop
+is a separator which is used to identify the targets from the prerequisites.
+Optionally it also provides a facility for modifying the way in which
+.B dmake
+handles the making of the associated targets.
+In its simplest form the operator is a single ':', and need not be separated
+by white space from its neighboring tokens. It may additionally be followed
+by any of the modifiers { !, ^, \-, :, | }, where:
+.sp
+.IP \fB!\fP
+says execute the recipe for the associated targets once for each out of date
+prerequisite. (The meaning of the runtime macro \fB$?\fP is changed, see
+below in the
+.B "RUNTIME MACROS"
+section.) Ordinarily the recipe is executed
+once for all out of date prerequisites at the same time.
+.IP \fB^\fP
+says to insert the specified prerequisites, if any, before any
+other prerequisites already associated with the specified targets.
+In general, it is not useful to specify ^ with an empty
+list of prerequisites.
+.IP \fB\-\fP
+says to clear the previous list of prerequisites before adding
+the new prerequisites. Thus,
+.sp
+\tfoo :
+.br
+\tfoo : bar baz
+.sp
+can be replaced by
+.sp
+\tfoo :\- bar baz
+.sp
+however the old form still works as expected.
+.IP \fB:\fP
+When the rule operator is not modified by a second ':'
+only one set of rules may be specified for making a target.
+Multiple definitions may be used to add to the
+list of prerequisites that a target depends on.
+However, if a target is multiply defined
+only one definition may specify a recipe
+for making the target.
+.sp
+When a target's rule operator is modified by a second ':'
+(:: for example) then this definition may not be the only
+definition with a recipe for the target. There may be other :: target
+definition lines that specify a different set of prerequisites with a
+different recipe for updating the target.
+Any such target is made if any of the definitions
+find it to be out of date
+with respect to the related prerequisites
+and the corresponding recipe is used to update the
+target. By definition all '::' recipes that are found to be out of date for
+are executed.
+.sp
+In the following simple example, each rule has a `::' \fIruleop\fP. In such an
+operator we call the first `:' the operator, and the second `:' the modifier.
+.sp
+.nf
+a.o :: a.c b.h
+ first recipe for making a.o
+
+a.o :: a.y b.h
+ second recipe for making a.o
+.fi
+.sp
+If a.o is found to be out of date with respect to a.c then the first recipe
+is used to make a.o. If it is found out of date with respect to a.y then
+the second recipe is used. If a.o is out of date with respect to
+b.h then both recipes are invoked to make a.o.
+In the last case the order of invocation corresponds to the order in which the
+rule definitions appear in the makefile.
+.IP \fB|\fP
+Is defined only for PERCENT rule target definitions. When specified it
+indicates that the following construct should be parsed using the old
+semantinc meaning:
+.sp
+.nf
+%.o :| %.c %.r %.f ; some rule
+.sp
+is equivalent to:
+.sp
+%.o : %.c ; some rule
+%.o : %.r ; some rule
+%.o : %.f ; some rule
+.fi
+.PP
+Targets defined using a single `:' operator
+with a recipe may be redefined again with a new recipe by using a
+`:' operator with a `:' modifier.
+This is equivalent to a target having been
+initially defined with a rule using a `:' modifier.
+Once a target is defined using a `:'
+modifier it may not be defined again with a recipe using only the `:' operator
+with no `:' modifier. In both cases the use of a `:' modifier creates a new
+list of prerequisites and makes it the current prerequisite list for the target.
+The `:' operator with no recipe always modifies the current list
+of prerequisites.
+Thus assuming each of the following definitions has a recipe attached, then:
+.RS
+.sp
+.nf
+joe : fred ... (1)
+joe :: more ... (2)
+.sp
+and
+.sp
+joe :: fred ... (3)
+joe :: more ... (4)
+.sp
+.fi
+.RE
+are legal and mean: add the recipe associated with (2), or (4) to the set
+of recipes for joe, placing them after existing recipes for
+making joe.
+The constructs:
+.RS
+.sp
+.nf
+joe :: fred ... (5)
+joe : more ... (6)
+.sp
+and
+.sp
+joe : fred ... (7)
+joe : more ... (8)
+.sp
+.fi
+.RE
+are errors since we have two sets of perfectly good recipes for
+making the target.
+.PP
+.I prerequisites
+is a possibly empty list of targets that must be brought up to date before
+making the current target.
+.PP
+.I recipe
+is a short form and allows the user to specify short rule definitions
+on a single line.
+It is taken to be the first recipe line in a larger recipe
+if additional lines follow the rule definition.
+If the semi-colon is present but the recipe line is empty (ie. null string)
+then it is taken
+to be an empty rule. Any target so defined causes target to be treated
+as a virtual target, see VIRTUAL TARGETS below.
+.SH "RECIPES"
+The traditional format used by most versions of Make defines the recipe
+lines as arbitrary strings that may contain macro expansions. They
+follow a rule definition line and may be spaced
+apart by comment or blank lines.
+The list of recipe lines defining the recipe is terminated by a new target
+definition, a macro definition, or end-of-file.
+Each recipe line
+.B MUST
+begin with a \fB<TAB>\fP character (or \fBspaces\fP, see \fB.NOTABS\fP)
+which may optionally be followed with one or all the following
+.I recipe property
+characters
+.IR "'@%+\-'"
+which affect the recipe execution:
+.IP "'\-'"
+indicates that non-zero exit values (ie. errors)
+are to be ignored when this recipe line is executed.
+.IP "'\+'"
+indicates that the current recipe line is to be executed using the shell. Group recipes implicitely ignore this property.
+.IP "'%'"
+indicates that
+.B dmake
+should swap itself out to secondary storage (MSDOS only) before running the
+recipe.
+.IP "'@'"
+indicates that the recipe line should NOT be echoed to the terminal prior to
+being executed.
+.IP "'@@'"
+is a stronger version of the previous property. The recipe line and the
+output (stdout and stderr) of the executed recipe are NOT shown on the
+terminal.
+.LP
+Each property is off by default
+(ie. by default, errors are significant, commands are echoed, no swapping is
+done and a shell is
+used only if the recipe line contains a character found in the value of the
+SHELLMETAS macro).
+Global settings activated via command line options or special attribute or
+target names may also affect these settings.
+An example recipe:
+.sp
+.RS
+.nf
+target :
+.RS
+first recipe line
+second recipe line, executed independent of first.
+@a recipe line that is not echoed
+-and one that has errors ignored
+%and one that causes dmake to swap out
++and one that is executed using a shell.
+.RE
+.fi
+.RE
+.PP
+The second and new format of the recipe block begins the block with the
+character '[' (the open group character) in the last non-white space
+position of a line, and terminates the
+block with the character ']' (the close group character)
+in the first non-white space position of a line.
+In this form each recipe line need not have a leading TAB. This is
+called a recipe group. Groups so defined are fed intact as a single
+unit to a shell for execution whenever the corresponding target needs to
+be updated. If the open group character '[' is preceded
+by one or all of the
+.I recipe properties
+(\-, %, @ and @@)
+then they apply to the entire group in the same way that they
+apply to single recipe lines. You may also specify '+' but it is
+redundant as a shell is already being used to run the recipe.
+See the MAKING TARGETS section for a description of how
+.B dmake
+invokes recipes.
+Here is an example of a group recipe:
+.sp
+.RS
+.nf
+target :
+[
+ first recipe line
+ second recipe line
+ tall of these recipe lines are fed to a
+ single copy of a shell for execution.
+]
+.fi
+.RE
+.sp
+.SH "BUILTIN COMMANDS"
+.B dmake
+supports some builtin commands. An optional leading '+' describes that
+the builtin can be used also when being executed in a shell otherwise it
+is only implemented when used directly. Remember that if a character of the
+recipe is found in the SHELLMETAS macro the execution of the recipe in a
+shell is forced.
+.IP "[\fB+\fP]\fBnoop\fP [\fBsomething\fP]"
+The \fBnoop\fP internal command always returns success if used but it is
+not executed even though the rest of the commandline is evaluated.
+This command can be used to evaluate macro expansions at the runtime of the
+recipe without starting a real commmand.
+.IP "[\fB+\fP]<empty recipe>
+If an empty recipe line is encountered it is not executed. This sounds
+more trivial than it really is because the recipe could consist of
+macros that evaluated to empty or whitespace only strings.
+.IP "\fBecho\fP [\fB-n\fP] \fBdata\fP"
+This internal command prints data (with all leading whitespace removed, but
+otherwise literally) to stdout. If the '-n' switch is given no trailing
+newline is printed. Note that no quoting is removed nor that escape sequences
+are handled.
+.PP
+No special treatment of buildin commands for group recipes is implemented
+even though the <empty recipe> will most propably also not be evaluated by
+most shells that can be used to handle the recipe groups.
+.SH "TEXT DIVERSIONS"
+.B dmake
+supports the notion of text diversions.
+If a recipe line contains the macro expression
+.RS
+.sp
+$(mktmp[,[\fIfile\fP][,\fItext\fP]] \fIdata\fP)
+.sp
+.RE
+then all text contained in the \fIdata\fP expression is expanded and
+is written to a temporary file. The \fIdata\fP in the file will always
+be terminated from a new line character. The \fIfile\fP parameter can
+be used to override the name of the temporary file. If its expanded value
+is not empty it will be used instead of the unique and thread safe file
+name that otherwise would be generated internally. The return
+value of the macro is the name of the temporary file unless the \fItext\fP
+parameter is defined. In this case the return value is the expanded value
+of \fItext\fP.
+.PP
+.I data
+can be any text and must be separated from the 'mktmp' portion of the
+macro name by white-space. The only restriction on the data text is that
+it must contain a balanced number of parentheses of the same kind as are
+used to initiate the $(mktmp ...) expression. For example:
+.RS
+.sp
+$(mktmp $(XXX))
+.sp
+.RE
+is legal and works as expected, but:
+.RS
+.sp
+$(mktmp text (to dump to file)
+.sp
+.RE
+is not legal. You can achieve what you wish by either defining a macro that
+expands to '(' or by using {} in the macro expression; like this:
+.RS
+.sp
+${mktmp text (to dump to file}
+.sp
+.RE
+Since the temporary file is opened when the
+macro containing the text diversion expression is expanded, diversions may
+be nested and any diversions that are created as part of ':=' macro
+expansions persist for the duration of the
+.B dmake
+run.
+If the \fIdata\fP text is to contain new lines the map escape codes macro
+expasion can be used. For example the expression:
+.RS
+.sp
+.nf
+mytext:=this is a\entest of the text diversion
+all:
+ cat $(mktmp $(mytext:m))
+.fi
+.sp
+.RE
+is replaced by:
+.RS
+.sp
+cat /tmp/mk12294AA
+.sp
+.RE
+where the temporary file contains two lines both of which are terminated
+by a new-line.
+A second more illustrative example generates a response file to an MSDOS
+link command:
+.RS
+.sp
+.nf
+OBJ = fred.obj mary.obj joe.obj
+all : $(OBJ)
+ link @$(mktmp $(^:t"+\en"))
+.fi
+.sp
+.RE
+The result of making `all' in the second example is the command:
+.RS
+.sp
+link @/tmp/mk02394AA
+.sp
+.RE
+where the temporary file contains:
+.RS
+.sp
+.nf
+fred.obj+
+mary.obj+
+joe.obj
+.fi
+.sp
+.RE
+The last line of the file is terminated by a new-line which is always
+inserted at the end of the \fIdata\fP string.
+.PP
+If the optional \fIfile\fP specifier is present it can be used to specify
+the name of the temporary file to create. An example that would be useful
+for MSDOS users with a Turbo-C compiler
+.RS
+.sp
+$(mktmp,turboc.cfg $(CFLAGS))
+.sp
+.RE
+will place the contents of CFLAGS into a local \fIturboc.cfg\fP file.
+The second optional argument, \fItext\fP, if present alters the name
+of the value returned by the $(mktmp ...) macro.
+.PP
+Under MS-DOS text diversions may be a problem. Many DOS tools require
+that path names which contain directories use the \e character to delimit
+the directories. Some users however wish to use the '/' to delimit pathnames
+and use environments that allow them to do so.
+The macro USESHELL is set to "yes" if the
+current recipe is forced to use a shell via the .USESHELL or '+' directives,
+otherwise its value is "no".
+The
+.B dmake
+startup files define the macro DIVFILE whose value is either the
+value of TMPFILE or the value of TMPFILE edited to replace any '/' characters
+to the appropriate value based on the current shell and whether it will be
+used to execute the recipe.
+.PP
+Previous versions of
+.B dmake
+defined text diversions using <+, +> strings,
+where <+ started a text diversion and +> terminated one.
+.B dmake
+is backward compatible with this construct only
+if the <+ and +> appear literally
+on the same recipe line or in the same macro value string. In such instances
+the expression:
+.sp
+\t<+data+>
+.sp
+is mapped to:
+.sp
+\t$(mktmp data)
+.sp
+which is fully output compatible with the earlier construct. <+, +>
+constructs whose text spans multiple lines must be converted by hand to use
+$(mktmp ...).
+.PP
+If the environment variable TMPDIR is defined then the
+temporary file is placed into the directory specified by that variable.
+A makefile can modify the location of temporary files by
+defining a macro named TMPDIR and exporting it using the .EXPORT special
+target.
+.SH "VIRTUAL TARGETS"
+.B Dmake
+allows to define targets with the sole purpose to enforce a dependency
+chain that are unable to create the target, hence virtual targets.
+When \fBdmake\fP tries to make a target, but only finds a target definition
+without recipe lines, it would normally issues
+a \fB"Don't know how to make ..."\fP error message, but if a target rule is
+terminated by a semicolon and has no following recipe lines,
+or if it has no recipe lines, but defines prerequisites,
+or if the AUGMAKE mode is enabled (see the COMPATIBILITY section for details),
+the target is treated as a virtual target and the error is suppressed. In
+addition to this, if the default target does not have recipe lines it is also
+treated as a virtual target.
+.PP
+Virtual targets should not have a corresponding file therefore
+they inherit the time of their newest prerequisite if they have prerequisites,
+otherwise they get the current time assigned when being made.
+If the virtual target has a corresponding file a warning is issued, but the
+time stamp of that file is taken into account. The virtual target uses the
+time stamp of the corresponding file if it is newer than the one determined
+by the previous rule.
+.SH "SPECIAL TARGETS"
+This section describes the special targets that are recognized by \fBdmake\fP.
+Some are affected by attributes and others are not.
+.IP \fB.ERROR\fP 1.4i
+If defined then the recipe associated with this target is executed
+whenever an error condition is detected by \fBdmake\fP. All attributes that
+can be used with any other target may be used with this target. Any
+prerequisites of this target will be brought up to date during its processing.
+NOTE: errors will be ignored while making this target, in extreme cases this
+may cause some problems.
+.IP \fB.EXIT\fP 1.4i
+If this target is encountered while parsing a makefile then the parsing of the
+makefile is immediately terminated at that point.
+.IP \fB.EXPORT\fP 1.4i
+All prerequisites associated with this target are assumed to
+correspond to macro names and they and their values
+are exported to the environment as environment strings at the point in
+the makefile at which this target appears.
+Any attributes specified with this target are ignored.
+Only macros which have been assigned a value in the makefile prior to the
+export directive are exported, macros as yet undefined
+or macros whose value contains any of the characters "+=:*"
+are not exported.
+.sp
+Note that macros that are not expanded during the macro assignment and contain
+other macros will be written into the environment containing these other
+macros in the form of $(macroname).
+.IP \fB.IMPORT\fP 1.4i
+Prerequisite names specified for this target are searched for in the
+environment and defined as macros with their value taken from the environment.
+If the special name \fB.EVERYTHING\fP is used as a prerequisite name then
+all environment variables defined in the environment are imported.
+The functionality of the \fB\-E\fP flag can be forced by placing the construct
+\&\fI.IMPORT : .EVERYTHING\fP at the start of a makefile. Similarly, by
+placing the construct at the end, one can emulate the effect of the \fB\-e\fP
+command line flag.
+If a prerequisite name cannot be found in the environment
+an error message is issued.
+\&.IMPORT accepts the .IGNORE attribute. When given, it causes \fBdmake\fP
+to ignore the above error.
+See the MACROS section for a description of the processing of imported macro
+values.
+.IP \fB.INCLUDE\fP 1.4i
+Parse another makefile just as if it had been located at the point of the
+\&.INCLUDE in the current makefile.
+The list of prerequisites gives the list of
+makefiles to try to read. If the list contains multiple makefiles then they
+are read in order from left to right. The following search rules are used
+when trying to locate the file. If the filename is surrounded by " or just
+by itself then it is searched for in the current directory. If it is not
+found it is then searched for in each of the directories specified
+as prerequisites of the \&.INCLUDEDIRS special target.
+If the file name is surrounded by < and >, (ie.
+<my_spiffy_new_makefile>) then it is searched for only in the directories
+given by the .INCLUDEDIRS special target. In both cases if the file name is a
+fully qualified name starting at the root of the file system then it is only
+searched for once, and the .INCLUDEDIRS list is ignored.
+If .INCLUDE fails to find the file it invokes the inference engine to
+try to infer and hence make the file to be included. In this way the
+file can be checked out of an RCS repository for example.
+\&.INCLUDE accepts
+the .IGNORE, .SETDIR, and .NOINFER attributes.
+If the .IGNORE attribute is given and the file
+cannot be found then \fBdmake\fP continues processing,
+otherwise an error message is generated.
+If the .NOINFER attribute is given and the file
+cannot be found then \fBdmake\fP will not attempt to
+\fIinfer and make\fP the file.
+The .SETDIR attribute causes
+.B dmake
+to change directories to the specified directory prior to attempting the
+include operation. If all fails \fBdmake\fP attempts to \fImake\fP the file
+to be included. If making the file fails then \fBdmake\fP terminates unless
+the .INCLUDE directive also specified the .IGNORE attribute.
+If .FIRST is specified along with .INCLUDE then \fBdmake\fP attempts to
+include each named prerequisite and will terminate the inclusion with the
+first prerequisite that results in a successful inclusion.
+.IP \fB.INCLUDEDIRS\fP 1.4i
+The list of prerequisites specified for this target defines the set of
+directories to search when trying to include a makefile.
+.IP \fB.KEEP_STATE\fP 1.4i
+This special target is a synonym for the macro definition
+.sp
+\&\t.KEEP_STATE := _state.mk
+.sp
+It's effect is to turn on STATE keeping and to define \fI_state.mk\fP
+as the state file.
+.IP \fB.MAKEFILES\fP 1.4i
+The list of prerequisites is the set of files to try to read as the default
+makefile. By default this target is defined as:
+.sp
+\t\&.MAKEFILES : makefile.mk Makefile makefile
+.sp
+.IP \fB.REMOVE\fP 1.4i
+The recipe of this target is used whenever \fBdmake\fP needs to remove
+intermediate targets that were made but do not need to be kept around.
+Such targets result from the application of transitive closure on the
+dependency graph.
+.IP \fB.ROOT\fP 1.4i
+The internal root of the dependency graph, see section STARTUP for details.
+.IP \fB.SOURCE\fP 1.4i
+The prerequisite list of this target defines a set of directories to check
+when trying to locate a target file name. See the section on BINDING of
+targets for more information.
+.IP \fB.SOURCE.suff\fP 1.4i
+The same as .SOURCE, except that the .SOURCE.suff list is searched first when
+trying to locate a file matching the a target whose name ends in the suffix
+\&.suff.
+.IP \fB.SUFFIXES\fP 1.4i
+This deprecated special target has no special meaning. Avoid its use.
+.IP \fB.TARGETS\fP 1.4i
+The internal targets that all user defined targets are prerequisites of,
+see section STARTUP for details.
+.PP
+There are a few targets that are "slightly" special:
+.RS
+.nf
+
+\&\fB.INIT\fP
+\&\fB.DONE\fP
+
+.fi
+.RE
+These targets exist because of historical reasons, see the usage of .INIT
+and .DONE in section "STARTUP", they can be used and defined as ordinary
+targets but are special in the sense that even though they start with a `.'
+they are not treated as a .<suffix> meta target (See the AUGMAKE META RULES
+section for details).
+.PP
+.B Please note
+that self defined targets shouldn't use the prefix `.' as they would be
+handled as .<suffix> meta targets and dmake most propably would complain
+about this.
+.PP
+In addition to the special targets above,
+several other forms of targets are recognized and are considered special,
+their exact form and use is defined in the sections that follow.
+.SH "SPECIAL MACROS"
+.B dmake
+defines a number of special macros. They are divided into three classes:
+control macros, run-time macros, and function macros.
+The control macros are used by
+.B dmake
+to configure its actions, and are the preferred method of doing so.
+In the case when a control macro has the same function as a special
+target or attribute they share the same name as the special target or
+attribute.
+The run-time macros are defined when
+.B dmake
+makes targets and may be used by the user inside recipes.
+The function macros provide higher level functions dealing with macro
+expansion and diversion file processing.
+.SH "CONTROL MACROS"
+To use the control macros simply assign them a value just like any other
+macro. The control macros are divided into three groups:
+string valued macros, character valued macros, and boolean valued macros.
+.PP
+The following are all of the string valued macros.
+This list is divided into two groups. The first group gives the string
+valued macros that are defined internally and cannot be directly set by the
+user.
+.IP \fBABSMAKECMD\fP 1.6i
+\fBWarning!\fP This macro's value is differently defined for a native Windows
+dmake executable (compiled with MS Visual C++ or MinGW) and dmake for other
+operating systems or build with other compilers.
+.sp
+In the first case its value is the absolute filename of the executable of
+the current dmake process, otherwise it is defined as the NULL string.
+.IP \fBINCDEPTH\fP 1.6i
+This macro's value is a string of digits representing
+the current depth of makefile inclusion.
+In the first makefile level this value is zero.
+.IP \fBMFLAGS\fP 1.6i
+Is the list of flags
+that were given on the command line including a leading switch character.
+The \-f flag is not included in this list.
+.IP \fBMAKECMD\fP 1.6i
+Is the name with which \fBdmake\fP was invoked.
+.IP \fBMAKEDIR\fP 1.6i
+Is the full path to the initial directory in which
+.B dmake
+was invoked.
+.IP \fBMAKEFILE\fP 1.6i
+Contains the string "\-f \fImakefile\fP" where, \fImakefile\fP is the name
+of initial user makefile that was first read.
+.IP \fBMAKEFLAGS\fP 1.6i
+Is the same as $(MFLAGS) but has no leading switch
+character. (ie. MFLAGS = \-$(MAKEFLAGS))
+.IP \fBMAKEMACROS\fP 1.6i
+Contains the complete list of macro expressions that were specified on the
+command line.
+.IP \fBMAKETARGETS\fP 1.6i
+Contains the name(s) of the target(s), if any, that were
+specified on the command line.
+.IP \fBMAKEVERSION\fP 1.6i
+Contains a string indicating the current \fBdmake\fP version number.
+.IP \fBMAXPROCESSLIMIT\fP 1.6i
+Is a numeric string representing the maximum number of processes that
+\fBdmake\fP can use when making targets using parallel mode.
+.IP \fBNULL\fP 1.6i
+Is permanently defined to be the NULL string.
+This is useful when comparing a conditional expression to an NULL value.
+.IP \fBPWD\fP 1.6i
+Is the full path to the
+current directory in which make is executing.
+.IP \fBSPACECHAR\fP 1.6i
+Is permanently defined to contain one space character. This is useful
+when using space characters in function macros, e.g. subst, that
+otherwise would get deleted (leading/trailing spaces) or for using
+spaces in function macro parameters.
+.IP \fBTMPFILE\fP 1.6i
+Is set to the name of the most recent temporary file opened by \fBdmake\fP.
+Temporary files are used for text diversions and for group recipe processing.
+.IP \fBTMD\fP 1.6i
+Stands for "To Make Dir", and
+is the path from the present directory (value of $(PWD)) to the directory
+that \fBdmake\fP was started up in (value of $(MAKEDIR)). If the present
+directory is the directory that \fBdmake\fP was started up in TMD will be
+set to the relative path ".". This allows to create valid paths by prepending
+$(TMD)$(DIRSEPSTR) to a relative path.
+This macro is modified when .SETDIR attributes are processed.
+TMD will usually be a relative path with the following two exceptions. If the
+relative path would go up until the root directory or if different drive
+letters (DOS file system) make a relative path impossible the absolute path
+from MAKEDIR is used.
+.IP \fBUSESHELL\fP 1.6i
+The value of this macro is set to "yes" if the current recipe is forced to
+use a shell for its execution via the .USESHELL or '+' directives, its value
+is "no" otherwise.
+.sp
+.PP
+The second group of string valued macros control
+.B dmake
+behavior and may be set by the user.
+.IP \fB.DIRCACHE\fP 1.6i
+If set to "yes" enables the directory cache (this is the default). If set to
+"no" disables the directory cache (equivalent to -d command-line flag).
+.IP \fB.DIRCACHERESPCASE\fP 1.6i
+If set to "yes" causes the directory cache, if enabled, to respect
+file case, if set to "no" files are cached case insensitive.
+By default it is set to "no" on Windows as the filesystems on
+this operating system are case insensitive and set to "yes" for all
+other operating systems. The default can be overriden, if desired.
+.sp
+\fBNote:\fP Using case insensitive directory caching on case sensitive
+file systems is a \fBBAD\fP idea. If in doubt use case sensitive
+directory caching even on case insensitive file systems as the
+worst case in this scenario is that /foo/bar/ and /foo/BAR/ are
+cached separately (with the same content) even though they are
+the same directory. This would only happen if different targets
+use different upper/lower case spellings for the same directory
+and that is \fBnever\fP a good idea.
+.IP \fBNAMEMAX\fP 1.6i
+Defines the maximum length of a filename component. The value of the variable
+is initialized at startup to the value of the compiled macro NAME_MAX. On
+some systems the value of NAME_MAX is too short by default. Setting a new
+value for NAMEMAX will override the compiled value.
+.IP \fB.NOTABS\fP 1.6i
+When set to "yes" enables the use of spaces as well as <tabs> to begin
+recipe lines.
+By default a non\-group recipe is terminated by a line without any leading
+white\-space or by a line not beggining with a <tab> character.
+Enabling this mode modifies the first condition of
+the above termination rule to terminate a
+non\-group recipe with a line that contains only white\-space.
+This mode does not effect the parsing of group recipes bracketed by [].
+.IP \fBAUGMAKE\fP 1.6i
+If set to "yes" value will enable the transformation of special
+meta targets to support special AUGMAKE inferences (See the "AUGMAKE
+META RULES" and "COMPATIBILITY" sections).
+.IP \fBDIRBRKSTR\fP 1.6i
+Contains the string of chars used to terminate
+the name of a directory in a pathname.
+Under UNIX its value is "/", under MSDOS its value is "/\e:".
+.IP \fBDIRSEPSTR\fP 1.6i
+Contains the string that is used to separate directory components when
+path names are constructed. It is defined with a default value at startup.
+.IP \fBDIVFILE\fP 1.6i
+Is defined in the startup file and gives the name that should be returned for
+the diversion file name when used in
+$(mktmp ...) expansions, see the TEXT DIVERSION section for details.
+.IP \fB.KEEP_STATE\fP 1.6i
+Assigning this macro a value tells
+.B dmake
+the name of the state file to use and turns on the keeping of state
+information for any targets that are brought up to date by the make.
+.IP \fBGROUPFLAGS\fP 1.6i
+This macro gives the set of flags to pass to the shell when
+invoking it to execute a group recipe. The value of the macro is the
+list of flags with a leading switch indicator. (ie. `\-' under UNIX)
+.IP \fBGROUPSHELL\fP 1.6i
+This macro defines the full
+path to the executable image to be used as the shell when
+processing group recipes. This macro must be defined if group recipes are
+used. It is assigned a default value in the startup makefile. Under UNIX
+this value is /bin/sh.
+.IP \fBGROUPSUFFIX\fP 1.6i
+If defined, this macro gives the string to use as a suffix
+when creating group recipe files to be handed to the command interpreter.
+For example, if it is defined as .sh, then all
+temporary files created by \fBdmake\fP will end in the suffix .sh.
+Under MSDOS if you are using command.com as your GROUPSHELL, then this suffix
+must be set to .bat in order for group recipes to function correctly.
+The setting of GROUPSUFFIX and GROUPSHELL is done automatically for
+command.com in the startup.mk files.
+.IP \fBMAKE\fP 1.6i
+Is defined in the startup file by default.
+Initially this macro is defined to have the value "$(MAKECMD) $(MFLAGS)".
+The string $(MAKE) is recognized when using the \-n switch.
+.IP \fBMAKESTARTUP\fP 1.6i
+This macro defines the full path to the initial startup
+makefile. Use the \fB\-V\fP command line option to discover its initial
+value.
+.IP \fBMAXLINELENGTH\fP 1.6i
+This macro defines the maximum size of a single line of
+makefile input text. The size is specified as a number, the default value
+is defined internally and is shown via the \fB\-V\fP option.
+A buffer of this size plus 2 is allocated for reading makefile text. The
+buffer is freed before any targets are made, thereby allowing files containing
+long input lines to be processed without consuming memory during the actual
+make.
+This macro can only be used to extend the line length beyond it's default
+minimum value.
+.IP \fBMAXPROCESS\fP 1.6i
+Specify the maximum number of child processes to use when making targets.
+The default value of this macro is "1" and its value cannot exceed the value
+of the macro MAXPROCESSLIMIT. Setting the value of MAXPROCESS on the command
+line or in the makefile is equivalent to supplying a corresponding value to
+the -P flag on the command line. If the global .SEQUENTIAL attribute is set
+(or the -S command line switch is used) the value of MAXPROCESS is fixed
+to "1" and cannot be changed.
+.IP \fBOOODMAKEMODE\fP 1.6i
+This macro enables a special compatibility mode needed by the OpenOffice.org
+build system. If set, the switch disables the removal of leading './' path
+elements during target filename normalization (See BINDING TARGETS). If './'
+appear in the pathname, but not at the beginning of it, they are still
+removed by the normalization. Please note that targets that are given on the
+command line are going to be registered as default targets \fBafter\fP the
+startup file is read.
+.IP \fBPREP\fP 1.6i
+This macro defines the number of iterations to be expanded
+automatically when processing % rule definitions of the form:
+.sp
+% : %.suff
+.sp
+See the sections on PERCENT(%) RULES for details on how PREP is used.
+.IP \fBSHELL\fP 1.6i
+This macro defines the full path to the executable
+image to be used as the shell when
+processing single line recipes. This macro must be defined if recipes
+requiring the shell for execution are to be used.
+It is assigned a default value in the startup makefile.
+Under UNIX this value is /bin/sh.
+.IP \fBSHELLCMDQUOTE\fP 1.6i
+This macro can be used to add additional characters before and after the
+command string that is passed to the shell defined by the SHELL macro.
+If needed, like for \fIcmd.exe\fP and \fIcommand.com\fP, it is assigned
+a value in the startup file.
+.IP \fBSHELLFLAGS\fP 1.6i
+This macro gives the set of flags to pass to the shell when
+invoking it to execute a single line recipe. The value of the macro is the
+list of flags with a leading switch indicator. (ie. `\-' under UNIX)
+.IP \fBSHELLMETAS\fP 1.6i
+Each time
+.B dmake
+executes a single recipe line (not a group recipe) the line is
+searched for any occurrence of a character defined in the value of SHELLMETAS.
+If such a character is found the recipe line is defined to require a shell
+to ensure its correct execution. In such instances
+a shell is used to invoke the recipe line.
+If no match is found the recipe line is executed without the use of a shell.
+.sp
+.PP
+There is only one character valued macro defined by \fBdmake\fP:
+\fBSWITCHAR\fP contains the switch character used
+to introduce options on command lines. For UNIX its value is `\-', and for
+MSDOS its value may be `/' or `\-'.
+The macro is internally defined and is not user setable.
+The MSDOS version of \fBdmake\fP attempts to first extract SWITCHAR from an
+environment variable of the same name. If that fails it then attempts to
+use the undocumented getswitchar system call, and returns the result of
+that. Under MSDOS version 4.0 you must set the value of the environment
+macro SWITCHAR to '/' to obtain predictable behavior.
+.PP
+All boolean macros currently understood by
+.B dmake
+correspond directly to the previously defined attributes.
+These macros provide
+a second way to apply global attributes, and represent the
+preferred method of doing so. They are used by assigning them a
+value. If the value is not a NULL string then the boolean condition
+is set to on.
+If the value is a NULL string then the condition is set to off.
+There are five conditions defined and they correspond directly to the
+attributes of the same name. Their meanings are defined in the ATTRIBUTES
+section above.
+The macros are:
+\&\fB.EPILOG\fP,
+\&\fB.IGNORE\fP,
+\&\fB.MKSARGS\fP,
+\&\fB.NOINFER\fP,
+\&\fB.PRECIOUS\fP,
+\&\fB.PROLOG\fP,
+\&\fB.SEQUENTIAL\fP,
+\&\fB.SILENT\fP,
+\&\fB.SWAP\fP, and
+\&\fB.USESHELL\fP.
+Assigning any of these a non NULL value will globally set
+the corresponding attribute to on.
+.SH "RUNTIME MACROS"
+These macros are defined
+when \fBdmake\fP is making targets, and may take on different values for each
+target. \fB$@\fP is defined to be the full target name, \fB$?\fP is the
+list of all out of date prerequisites, except for the \fB!\fP ruleop, in
+which case it is set to the current build
+prerequisite instead. \fB$&\fP is the list of all
+prerequisites, \fB$>\fP is the name of the library if the current target is a
+library member, and
+\fB$<\fP is the list of prerequisites specified in the current rule.
+If the current target had a recipe inferred then \fB$<\fP is the name of the
+inferred prerequisite even if the target had a list of prerequisites supplied
+using an explicit rule that did not provide a recipe. In such situations
+\fB$&\fP gives the full list of prerequisites.
+.PP
+\fB$*\fP is defined as
+\fB$(@:db)\fP when making targets with explicit recipes and is defined as the
+value of % when making targets whose recipe is the result of an inference.
+In the first case \fB$*\fP is the target name with no suffix,
+and in the second case, is the value of the matched % pattern from
+the associated %-rule.
+\fB$^\fP expands to the set of out of date prerequisites taken from the
+current value of \fB$<\fP.
+In addition to these,
+\fB$$\fP expands to $, \fB{{\fP expands to {, \fB}}\fP expands to }, and the
+strings \fB<+\fP and \fB+>\fP are recognized
+as respectively starting and terminating a text diversion when they appear
+literally together in the same input line.
+.PP
+The difference between $? and $^ can best be illustrated by an example,
+consider:
+.RS
+.sp
+.nf
+fred.out : joe amy hello
+\trules for making fred
+
+fred.out : my.c your.h his.h her.h # more prerequisites
+.fi
+.sp
+.RE
+Assume joe, amy, and my.c are newer then fred.out. When
+.B dmake
+executes the recipe for making fred.out the values of the following macros
+will be:
+.RS
+.sp
+.nf
+.Is "$@ "
+.Ii "$@"
+--> fred.out
+.Ii "$*"
+--> fred
+.Ii "$?"
+--> joe amy my.c # note output of $? vs $^
+.Ii "$^"
+--> joe amy
+.Ii "$<"
+--> joe amy hello
+.Ii "$&"
+--> joe amy hello my.c your.h his.h her.h
+.fi
+.sp
+.RE
+.SH "FUNCTION MACROS"
+.B dmake
+supports a full set of functional macros. One of these, the $(mktmp ...)
+macro, is discussed in detail in the TEXT DIVERSION section and is not
+covered here.
+The names of function macros must appear literally after the opening $(
+or ${. They are \fBnot\fP recognized if they are the result of a recursive
+expansion.
+.PP
+Note that some of these macros take comma separated parameters
+but that these parameters must not contain literal whitespaces. Whitespaces
+in macros used in these parameters are allowed.
+.RS
+.sp
+.IP "$(\fBand\fP \fBmacroterm ...\fP)"
+expands each \fBmacroterm\fP in turn until there are no more or one of
+them returns an empty string. If all expand to non-empty strings the
+macro returs the string "t" otherwise it returns an empty string.
+.sp
+.IP "$(\fBassign\fP \fBexpression\fP)"
+Causes \fIexpression\fP to be parsed as a macro assignment expression and results
+in the specified assignment being made. An error is issued if the assignment
+is not syntatically correct. \fIexpression\fP may contain white space. This is
+in effect a dynamic macro assignment facility and may appear anywhere any
+other macro may appear. The result of the expanding a dynamic macro
+assignment expression is the name of the macro that was assigned and $(NULL)
+if the \fIexpression\fP is not a valid macro assignment expression.
+Some examples are:
+.RS
+.sp
+.nf
+$(assign foo := fred)
+$(assign $(ind_macro_name) +:= $(morejunk))
+.fi
+.RE
+.IP "$(\fBecho\fP \fBlist\fP)"
+Echo's the value of \fIlist\fP. \fIlist\fP is not expanded.
+.IP "$(\fBeq\fP,\fItext_a\fP,\fItext_b\fP \fBtrue\fP \fBfalse\fP)"
+expands
+.I text_a
+and
+.I text_b
+and compares their results. If equal it returns the result of the expansion
+of the
+.B true
+term, otherwise it returns the expansion of the
+.B false
+term.
+.IP "$(\fB!eq\fP,\fItext_a\fP,\fItext_b\fP \fBtrue\fP \fBfalse\fP)"
+Behaves identically to the previous macro except that the
+.B true
+string is chosen if the expansions of the two strings are not equal
+.IP "$(\fBforeach\fP,\fIvar\fP,\fIlist\fP \fBdata\fP)"
+Implements iterative macro expansion over \fIdata\fP using \fBvar\fP as the
+iterator taking on values from \fIlist\fP. \fIvar\fP and \fIlist\fP are
+expanded and the result is the concatenation of expanding \fIdata\fP with
+\fIvar\fP being set to each whitespace separated token from \fIlist\fP.
+For example:
+.RS
+.RS
+.sp
+.nf
+list = a b c
+all :; echo [$(foreach,i,$(list) [$i])]
+.fi
+.sp
+.RE
+will output
+.RS
+.sp
+.nf
+[[a] [b] [c]]
+.fi
+.sp
+.RE
+The iterator variable is defined as a local variable to this foreach
+instance. The following expression illustrates this:
+.RS
+.sp
+.nf
+$(foreach,i,$(foreach,i,$(sort c a b) root/$i) [$i/f.h])
+.fi
+.sp
+.RE
+when evaluated the result is:
+.RS
+.sp
+.nf
+[root/a/f.h] [root/b/f.h] [root/c/f.h]
+.fi
+.sp
+.RE
+The specification of list must be a valid macro expression, such as:
+.RS
+.sp
+.nf
+$($(assign list=a b c))
+$(sort d a b c)
+$(echo a b c)
+.fi
+.sp
+.RE
+and cannot just be the list itself. That is, the following foreach
+expression:
+.RS
+.sp
+.nf
+$(foreach,i,a b c [$i])
+.fi
+.sp
+.RE
+yields:
+.RS
+.sp
+.nf
+"b c [a]"
+.fi
+.sp
+.RE
+when evaluated.
+.RE
+.IP "$(\fBnil\fP \fBexpression\fP)"
+Always returns the value of $(NULL) regardless of what \fIexpression\fP is.
+This function macro can be used to discard results of expanding
+macro expressions.
+.IP "$(\fBnormpath\fP \fBlist\fP)"
+Will return the normalized path names of all white-space separated tokens
+in \fBlist\fP. Quotes can be used to normalize path names that contain
+white-space characters. On cygwin the result honors the setting of .WINPATH
+to determine the output format of the returned path names.
+.IP "$(\fBnormpath,para\fP \fBlist\fP)"
+Same as above except that the expanded value of \fBpara\fP is used to
+override the .WINPATH setting.
+.IP "$(\fBnot\fP \fBmacroterm\fP)"
+expands \fBmacroterm\fP and returs the string "t" if the result of the
+expansion is the empty string; otherwise, it returns the empty string.
+.IP "$(\fBnull\fP,\fItext\fP \fBtrue\fP \fBfalse\fP)"
+expands the value of
+.I text.
+If it is NULL then the macro returns the value of the expansion of \fBtrue\fP
+and the expansion of \fBfalse\fP otherwise. The terms \fBtrue\fP, and
+\fBfalse\fP must be strings containing no white\-space.
+.IP "$(\fB!null\fP,\fItext\fP \fBtrue\fP \fBfalse\fP)"
+Behaves identically to the previous macro except that the
+.B true
+string is chosen if the expansion of
+.I text
+is not NULL.
+.IP "$(\fBor\fP \fBmacroterm ...\fP)"
+expands each \fBmacroterm\fP in turn and returs the empty string if
+each term expands to the empty string; otherwise, it returs the string
+"t".
+.IP "$(\fBshell\fP \fBcommand\fP)"
+is a shell escape macro. It runs \fIcommand\fP as if it were part of a
+recipe and returns, separated by a single space, all the non-white
+space terms written to stdout by the command.
+For example:
+.RS
+.RS
+.sp
+$(shell ls *.c)
+.sp
+.RE
+will return \fI"a.c b.c c.c d.c"\fP if the files exist in the current
+directory. The recipe modification flags \fB[+@%\-]\fP are honored if they
+appear as the first characters in the command. For example:
+.RS
+.sp
+$(shell +ls *.c)
+.sp
+.RE
+will run the command using the current shell.
+.LP
+\fBNote\fP that if the macro is part of a recipe it will be evaluated after
+all previous recipe lines have been executed. For obvious reasons it will be
+evaluated before the current recipe line or group recipe is executed.
+.RE
+.IP "$(\fBshell,expand\fP \fBcommand\fP)"
+Is an extension to the \fB$(shell command)\fP function macro that expands the
+result of running \fBcommand\fP.
+.IP "$(\fBsort\fP \fBlist\fP)"
+Will take all white\-space separated tokens in \fIlist\fP and will
+return their sorted equivalent list.
+.IP "$(\fBstrip\fP \fBdata\fP)"
+Will replace all strings of white\-space in data by a single space.
+.IP "$(\fBsubst\fP,\fIpat\fP,\fIreplacement\fP \fBdata\fP)"
+Will search for \fIpat\fP in
+.B data
+and will replace any occurrence of
+.I pat
+with the
+.I replacement
+string. The expansion
+.RS
+.sp
+$(subst,.o,.c $(OBJECTS))
+.sp
+.RE
+is equivalent to:
+.RS
+.sp
+$(OBJECTS:s/.o/.c/)
+.sp
+.RE
+.IP "$(\fBuniq\fP \fBlist\fP)"
+Will take all white\-space separated tokens in \fIlist\fP and will
+return their sorted equivalent list containing no duplicates.
+.sp
+.RE
+For historic reasons \fBdmake\fP treats the following case slightly special:
+.RS
+.sp
+$(\fBname\fP \fBsomething\fP)
+.sp
+.RE
+If it encounters a macro with a whitespace after \fBname\fP and \fBname\fP
+is not literally one of the above mentioned function macro identifiers then
+\fBdmake\fP will return the recursively expanded value of \fB$(name)\fP.
+The remaining \fBsomething\fP part will be expanded but the result will be
+discarded. The use of this special feature is deprecated and should not be
+used.
+.sp
+.SH "CONDITIONAL MACROS"
+.B dmake
+supports conditional macros. These allow the definition of target specific
+macro values. You can now say the following:
+.RS
+.sp
+\fBtarget\fP ?= \fIMacroName MacroOp Value\fP
+.sp
+.RE
+This creates a definition for \fIMacroName\fP whose value is \fIValue\fP
+only when \fBtarget\fP is being made. You may use a conditional macro
+assignment anywhere that a regular macro assignment may appear, including
+as the value of a $(assign ...) macro.
+.LP
+The new definition is associated with the most recent cell definition
+for \fBtarget\fP. If no prior definition exists then one is created. The
+implications of this are immediately evident in the following example:
+.sp
+.RS
+.nf
+foo := hello
+.sp
+all : cond;@echo "all done, foo=[$(foo)] bar=[$(bar)]"
+.sp
+cond ?= bar := global decl
+.sp
+cond .SETDIR=unix::;@echo $(foo) $(bar)
+cond ?= foo := hi
+.sp
+cond .SETDIR=msdos::;@echo $(foo) $(bar)
+ cond ?= foo := hihi
+.fi
+.RE
+.sp
+The first conditional assignment creates a binding for 'bar' that is
+activated when 'cond' is made. The bindings following the :: definitions are
+activated when their respective recipe rules are used. Thus the
+first binding serves to provide a global value for 'bar' while any of the
+cond :: rules are processed, and the local bindings for 'foo' come into
+effect when their associated :: rule is processed.
+.LP
+Conditionals for targets of .UPDATEALL are all activated before the
+target group is made. Assignments are processed in order. Note that
+the value of a conditional macro assignment is NOT AVAILABLE until the
+associated target is made, thus the construct
+.sp
+.RS
+.nf
+mytarget ?= bar := hello
+mytarget ?= foo := $(bar)
+.fi
+.RE
+.sp
+results in $(foo) expanding to "", if you want the result to be "hello"
+you must use:
+.sp
+.RS
+.nf
+mytarget ?= bar := hello
+mytarget ?= foo = $(bar)
+.fi
+.RE
+.sp
+Once a target is made any associated conditional macros are deactivated
+and their values are no longer available. Activation occurrs after all
+inference, and .SETDIR directives have been processed and after $@ is
+assigned, but before prerequisites are processed; thereby making the values of
+conditional macro definitions available during construction of prerequisites.
+.LP
+If a %-meta rule target has associated conditional macro assignments,
+and the rule is chosen by the inference algorithm then the conditional
+macro assignments are inferred together with the associated recipe.
+.SH "DYNAMIC PREREQUISITES"
+.B dmake
+looks for prerequisites whose names contain macro expansions during target
+processing. Any such prerequisites are expanded and the result of the
+expansion is used as the prerequisite name. As an example the line:
+.sp
+\tfred : $$@.c
+.sp
+causes the $$@ to be expanded when \fBdmake\fP is making fred, and it resolves
+to the target \fIfred\fP.
+This enables dynamic prerequisites to be generated. The value
+of @ may be modified by any of the valid macro modifiers. So you can say for
+example:
+.sp
+\tfred.out : $$(@:b).c
+.sp
+where the $$(@:b) expands to \fIfred\fP.
+Note the use of $$ instead of $ to indicate the dynamic expansion, this
+is due to the fact that the rule line is expanded when it is initially parsed,
+and $$ then returns $ which later triggers the dynamic prerequisite expansion.
+Dynamic macro expansion is performed in all user defined rules, and the special
+targets .SOURCE*, and .INCLUDEDIRS.
+.PP
+\fBNOTE:\fP The use of a \fB$\fP as part of a prerequisite or target name is
+\fBstrongly discouraged\fP as the runtime macros (like $@) are expanded when
+used in a recipe line so that the $ is interpreted as a macro identifier and
+not as a character of the filename leading to invalid runtime macros.
+In addition to this no filename normalization is done for prerequisites and
+targets that contain $ characters.
+Nevertheless it is possible to use $ in prerequisites by using $$$$ but this
+is \fBnot recommended\fP and can lead to surprising results.
+.PP
+If dynamic macro expansion results in multiple white space separated tokens
+then these are inserted into the prerequisite list inplace of the dynamic
+prerequisite. Due to the recursive nature of macro expansion the prerequisite
+list is fully expanded even if the dynamic prerequisite contained other
+runtime macros.
+.SH "BINDING TARGETS"
+This operation takes a target name and binds it to an existing file, if
+possible.
+.B dmake
+makes a distinction between the internal target name of a target and its
+associated external file name.
+Thus it is possible for a target's internal name and its external
+file name to differ.
+To perform the binding, the following set of rules is used.
+Assume that we are
+trying to bind a target whose name is of the form \fIX.suff\fP,
+where \fI.suff\fP is the suffix and \fIX\fP is the stem portion
+(ie. that part which contains the directory and the basename).
+.B dmake
+takes this target name and performs a series of search operations that try to
+find a suitably named file in the external file system.
+The search operation is user controlled
+via the settings of the various .SOURCE targets.
+.RS
+.IP 1.
+If target has the .SYMBOL attribute set then look for it in the library.
+If found, replace the target name with the library member name and continue
+with step 2. If the name is not found then return.
+.IP 2.
+Extract the suffix portion (that following the `.') of the target name.
+If the suffix is not null, look up the special target .SOURCE.<suff>
+(<suff> is the suffix).
+If the special target exists then search each directory given in
+the .SOURCE.<suff> prerequisite list for the target.
+If the target's suffix was null (ie. \fI.suff\fP was empty) then
+perform the above search but use the special target .SOURCE.NULL instead.
+If at any point a match is found then terminate the search.
+If a directory in the prerequisite list is the special name `.NULL ' perform
+a search for the full target name without prepending any directory portion
+(ie. prepend the NULL directory).
+.IP 3.
+The search in step 2. failed. Repeat the same search but this time
+use the special target .SOURCE.
+(a default target of '.SOURCE : .NULL' is defined by \fBdmake\fP at startup,
+and is user redefinable)
+.IP 4.
+The search in step 3. failed.
+If the target has the library member attribute (.LIBMEMBER)
+set then try to find the target in the library which was passed along
+with the .LIBMEMBER attribute (see the MAKING LIBRARIES section).
+The bound file name assigned to a target which is successfully
+located in a library is the same name that would be assigned had the search
+failed (see 5.).
+.IP 5.
+The search failed. Either the target was not found in any of the search
+directories or no applicable .SOURCE special targets exist.
+If applicable .SOURCE special targets exist, but the target was not found,
+then \fBdmake\fP assigns the first name searched as the bound file name.
+If no applicable .SOURCE special targets exist,
+then the full original target name becomes the bound file name.
+.RE
+.PP
+There is potential here for a lot of search operations. The trick is to
+define .SOURCE.x special targets with short search lists and leave .SOURCE
+as short as possible.
+The search algorithm has the following useful side effect.
+When a target having the .LIBMEMBER (library member) attribute is searched for,
+it is first searched for as an ordinary file.
+When a number of library members require updating it is desirable to compile
+all of them first and to update the library at the end in a single operation.
+If one of the members does not compile and \fBdmake\fP stops, then
+the user may fix the error and make again. \fBdmake\fP will not remake any
+of the targets whose object files have already been generated as long as
+none of their prerequisite files have been modified as a result of the fix.
+.PP
+When \fBdmake\fP constructs target (and prerequisite) pathnames they are
+normalized to the shortest (or most natural, see below for the cygwin case)
+representation. Substrings like './' or of the form 'baz/..' are removed
+and multiple slashes are collapsed to one unless they are at the beginning
+of the pathname. Leading slashes are normalized according to POSIX rules,
+i.e. more than two leading slashes are reduced to one slash and a
+leading '//' is kept as it might have a special meaning.
+For example "./foo", "bar/../foo" and foo are recognized as the same file.
+This may result in somewhat unexpected values of the macro expansion
+of runtime macros like \fB$@\fP, but is infact the corect result.
+.PP
+\fBNOTE:\fP A cygwin \fBdmake\fP executable will accept DOS like pathnames
+with drive letters and cygwin POSIX pathnames and normalize them into its
+natural POSIX representation. This might result in even more surprising
+values of runtime macros.
+.PP
+When defining .SOURCE and .SOURCE.x targets the construct
+.RS
+.sp
+\&.SOURCE :
+.br
+\&.SOURCE : fred gery
+.sp
+.RE
+is equivalent to
+.RS
+.sp
+\&.SOURCE :\- fred gery
+.RE
+.PP
+\fBdmake\fP correctly handles the UNIX Make variable VPATH. By definition VPATH
+contains a list of ':' separated directories to search when looking for a
+target. \fBdmake\fP maps VPATH to the following special rule:
+.RS
+.sp
+\&.SOURCE :^ $(VPATH:s/:/ /)
+.sp
+.RE
+Which takes the value of VPATH and sets .SOURCE to the same set of directories
+as specified in VPATH.
+.SH "PERCENT(%) RULES AND MAKING INFERENCES"
+When \fBdmake\fP makes a target, the target's set of prerequisites (if any)
+must exist and the target must have a recipe which \fBdmake\fP
+can use to make it.
+If the makefile does not specify an explicit recipe for the target then
+.B dmake
+uses special rules to try to infer a recipe which it can use
+to make the target. Previous versions of Make perform this task by using
+rules that are defined by targets of the form .<suffix>.<suffix> (this is still
+supported, see "AUGMAKE META RULES") or by using the \fBnot supported\fP by
+dmake .SUFFIXES list of suffixes (see "SPECIAL TARGETS" for more details
+about .SUFFIXES). The exact workings of this mechanism
+were sometimes difficult to understand and often limiting in their usefulness.
+Instead, \fBdmake\fP supports the concept of \fI%-meta\fP rules.
+The syntax and semantics of these rules differ from standard rule lines as
+follows:
+.sp
+.nf
+.RS
+\fI<%-targets>\fP [\fI<attributes>\fP] \fI<ruleop>\fP [\fI<%-prereqs>\fP] [;\fI<recipe>\fP]
+.RE
+.fi
+.sp
+where \fI%-targets\fP are one or more targets containing exactly a single `%'
+sign,
+.I attributes
+is a list (possibly empty) of attributes,
+.I ruleop
+is the standard set of rule operators,
+.I "%-prereqs"
+\&, if present, is a list of prerequisites containing zero or more `%' signs,
+and
+.I recipe,
+if present, is the first line of the recipe.
+.PP
+If more than one %-target is present this line is equivalent to a repetition
+of the whole [<attributes>] <ruleop> [<%-prereqs>] [;<recipe>] sequence
+for each %-target, i.e. it is possible to specify the same rule for multiple
+%-targets. Because of this following only speaks about \fI<%-target>\fP as
+\fI%-targets\fP are divided into multiple definitions with a single %-target.
+.PP
+\fBNOTE:\fP As multiple %-targets didn't work reliably with dmake versions prior
+to 4.5 unless the rule operator `|:' was used we currently issue a warning
+stating that it \fBnow\fP works.
+.PP
+The
+.I %-target
+defines a pattern against which a target whose recipe is
+being inferred gets matched. The pattern match goes as follows: all chars are
+matched exactly from left to right up to but not including the % sign in the
+pattern, % then matches the longest string from the actual target name
+not ending in
+the suffix given after the % sign in the pattern.
+Consider the following examples:
+.RS
+.sp
+.nf
+.Is "dir/%.c "
+.Ii "%.c"
+matches fred.c but not joe.c.Z
+.Ii "dir/%.c"
+matches dir/fred.c but not dd/fred.c
+.Ii "fred/%"
+matches fred/joe.c but not f/joe.c
+.Ii "%"
+matches anything
+.fi
+.sp
+.RE
+In each case the part of the target name that matched the % sign is retained
+and is substituted for any % signs in the prerequisite list of the %-meta rule
+when the rule is selected during inference and
+.B dmake
+constructs the new dependency.
+.PP
+.B Please note,
+that only the first, non-indirect, prerequisite of the list is used for the
+inference mechanism. If more than one non-indirect prerequisite is given
+a warning is issued and all but the first non-indirect prerequisites are
+ignored. See below for a description of indirect prerequisites.
+.PP
+As an example the following %-meta rules describe the following:
+.RS
+.sp
+%.c : %.y ; recipe...
+.sp
+.RE
+describes how to make any file ending in .c if a corresponding file ending
+in .y can be found.
+.RS
+.sp
+foo%.o : fee%.k ; recipe...
+.sp
+.RE
+is used to describe how to make fooxxxx.o from feexxxx.k.
+.RS
+.sp
+%.a :; recipe...
+.sp
+.RE
+describes how to make a file whose suffix is .a without inferring any
+prerequisites.
+.RS
+.sp
+%.c : %.y 'yaccsrc/%.y' ; recipe...
+.sp
+.RE
+matches the corresponding .y file as prerequisite and additionally another .y
+file in the yaccsrc subdirectory as indirect prerequisite.
+Another interesting example is:
+.RS
+.sp
+% : RCS/%,v ; co $<
+.sp
+.RE
+which describes how to take any target and check it out of
+the RCS directory if the corresponding file exists in the RCS directory.
+The equivalent SCCS rule would be:
+.RS
+.sp
+% : s.% ; get $<
+.sp
+.RE
+.PP
+The previous RCS example defines an infinite rule, because it says how to make
+.I anything
+from RCS/%,v, and
+.I anything
+also includes RCS/fred.c,v.
+To limit the size of the graph that results from such rules
+.B dmake
+uses the macro variable PREP (stands for % repetition). By default the value
+of this variable is 0, which says that no repetitions of a %-rule are to be
+generated. If it is set to something greater than 0, then that many
+repetitions of any infinite %-rule are allowed. If in the above
+example PREP was set to 1, then \fBdmake\fP would generate the dependency
+graph:
+.RS
+.sp
+% --> RCS/%,v --> RCS/RCS/%,v,v
+.sp
+.RE
+Where each link is assigned the same recipe as the first link.
+PREP should be used only in special cases, since it may result in
+a large increase in the number of possible prerequisites tested.
+.B dmake
+further assumes that any target that has no suffix can be made from
+a prerequisite that has at least one suffix.
+.PP
+.B dmake
+supports dynamic prerequisite generation for prerequisites of %-meta rules.
+This is best illustrated by an example. The RCS rule shown above can infer
+how to check out a file from a corresponding RCS file only if the target
+is a simple file name with no directory information. That is, the above rule
+can infer how to find \fIRCS/fred.c,v\fP from the target \fIfred.c\fP,
+but cannot infer how to find \fIsrcdir/RCS/fred.c,v\fP from \fIsrcdir/fred.c\fP
+because the above rule will cause \fBdmake\fP to look for RCS/srcdir/fred.c,v;
+which does not exist (assume that srcdir has its own RCS directory as is the
+common case).
+.PP
+A more versatile formulation of the above RCS check out rule is the following:
+.RS
+.sp
+% : $$(@:d)RCS/$$(@:f),v : co $@
+.sp
+.RE
+This rule uses the dynamic macro $@ to specify the prerequisite to try to
+infer. During inference of this rule the macro $@ is set to the value of
+the target of the %-meta rule and the appropriate prerequisite is generated by
+extracting the directory portion of the target name (if any), appending the
+string \fIRCS/\fP to it, and appending the target file name with a trailing
+\fI,v\fP attached to the previous result.
+.PP
+.B dmake
+can also infer indirect prerequisites.
+An inferred target can have a list of prerequisites added that will not
+show up in the value of $< but will show up in the value of $? and $&.
+Indirect prerequisites are specified in an inference rule by quoting the
+prerequisite with single quotes. For example, if you had the explicit
+dependency:
+.RS
+.sp
+.nf
+fred.o : fred.c ; rule to make fred.o
+fred.o : local.h
+.fi
+.sp
+.RE
+then this can be inferred for fred.o from the following inference rule:
+.RS
+.sp
+%.o : %.c 'local.h' ; makes a .o from a .c
+.sp
+.RE
+You may infer indirect prerequisites that are a function of the value of '%'
+in the current rule. The meta-rule:
+.RS
+.sp
+%.o : %.c '$(INC)/%.h' ; rule to make a .o from a .c
+.sp
+.RE
+infers an indirect prerequisite found in the INC directory whose name is the
+same as the expansion of $(INC), and the prerequisite name depends on the
+base name of the current target.
+The set of indirect prerequisites is attached to the meta rule in which they
+are specified and are inferred only if the rule is used to infer a recipe
+for a target. They do not play an active role in driving the inference
+algorithm.
+The construct:
+.RS
+.sp
+%.o :| %.c %.f 'local.h'; recipe
+.sp
+.RE
+is equivalent to:
+.RS
+.sp
+.nf
+%.o : %.c 'local.h' ; recipe
+%.o : %.f 'local.h' ; recipe
+.fi
+.sp
+.RE
+.PP
+If any of the attributes .EPILOG, .IGNORE, .LIBRARY, .NOSTATE, .PHONY, .PRECIOUS,
+\&.PROLOG, .SETDIR, .SILENT, .SWAP, .USESHELL and .WINPATH
+are given for a %-rule then when that rule is bound to a target
+as the result of an inference, the target's set of attributes is augmented by
+the attributes from the above set that are specified in the bound %-rule.
+Other attributes specified for %-meta rules are not inherited by the target.
+The .SETDIR attribute is treated in a special way.
+If the target already had a .SETDIR attribute set then
+.B dmake
+changes to that directory prior to performing the inference.
+During inference any .SETDIR attributes for the inferred prerequisite
+are honored.
+The directories must exist for a %-meta rule to be selected as a possible
+inference path. If the directories do not exist no error message is issued,
+instead the corresponding path in the inference graph is rejected.
+.PP
+.B dmake
+bases all of its inferences on the inference graph constructed from the
+%-rules defined in the makefile.
+It knows exactly which targets can be made from which prerequisites by
+making queries on the inference graph.
+.PP
+For a %-meta rule to be inferred as the
+rule whose recipe will be used to make a target, the target's name must match
+the %-target pattern, and any inferred %-prerequisite must already exist or
+have an explicit recipe so that the prerequisite can be made.
+Without \fItransitive closure\fP on the inference graph the above rule
+describes precisely when an inference match terminates the search.
+If transitive closure is enabled (the usual case), and a prerequisite does
+not exist or cannot be made, then
+.B dmake
+invokes the inference algorithm recursively on the prerequisite to see if
+there is some way the prerequisite can be manufactured. For, if the
+prerequisite can be made then the current target can also be made using the
+current %-meta rule.
+This means that there is no longer a need to give a rule
+for making a .o from a .y if you have already given a rule for making a .o
+from a .c and a .c from a .y. In such cases
+.B dmake
+can infer how to make the
+\&.o from the .y via the intermediary .c and will remove the .c when the .o is
+made. Transitive closure can be disabled by giving the \-T switch on the
+command line.
+.PP
+A word of caution.
+.B dmake
+bases its transitive closure on the %-meta rule targets.
+When it performs transitive closure it infers how to make a target from a
+prerequisite by performing a pattern match as if the potential prerequisite
+were a new target.
+The set of rules:
+.RS
+.nf
+.sp
+%.o : %.c ; rule for making .o from .c
+%.c : %.y ; rule for making .c from .y
+% : RCS/%,v ; check out of RCS file
+.fi
+.sp
+.RE
+will, by performing transitive closure, allow \fBdmake\fP to infer how to make
+a .o from a .y using a .c as an intermediate temporary file. Additionally
+it will be able to infer how to make a .y from an RCS file, as long as that
+RCS file is in the RCS directory and has a name which ends in .y,v.
+The transitivity computation is performed dynamically for each target that
+does not have a recipe. This has potential to be costly if the %-meta
+rules are not carefully specified. The .NOINFER attribute is used to mark
+a %-meta node as being a final target during inference. Any node with this
+attribute set will not be used for subsequent inferences. As an example
+the node RCS/%,v is marked as a final node since we know that if the RCS file
+does not exist there likely is no other way to make it. Thus the standard
+startup makefile contains an entry similar to:
+.RS
+.nf
+\&.NOINFER : RCS/%,v
+.fi
+.RE
+Thereby indicating that the RCS file is the end of the inference chain.
+Whenever the inference algorithm determines that a target can be made from
+more than one prerequisite and the inference chains for the two methods
+are the same length the algorithm reports an ambiguity and prints the
+ambiguous inference chains.
+.PP
+.B dmake
+tries to
+remove intermediate files resulting from transitive closure if the file
+is not marked as being PRECIOUS, or the \fB\-u\fP flag was not given on the
+command line, and if the inferred intermediate did not previously exist.
+Intermediate targets that existed prior to being made are never removed.
+This is in keeping with the philosophy that
+.B dmake
+should never remove things from the file system that it did not add.
+If the special target .REMOVE is defined and has a recipe then
+.B dmake
+constructs a list of the intermediate files to be removed and makes them
+prerequisites of .REMOVE. It then makes .REMOVE thereby removing the
+prerequisites if the recipe of .REMOVE says to. Typically .REMOVE is defined
+in the startup file as:
+.RS
+.sp
+\&.REMOVE :; $(RM) $<
+.RE
+.SH "AUGMAKE META RULES"
+As a subclass of the meta targets that is actually mapped to %-meta rules
+.B dmake
+understands several SYSV AUGMAKE targets transformations. This .<suffix>
+special target construct transforms into the following %-meta rules:
+.RS
+.sp
+\&.suff :; recipe
+.sp
+.RE
+gets mapped into:
+.RS
+.sp
+% : %.suff; recipe
+.sp
+.RE
+.PP
+.B dmake
+also supports the old format special target .<suffix>.<suffix>
+by identifying any rules
+of this form and mapping them to the appropriate %-rule. So for example if
+an old makefile contains the construct:
+.RS
+.sp
+\&.c.o :; cc \-c $< \-o $@
+.sp
+.RE
+.B dmake
+maps this into the following %-rule:
+.RS
+.sp
+%.o : %.c; cc \-c $< \-o $@
+.sp
+.RE
+The following SYSV AUGMAKE special targets transformation must be
+enabled by providing the \-A flag
+on the command line or by setting the value of AUGMAKE to non\-NULL.
+The construct
+.RS
+.sp
+\&.c~.o :; recipe
+.sp
+.RE
+gets mapped into:
+.RS
+.sp
+%.o : s.%.c ; recipe
+.sp
+.RE
+In general, a special target of the form .<str>~ is replaced by the %-rule
+construct s.%.<str>, thereby providing support for the syntax used by SYSV
+AUGMAKE for providing SCCS support.
+When enabled, these mappings allow processing of existing SYSV
+makefiles without modifications.
+.RE
+.SH "MAKING TARGETS"
+In order to update a target \fBdmake\fP must execute a recipe.
+When a recipe needs to be executed it is first expanded so that any macros
+in the recipe text are expanded, and it is then either executed directly or
+passed to a shell.
+.B dmake
+supports two types of recipes. The regular recipes and group recipes.
+.PP
+When a regular recipe is invoked \fBdmake\fP executes each line of the recipe
+separately using a new copy of a shell if a shell is required.
+Thus effects of commands do not generally persist across recipe lines
+(e.g. cd requests in a recipe line do not carry over to the next recipe line).
+This is true even in environments such as \fBMSDOS\fP, where dmake internally
+sets the current working director to match the directory it was in before
+the command was executed.
+.PP
+The decision on whether a shell is required to execute a command is based on
+the value of the macro SHELLMETAS or on the specification of '+' or .USESHELL
+for the current recipe or target respectively.
+If any character in the value of
+SHELLMETAS is found in the expanded recipe text-line or the use of a shell
+is requested explicitly via '+' or .USESHELL then the command is
+executed using a shell, otherwise the command is executed directly.
+The shell that is used for execution is given by the value of the macro SHELL.
+The flags that are passed to the shell are given by the value of SHELLFLAGS.
+Thus \fBdmake\fP constructs the command line:
+.sp
+\t$(SHELL) $(SHELLFLAGS) $(expanded_recipe_command)
+.sp
+If the $(SHELLCMDQUOTE) macro is set its value is inserted before and after
+the $(expanded_recipe_command) string.
+.sp
+Normally
+.B dmake
+writes the command line that it is about to invoke to standard output.
+If the .SILENT attribute is set for the target or for
+the recipe line (via @), then the recipe line is not echoed.
+.PP
+Group recipe processing is similar to that of regular recipes, except that
+a shell is always invoked. The shell that is invoked is given by the value of
+the macro GROUPSHELL, and its flags are taken from the value of the macro
+GROUPFLAGS. If a target has the .PROLOG attribute set then
+.B dmake
+prepends to the shell script the recipe associated with the special target
+\&.GROUPPROLOG, and if the attribute .EPILOG is set as well, then the recipe
+associated with the special target .GROUPEPILOG is appended to the script
+file.
+This facility can be used to always prepend a common header and common trailer
+to group recipes.
+Group recipes are echoed to standard output just like standard recipes, but
+are enclosed by lines beginning with [ and ].
+.PP
+The recipe flags [+,\-,%,@] are recognized at the start of a recipe line
+even if they appear in a macro. For example:
+.RS
+.sp
+.nf
+SH = +
+all:
+\t$(SH)echo hi
+.fi
+.sp
+.RE
+is completely equivalent to writing
+.RS
+.sp
+.nf
+SH = +
+all:
+\t+echo hi
+.fi
+.sp
+.RE
+.PP
+The last step performed by
+.B dmake
+prior to running a recipe is to set the macro CMNDNAME to the name of the
+command to execute (determined by finding the first white\-space ending token
+in the command line). It then sets the macro CMNDARGS to be the remainder
+of the line.
+.B dmake
+then expands the macro COMMAND which by default is set to
+.RS
+.sp
+COMMAND = $(CMNDNAME) $(CMNDARGS)
+.sp
+.RE
+The result of this final expansion is the command that will be executed.
+The reason for this expansion is to allow for a different interface to
+the argument passing facilities (esp. under DOS) than that provided by
+.B dmake\fR.\fP
+You can for example define COMMAND to be
+.RS
+.sp
+COMMAND = $(CMNDNAME) @$(mktmp $(CMNDARGS))
+.sp
+.RE
+which dumps the arguments into a temporary file and runs the command
+.RS
+.sp
+$(CMNDNAME) @/tmp/ASAD23043
+.sp
+.RE
+which has a much shorter argument list. It is now up to the command to
+use the supplied argument as the source for all other arguments.
+As an optimization, if COMMAND is not defined
+.B dmake
+does not perform the above expansion. On systems, such as UNIX, that
+handle long command lines this provides a slight saving in processing the
+makefiles.
+.SH "MAKING LIBRARIES"
+Libraries are easy to maintain using \fBdmake\fP. A library is a file
+containing a collection of object files.
+Thus to make a library you simply specify it as a target with the .LIBRARY
+attribute set and specify its list of prerequisites. The prerequisites should
+be the object members that are to go into the library. When
+.B dmake
+makes the library target it uses the .LIBRARY attribute to pass to the
+prerequisites the .LIBMEMBER attribute and the name of the library. This
+enables the file binding mechanism to look for the member in the library if an
+appropriate object file cannot be found.
+.B dmake
+now supports \fBElf\fP libraries on systems that support \fBElf\fP and
+hence supports, on those systems, long member file names.
+A small example best illustrates this.
+.RS
+.nf
+.sp
+mylib.a .LIBRARY : mem1.o mem2.o mem3.o
+\trules for making library...
+\t# remember to remove .o's when lib is made
+.sp
+# equivalent to: '%.o : %.c ; ...'
+\&.c.o :; rules for making .o from .c say
+.sp
+.fi
+.RE
+.B dmake
+will use the .c.o rule for making the library members if appropriate .c files
+can be found using the search rules. NOTE: this is not specific in any way
+to C programs, they are simply used as an example.
+.PP
+.B dmake
+tries to handle the old library construct format in a sensible way.
+The construct
+.I lib(member.o)
+is separated and the \fIlib\fP portion is declared
+as a library target.
+The new target is defined
+with the .LIBRARY attribute set and the \fImember.o\fP portion of the
+construct is
+declared as a prerequisite of the lib target.
+If the construct \fIlib(member.o)\fP
+appears as a prerequisite of a target in the
+makefile, that target has the new name of the lib assigned as its
+prerequisite. Thus the following example:
+.RS
+.sp
+.nf
+a.out : ml.a(a.o) ml.a(b.o); $(CC) \-o $@ $<
+
+\&.c.o :; $(CC) \-c $(CFLAGS) \-o $@ $<
+%.a:
+.RS
+ar rv $@ $?
+ranlib $@
+rm \-rf $?
+.RE
+.sp
+.fi
+.RE
+constructs the following dependency
+graph.
+.RS
+.sp
+.nf
+a.out : ml.a; $(CC) \-o $@ $<
+ml.a .LIBRARY : a.o b.o
+
+%.o : %.c ; $(CC) -c $(CFLAGS) \-o $@ $<
+%.a :
+.RS
+ar rv $@ $?
+ranlib $@
+rm -rf $?
+.RE
+.sp
+.fi
+.RE
+and making a.out then works as expected.
+.PP
+The same thing happens for any target of the form \fIlib((entry))\fP.
+These targets have an
+additional feature in that the \fIentry\fP target has the .SYMBOL attribute
+set automatically.
+.PP
+NOTE: If the notion of entry points is supported by the archive and by
+\fBdmake\fP (currently not the case) then
+.B dmake
+will search the archive for the entry point and return not only the
+modification time of the member which defines the entry but also the name of
+the member file. This name will then replace \fIentry\fP and will be used for
+making the member file. Once bound to an archive member the .SYMBOL
+attribute is removed from the target.
+This feature is presently disabled as there is little standardization
+among archive formats, and we have yet to find a makefile utilizing this
+feature (possibly due to the fact that it is unimplemented in most versions
+of UNIX Make).
+.PP
+Finally, when
+.B dmake
+looks for a library member it must first locate the library file.
+It does so by first looking for the library relative to the current directory
+and if it is not found it then looks relative to the current value of
+$(TMD). This allows commonly used libraries to be kept near the root of
+a source tree and to be easily found by
+.B dmake\fR.\fP
+.SH "KEEP STATE"
+.B dmake
+supports the keeping of state information for targets that it makes whenever
+the macro .KEEP_STATE is assigned a value. The value of the macro should be
+the name of a state file that will contain the state information. If state
+keeping is enabled then each target that does not poses the .NOSTATE
+attribute will have a record written into the state file indicating the
+target's name, the current directory, the command used to update the target,
+and which, if any, :: rule is being used. When you make this target again
+if any of this information does not match the previous settings and the
+target is not out dated it will still be re\-made. The assumption is that one
+of the conditions above has changed and that we wish to remake the target.
+For example,
+state keeping is used in the maintenance of
+.B dmake
+to test compile different versions of the source using different compilers.
+Changing the compiler causes the compilation flags to be modified and hence
+all sources to be recompiled.
+.PP
+The state file is an ascii file and is portable, however it is
+not in human readable form as the entries represent hash keys of the above
+information.
+.PP
+The Sun Microsystem's Make construct
+.RS
+.sp
+\&.KEEP_STATE :
+.sp
+.RE
+is recognized and is mapped to \fB.KEEP_STATE:=_state.mk\fP.
+The
+.B dmake
+version of state keeping does not include scanning C source files for
+dependencies like Sun Make. This is specific to C programs and it was
+felt that it does not belong in make.
+.B dmake
+instead provides the tool, \fBcdepend\fP, to scan C source files and to produce
+depedency information. Users are free to modify cdepend to produce other
+dependency files. (NOTE:
+.B cdepend
+does not come with the distribution at this time, but will be available in
+a patch in the near future)
+.SH "MULTI PROCESSING"
+If the architecture supports it then \fBdmake\fP is capable of making a target's
+prerequisites in parallel. \fBdmake\fP will make as much in parallel as it
+can and use a number of child processes up to the maximum specified by
+MAXPROCESS or by the value supplied to the \-P command line flag.
+A parallel make is enabled by setting the value of MAXPROCESS (either directly
+or via \-P option) to a value which is > 1.
+\fBdmake\fP guarantees that all dependencies as specified in the makefile are
+honored. A target will not be made until all of its prerequisites have been
+made. Note that when you specify \fB-P 4\fP then four child processes are
+run concurrently but \fBdmake\fP actually displays the fifth command it will
+run immediately upon a child process becomming free. This is an artifact of
+the method used to traverse the dependency graph and cannot be removed.
+If a parallel make is being performed then the following restrictions on
+parallelism are enforced.
+.RS
+.IP 1.
+Individual recipe lines in a non-group recipe are performed sequentially in
+the order in which they are specified within the makefile and in parallel with
+the recipes of other targets.
+.IP 2.
+If a target contains multiple recipe definitions (cf. :: rules) then these are
+performed sequentially in the order in which the :: rules are specified within
+the makefile and in parallel with the recipes of other targets.
+.IP 3.
+If a target rule contains the `!' modifier, then the recipe is performed
+sequentially for the list of outdated prerequisites and in parallel with the recipes of other targets.
+.IP 4.
+If a target has the .SEQUENTIAL attribute set then all of its prerequisites
+are made sequentially relative to one another (as if MAXPROCESS=1), but in
+parallel with other targets in the makefile.
+.RE
+.PP
+Note: If you specify a parallel make then
+the order of target update and the order in which the associated recipes are
+invoked will not correspond to that displayed by the \-n flag.
+.SH "CONDITIONALS"
+.B dmake
+supports a makefile construct called a \fIconditional\fR. It allows
+the user
+to conditionally select portions of makefile text for input processing
+and to discard other portions. This becomes useful for
+writing makefiles that are intended to function for more than one target
+host and environment. The conditional expression is specified as follows:
+.sp
+.RS
+.nf
+\&.IF \fIexpression\fR
+ ... if text ...
+\&.ELIF \fIexpression\fR
+ ... if text ...
+\&.ELSE
+ ... else text ...
+\&.END
+.RE
+.fi
+.sp
+The .ELSE and .ELIF portions are optional, and the conditionals may be
+nested (ie. the text may contain another conditional).
+\&.IF, .ELSE, and .END
+may appear anywhere in the makefile, but a single conditional expression
+may not span multiple makefiles.
+.PP
+\fIexpression\fR can be one of the following forms:
+.sp
+String evaluation
+.br
+\t<text> | <text> == <text> | <text> != <text>
+.sp
+Numeric evaluation
+.br
+\t<text> <= <text> | <text> >= <text>
+.sp
+Boolean evaluation
+.br
+\t( <text> ) | <text> || <text> | <text> && <text>
+.sp
+where \fItext\fR is either text or a macro expression. In any case,
+before the comparison is made, the expression is expanded. The text
+portions are then selected and compared. In the case of the numeric
+comparisons enclosing quotes are removed after expanding the expressions
+and the leading numerical parts are converted to an integer number. If no
+numerical part is found this results to 0 (zero). The
+string "12ab" for example evaluates to the number 12.
+Expressions can be nested with () and the use of || or &&.
+White space at the start and
+end of the text portion is discarded before the comparison. This means
+that a macro that evaluates to nothing but white space is considered a
+NULL value for the purpose of the comparison.
+In the first case the expression evaluates TRUE if the text is not NULL
+otherwise it evaluates FALSE. The remaining two cases both evaluate the
+expression on the basis of a string comparison.
+If a macro expression needs to be equated to a NULL string then compare it to
+the value of the macro $(NULL).
+You can use the $(shell ...) macro to construct more complex test expressions.
+.SH "EXAMPLES"
+.RS
+.nf
+.sp
+# A simple example showing how to use make
+#
+prgm : a.o b.o
+ cc a.o b.o \-o prgm
+a.o : a.c g.h
+ cc a.c \-o $@
+b.o : b.c g.h
+ cc b.c \-o $@
+.fi
+.RE
+.sp
+In the previous
+example prgm is remade only if a.o and/or b.o is out of date with
+respect to prgm.
+These dependencies can be stated more concisely
+by using the inference rules defined in the standard startup file.
+The default rule for making .o's from .c's looks something like this:
+.sp
+\&\t%.o : %.c; cc \-c $(CFLAGS) \-o $@ $<
+.sp
+Since there exists a rule (defined in the startup file)
+for making .o's from .c's
+\fBdmake\fR will use that rule
+for manufacturing a .o from a .c and we can specify our dependencies
+more concisely.
+.sp
+.RS
+.nf
+prgm : a.o b.o
+ cc \-o prgm $<
+a.o b.o : g.h
+.fi
+.RE
+.sp
+A more general way to say the above using the new macro expansions
+would be:
+.sp
+.RS
+.nf
+SRC = a b
+OBJ = {$(SRC)}.o
+.sp
+prgm : $(OBJ)
+ cc \-o $@ $<
+.sp
+$(OBJ) : g.h
+.fi
+.RE
+.sp
+If we want to keep the objects in a separate directory, called
+objdir, then we would write
+something like this.
+.sp
+.RS
+.nf
+SRC = a b
+OBJ = {$(SRC)}.o
+.sp
+prgm : $(OBJ)
+ cc $< \-o $@
+.sp
+$(OBJ) : g.h
+\&%.o : %.c
+ $(CC) \-c $(CFLAGS) \-o $(@:f) $<
+ mv $(@:f) objdir
+
+\&.SOURCE.o : objdir # tell dmake to look here for .o's
+.fi
+.RE
+.sp
+An example of building library members would go something like this:
+(NOTE: The same rules as above will be used to produce .o's from .c's)
+.sp
+.RS
+.nf
+SRC\t= a b
+LIB\t= lib
+LIBm\t= { $(SRC) }.o
+.sp
+prgm: $(LIB)
+ cc \-o $@ $(LIB)
+.sp
+$(LIB) .LIBRARY : $(LIBm)
+ ar rv $@ $<
+ rm $<
+.fi
+.RE
+.sp
+Finally, suppose that each of the source files in the previous example had
+the `:' character in their target name. Then we would write the above example
+as:
+.sp
+.RS
+.nf
+SRC\t= f:a f:b
+LIB\t= lib
+LIBm\t= "{ $(SRC) }.o" # put quotes around each token
+.sp
+prgm: $(LIB)
+ cc \-o $@ $(LIB)
+.sp
+$(LIB) .LIBRARY : $(LIBm)
+ ar rv $@ $<
+ rm $<
+.fi
+.RE
+.SH "COMPATIBILITY"
+There are two notable differences between
+.B \fBdmake\fR
+and the standard version of BSD UNIX 4.2/4.3 Make.
+.RS
+.IP 1. .3i
+BSD UNIX 4.2/4.3 Make supports wild card filename expansion for
+prerequisite names. Thus if a directory contains a.h, b.h and c.h, then a
+line like
+.sp
+\ttarget: *.h
+.sp
+will cause UNIX make to expand the *.h into "a.h b.h c.h". \fBdmake\fR
+does not support this type of filename expansion.
+.IP 2. .3i
+Unlike UNIX make, touching a library member causes \fBdmake\fR
+to search the library for the member name and to update the library time stamp.
+This is only implemented in the UNIX version.
+MSDOS and other versions may not have librarians that keep file time stamps,
+as a result \fBdmake\fR touches the library file itself, and prints a warning.
+.RE
+.PP
+\fBdmake\fP is not compatible with GNU Make. In particular it does not
+understand GNU Make's macro expansions that query the file system.
+.PP
+.B dmake
+is fully compatible with SYSV AUGMAKE, and supports the following AUGMAKE
+features:
+.RS
+.IP 1. .3i
+GNU Make style \fBinclude\fP, and \fBif/else/endif\fP directives are allowed
+in non-group recipes.
+Thus, the word \fBinclude\fP appearing at
+the start of a line that is not part of a gruop recipe will be mapped
+to the ".INCLUDE" directive that \fBdamke\fP uses.
+Similarly, the words \fBifeq\fP,\fBifneq\fP,\fBelif\fP,\fBelse\fP,
+and \fBendif\fP are mapped to their corresponding \fBdmake\fP equivalents.
+.IP 2. .3i
+The macro modifier expression $(macro:str=sub) is understood and is equivalent
+to the expression $(macro:s/str/sub), with the restriction that str must match
+the following regular expression:
+.sp
+\tstr[ |\et][ |\et]*
+.sp
+(ie. str only matches at the end of a token where str is a suffix and is
+terminated by a space, a tab, or end of line)
+Normally \fIsub\fP is expanded before the substitution is made, if you specify
+\-A on the command line then sub is not expanded.
+.IP 3.
+The macro % is defined to be $@ (ie. $% expands to the same value as $@).
+.IP 4.
+The AUGMAKE notion of libraries is handled correctly.
+.IP 5.
+Directories are always made if you specify \fB\-A\fP. This is consistent
+with other UNIX versions of Make.
+.IP 6.
+Makefiles that utilize virtual targets to force making of other targets work
+as expected if AUGMAKE special target handling is enabled. For example:
+.sp
+.nf
+\tFRC:
+\tmyprog.o : myprog.c $(FRC) ; ...
+.fi
+.sp
+Works as expected if you issue the command
+.sp
+\t'\fBdmake\fP \-A FRC=FRC'
+.sp
+but fails with a 'don't know how to make FRC'
+error message if you do not specify AUGMAKE special target handling via
+the \-A flag (or by setting AUGMAKE:=yes internally).
+.RE
+.SH "LIMITS"
+In some environments the length of an argument string is restricted.
+(e.g. MSDOS command line arguments cannot be longer than 128 bytes if you are
+using the standard command.com command interpreter as your shell,
+.B dmake
+text diversions may help in these situations.)
+.SH "PORTABILITY"
+To write makefiles that can be moved from one environment to another requires
+some forethought. In particular you must define as macros all those things
+that may be different in the new environment.
+.B dmake
+has two facilities that help to support writing portable makefiles, recursive
+macros and conditional expressions. The recursive macros, allow one to define
+environment configurations that allow different environments for similar types
+of operating systems. For example the same make script can be used for SYSV and
+BSD but with different macro definitions.
+.PP
+To write a makefile that is portable between UNIX and MSDOS requires both
+features since in almost all cases you will need to define new recipes for
+making targets. The recipes will probably be quite different since the
+capabilities of the tools on each machine are different. Different
+macros will be needed to help handle the smaller differences in the two
+environments.
+.SH FILES
+Makefile, makefile, startup.mk (use dmake \-V to tell you where the startup
+file is)
+.SH "SEE ALSO"
+sh(1), csh(1), touch(1), f77(1), pc(1), cc(1)
+.br
+S.I. Feldman \fIMake - A Program for Maintaining Computer Programs\fP
+.SH "AUTHOR"
+Dennis Vadura, dvadura@wticorp.com
+.br
+Many thanks to Carl Seger for his helpful suggestions,
+and to Trevor John Thompson for his many excellent ideas and
+informative bug reports. Many thanks also go to those on the
+NET that have helped in making \fBdmake\fP one of the best Make tools
+available.
+.SH BUGS
+Some system commands return non-zero status inappropriately.
+Use
+.B \-i
+(`\-' within the makefile) to overcome the difficulty.
+.PP
+Some systems do not have easily accessible
+time stamps for library members (MSDOS, AMIGA, etc)
+for these \fBdmake\fR uses the time stamp of the library instead and prints
+a warning the first time it does so. This is almost always ok, except when
+multiple makefiles update a single library file. In these instances it is
+possible to miss an update if one is not careful.
+.PP
+This man page is way too long.
+.SH WARNINGS
+Rules supported by make(1) may not work if transitive closure is turned off
+(-T, .NOINFER).
+.PP
+PWD from csh/ksh will cause problems if a cd operation is performed and
+-e or -E option is used.
+.PP
+Using internal macros such as COMMAND, may wreak havoc if you don't understand
+their functionality.
diff --git a/dmake/man/readme b/dmake/man/readme
new file mode 100644
index 000000000000..68c364e30056
--- /dev/null
+++ b/dmake/man/readme
@@ -0,0 +1,12 @@
+This directory contains the DMAKE manual page.
+
+The files found here are:
+
+ dmake.tf - troff source for the manual page, you must use GNU groff
+ to typeset it or copy it as dmake.1 into a directory in
+ your search path for man pages to view it with the man
+ command.
+
+ dmake.nc - a typeset version of the manual page containing no control
+ characters. Generated with:
+ "groff -mman -rcR=0 -Tlatin1 -P -bcu dmake.tf > dmake.nc"
diff --git a/dmake/missing b/dmake/missing
new file mode 100755
index 000000000000..894e786e16c1
--- /dev/null
+++ b/dmake/missing
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/dmake/mkinstalldirs b/dmake/mkinstalldirs
new file mode 100755
index 000000000000..259dbfcd3578
--- /dev/null
+++ b/dmake/mkinstalldirs
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/dmake/msdos/arlib.c b/dmake/msdos/arlib.c
new file mode 100644
index 000000000000..ecd556b7d621
--- /dev/null
+++ b/dmake/msdos/arlib.c
@@ -0,0 +1,56 @@
+/* RCS $Id: arlib.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- Library access code.
+--
+-- DESCRIPTION
+-- This implementation uses the library timestamp inplace of the
+-- library member timestamp.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+PUBLIC time_t
+seek_arch(name, lib)
+char* name;
+char* lib;
+{
+ static int warned = FALSE;
+
+ if (!warned && !(Glob_attr&A_SILENT))
+ warned = TRUE,
+ Warning("Can't extract library member timestamp;\n\
+ using library timestamp instead.");
+ return (Do_stat(lib, NULL, NULL, TRUE));
+}
+
+PUBLIC int
+touch_arch(name, lib)
+char* name;
+char* lib;
+{
+ static int warned = FALSE;
+
+ if (!warned && !(Glob_attr&A_SILENT))
+ warned = TRUE,
+ Warning("Can't update library member timestamp;\n\
+ touching library instead.");
+ return (Do_touch(lib, NULL, NULL));
+}
+
diff --git a/dmake/msdos/borland/bcc30/config.h b/dmake/msdos/borland/bcc30/config.h
new file mode 100644
index 000000000000..3db5098145fa
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/config.h
@@ -0,0 +1,48 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:08 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Have to pull this in for the standard lib defines */
+#include <io.h>
diff --git a/dmake/msdos/borland/bcc30/config.mk b/dmake/msdos/borland/bcc30/config.mk
new file mode 100644
index 000000000000..0b1d122a868c
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/config.mk
@@ -0,0 +1,8 @@
+
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+LDLIBS = e:/cc/borland/bcc30/lib/c$(MODEL)
+CSTARTUP = e:/cc/borland/bcc30/lib/c0$(MODEL).obj
+
+CFLAGS += -I$(osedir) -w-pia
diff --git a/dmake/msdos/borland/bcc30/lib.rsp b/dmake/msdos/borland/bcc30/lib.rsp
new file mode 100644
index 000000000000..41e591347bae
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/lib.rsp
@@ -0,0 +1 @@
+d:\cc\borland\bcc30\lib\cl
diff --git a/dmake/msdos/borland/bcc30/libswp.rsp b/dmake/msdos/borland/bcc30/libswp.rsp
new file mode 100644
index 000000000000..64f053bf1fb1
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/libswp.rsp
@@ -0,0 +1 @@
+e:\cc\borland\bcc30\lib\cl
diff --git a/dmake/msdos/borland/bcc30/mkswp.bat b/dmake/msdos/borland/bcc30/mkswp.bat
new file mode 100755
index 000000000000..9266d8dfc0cd
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/mkswp.bat
@@ -0,0 +1,107 @@
+md objects
+tasm -t -mx -dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia infer.c
+copy infer.obj objects
+del infer.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia make.c
+copy make.obj objects
+del make.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia stat.c
+copy stat.obj objects
+del stat.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia expand.c
+copy expand.obj objects
+del expand.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia hash.c
+copy hash.obj objects
+del hash.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dag.c
+copy dag.obj objects
+del dag.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia path.c
+copy path.obj objects
+del path.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia parse.c
+copy parse.obj objects
+del parse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia quit.c
+copy quit.obj objects
+del quit.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia state.c
+copy state.obj objects
+del state.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia percent.c
+copy percent.obj objects
+del percent.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia function.c
+copy function.obj objects
+del function.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\find.c
+copy find.obj objects
+del find.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\borland\utime.c
+copy utime.obj objects
+del utime.obj
+tlink @msdos\borland\bcc30\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc30\libswp.rsp
+copy msdos\borland\bcc30\template.mk startup\config.mk
diff --git a/dmake/msdos/borland/bcc30/obj.rsp b/dmake/msdos/borland/bcc30/obj.rsp
new file mode 100644
index 000000000000..3f396242ce36
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/obj.rsp
@@ -0,0 +1,34 @@
+d:\cc\borland\bcc30\lib\c0l.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\tee.obj+
+objects\dirlib.obj+
+objects\find.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc30/objswp.rsp b/dmake/msdos/borland/bcc30/objswp.rsp
new file mode 100644
index 000000000000..aa0bf5e5831a
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/objswp.rsp
@@ -0,0 +1,36 @@
+e:\cc\borland\bcc30\lib\c0l.obj+
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc30/public.h b/dmake/msdos/borland/bcc30/public.h
new file mode 100644
index 000000000000..dde6da773177
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:43:40 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/borland/bcc30/template.mk b/dmake/msdos/borland/bcc30/template.mk
new file mode 100644
index 000000000000..df574e09c7aa
--- /dev/null
+++ b/dmake/msdos/borland/bcc30/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc30
diff --git a/dmake/msdos/borland/bcc40/config.h b/dmake/msdos/borland/bcc40/config.h
new file mode 100644
index 000000000000..3a9b58383498
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/config.h
@@ -0,0 +1,51 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:30 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Borland redefined the environment variable, sigh */
+#define environ _environ
+
+/* Have to pull this in for the standard lib defines */
+#include <io.h>
diff --git a/dmake/msdos/borland/bcc40/config.mk b/dmake/msdos/borland/bcc40/config.mk
new file mode 100644
index 000000000000..550b86950705
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/config.mk
@@ -0,0 +1,7 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+LDLIBS = e:/cc/borland/bcc40/lib/c$(MODEL)
+CSTARTUP = e:/cc/borland/bcc40/lib/c0$(MODEL).obj
+
+CFLAGS += -I$(osedir) -w-pro
diff --git a/dmake/msdos/borland/bcc40/lib.rsp b/dmake/msdos/borland/bcc40/lib.rsp
new file mode 100644
index 000000000000..828ccf4ab0b8
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/lib.rsp
@@ -0,0 +1,2 @@
+e:\cc\borland\bcc40\lib\cw32+
+e:\cc\borland\bcc40\lib\import32
diff --git a/dmake/msdos/borland/bcc40/libswp.rsp b/dmake/msdos/borland/bcc40/libswp.rsp
new file mode 100644
index 000000000000..1557935cd40c
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/libswp.rsp
@@ -0,0 +1 @@
+e:\cc\borland\bcc40\lib\cl
diff --git a/dmake/msdos/borland/bcc40/mkswp.bat b/dmake/msdos/borland/bcc40/mkswp.bat
new file mode 100755
index 000000000000..d8a1bf824de4
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/mkswp.bat
@@ -0,0 +1,107 @@
+md objects
+tasm -t -mx -dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro infer.c
+copy infer.obj objects
+del infer.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro make.c
+copy make.obj objects
+del make.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro stat.c
+copy stat.obj objects
+del stat.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro expand.c
+copy expand.obj objects
+del expand.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro hash.c
+copy hash.obj objects
+del hash.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dag.c
+copy dag.obj objects
+del dag.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro path.c
+copy path.obj objects
+del path.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro parse.c
+copy parse.obj objects
+del parse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro quit.c
+copy quit.obj objects
+del quit.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro state.c
+copy state.obj objects
+del state.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro percent.c
+copy percent.obj objects
+del percent.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro function.c
+copy function.obj objects
+del function.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\find.c
+copy find.obj objects
+del find.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\borland\utime.c
+copy utime.obj objects
+del utime.obj
+tlink @msdos\borland\bcc40\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc40\libswp.rsp
+copy msdos\borland\bcc40\template.mk startup\config.mk
diff --git a/dmake/msdos/borland/bcc40/obj.rsp b/dmake/msdos/borland/bcc40/obj.rsp
new file mode 100644
index 000000000000..572259dca8ea
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/obj.rsp
@@ -0,0 +1,34 @@
+e:\cc\borland\bcc40\lib\c0x32.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\find.obj+
+objects\tee.obj+
+objects\dirlib.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc40/objswp.rsp b/dmake/msdos/borland/bcc40/objswp.rsp
new file mode 100644
index 000000000000..712d47f47504
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/objswp.rsp
@@ -0,0 +1,36 @@
+e:\cc\borland\bcc40\lib\c0l.obj+
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc40/public.h b/dmake/msdos/borland/bcc40/public.h
new file mode 100644
index 000000000000..0e80be51da3e
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:43:53 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/borland/bcc40/template.mk b/dmake/msdos/borland/bcc40/template.mk
new file mode 100644
index 000000000000..30a27692f3ed
--- /dev/null
+++ b/dmake/msdos/borland/bcc40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc40
diff --git a/dmake/msdos/borland/bcc45/config.h b/dmake/msdos/borland/bcc45/config.h
new file mode 100644
index 000000000000..b59a431fa317
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/config.h
@@ -0,0 +1,51 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:44 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Borland redefined the environment variable, sigh */
+#define environ _environ
+
+/* Have to pull this in for the standard lib defines */
+#include <io.h>
diff --git a/dmake/msdos/borland/bcc45/config.mk b/dmake/msdos/borland/bcc45/config.mk
new file mode 100644
index 000000000000..550b86950705
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/config.mk
@@ -0,0 +1,7 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+LDLIBS = e:/cc/borland/bcc40/lib/c$(MODEL)
+CSTARTUP = e:/cc/borland/bcc40/lib/c0$(MODEL).obj
+
+CFLAGS += -I$(osedir) -w-pro
diff --git a/dmake/msdos/borland/bcc45/lib.rsp b/dmake/msdos/borland/bcc45/lib.rsp
new file mode 100644
index 000000000000..db2b78d82438
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/lib.rsp
@@ -0,0 +1,2 @@
+e:\cc\borland\bcc45\lib\cw32+
+e:\cc\borland\bcc45\lib\import32
diff --git a/dmake/msdos/borland/bcc45/libswp.rsp b/dmake/msdos/borland/bcc45/libswp.rsp
new file mode 100644
index 000000000000..1557935cd40c
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/libswp.rsp
@@ -0,0 +1 @@
+e:\cc\borland\bcc40\lib\cl
diff --git a/dmake/msdos/borland/bcc45/mkswp.bat b/dmake/msdos/borland/bcc45/mkswp.bat
new file mode 100755
index 000000000000..c6bfede2f370
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/mkswp.bat
@@ -0,0 +1,107 @@
+md objects
+tasm -t -mx -dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro infer.c
+copy infer.obj objects
+del infer.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro make.c
+copy make.obj objects
+del make.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro stat.c
+copy stat.obj objects
+del stat.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro expand.c
+copy expand.obj objects
+del expand.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro hash.c
+copy hash.obj objects
+del hash.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dag.c
+copy dag.obj objects
+del dag.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro path.c
+copy path.obj objects
+del path.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro parse.c
+copy parse.obj objects
+del parse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro quit.c
+copy quit.obj objects
+del quit.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro state.c
+copy state.obj objects
+del state.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro percent.c
+copy percent.obj objects
+del percent.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro function.c
+copy function.obj objects
+del function.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\find.c
+copy find.obj objects
+del find.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\borland\utime.c
+copy utime.obj objects
+del utime.obj
+tlink @msdos\borland\bcc45\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc45\libswp.rsp
+copy msdos\borland\bcc45\template.mk startup\config.mk
diff --git a/dmake/msdos/borland/bcc45/obj.rsp b/dmake/msdos/borland/bcc45/obj.rsp
new file mode 100644
index 000000000000..e1d4b1e23186
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/obj.rsp
@@ -0,0 +1,34 @@
+e:\cc\borland\bcc45\lib\c0x32.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\find.obj+
+objects\tee.obj+
+objects\dirlib.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc45/objswp.rsp b/dmake/msdos/borland/bcc45/objswp.rsp
new file mode 100644
index 000000000000..712d47f47504
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/objswp.rsp
@@ -0,0 +1,36 @@
+e:\cc\borland\bcc40\lib\c0l.obj+
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc45/public.h b/dmake/msdos/borland/bcc45/public.h
new file mode 100644
index 000000000000..b8d43eb32dc9
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:06 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/borland/bcc45/template.mk b/dmake/msdos/borland/bcc45/template.mk
new file mode 100644
index 000000000000..83b5e009033d
--- /dev/null
+++ b/dmake/msdos/borland/bcc45/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc45
diff --git a/dmake/msdos/borland/bcc50/config.h b/dmake/msdos/borland/bcc50/config.h
new file mode 100644
index 000000000000..cd1a8cca5016
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/config.h
@@ -0,0 +1,51 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:58 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Borland redefined the environment variable, sigh */
+#define environ _environ
+
+/* Have to pull this in for the standard lib defines */
+#include <io.h>
diff --git a/dmake/msdos/borland/bcc50/config.mk b/dmake/msdos/borland/bcc50/config.mk
new file mode 100644
index 000000000000..550b86950705
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/config.mk
@@ -0,0 +1,7 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+LDLIBS = e:/cc/borland/bcc40/lib/c$(MODEL)
+CSTARTUP = e:/cc/borland/bcc40/lib/c0$(MODEL).obj
+
+CFLAGS += -I$(osedir) -w-pro
diff --git a/dmake/msdos/borland/bcc50/lib.rsp b/dmake/msdos/borland/bcc50/lib.rsp
new file mode 100644
index 000000000000..fd89d29f284c
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/lib.rsp
@@ -0,0 +1,2 @@
+e:\cc\borland\bcc50\lib\cw32+
+e:\cc\borland\bcc50\lib\import32
diff --git a/dmake/msdos/borland/bcc50/libswp.rsp b/dmake/msdos/borland/bcc50/libswp.rsp
new file mode 100644
index 000000000000..1557935cd40c
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/libswp.rsp
@@ -0,0 +1 @@
+e:\cc\borland\bcc40\lib\cl
diff --git a/dmake/msdos/borland/bcc50/mkswp.bat b/dmake/msdos/borland/bcc50/mkswp.bat
new file mode 100755
index 000000000000..14de52506f56
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/mkswp.bat
@@ -0,0 +1,107 @@
+md objects
+tasm -t -mx -dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro infer.c
+copy infer.obj objects
+del infer.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro make.c
+copy make.obj objects
+del make.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro stat.c
+copy stat.obj objects
+del stat.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro expand.c
+copy expand.obj objects
+del expand.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro hash.c
+copy hash.obj objects
+del hash.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dag.c
+copy dag.obj objects
+del dag.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro path.c
+copy path.obj objects
+del path.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro parse.c
+copy parse.obj objects
+del parse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro quit.c
+copy quit.obj objects
+del quit.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro state.c
+copy state.obj objects
+del state.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro percent.c
+copy percent.obj objects
+del percent.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro function.c
+copy function.obj objects
+del function.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\find.c
+copy find.obj objects
+del find.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\borland\utime.c
+copy utime.obj objects
+del utime.obj
+tlink @msdos\borland\bcc50\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc50\libswp.rsp
+copy msdos\borland\bcc50\template.mk startup\config.mk
diff --git a/dmake/msdos/borland/bcc50/obj.rsp b/dmake/msdos/borland/bcc50/obj.rsp
new file mode 100644
index 000000000000..08ea653f70f4
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/obj.rsp
@@ -0,0 +1,34 @@
+e:\cc\borland\bcc50\lib\c0x32.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\find.obj+
+objects\tee.obj+
+objects\dirlib.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc50/objswp.rsp b/dmake/msdos/borland/bcc50/objswp.rsp
new file mode 100644
index 000000000000..712d47f47504
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/objswp.rsp
@@ -0,0 +1,36 @@
+e:\cc\borland\bcc40\lib\c0l.obj+
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/bcc50/public.h b/dmake/msdos/borland/bcc50/public.h
new file mode 100644
index 000000000000..b9d491239c91
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:19 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/borland/bcc50/template.mk b/dmake/msdos/borland/bcc50/template.mk
new file mode 100644
index 000000000000..51b575677985
--- /dev/null
+++ b/dmake/msdos/borland/bcc50/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc50
diff --git a/dmake/msdos/borland/config.mk b/dmake/msdos/borland/config.mk
new file mode 100644
index 000000000000..42361968671d
--- /dev/null
+++ b/dmake/msdos/borland/config.mk
@@ -0,0 +1,46 @@
+# This is the Turbo C++ 2.0 DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following sources are required for TURBO C++ 2.0
+OSR_SRC = tempnam.c utime.c
+.SETDIR=$(osrdir) : $(OSR_SRC)
+
+SRC += $(OSR_SRC)
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS. Make sure your turboc.cfg
+# file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line
+# below!
+#CFLAGS += -DM_I86=1 -D__STDC__=1
+
+# You can get a smaller executable still, buy adding a -1 to the list of
+# flags below, but then you can't run this on an 8086/88 cpu.
+#CFLAGS += -1
+CFLAGS += -I$(osrdir) -d -O -N- -w-nod $(C_$(MODEL))
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+# Debugging information for Turbo-C
+DB_CFLAGS += -v
+DB_LDFLAGS += /v
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+C_s =
+C_m = -mm
+C_c = -mc
+C_l = -ml
+
+S_s = -dmsmall
+S_m = -dmmedium
+S_c = -dmcompact
+S_l = -dmlarge
diff --git a/dmake/msdos/borland/tcc20/config.h b/dmake/msdos/borland/tcc20/config.h
new file mode 100644
index 000000000000..27fae79049cf
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/config.h
@@ -0,0 +1,48 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:37:12 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Have to pull this in for the standard lib defines */
+#include <io.h>
diff --git a/dmake/msdos/borland/tcc20/config.mk b/dmake/msdos/borland/tcc20/config.mk
new file mode 100644
index 000000000000..e7c53757d2b6
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/config.mk
@@ -0,0 +1,10 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+LDLIBS = e:/cc/borland/tcc20/lib/c$(MODEL)
+CSTARTUP = e:/cc/borland/tcc20/lib/c0$(MODEL).obj
+
+CFLAGS += -I$(osedir) -f-
+
+# Case of identifiers is significant
+NDB_LDFLAGS += -c
diff --git a/dmake/msdos/borland/tcc20/libswp.rsp b/dmake/msdos/borland/tcc20/libswp.rsp
new file mode 100644
index 000000000000..68d583f00580
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/libswp.rsp
@@ -0,0 +1 @@
+e:\cc\borland\tcc20\lib\cl
diff --git a/dmake/msdos/borland/tcc20/mkswp.bat b/dmake/msdos/borland/tcc20/mkswp.bat
new file mode 100755
index 000000000000..52f6748e8ef3
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/mkswp.bat
@@ -0,0 +1,107 @@
+md objects
+tasm -t -mx -dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- infer.c
+copy infer.obj objects
+del infer.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- make.c
+copy make.obj objects
+del make.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- stat.c
+copy stat.obj objects
+del stat.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- expand.c
+copy expand.obj objects
+del expand.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- hash.c
+copy hash.obj objects
+del hash.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dag.c
+copy dag.obj objects
+del dag.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dmake.c
+copy dmake.obj objects
+del dmake.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- path.c
+copy path.obj objects
+del path.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- imacs.c
+copy imacs.obj objects
+del imacs.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- parse.c
+copy parse.obj objects
+del parse.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- getinp.c
+copy getinp.obj objects
+del getinp.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- quit.c
+copy quit.obj objects
+del quit.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- state.c
+copy state.obj objects
+del state.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- macparse.c
+copy macparse.obj objects
+del macparse.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- percent.c
+copy percent.obj objects
+del percent.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- function.c
+copy function.obj objects
+del function.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\find.c
+copy find.obj objects
+del find.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\borland\utime.c
+copy utime.obj objects
+del utime.obj
+tlink /c @msdos\borland\tcc20\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\tcc20\libswp.rsp
+copy msdos\borland\tcc20\template.mk startup\config.mk
diff --git a/dmake/msdos/borland/tcc20/objswp.rsp b/dmake/msdos/borland/tcc20/objswp.rsp
new file mode 100644
index 000000000000..c177fda3efbd
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/objswp.rsp
@@ -0,0 +1,36 @@
+e:\cc\borland\tcc20\lib\c0l.obj+
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\utime.obj
diff --git a/dmake/msdos/borland/tcc20/public.h b/dmake/msdos/borland/tcc20/public.h
new file mode 100644
index 000000000000..c56278966b05
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:32 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/borland/tcc20/template.mk b/dmake/msdos/borland/tcc20/template.mk
new file mode 100644
index 000000000000..3cac6b22a240
--- /dev/null
+++ b/dmake/msdos/borland/tcc20/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= tcc20
diff --git a/dmake/msdos/borland/tempnam.c b/dmake/msdos/borland/tempnam.c
new file mode 100644
index 000000000000..c4d599de5971
--- /dev/null
+++ b/dmake/msdos/borland/tempnam.c
@@ -0,0 +1,109 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:28 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* Turbo C stdio.h doesn't define P_tmpdir, so let's do it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifndef P_tmpdir
+static char *P_tmpdir = "";
+#endif
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/msdos/borland/utime.c b/dmake/msdos/borland/utime.c
new file mode 100644
index 000000000000..2b87022fe3f1
--- /dev/null
+++ b/dmake/msdos/borland/utime.c
@@ -0,0 +1,66 @@
+/* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:28 hr Exp $
+--
+-- SYNOPSIS
+-- utime
+--
+-- DESCRIPTION
+-- chage the last modified time on a file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <io.h>
+#include <time.h>
+
+int
+utime(name, timep)/*
+====================
+ Broken for turbo C it only sets the file time to the current time by
+ touching a character in the file */
+char* name;
+time_t timep[2];
+{
+ struct stat buf;
+ int fil;
+ char data;
+
+ if (stat(name, &buf) != 0)
+ return (-1);
+ if (buf.st_size != 0) {
+ if ((fil = open(name, O_RDWR, S_IWRITE)) < 0)
+ return (-1);
+ if (read(fil, &data, 1) < 1) {
+ close(fil);
+ return (-1);
+ }
+ lseek(fil, 0L, 0);
+ if (write(fil, &data, 1) < 1) {
+ close(fil);
+ return (-1);
+ }
+ close(fil);
+ return (0);
+ } else if ((fil = creat(name, S_IWRITE)) < 0) {
+ return (-1);
+ } else {
+ close(fil);
+ return (0);
+ }
+}
diff --git a/dmake/msdos/config.mk b/dmake/msdos/config.mk
new file mode 100644
index 000000000000..77a32bf419de
--- /dev/null
+++ b/dmake/msdos/config.mk
@@ -0,0 +1,71 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+
+# Memory model to compile for
+# set to s - small, m - medium, c - compact, l - large
+# Need large model now, dmake has grown up :-)
+MODEL = l
+
+STARTUPFILE = $(OS)/startup.mk
+
+CPPFLAGS = $(CFLAGS)
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDHEAD) $(LDFLAGS:s/ //) @$(LDTMPOBJ),$(TARGET),NUL.MAP$(LDTAIL)
+LDTAIL = $(_libs)
+_libs = $(!null,$(LDLIBS) ,@$(LDTMPLIB))
+LDTMPOBJ = $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"+\n")\n)
+LDTMPLIB = $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\\,:t"+\n")\n)
+
+# Debug flags
+DB_CFLAGS = -DDBUG
+DB_LDFLAGS =
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS =
+NDB_LDFLAGS =
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += -I$(OS)
+
+# Common MSDOS source files.
+# Define SWAP to anything but 'y' for the swap code to be excluded on making.
+# Swapping for DOS versions is enabled by default.
+# Note: swapping is handled specially for ZTC in msdos/zortech/config.mk.
+SWAP *= y
+
+.IF $(OSRELEASE) != zortech
+ .IF $(SWAP) == y
+ SWP_SRC += spawn.c
+ ASRC += exec.asm
+ .ELSE
+ SWP_SRC += tee.c
+ .END
+.ELSE
+ SWP_SRC += tee.c
+.END
+
+OS_SRC += ruletab.c dirbrk.c runargv.c arlib.c dchdir.c switchar.c rmprq.c\
+ $(SWP_SRC) find.c dirlib.c dstrlwr.c
+UNIXSRC := dcache.c
+SRC += $(OS_SRC) $(UNIXSRC)
+.SETDIR=$(OS) : $(ASRC) $(OS_SRC)
+.SETDIR=unix : $(UNIXSRC)
+
+# Provide our own %$O : %$S rule.
+%$O : %$S
+ +$(AS) $(ASFLAGS) $(<:s,\,${__.DIVSEP-sh-${USESHELL}},:s,/,${__.DIVSEP-sh-${USESHELL}},),,,;
+ mv $(@:f) $(OBJDIR)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/msdos/dchdir.c b/dmake/msdos/dchdir.c
new file mode 100644
index 000000000000..19006825b7f6
--- /dev/null
+++ b/dmake/msdos/dchdir.c
@@ -0,0 +1,47 @@
+/* RCS $Id: dchdir.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- Change directory.
+--
+-- DESCRIPTION
+-- Under DOS change the current drive as well as the current directory.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <dos.h>
+#include "extern.h"
+
+PUBLIC int
+dchdir(path)
+char *path;
+{
+ int res;
+
+ res = chdir(path);
+
+ if (res != -1 && path[1] == ':') {
+ union REGS reg;
+
+ /* we must change the logged drive, since the chdir worked. */
+ reg.h.ah = 0x0E;
+ reg.h.dl = (*path & ~0x20) - 'A' + 1;
+ intdos(&reg, &reg);
+ }
+
+ return (res);
+}
diff --git a/dmake/msdos/dirbrk.c b/dmake/msdos/dirbrk.c
new file mode 100644
index 000000000000..d8aab76b6f96
--- /dev/null
+++ b/dmake/msdos/dirbrk.c
@@ -0,0 +1,42 @@
+/* RCS $Id: dirbrk.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- Define the directory separator string.
+--
+-- DESCRIPTION
+-- Define this string for any character that may appear in a path name
+-- and can be used as a directory separator.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+/* dos uses /, \, and : */
+char* DirBrkStr = "/\\:";
+
+/*
+** Return TRUE if the name is the full specification of a path name to a file
+** starting at the root of the file system, otherwise return FALSE
+*/
+PUBLIC int
+If_root_path(name)
+char *name;
+{
+ return( (strchr(DirBrkStr, *name) != NIL(char)) ||
+ (isalpha(*name) && name[1] == ':') );
+}
diff --git a/dmake/msdos/dirent.h b/dmake/msdos/dirent.h
new file mode 100644
index 000000000000..24ad5681da59
--- /dev/null
+++ b/dmake/msdos/dirent.h
@@ -0,0 +1,32 @@
+/* DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 */
+
+#ifndef _DIRLIB_h_
+#define _DIRLIB_h_
+
+#include <stdio.h>
+#include "stdmacs.h"
+#include "dosdta.h"
+
+#define MAXNAMLEN 15
+
+struct dirent {
+ long d_ino;
+ unsigned short d_reclen;
+ unsigned short d_namlen;
+ char d_name[MAXNAMLEN+1];
+};
+
+typedef struct {
+ DTA dd_dta; /* disk transfer area for this dir. */
+ short dd_stat; /* status return from last lookup */
+ char dd_name[1]; /* full name of file -- struct is extended */
+} DIR;
+
+extern DIR *opendir ANSI((char *));
+extern struct dirent *readdir ANSI((DIR *));
+extern long telldir ANSI((DIR *));
+extern void seekdir ANSI((DIR *, long));
+extern void closedir ANSI((DIR *));
+
+#define rewinddir(dirp) seekdir(dirp,0L)
+#endif
diff --git a/dmake/msdos/dirlib.c b/dmake/msdos/dirlib.c
new file mode 100644
index 000000000000..eaef928772af
--- /dev/null
+++ b/dmake/msdos/dirlib.c
@@ -0,0 +1,285 @@
+/*
+ DIRLIB for MS-DOS
+ -----------------
+
+Enclosed is an implementation of the `dirlib' package for MS-DOS.
+The implementation is targeted for MS-C, although any reasonably
+competent C compiler should manage. The package consists of:
+
+ dir.h the header file
+ dir.c the functions
+ testdir.c a q&d test program
+
+The package tries to view directory naming in a Un*x light; in particular,
+directories such as '/.' and '/..' (as well as `.' and `..' if your
+current directory is root) are understood. Indefinite paths like
+`/../.././../..' will correctly refer to the root (of the particular disk).
+Names such as `a:////./../' are okay too.
+
+I've tried to be as sensible about DTA's as possible, since you never
+know who will be using one; they are set before use, and reset afterwards.
+
+There is some cruft in the package, namely the way `seekdir' and
+`telldir' are done. The code was derived from a little experimentation,
+and may not work after a certain point (although I believe the 2.x version
+to be solid). Caveat utilitor.
+
+Documentation for the package is available in the public domain; the
+package's functionality was derived from this documentation.
+
+Bug reports and comments are welcome. Enjoy!
+
+ - Matt
+
+-------
+UUCP: {ucbvax,ihnp4,randvax,trwrb!trwspp,ism780}!ucla-cs!matt
+ARPA: matt@LOCUS.UCLA.EDU
+Ph: (213) 825-2756
+
+--------
+Modified for use in dmake by Dennis Vadura. Mostly just clean up and an
+effort to make correctly typed objects are passed to functions in find.c.
+Also deleted all dos version 2.0 specific code. It is not required any
+more.
+*/
+
+/*
+ * revision history:
+ *
+ * VER MM/DD/YY COMMENTS
+ * ---- -------- --------
+ * 0.99 02/24/86 Beta release to INTERNET
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+#include <string.h>
+#include <dos.h>
+
+#include "dirent.h"
+
+extern int find_err;
+
+
+static char *
+getdcwd(drive)
+int drive;
+{
+ union REGS r;
+ struct SREGS s;
+ static char xcwd[64];
+ char far *cwd = xcwd;
+
+ r.h.ah = 0x47;
+ r.h.dl = drive;
+ r.x.si = FP_OFF(cwd);
+ s.ds = FP_SEG(cwd);
+ intdosx(&r, &r, &s);
+ find_err = r.x.ax;
+ if (r.x.cflag)
+ return (char *) 0;
+ return xcwd;
+}
+
+
+
+/*
+ * opendir
+ */
+
+#define SUFFIX "\\*.*"
+#define SLASH "\\"
+#define streq(a,b) (strcmp(a,b)==0)
+
+DIR *
+opendir(name)
+char *name;
+{
+ register DIR *nd;
+ char *cwd;
+ char drive[3];
+ int atroot = 0;
+ int rooted = 0;
+
+ /*
+ * hack off drive designator if present
+ */
+
+ if (name[1] == ':') {
+ cwd = getdcwd(toupper(name[0]) - 'A' + 1);
+ drive[0] = name[0]; drive[1] = ':'; drive[2] = '\0';
+ name += 2;
+ }
+ else {
+ cwd = getdcwd(0);
+ drive[0] = '\0';
+ }
+
+ /* is the name 'rooted'? */
+ if ((*name == '/') || (*name == '\\')) ++rooted;
+
+ /* see if we are at the root directory for this device */
+ if (!*cwd) ++atroot;
+
+ /*
+ * MSDOS '/' doesn't have a '.' or '..'
+ * also, double '/' sequences don't make sense.
+ * many ported programs expect them to work, so we fix it up...
+ */
+
+ /* chop off leading . and .. if at root */
+ if (atroot && (*name == '.')) {
+ switch (*++name) {
+ case '\0':
+ case '/':
+ case '\\':
+ break;
+
+ case '.':
+ switch (*++name) {
+ case '\0':
+ case '/':
+ case '\\':
+ break;
+ default:
+ --name;
+ --name;
+ }
+ break;
+
+ default:
+ --name;
+ }
+ }
+
+ /* chop off leading /'s, /.'s and /..'s to make naming sensible */
+ while (*name && ((*name == '/') || (*name == '\\'))) {
+ if (*++name == '.') {
+ switch (*++name) {
+ case '\0':
+ case '/':
+ case '\\':
+ break;
+
+ case '.':
+ switch (*++name) {
+ case '\0':
+ case '/':
+ case '\\':
+ break;
+
+ default:
+ --name;
+ --name;
+ }
+ break;
+
+ default:
+ --name;
+ }
+ }
+ }
+
+
+ /*
+ * name should now look like: path/path/path
+ * we must now construct name based on whether or not it
+ * was 'rooted' (started with a /)
+ */
+
+ if (rooted) cwd = "";
+
+ /* construct DIR */
+ if (!(nd = (DIR *)malloc(
+ sizeof(DIR)+strlen(drive)+strlen(cwd)+strlen(SLASH)+
+ strlen(name)+strlen(SUFFIX))))
+ return (DIR *) 0;
+
+ /* create long name */
+ strcpy(nd->dd_name, drive);
+ if (*cwd) {
+ strcat(nd->dd_name, SLASH);
+ strcat(nd->dd_name, cwd);
+ }
+ if (*name) {
+ strcat(nd->dd_name, SLASH);
+ strcat(nd->dd_name, name);
+ }
+ strcat(nd->dd_name, SUFFIX);
+
+ /* search */
+ if (!findfirst(&nd->dd_name[0], &nd->dd_dta)) {
+ free((char *)nd);
+ errno = ENOENT;
+ return (DIR *) 0;
+ }
+ nd->dd_stat = 0;
+ return nd;
+}
+
+
+struct dirent *
+readdir(dirp)
+DIR *dirp;
+{
+ static struct dirent dir;
+
+ if (dirp->dd_stat)
+ return (struct dirent *) 0;
+
+ /* format structure */
+ dir.d_ino = 0; /* not valid for DOS */
+ dir.d_reclen = 0;
+ strcpy(dir.d_name, dirp->dd_dta.name);
+ dir.d_namlen = strlen(dir.d_name);
+ strlwr(dir.d_name); /* DOSism */
+
+ /* read ahead */
+ if (findnext(&dirp->dd_dta) != NULL)
+ dirp->dd_stat = 0;
+ else
+ dirp->dd_stat = find_err;
+
+ return &dir;
+}
+
+
+void
+closedir(dirp)
+DIR *dirp;
+{
+ free((char *)dirp);
+}
+
+
+void
+seekdir(dirp, pos)
+DIR *dirp;
+long pos;
+{
+ /*
+ * check against DOS limits
+ */
+
+ if ((pos < 0) || (pos > 4095)) {
+ dirp->dd_stat = 1;
+ return;
+ }
+
+ *(short *)&dirp->dd_dta.fcb[13] = pos + 1;
+
+ /* read ahead */
+ if (findnext(&dirp->dd_dta))
+ dirp->dd_stat = 0;
+ else
+ dirp->dd_stat = find_err;
+}
+
+
+long
+telldir(dirp)
+DIR *dirp;
+{
+ return (long) (*(short *)&dirp->dd_dta.fcb[13] - 2);
+}
diff --git a/dmake/msdos/dosdta.h b/dmake/msdos/dosdta.h
new file mode 100644
index 000000000000..c9642715d937
--- /dev/null
+++ b/dmake/msdos/dosdta.h
@@ -0,0 +1,16 @@
+#ifndef _DOSDTA_
+#define _DOSDTA_
+
+#include "stdmacs.h"
+typedef struct {
+ char fcb[21];
+ char attr;
+ short time;
+ short date;
+ long size;
+ char name[13];
+} DTA;
+
+extern DTA *findfirst ANSI((char *, DTA *));
+extern DTA *findnext ANSI((DTA *));
+#endif
diff --git a/dmake/msdos/dstrlwr.c b/dmake/msdos/dstrlwr.c
new file mode 100644
index 000000000000..64027eb36481
--- /dev/null
+++ b/dmake/msdos/dstrlwr.c
@@ -0,0 +1,49 @@
+/* RCS $Id: dstrlwr.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- Rotines for computing case mappings in Win95/NT environments.
+--
+-- DESCRIPTION
+-- This code is an attempt at providing sane case mappings to help
+-- deal with the disparity in file name case between 8.3 and long
+-- file names under Win95/NT.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#include "extern.h"
+
+PUBLIC void
+dstrlwr(entry, target)
+char *entry;
+char *target;
+{
+ char *p;
+
+ if (STOBOOL(DcacheRespCase))
+ return;
+
+ /* Look for the target being lower case, if so then lower the case
+ * of the directory entry. Note that we only check the first
+ * character of the target. This is a bit of a kludge but there is
+ * really no other way to know, particularly since this test will be
+ * performed for each member of the directory but against the same
+ * target. */
+ if (islower(*target))
+ strlwr(entry);
+
+ return;
+}
diff --git a/dmake/msdos/exec.asm b/dmake/msdos/exec.asm
new file mode 100644
index 000000000000..db745aece6b2
--- /dev/null
+++ b/dmake/msdos/exec.asm
@@ -0,0 +1,1234 @@
+;
+; DESCRIPTION
+; This code is a model independent version of DOS exec that will swap
+; the calling process out to secondary storage prior to running the
+; child. The prototype for calling the exec function is below.
+;
+; exec( int swap, char far *program, char far *cmdtail,
+; int environment_seg, char far *tmpfilename );
+;
+;
+; To assemble this file issue the command:
+;
+; tasm /mx /t /dmmodel exec.asm
+;
+; where 'model' is one of {small, compact, medium, large}, you may
+; also use MASM 5.1 to assemble this file, in this case simply replace
+; 'tasm' with 'masm' in the above command line.
+;
+; AUTHOR
+; Dennis Vadura, dvadura@watdragon.uwaterloo.ca
+; CS DEPT, University of Waterloo, Waterloo, Ont., Canada
+;
+; COPYRIGHT
+; Copyright (c) 1990 by Dennis Vadura. All rights reserved.
+;
+; This program is free software; you can redistribute it and/or
+; modify it under the terms of the GNU General Public License
+; (version 1), as published by the Free Software Foundation, and
+; found in the file 'LICENSE' included with this distribution.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warrant of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+; GNU General Public License for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with this program; if not, write to the Free Software
+; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;
+ifdef have286
+ .286 ; define have286 with -D for 80286 processor or better
+ mpusha Macro
+ pusha
+ Endm
+
+ mpopa Macro
+ popa
+ Endm
+
+else ; 8088/8086 compatible
+ mpusha Macro
+ push ax
+ push cx
+ push dx
+ push bx
+ push sp
+ push bp
+ push si
+ push di
+ Endm
+
+ mpopa Macro
+ pop di
+ pop si
+ pop bp
+ add sp,2
+ pop bx
+ pop dx
+ pop cx
+ pop ax
+ Endm
+endif
+
+ifdef msmall
+ .model small
+argbase equ 4
+endif
+ifdef mcompact
+ .model compact
+argbase equ 4
+endif
+ifdef mmedium
+ .model medium
+argbase equ 6
+endif
+ifdef mlarge
+ .model large
+argbase equ 6
+endif
+a_swap equ <bp+argbase+0>
+a_prog equ <bp+argbase+2>
+a_tail equ <bp+argbase+6>
+a_env equ <bp+argbase+10>
+a_tmp equ <bp+argbase+12>
+
+a_handle equ <bp+argbase>
+
+
+; Define all useful equ's
+swap_xms equ 0 ; we swapped it out to xms
+swap_ems equ 2 ; we swapped it out to ems
+swap_file equ 4 ; we swapped it out to a file
+seg_no_alloc equ 0 ; this is part of a segment
+seg_alloc equ 1 ; this is a full segment header
+seg_data equ 2 ; this is data for part of a segment
+
+
+; Define any global/external variables that we will be accessing from here.
+ .data
+ extrn _errno:word ; Set to dos ret code from exec
+ public _Interrupted ; Set to 1 if interrupted 0
+_Interrupted dw 0 ; otherwise
+
+ .code
+ assume cs:@code, ds:@code, ss:@code, es:@code
+
+ even
+execstack dw 64 dup (?) ; put the temporary exec stack right
+exec_sp label word ; at the start.
+
+old_ss dw ? ; save stack seg across exec
+old_sp dw ? ; save stack ptr across exec
+progsize dw ? ; original size of the program
+rootsize dw ? ; size of base root kept during swap
+resend dw ? ; paragraph where resident code ends
+envseg dw ? ; paragraph of environment segment
+psp dw ? ; our own psp
+swap dw ? ; swapping selection flag
+eretcode dw ? ; return code from exec
+interrupted dw ? ; interrupted flag for exec
+arenahead dw ? ; start of memory block list
+alstr dw ? ; allocation strategy save spot
+in_exec dw 0 ; flag, 1 ==> in exec
+
+cmdpath db 65 dup(?) ; file to exec
+cmdtail db 129 dup(?) ; its command tail
+fcb db 37 dup(0) ; dummy fcb
+tmpseg db 7 dup(?) ; block header buffer
+
+tmpname db 65 dup(0) ; name of temporary file resource
+
+ even
+tmphandle dw ? ; handle for temporary file
+real_21h dd 0 ; will be DOS's 21h vector if doing -C
+
+std_fil_handle dw ? ; file handle for -C file
+std_fil_number db ? ; system file number for -C file
+our_stdout db ? ; sys file number our stdout handle
+
+error_rhdr db "exec: Failure reading header block", 0DH, 0AH, '$'
+error_rseg db "exec: Failure reading segment data", 0DH, 0AH, '$'
+error_resize db "exec: Failure on resize", 0DH, 0AH, '$'
+error_free db "exec: Failure to free a block", 0DH, 0AH, '$'
+error_string db "exec: Program swap failure", 0DH, 0AH, '$'
+error_alloc db "exec: Memory blocks don't match", 0DH, 0AH, '$'
+
+ even
+write_header label word
+ whdr_xms_ptr dw word ptr whdr_xms
+ whdr_ems_ptr dw word ptr whdr_ems
+ whdr_file_ptr dw word ptr whdr_file
+
+write_seg label word
+ wseg_xms_ptr dw word ptr wseg_xms
+ wseg_ems_ptr dw word ptr wseg_ems
+ wseg_file_ptr dw word ptr wseg_file
+
+read_header label word
+ rhdr_xms_ptr dw word ptr rhdr_xms
+ rhdr_ems_ptr dw word ptr rhdr_ems
+ rhdr_file_ptr dw word ptr rhdr_file
+
+read_seg label word
+ rseg_xms_ptr dw word ptr rseg_xms
+ rseg_ems_ptr dw word ptr rseg_ems
+ rseg_file_ptr dw word ptr rseg_file
+
+free_resource label word
+ free_xms_ptr dw word ptr free_xms_resource
+ free_ems_ptr dw word ptr free_ems_resource
+ free_file_ptr dw word ptr free_file_resource
+
+reset_resource label word
+ reset_xms_ptr dw word ptr reset_xms_resource
+ reset_ems_ptr dw word ptr reset_ems_resource
+ reset_file_ptr dw word ptr reset_file_resource
+
+old_ctl_brk label dword
+ old_ctl_brk_off dw ?
+ old_ctl_brk_seg dw ?
+
+old_crit_err label dword
+ old_crit_err_off dw ?
+ old_crit_err_seg dw ?
+
+exec_block label word
+ ex_envseg dw ? ; env seg, use parent's if 0
+ ex_cmdtail dd ? ; command tail for exec
+ ex_fcb1 dd far ptr fcb ; fcb's aren't used by dmake
+ ex_fcb2 dd far ptr fcb
+ ex_ss dw ? ; saved ss for exec
+ ex_sp dw ? ; saved sp for exec
+ ex_error dw 0 ; error code for dos exec
+
+
+; Special 21h (DOS call) handler to tee stdout/stderr writes to the -C file.
+; Ignore 21h calls that aren't writes to 1 or 2; i.e., pass them to DOS handler.
+; If write call was from this process, it's pretty simple to duplicate it
+; to the -C file. If it's from another process, we try to write to its
+; inherited handle. Worst case is where the handle wasn't inherited: someone
+; closed it. In that instance we have to switch to dmake's PSP to do the
+; duplicate write.
+
+; Subprocesses do not get their stdout/stderr teed to the -C file if
+; their stdout/stderr no longer points to the file/device that dmake's
+; stdout points to. This is tested by looking at the process's job
+; file table, which is a table that maps process handles to DOS system file
+; table numbers. (The far pointer to the JFT is at the PSP offset 34h.)
+; The JFT is also queried to see if the -C file was inherited.
+
+; O_BINARY, O_TEXT problems are ignored here. These are fudged by the
+; C library before it calls DOS; since we're working below that level
+; we don't have to worry about it.
+
+simulate_21h Macro
+ pushf ;; direct call to DOS
+ call cs:[real_21h]
+ Endm
+
+ assume cs:@code, ds:nothing, es:nothing, ss:nothing
+our_21h_handler proc far
+ pushf
+ cmp ah,40h ; is this a write?
+ jne call_dos ; --no
+ cmp bx,1 ; write on handle 1 (stdout?)
+ je duplicate_it
+ cmp bx,2 ; stderr?
+ je duplicate_it
+
+call_dos:
+ popf
+ jmp [real_21h] ; far jump to real handler, which will do the sys call
+ ; and return to the original caller
+
+duplicate_it:
+ mpusha
+ push ds
+ push es
+ mov bp,sp
+
+ mov di,std_fil_handle ; handle of the -C file
+
+ If @CodeSize eq 0
+ ; Small/compact models allow for quick test of us versus subprocess.
+ ; False negative (it's us with a different CS) will be picked
+ ; up by code just below. (Might happen due to call from C library.)
+ ; False positives would be bad, but can't happen.
+ mov ax,[bp+24] ; caller's CS
+ cmp ax,@code ; same as us?
+ je call_from_dmake
+ Endif
+
+ mov ah,51h ; get PSP ("undocumented version" works in DOS 2.0+)
+ simulate_21h ; PSP segment returned in BX
+ cmp bx,psp ; our PSP?
+ je call_from_dmake ; --yes, no PSP changing needed
+
+ mov es,bx ; set ES to current (caller's) PSP
+ lds bx,es:[34h] ; set DS:BX pointing to caller's job file table
+
+ mov si,[bp+12] ; file handle caller passed in (known to be 1 or 2)
+ mov al,[bx+si] ; system file number corresponding to caller's handle
+ cmp al,our_stdout ; same as our stdout?
+ jne do_real_write ; no--subprocess must have redirected it
+
+ mov al,[bx+di] ; see if caller has dup of -C file still open
+ cmp al,std_fil_number
+ je use_dup ; yes--we can write using caller's PSP
+
+ ; Calling process (or some intermediate process) has closed
+ ; the -C descriptor. We'll use dmake's (our) -C descriptor, but
+ ; to do so we'll have to change the PSP. Disable BREAK handling
+ ; so that ^break doesn't kill the wrong process.
+
+ mov ax,3300h ; get BREAK flag
+ simulate_21h
+ mov si,dx ; save BREAK state in SI
+ sub dx,dx ; now turn break flag off
+ mov ax,3301h
+ simulate_21h ; don't want ^Break recoginized while PSP changed
+ mov bx,psp ; set dmake's PSP
+ mov ah,50h
+ simulate_21h
+
+ mov bx,di ; handle of -C file
+ ; CX still has caller's count
+ mov ds,[bp+2] ; restore caller's DS
+ mov dx,[bp+14] ; DS:DX again points to caller's buffer
+ mov ah,40h
+ simulate_21h ; write the copy
+
+ mov bx,es ; caller's PSP
+ mov ah,50h ; set PSP
+ simulate_21h ; restore caller's PSP
+ mov dx,si ; break state before we changed it
+ mov ax,3301h
+ simulate_21h ; restore break state
+
+ jmp short do_real_write
+
+use_dup:
+ mov ds,[bp+2] ; restore caller's DS
+ mov dx,[bp+14] ; DS:DX again points to caller's buffer
+
+call_from_dmake:
+ mov bx,di ; handle of -C file
+ mov ah,40h ; write
+ ; CX still has caller's count
+ simulate_21h ; write to the file
+
+do_real_write:
+ pop es
+ pop ds
+ mpopa
+ popf
+ jmp [real_21h] ; far jump to real handler, which will do the sys call
+ ; and return to the original caller
+our_21h_handler endp
+
+ assume cs:@code, ds:@code, ss:@code, es:@code
+
+;-----------------------------------------------------------------------------
+; First define the critical-error and control-brk handlers.
+; The critical error handler simply pops the machine state and returns an
+; access denied result code.
+crit_err_handler proc far
+ add sp, 6 ; ip/cs/flags ...
+ pop ax
+ pop bx
+ pop cx
+ pop dx
+ pop si
+ pop di
+ pop bp
+ pop ds
+ pop es
+ push bp ; fix up the return flags
+ mov bp, sp
+ xchg ax, [bp+6] ; get the flag byte.
+ or ax, 1 ; set the carry bit
+ xchg ax, [bp+6] ; put it back.
+ pop bp
+ mov ax, 5 ; access denied
+ iret
+crit_err_handler endp
+
+
+;-----------------------------------------------------------------------------
+; Here we set the interrupted flag, and terminate the currently running
+; process.
+ctl_brk_handler proc far
+ clc ; make sure carry is clear
+ inc cs:interrupted ; set the flag
+
+; Make certain it isn't us that is going to get terminated.
+; There is a small window where the in_exec flag is set but the child is
+; not running yet, I assume that DOS doesn't test for ctl_brk at that time
+; as it is bussily creating a new process.
+ cmp cs:in_exec,0
+ je just_return ; note this implies CF == 0
+ stc ; set CF to abort child
+just_return: iret
+ctl_brk_handler endp
+
+
+;-----------------------------------------------------------------------------
+; Something really nasty happened, so abort the exec call and exit.
+; This kills the calling process altogether, and is a very nasty way of
+; termination since files may still be open etc.
+abort_exec_rhdr label near
+ mov dx, offset error_rhdr
+ jmp print_it
+abort_exec_rseg label near
+ mov dx, offset error_rseg
+ jmp print_it
+abort_exec_resize label near
+ mov dx, offset error_resize
+ jmp print_it
+abort_exec_free label near
+ mov dx, offset error_free
+ jmp print_it
+abort_exec_alloc label near
+ mov dx, offset error_alloc
+ jmp print_it
+abort_exec proc near
+ mov dx, offset error_string
+print_it: push dx
+ mov bx, [swap]
+ call [free_resource+bx]
+ mov ax, cs
+ mov ds, ax
+ pop dx
+ mov ah, 9
+ int 21H
+kill_program: mov ax, 04cffH ; nuke it!
+ int 21H
+abort_exec endp
+
+
+;-----------------------------------------------------------------------------
+; lodsw/stosw loop to copy data. Called only for word copy operations.
+; ds:si - point at source
+; es:di - point at destination
+; cx - count of bytes to copy.
+copy_data proc near
+ shr cx, 1 ; convert to word count
+ jnc copy_words
+ movsb
+copy_words: rep movsw ; copy the words.
+ ret
+copy_data endp
+
+
+
+;=============================================================================
+; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ XMS RECORDS.
+;=============================================================================
+rhdr_xms proc near
+ ret
+rhdr_xms endp
+
+rseg_xms proc near
+ ret
+rseg_xms endp
+
+reset_xms_resource proc near
+ ret
+reset_xms_resource endp
+
+free_xms_resource proc near
+ ret
+free_xms_resource endp
+;=============================================================================
+
+
+
+;=============================================================================
+; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ EMS RECORDS.
+;=============================================================================
+rhdr_ems proc near
+ ret
+rhdr_ems endp
+
+rseg_ems proc near
+ ret
+rseg_ems endp
+
+reset_ems_resource proc near
+ ret
+reset_ems_resource endp
+
+free_ems_resource proc near
+ ret
+free_ems_resource endp
+;=============================================================================
+
+
+
+;=============================================================================
+; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ FILE RECORDS.
+;=============================================================================
+; This routine reads a segment header from a file.
+; The header is a seven byte record formatted as follows:
+; segment address - of data
+; offset address - of data
+; length in paragraphs - of data
+; mode - 1 => segment header (allocate seg on read)
+; 0 => subsegment, don't allocate on read.
+; The information is placed into the tmpseg data area in the code segment.
+; The routine aborts if an error is detected.
+rhdr_file proc near
+ mov dx, offset tmpseg ; read the header record out
+ mov cx, 7
+ mov bx, [tmphandle]
+ mov ah, 03fH
+ int 21H
+ jnc rhdr_done ; make sure it worked
+ jmp abort_exec_rhdr
+
+rhdr_done: cmp ax, 7
+ je exit_rhdr_file
+ or ax, ax
+ je signal_eof
+ jmp abort_exec_rhdr
+
+signal_eof: stc
+exit_rhdr_file: ret
+rhdr_file endp
+
+
+;-----------------------------------------------------------------------------
+; Read a segment from the temporary file whose handle is in cs:tmphandle.
+; The routine aborts if an error is detected.
+rseg_file proc near
+ push ds
+ mov ds, word ptr cs:tmpseg; Now read the whole segment
+ mov dx, word ptr cs:tmpseg+2
+ mov cx, word ptr cs:tmpseg+4
+ mov bx, cs:tmphandle
+ mov ah, 03fH
+ int 21H
+ pop ds
+ jnc rseg_done
+ jmp abort_exec_rseg
+
+rseg_done: cmp ax, [word ptr tmpseg+4]
+ je exit_rseg_file
+ jmp abort_exec_rseg ; If we didn't get read full
+exit_rseg_file: ret ; segment then abort
+rseg_file endp
+
+
+;-----------------------------------------------------------------------------
+; Seek to the beginning of the file.
+reset_file_resource proc near
+ mov bx, [tmphandle]
+ xor cx, cx
+ mov dx, cx
+ mov ax, 04200H ; seek to begining of file
+ int 21H
+ ret
+reset_file_resource endp
+
+
+;-----------------------------------------------------------------------------
+; unlink the temporary file allocated for swapping.
+; We close the file first, and then delete it. We ignore errors here since
+; we can't do anything about them anyway.
+free_file_resource proc near
+ mov bx, [tmphandle] ; get the file handle
+ mov ah, 03eH ; close the file
+ int 21H
+ mov dx, offset tmpname ; Now delete the temp file
+ mov ah, 041H
+ int 21H
+ ret
+free_file_resource endp
+;=============================================================================
+
+
+
+;=============================================================================
+; CODE TO SWAP THE IMAGE IN FROM SECONDARY STORAGE
+;=============================================================================
+swap_in proc near
+ mov bx, [alstr] ; get previous alloc strategy
+ mov ax, 5801H ; and set it back
+ int 21H
+ mov bx, [swap] ; get type of resource
+ call [reset_resource+bx] ; reset the resource
+ mov es, [psp] ; resize the program back
+ mov bx, [progsize] ; to original size
+ mov ah, 04AH
+ int 21H
+ jnc read_seg_loop
+ jmp abort_exec
+
+read_seg_loop: mov bx, [swap] ; get type of resource
+ call [read_header+bx] ; get seg header
+ jc exit_swap_in ; all done
+ mov al, [tmpseg+6]
+ cmp al, seg_no_alloc ; see if dummy segment header
+ je read_seg_loop
+ cmp al, seg_alloc ; do we need to do an alloc?
+ jne read_data ; nope
+
+; Allocate back the memory for a segment that is not the [psp], note that this
+; must come back to the same segment we had previously since other segments
+; may have pointers stored in their variables that point to this segment using
+; segment:offset long pointers.
+ mov bx, [word ptr tmpseg+4] ; get count of paragraphs
+ mov ah, 048H ; dos_alloc
+ int 21H
+ jc alloc_error ; oops!
+ cmp ax, [word ptr tmpseg] ; did we get the same segment?
+ je read_seg_loop ; yup!
+alloc_error: jmp abort_exec_alloc
+
+read_data: mov bx, [swap]
+ call [read_seg+bx] ; this must succeed, if fail
+ jmp read_seg_loop ; we never come back here
+
+exit_swap_in: mov bx, [swap] ; all done, so free resource
+ call [free_resource+bx]
+ ret
+swap_in endp
+
+
+;=============================================================================
+; CODE TO SWAP THE IMAGE OUT TO SECONDARY STORAGE
+;=============================================================================
+; This routine is called to swap the non-resident portion of the program
+; out to the resource specified by the value of [cs:swap]. If the swap out
+; fails, then appropriate routines are called to free the resources allocated
+; up to that point.
+;
+; The steps used to swap the program out are as follows:
+; - calculate new size of program to remain resident and size to swap
+; out.
+; - write out non-resident portion of current segment
+; - walk DOS allocation chain and write out all other segments owned by
+; the current program that are contiguous with the _psp segment
+; - copy the environment down to low memory
+; - resize the current _psp segment to savesize
+; - free all segments belonging to program except current _psp segment
+swap_out proc near
+ mov ax, 05800H ; get memory alocation strategy
+ int 021H
+ mov [alstr], ax ; and save it for future restoration.
+ mov di, [psp] ; compute length of program to current
+ mov bx, cs ; value of cs, and find program size
+ sub bx, di ; by looking at length stored in
+ mov ax, di ; arena header found in front of psp
+ dec ax
+ mov es, ax
+ mov si, es:3 ; si is size of program in paragraphs
+ mov [progsize], si ; progsize now contains the size.
+
+; Now compute length of program segment to save.
+; Length is: cs - psp + (offset overlay_code_here+15 >> 4)
+ mov ax, offset overlay_code_here+15
+ shr ax, 1
+ shr ax, 1
+ shr ax, 1
+ shr ax, 1
+ add bx, ax ; bx is size of program to keep
+ sub si, bx ; si is # of paragraphs to save.
+ add di, bx ; di is paragraph to start at
+ mov rootsize, bx
+ mov resend, di ; cs:resend is saved start para
+ mov al, seg_no_alloc ; set no allocation for segment
+ call write_segment
+ jc abort_swap_out
+
+; We have now saved the portion of the program segment that will not remain
+; resident during the exec. We should now walk the DOS allocation chain and
+; write out all other segments owned by the current process.
+save_segments: mov ax, [psp]
+ dec ax
+ mov es, ax
+ mov bx, offset write_segment_data
+ call walk_arena_chain
+ jc abort_swap_out
+
+; Now we must walk the chain of allocated memory blocks again and free
+; all those that are owned by the current process, except the one that is
+; the current process' psp.
+free_segments: mov ax, [psp]
+ dec ax
+ mov es,ax
+ mov bx, offset free_dos_segment
+ call walk_arena_chain
+ jnc resize_program
+ jmp abort_exec_free ; can't fix it up now.
+
+; We now resize the program to the size specified by cs:rootsize. This will
+; free most of the memory taken up by the current program segment.
+resize_program: mov es, [psp] ; es is segment to resize.
+ mov bx, [rootsize] ; bx is size of segment.
+ mov ah, 04aH ; resize memory block
+ int 21H
+ jnc swap_out_ok
+ jmp abort_exec_resize ; disaster
+swap_out_ok: ret
+
+; The swap out failed for some reason, so free any allocated resources
+; and set the carry bit.
+abort_swap_out: mov bx, [swap]
+ call [free_resource+bx]
+ xor ax, ax
+ mov [swap], ax ; clear the swap flag
+ stc
+ ret
+swap_out endp
+
+
+;=============================================================================
+; CODE TO SET-UP FOR AND EXEC THE CHILD PROCESS
+;=============================================================================
+; Actually execute the program. If cs:swap is set, this code will invoke the
+; swap-out/swap-in code as required.
+do_exec proc near
+ cmp [swap], 0 ; does the user want to swap?
+ je no_swap_out ; nope
+ call init_swap ; figger out where to swap to
+ jc no_swap_out ; if carry set then don't swap
+ call swap_out
+
+no_swap_out: cmp [interrupted], 0 ; were we interrupted?
+ jne leave_exec ; yep, so clean up, don't exec
+
+; free passed in environment block if it is non zero.
+; This way the parent program does not need to free it.
+ mov ax, [envseg]
+ or ax, ax
+ je setup_block
+ push ax
+ mov es, ax
+ mov ah, 49H
+ int 21H
+ pop ax
+
+; set up the parameter block for the DOS exec call.
+; offset contents
+; 00 segment address of environment to be passed,
+; 0 => use parents env.
+; 02 pointer to command tail for new process.
+; 06 pointer to fcb1
+; 0a pointer to fcb2
+setup_block: mov ax, [envseg]
+ mov [ex_envseg], ax
+ mov cx, cs
+ mov [word ptr ex_cmdtail], offset cmdtail
+ mov [word ptr ex_cmdtail+2], cx
+
+; set up registers for exec call
+; ds:dx - pointer to pathname of program to execute
+; es:bx - pointer to above parameter block
+ mov dx, offset cmdpath
+ mov es, cx
+ mov bx, offset exec_block
+
+; Under DOS 2.x exec is notorious for clobbering registers and guarantees
+; to preserve only cs:ip.
+ push ds
+ mov [ex_sp], sp
+ mov [ex_ss], ss
+ mov [ex_error], 0 ; clear exec error code
+ inc [in_exec] ; set internal flag
+ mov ax, 04b00H
+ int 21H
+
+; returned from exec, so restore possibly clobbered registers.
+ mov ss, cs:ex_ss
+ mov sp, cs:ex_sp
+ pop ds
+
+; check to make certain the exec call worked.
+ jnc it_worked
+
+; exec call failed. Save return code from msdos.
+ mov [ex_error], ax
+ jmp leave_exec
+
+it_worked: mov ah, 04dH ; get the return code
+ int 21H
+ cmp ah,1 ; check if terminated by ^C
+ jnz nosigint
+ inc interrupted ; yes so set flag
+nosigint: xor ah, ah ; 8-bit return code, so clear ah
+ mov [eretcode], ax
+
+leave_exec: cmp [swap], 0 ; check swap, if non-zero swap back in
+ je no_swap_in
+ call swap_in
+
+; Clear the in_exec after the swap back in. This way we are guaranteed to
+; get parent in and the resources freed should a ^C be hit when we are reading
+; the image in.
+no_swap_in: mov [in_exec], 0
+ ret
+do_exec endp
+
+
+
+;==============================================================================
+; Everything past this point is overwriten with the environment and new
+; program after the currently executing program is swapped out.
+;==============================================================================
+overlay_code_here label word
+
+;-----------------------------------------------------------------------------
+; Figure out where we can swap to and initialize the resource we are going to
+; use. We try XMS, EMS, and a tempfile (if specified), in that order. We set
+; [cs:swap] to the correct value based on which of the resources exists.
+; If none can be used, then [cs:swap] is set to 0, and no swap takes place.
+; The exec code will still attempt to execute the child in this instance, but
+; may fail due to lack of resources. Each swap_out_* routine must provide
+; its own clean-up handler should it not be able to write all program
+; segments to the swap resource.
+init_swap proc near
+ mov [swap], 0
+;call init_xms
+;jnc init_done
+;call init_ems
+;jnc init_done
+ call init_file
+init_done: ret
+init_swap endp
+
+
+;-----------------------------------------------------------------------------
+; This routine is used to walk the DOS allocated memory block chain
+; starting at address supplied in the es register. For each block it
+; calls the routine specified by the bx register with the segment length
+; in si, and its address in di. It does not apply the routine to the
+; segment if the segment is the same as the current program's [cs:psp] value.
+memheader struc
+ magic db ? ; either 'Z' for end or 'M' for allocated
+ owner dw ? ; psp of owner block
+ len dw ? ; length in paragraphs of segment
+memheader ends
+
+walk_arena_chain proc near
+ mov si, word ptr es:3 ; get length
+ mov di, es
+ inc di
+ mov ax, word ptr es:1
+
+; Stop the search if the block is NOT owned by us. Ignore our own psp block
+; and our environment segment block.
+ cmp ax, cs:psp ; is it owned by us?
+ jne walk_done ; NOPE! -- all done
+ cmp di, cs:envseg ; skip our environment
+ je next_block
+ cmp di, cs:psp ; skip our psp
+ je next_block
+
+; Now save state and call the routine pointed at by [bx].
+ push di
+ push si
+ push bx
+ call bx
+ pop bx
+ pop si
+ pop di
+ jc exit_walk ; if error then stop
+ mov al, byte ptr es:0 ; check if at end
+ cmp al, 'Z'
+ je walk_done
+
+next_block: add di, si ; go on to next segment
+ mov es, di
+ jmp walk_arena_chain
+walk_done: clc
+exit_walk: ret
+walk_arena_chain endp
+
+
+;-----------------------------------------------------------------------------
+; This routine takes a dos segment found in the di register and free's it.
+free_dos_segment proc near
+ mov es, di ; free dos memory block
+ mov ah, 49H
+ int 21H
+ ret
+free_dos_segment endp
+
+
+;-----------------------------------------------------------------------------
+; Called to invoke write_segment with proper values in the al register. Only
+; ever called from walk_arena_chain, and so al should be set to seg_alloc.
+write_segment_data label near
+ mov al, seg_alloc ; and fall through into write_segment
+;-----------------------------------------------------------------------------
+; This routine writes a segment as a block of data segments if the number of
+; paragraphs to write exceeds 0x0fff (rarely the case).
+; It stuffs the info into tmpseg, and then calls wheader and wseg to get the
+; data out.
+;
+; di:dx segment:offset of segment; offset is ALWAYS zero.
+; si number of paragraphs to write.
+; al mode of header to write
+write_segment proc near
+ push di
+ push si
+ xor dx,dx
+ mov bx, [swap]
+ call [write_header+bx]
+ pop si
+ pop di
+ jc exit_wseg
+
+do_io_loop: cmp si, 0 ; are we done yet?
+ je exit_wseg ; yup so leave.
+ mov cx, si ; # of paragraphs to move
+ cmp cx, 0fffH ; see if we have lots to move?
+ jle do_io
+ mov cx, 0fffH ; reset to max I/O size
+
+do_io: push cx ; save # of paragraphs we are writing
+ shl cx, 1 ; shift cx by four to the left
+ shl cx, 1
+ shl cx, 1
+ shl cx, 1
+ push di ; save the start, and count left
+ push si
+ mov si, cx
+ xor dx,dx
+ mov al, seg_data
+ mov bx, [swap]
+ push bx
+ call [write_header+bx]
+ pop bx
+ call [write_seg+bx]
+ pop si
+ pop di
+ pop dx ; original paragraph count in dx
+ jc exit_wseg ; it failed so exit.
+ add di, dx ; adjust the pointers, and continue.
+ sub si, dx
+ jmp do_io_loop
+exit_wseg: ret
+write_segment endp
+
+
+;=============================================================================
+; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO WRITE XMS RECORDS.
+;=============================================================================
+init_xms proc near
+ ret
+init_xms endp
+
+whdr_xms proc near
+ ret
+whdr_xms endp
+
+wseg_xms proc near
+ ret
+wseg_xms endp
+;=============================================================================
+
+
+;=============================================================================
+; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO WRITE EMS RECORDS.
+;=============================================================================
+init_ems proc near
+ ret
+init_ems endp
+
+whdr_ems proc near
+ ret
+whdr_ems endp
+
+wseg_ems proc near
+ ret
+wseg_ems endp
+;=============================================================================
+
+
+;=============================================================================
+; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO WRITE FILES.
+;=============================================================================
+;-----------------------------------------------------------------------------
+; Attempt to create a temporary file. If the tempfile name is NIL then return
+; with the cary flag set.
+init_file proc near
+ mov al, [tmpname]
+ or al, al
+ je err_init_file
+ mov dx, offset tmpname
+ xor cx, cx
+ mov ah, 03cH
+ int 21H
+ jc err_init_file ; if carry set then failure
+ mov [tmphandle], ax ; init swapping
+ mov [swap], swap_file
+ jmp exit_init_file
+err_init_file: stc
+exit_init_file: ret
+init_file endp
+
+
+;-----------------------------------------------------------------------------
+; This routine writes a segment header to a file.
+; The header is a seven byte record formatted as follows:
+; segment address - of data
+; offset address - of data
+; length in paragraphs - of data
+; mode - 1 => segment header (allocate seg on read)
+; 0 => subsegment, don't allocate on read.
+; Routine takes three arguments:
+; di:dx segment:offset of segment
+; si number of paragraphs to write.
+; al mode of header to write
+whdr_file proc near
+ mov [word ptr tmpseg], di ; save the segment/offset
+ mov [word ptr tmpseg+2], dx
+ mov [word ptr tmpseg+4], si ; save the segment length
+ mov [tmpseg+6], al
+ mov dx, offset tmpseg ; write the header record out
+ mov cx, 7
+ mov bx, [tmphandle]
+ mov ah, 040H
+ int 21H
+ jc exit_whdr_file ; make sure it worked
+ cmp ax, 7
+ je exit_whdr_file ; oh oh, disk is full!
+err_whdr_file: stc
+exit_whdr_file: ret
+whdr_file endp
+
+
+;-----------------------------------------------------------------------------
+; Write a segment to the temporary file whose handle is in cs:tmphandle
+; Parameters for the write are assumed to be stored in the tmpseg data area.
+; function returns carry set if failed, carry clear otherwise.
+wseg_file proc near
+ push ds
+ mov ds, word ptr cs:tmpseg ; Now write the whole segment
+ mov dx, word ptr cs:tmpseg+2
+ mov cx, word ptr cs:tmpseg+4
+ mov bx, cs:tmphandle
+ mov ah, 040H
+ int 21H
+ pop ds
+ jc exit_wseg_file ; make sure it worked
+ cmp ax, [word ptr tmpseg+4]
+ je exit_wseg_file
+err_wseg_file: stc ; it failed (usually disk full)
+exit_wseg_file: ret
+wseg_file endp
+;=============================================================================
+
+
+;=============================================================================
+; _exec: THIS IS THE MAIN ENTRY ROUTINE TO THIS MODULE
+;=============================================================================
+; This is the main entry routine into the swap code and corresponds to the
+; following C function call:
+;
+; exec( int swap, char far *program, char far *cmdtail, int environment_seg,
+; char far *tmpfilename );
+;
+; Exec performs the following:
+; 1. set up the local code segment copies of arguments to the exec call.
+; 2. switch to a local stack frame so that we don't clobber the user
+; stack.
+; 3. save old interrupt vectors for ctrl-brk.
+; 4. install our own handler for the ctrl-brk interrupt, our handler
+; terminates the current running process, and returns with non-zero
+; status code.
+; 5. get our psp
+; 6. setup arguments for exec call
+; 7. exec the program, save result code on return.
+; 8. restore previous ctrl-brk and crit-error handler.
+; 9. restore previous process stack, and segment registers.
+; 10. return from exec with child result code in AX
+; and global _Interrupted flag set to true if child execution was
+; interrupted.
+
+; NOTE: When first called the segments here assume the standard segment
+; settings.
+ assume cs:@code, ds:DGROUP,es:DGROUP,ss:DGROUP
+
+ public _exec
+_exec proc
+ push bp ; set up the stack frame
+ mov bp, sp
+ push si ; save registers we shouldn't step on.
+ push di
+ push ds
+
+; set up for copying of parameters passed in with long pointers.
+ push cs ; going to use lodsb/stosb, set up es
+ pop es ; as destination.
+ assume es:@code ; let the assembler know :-)
+ cld ; make sure direction is right
+
+; Copy all parameters into the bottom of the code segment. After doing so we
+; will immediately switch stacks, so that the user stack is preserved intact.
+ mov ax, ss:[a_swap] ; save swap
+ mov es:swap, ax
+ mov ax, ss:[a_env] ; save env seg to use
+ mov es:envseg, ax
+
+ mov di, offset cs:cmdpath ; copy the command
+ lds si, ss:[a_prog] ; 65 bytes worth
+ mov cx, 65
+ call copy_data
+
+ mov di, offset cs:cmdtail ; copy the command tail
+ lds si, ss:[a_tail] ; 129 bytes worth
+ mov cx, 129
+ call copy_data
+
+ mov di, offset cs:tmpname ; copy the temp file name
+ lds si, ss:[a_tmp] ; 65 bytes worth.
+ mov cx, 65
+ call copy_data
+
+; Now we save the current ss:sp stack pointer and swap stack to our temporary
+; stack located in the current code segment. At the same time we reset the
+; segment pointers to point into the code segment only.
+swap_stacks: mov ax, ss
+ mov es:old_ss, ax
+ mov es:old_sp, sp
+ mov ax, cs
+ mov ds, ax
+ mov ss, ax ; set ss first, ints are then
+ mov sp, offset cs:exec_sp ; disabled for this instr too
+ assume ds:@code, ss:@code ; let the assembler know :-)
+
+; Now we save the old control break and critical error handler addresses.
+; We replace them by our own routines found in the resident portion of the
+; swapping exec code.
+set_handlers: mov [interrupted], 0 ; clear interrupted flag
+ mov [eretcode], 0 ; clear the return code
+ mov ax, 03523H ; get int 23 handler address
+ int 21H
+ mov cs:old_ctl_brk_off, bx
+ mov cs:old_ctl_brk_seg, es
+ mov dx, offset ctl_brk_handler
+ mov ax, 02523H ; set int 23 handler address
+ int 21H
+
+ mov ax, 03524H ; get int 24 handler address
+ int 21H
+ mov cs:old_crit_err_off, bx
+ mov cs:old_crit_err_seg, es
+ mov dx, offset crit_err_handler
+ mov ax, 02524H ; set int 24 handler address
+ int 21H
+
+; Go and execute the child, we've set up all of its parameters. The do_exec
+; routine will attempt to perform a swap of the code if requested to do so by
+; a non-zero value in the variable cs:swap.
+ mov ah, 051H ; get the psp
+ int 21H
+ mov cs:psp, bx
+ call do_exec
+
+; We're back from the exec, so fix things up the way they were.
+; Restore the old control-break and critical-error handlers.
+ lds dx, cs:old_ctl_brk
+ mov ax, 02523H
+ int 21H
+ lds dx, cs:old_crit_err
+ mov ax, 02524H
+ int 21H
+
+; Restore previous program stack segment registers, and data segment.
+ mov ax, cs:old_ss
+ mov ss, ax ; mov into ss first, that way
+ mov sp, cs:old_sp ; no interrupts in this instr.
+ pop ds
+
+; Tell the assembler we have swaped segments again.
+ assume ds:DGROUP,es:DGROUP,ss:DGROUP
+
+; Set the global Interrupted flag so that parent can tell it was interrupted.
+ mov ax, seg DGROUP:_Interrupted
+ mov es, ax
+ mov ax, cs:interrupted
+ mov es:_Interrupted, ax
+
+; Set the global errno value to reflect the success/failure of the DOS
+; exec call.
+ mov ax, seg DGROUP:_errno
+ mov es, ax
+ mov ax, cs:ex_error
+ mov es:_errno, ax
+
+; Fetch the child's return code, pop rest of stuff off of the stack
+; and return to the caller.
+ mov ax, cs:eretcode
+ pop di
+ pop si
+ pop bp
+ ret
+_exec endp
+
+; void do_hook_std_writes(int handle);
+; This saves the 21h interrupt vector and changes it to point
+; into this code. Argument is the file handle of the -C file.
+
+ public _do_hook_std_writes
+_do_hook_std_writes proc
+ push bp
+ mov bp,sp
+ push di
+
+ mov di, ss:[a_handle] ; handle of -C file
+ mov std_fil_handle, di
+
+ mov ah, 51h ; request our PSP
+ int 21h
+ mov [psp], bx ; save it
+
+ mov es, bx
+ les bx, es:[34h] ; pointer to job file table
+ mov al, es:[bx+1] ; system file # of our stdout
+ mov [our_stdout], al
+ mov al, es:[bx+di] ; system file number of -C file
+ mov std_fil_number, al
+
+ mov ax,3521h ; request vector 21h
+ int 21h ; it's returned in ES:BX
+ mov word ptr [real_21h], bx
+ mov word ptr [real_21h+2], es
+
+ push ds
+ mov ax,cs
+ mov ds,ax
+ lea dx,our_21h_handler ; DS:DX is the new vector
+ mov ax,2521h ; set vector 21h
+ int 21h
+
+ pop ds
+ pop di
+ pop bp
+ ret
+_do_hook_std_writes endp
+
+; void do_unhook_std_writes(void);
+; This restores the 21h interrupt vector.
+; The saved vector is zero if it wasn't changed (no -C option).
+
+ public _do_unhook_std_writes
+_do_unhook_std_writes proc
+ push ds
+
+ lds dx, [real_21h] ; put saved vector into DS:DX
+ mov ax, ds
+ or ax, dx
+ jz unhook_return ; zero means we didn't hook 21h
+
+ mov ax,2521h ; set vector 21h
+ simulate_21h
+
+unhook_return: pop ds
+ ret
+_do_unhook_std_writes endp
+end
diff --git a/dmake/msdos/exec.h b/dmake/msdos/exec.h
new file mode 100644
index 000000000000..f603bc43d2cb
--- /dev/null
+++ b/dmake/msdos/exec.h
@@ -0,0 +1,43 @@
+/* RCS $Id: exec.h,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- Internal version of exec for dmake.
+--
+-- DESCRIPTION
+-- External defines for the exec.c code.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#ifndef _EXEC_h_
+#define _EXEC_h_
+
+#ifndef ANSI
+#if defined(__STDC__) || defined(__TURBOC__)
+#define ANSI(x) x
+#else
+#define ANSI(x) ()
+#endif
+#endif
+
+extern int exec ANSI((int, char far *, char far *, unsigned int, char far *));
+
+#ifndef MK_FP
+#define MK_FP(seg,ofs) \
+ ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
+#endif
+
+#endif
diff --git a/dmake/msdos/exec.uue b/dmake/msdos/exec.uue
new file mode 100644
index 000000000000..90a1c3e661e8
--- /dev/null
+++ b/dmake/msdos/exec.uue
@@ -0,0 +1,63 @@
+begin 777 exec.obj
+M@! #DU31$]37&5X96,N87-M;(@@ '%1U<F)O($%S<V5M8FQE<B @5F5R
+M<VEO;B S+C";B!8 0.DJ<T$=#DU31$]37&5X96,N87-M.H@# $#I3)8" !H
+MB , 0*&4EA "45814-?5$585 1#3T1%:9@' $@:" (# ?&6# %7T1!5$$$
+M1$%40<*8!P!( @ $!0$-E@@ !D1'4D]54(N:! &_P);C D !E]E<G)N;P#@
+MD!, 0(,7TEN=&5R<G5P=&5D 69 < !%5]D;U]U;FAO;VM?<W1D7W=R
+M:71E<P,( &>0# 05?97AE8^$& '.0&@ 1-?9&]?:&]O:U]S=&1?=W)I
+M=&5SN < FH@$ $"B 9&@!@ !F ,&B#@ !7 $E $ 0 $ RJ(. &(
+M 4$ 0 ! 0""H@X <D! 0 ! $ ! (&@" !S $ BJ#' '4
+M 65X96,Z($9A:6QU<F4@<F5A9&EN9R!H96%D97(@8FQO8VL-"B1E>&5C.B!&
+M86EL=7)E(')E861I;F<@<V5G;65N="!D871A#0HD97AE8SH@1F%I;'5R92!O
+M;B!R97-I>F4-"B1E>&5C.B!&86EL=7)E('1O(&9R964@82!B;&]C:PT*)&5X
+M96,Z(%!R;V=R86T@<W=A<"!F86EL=7)E#0HD97AE8SH@365M;W)Y(&)L;V-K
+M<R!D;VXG="!M871C: T*)+>B#@ !EP(! $ 0 $ LJ H &8 G(&=0:7
+M!G,&=@:]!@,$!P0+! 0$" 0J! 8$"@1@! 4$"012! J<20#$ %0!Q )4 <0$
+M5 '$!E0!Q A4 <0*5 '$#%0!Q Y4 <005 '$$E0!Q!14 <065 '$&%0!Q!I4
+M <0<5 '$'E0!Q"!4 <0B5 $GH P <H"7 $ %P! #-G D S !4 <P$5 $5
+MH,T# =8" "<@/Q =0J#^P%T"X/[ G0&G2[_+LP!4%%24U155E<>!HOL+HL^
+MT &T49PN_Q[, 2X['HP =&R.PR;%'C0 BW8,B@ N.@;3 75CB@$N.@;2 71*
+MN SG"[_'LP!B_(KTK@!,YPN_Q[, 2Z+'HP M%"<+O\>S &+WXY> HM6#K1
+MG"[_'LP!C,.T4)PN_Q[, 8O6N $SG"[_'LP!ZQ".7@*+5@Z+W[1 G"[_'LP!
+M!Q]?7EV#Q );6EE8G2[_+LP!@\0&6%M96EY?71\'58OLAT8&#0$ AT8&7;@%
+M ,_X+O\&D@ N@SZ8 !T ?G/NM0!ZQR0NOD!ZQ:0NAX"ZQ"0NC@"ZPJ0NG4"
+MZP20NE@"4HL>C@#_E[ "C,B.V%JT"<TAN/],S2'1Z7,!I/.EP\/#P\/#P\/#
+MNH$!N0< BQ[* ;0_S2%S NNF/0< = <+P'0"ZYOYPQXNCAZ! 2Z+%H,!+HL.
+MA0$NBQ[* ;0_S2$?<P+K@3L&A0%T ^EX_\.+'LH!,\F+T;@ 0LTAPXL>R@&T
+M/LTANH@!M$'-(<.+'I8 N %8S2&+'HX _Y>V HX&C "+'H0 M$K-(7,#Z4__
+MBQZ. /^7I )R**"' 3P =.\\ 743BQZ% ;1(S2%R!CL&@0%TV^DA_XL>C@#_
+MEZH"Z\Z+'HX _Y>P L.X %C-(:.6 (L^C ",RRO?B\=(CL FBS8# (DVA "X
+MYP71Z-'HT>C1Z /8*_,#^XD>A@")/H@ L #H'0%R,:&, $B.P+LD!NC+ '(C
+MH8P 2([ NQT&Z+T <P/IJ_Z.!HP BQZ& +1*S2%S ^F4_L.+'HX _Y>P C/
+MHXX ^<.#/HX '0(Z(, <@/H<_^#/I( '5FH8H "\!T"%".P+1)S2%8H8H
+MH\0"C,G'!L8"VP")#L@"NIH CL&[Q (>B2;4 HP6T@+'!M8" #_!I@ N !+
+MS2$NCA;2 BZ+)M0"'W,&H]8"ZQ.0M$W-(8#\ 74$_P:2 #+DHY @SZ. !T
+M ^B?_L<&F ,/'!HX #HE@##)HLV P",QT<FH0$ +CL&C !U)BX[/HH
+M=!DN.SZ, '025U93_]-;7E]R#R:@ \6G0& _Z.Q^O'^,..Q[1)S2'#L %7
+M5C/2BQZ. /^7F )>7W(Z@_X =#6+SH'Y_P]^ [G_#U'1X='AT>'1X5=6B_$S
+MTK "BQZ. %/_EY@"6_^7G@)>7UIR!@/Z*_+KQL/#P\/#P\.@B $*P'07NH@!
+M,\FT/,TA<@RCR@''!HX ! #K I#YPXD^@0&)%H,!(YR1 <065 '$)U0!Q"]4
+M <0T5 '$1U0!Q%!4 <1;5 '$:%0!Q&U4 <1U5 '$A50!Q(]4 <2:5 '$K%0!
+MQ+Y4 <3A5 '$YE0!Q.Y4 <3T5 '$^E0!Q0!4 <4&5 '%#%0!Q1%4 <455 '%
+M-E0!Q3U4 <585 '%750!Q6)4 <5G5 '%=%0!Q7Y4 <6,5 '%DU0!Q9Q4 <6E
+M5 '%J50!Q:U4 <6Q5 '%OE0!Q<)4 <7'5 '%TU0!Q=U4 <865 '&/%0!QDI4
+M <7F5 '%ZE0!Q?!4 <7T5 '%_50!Q@%4 <835 '&*%0!QBQ4 <8V5 '&1%0!
+MQE94 <9:5 '&:%0!QFQ4 <9Q5 '&=U0!QH94 <:,5 '&FU0!QIY4 <:D5 '&
+MIE0!QJI4 <:M5 '&LE0!QK=4 <:[5 '&OU0!QL54 <;/5 '&U%0!QMI4 <;J
+M5 '&[U0!QO-4 <;]5 ''!%0!QQM4 <<B5 ''*50!QU94 <=:5 ''@U0!QXA4
+M <>-5 ''HE0!QZE4 <>T5 ''N%0!Q\-4 <?'5 $%H'\! 9\&B3:% :*' ;J!
+M ;D' (L>R@&T0,TA<@8]!P!T ?G#'BZ.'H$!+HL6@P$NBPZ% 2Z+'LH!M$#-
+M(1]R!SL&A0%T ?G#58OL5E<>#@?\BT8&)J.. (M&$":CB@"_F@#%=@BY00#H
+M]_R_VP#%=@RY@0#HZ_R_B '%=A*Y00#HW_R,T":C@ FB2:" (S(CMB.T+R
+M ,<&D@ ,<&D +@C-<TA+HD>O (NC :^ KJS [@C)<TAN"0US2$NB1[
+M BZ,!L("NI8#N"0ES2&T4<TA+HD>C #HU?TNQ1:\ K@C)<TA+L46P *X)"7-
+M(2ZA@ ".T"Z+)H( '[@ ([ +J&2 ":C "X ".P"ZAU@(FHP +J&0 %]>
+M7<M5B^Q7BWX&+HD^T &T4<TA+HD>C ".PR;$'C0 )HI' 2ZBTP$FB@$NHM(!
+MN"$US2$NB1[, 2Z,!LX!'HS(CMBZV *X(27-(1]?7<L>+L46S &,V O"= FX
+M(26<+O\>S $?RPJ<O0#$ E0!Q 54 <0(5 '$#U0!Q")4 <0G5 '$+%0!Q#%4
+M <0\5 '$4%0!Q%=4 <1:5 '$9E0!Q')4 <2!5 '$AE0!Q(]4 <235 '$F50!
+MQ*54 <2J5 '$K50!Q+Q4 <3!5 '$Q%0!Q-)4 <3:5 '$Y%0!Q.U4 <3T5 '(
+M^!0! L3^5 '% A0! LD%%@$!Q0M4 <4/%@$!Q1-4 <4C5 '%+%0!Q3M4 <5"
+E5 '%3%0!Q5%4 <595 '%:%0!Q7=4 ?6@!@ " %B* @ =%0!
+
+end
diff --git a/dmake/msdos/find.c b/dmake/msdos/find.c
new file mode 100644
index 000000000000..d35cc477ec9e
--- /dev/null
+++ b/dmake/msdos/find.c
@@ -0,0 +1,130 @@
+/*
+ Directory Access Library
+
+ FIND.C taken from DIRLIB.C by M. J. Weinstein
+ Released to public domain 1-Jan-89
+
+ The author may be contacted at:
+ matt@cs.ucla.edu -or- POB 84524, L.A., CA 90073
+
+ Modified by dvadura@watdragon.edu to work with dmake.
+ (nuked the DOS version 2 code, since dmake needs version
+ 3.0 or greater to function).
+ */
+
+
+/*
+ * revision history:
+ *
+ * VER MM/DD/YY COMMENTS
+ * ---- -------- --------
+ * 0.99 02/24/86 Beta release to INTERNET
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+#include <string.h>
+#include <alloc.h>
+#include <dos.h>
+#include "dosdta.h"
+
+#ifndef MK_FP
+#define MK_FP(seg,ofs) ((void far *) \
+ (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
+#endif
+#ifndef FP_SEG
+#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
+#endif
+#ifndef FP_OFF
+#define FP_OFF(fp) ((unsigned)(fp))
+#endif
+
+int find_err;
+
+/*
+ * get/set dta address
+ */
+
+static DTA far *
+_getsetdta(newdta)
+DTA far *newdta;
+{
+ DTA far *olddta;
+ union REGS r;
+ struct SREGS s;
+
+ /* get old dta */
+ r.h.ah = 0x2f;
+ intdos(&r, &r);
+ segread(&s);
+ olddta = (DTA far *) MK_FP(s.es, r.x.bx);
+
+ /* conditionally set new dta */
+ if (newdta) {
+ r.h.ah = 0x1a;
+ s.ds = FP_SEG(newdta);
+ r.x.dx = FP_OFF(newdta);
+ intdosx(&r, &r, &s);
+ }
+
+ return olddta;
+}
+
+/*
+ * dos findfirst
+ */
+
+DTA *
+findfirst(name, dta)
+char *name;
+DTA *dta;
+{
+ union REGS r;
+ struct SREGS s;
+ DTA far *dtasave;
+ char far *nmp = (char far *)name;
+
+ dtasave = _getsetdta((DTA far *)dta);
+
+ /* do directory lookup */
+ segread(&s);
+ r.h.ah = 0x4e;
+ r.x.cx = 0x10;
+ r.x.dx = FP_OFF(nmp);
+ s.ds = FP_SEG(nmp);
+ intdosx(&r, &r, &s);
+ /* restore dta */
+ _getsetdta(dtasave);
+ find_err = r.x.ax;
+ if (r.x.cflag)
+ return(NULL);
+
+ return dta;
+}
+
+/*
+ * dos findnext
+ */
+
+DTA *
+findnext(dta)
+DTA *dta;
+{
+ union REGS r;
+ DTA far *dtasave;
+
+ dtasave = _getsetdta((DTA far *)dta);
+
+ /* do directory lookup */
+ r.h.ah = 0x4f;
+ intdos(&r, &r);
+ /* restore old dta */
+ _getsetdta(dtasave);
+ find_err = r.x.ax;
+ if (r.x.cflag)
+ return(NULL);
+
+ return dta;
+}
diff --git a/dmake/msdos/microsft/config.h b/dmake/msdos/microsft/config.h
new file mode 100644
index 000000000000..da2d7cbfc31f
--- /dev/null
+++ b/dmake/msdos/microsft/config.h
@@ -0,0 +1,77 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:37:29 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#if defined (_MSC_VER)
+# if _MSC_VER < 500
+ Force a compile-time blowup.
+ Do not define "#define _MSC_VER" for MSC compilers earlier than 5.0.
+# endif
+#endif
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+#define coreleft() 0L
+
+/* MSC Version 4.0 doesn't understand SIGTERM, later versions do. */
+#ifndef SIGTERM
+# define SIGTERM SIGINT
+#endif
+
+/* Fixes unimplemented line buffering for MSC 5.x and 6.0.
+ * MSC _IOLBF is the same as _IOFBF
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# undef _IOLBF
+# define _IOLBF _IONBF
+#endif
+
+/* in alloc.h: size_t is redefined
+ * defined in stdio.h which is included by alloc.h
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# define _TYPES_
+#endif
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in MSC */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/* MSC doesn't seem to care about CONST */
+#define CONST
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Have to pull this in for the standard lib defines */
+#include <io.h>
diff --git a/dmake/msdos/microsft/config.mk b/dmake/msdos/microsft/config.mk
new file mode 100644
index 000000000000..cd049cd471af
--- /dev/null
+++ b/dmake/msdos/microsft/config.mk
@@ -0,0 +1,59 @@
+# This is the MSC 4.0 and higher DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+TMPDIR :=
+.EXPORT : TMPDIR
+
+# Definition of macros for library, and C startup code.
+
+# The following sources are required for MSC
+OSR_SRC = tempnam.c
+.SETDIR=$(osrdir) : $(OSR_SRC)
+
+SRC += $(OSR_SRC)
+.SOURCE.h : $(osrdir)
+
+SET_STACK = -stack:4096
+NDB_LDFLAGS += $(SET_STACK)
+
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+# Microsoft C doesn't need tail but needs head
+LDTAIL = ;
+LDHEAD =
+
+# Debugging libraries
+DB_LDFLAGS += -co -li -map $(SET_STACK)
+DB_LDLIBS +=
+
+# NO Debug MSC flags:
+# Set the environment variable MSC_VER to be one of 5.1, 6.0, 8.0 (for VC++4.0)
+# to get these by default when you make dmake using 'dmake'.
+#
+# Setting MSC_VER to one of the above sets the variable _MSC_VER appropriately
+# and sets the flags appropriately.
+
+CFLAGS += -I$(osrdir) $(C_$(MODEL)) -nologo
+DB_CFLAGS += -Zi
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+C_s =
+C_m = -AM
+C_c = -AC
+C_l = -AL
+
+S_s = -Dmsmall
+S_m = -Dmmedium
+S_c = -Dmcompact
+S_l = -Dmlarge
diff --git a/dmake/msdos/microsft/msc51/config.mk b/dmake/msdos/microsft/msc51/config.mk
new file mode 100644
index 000000000000..beaae0dfea97
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/config.mk
@@ -0,0 +1,11 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+.IMPORT .IGNORE : MSC_VER
+MSC_VER *= 5.1
+
+CFLAGS += -I$(osedir) -D_MSC_VER=$(MSC_VER:s,.,,)0
+
+NDB_CFLAGS += -Oscl -Gs
+NDB_LDFLAGS += -exe -packc -batch
+NDB_LDLIBS +=
diff --git a/dmake/msdos/microsft/msc51/lib.rsp b/dmake/msdos/microsft/msc51/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/msdos/microsft/msc51/libswp.rsp b/dmake/msdos/microsft/msc51/libswp.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/libswp.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/msdos/microsft/msc51/mk.bat b/dmake/msdos/microsft/msc51/mk.bat
new file mode 100755
index 000000000000..b111d6e62f01
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/mk.bat
@@ -0,0 +1,102 @@
+md objects
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs infer.c
+copy infer.obj objects
+del infer.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs make.c
+copy make.obj objects
+del make.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs stat.c
+copy stat.obj objects
+del stat.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs expand.c
+copy expand.obj objects
+del expand.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs hash.c
+copy hash.obj objects
+del hash.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dag.c
+copy dag.obj objects
+del dag.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmake.c
+copy dmake.obj objects
+del dmake.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs path.c
+copy path.obj objects
+del path.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs imacs.c
+copy imacs.obj objects
+del imacs.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs parse.c
+copy parse.obj objects
+del parse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs getinp.c
+copy getinp.obj objects
+del getinp.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs quit.c
+copy quit.obj objects
+del quit.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs state.c
+copy state.obj objects
+del state.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs macparse.c
+copy macparse.obj objects
+del macparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs percent.c
+copy percent.obj objects
+del percent.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs function.c
+copy function.obj objects
+del function.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\tee.c
+copy tee.obj objects
+del tee.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\find.c
+copy find.obj objects
+del find.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\microsft\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+link /stack:4096/exe/packc/batch @msdos\microsft\msc51\obj.rsp,dmake.exe,NUL.MAP;
+copy msdos\microsft\msc51\template.mk startup\config.mk
diff --git a/dmake/msdos/microsft/msc51/mkswp.bat b/dmake/msdos/microsft/msc51/mkswp.bat
new file mode 100755
index 000000000000..5ab14d3517e5
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/mkswp.bat
@@ -0,0 +1,104 @@
+md objects
+masm -t -mx -Dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs infer.c
+copy infer.obj objects
+del infer.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs make.c
+copy make.obj objects
+del make.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs stat.c
+copy stat.obj objects
+del stat.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs expand.c
+copy expand.obj objects
+del expand.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs hash.c
+copy hash.obj objects
+del hash.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dag.c
+copy dag.obj objects
+del dag.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmake.c
+copy dmake.obj objects
+del dmake.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs path.c
+copy path.obj objects
+del path.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs imacs.c
+copy imacs.obj objects
+del imacs.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs parse.c
+copy parse.obj objects
+del parse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs getinp.c
+copy getinp.obj objects
+del getinp.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs quit.c
+copy quit.obj objects
+del quit.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs state.c
+copy state.obj objects
+del state.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs macparse.c
+copy macparse.obj objects
+del macparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs percent.c
+copy percent.obj objects
+del percent.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs function.c
+copy function.obj objects
+del function.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\find.c
+copy find.obj objects
+del find.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\microsft\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+link /stack:4096/exe/packc/batch @msdos\microsft\msc51\objswp.rsp,dmake.exe,NUL.MAP;
+copy msdos\microsft\msc51\template.mk startup\config.mk
diff --git a/dmake/msdos/microsft/msc51/obj.rsp b/dmake/msdos/microsft/msc51/obj.rsp
new file mode 100644
index 000000000000..8f79a32754c9
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/obj.rsp
@@ -0,0 +1,33 @@
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\tee.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj
diff --git a/dmake/msdos/microsft/msc51/objswp.rsp b/dmake/msdos/microsft/msc51/objswp.rsp
new file mode 100644
index 000000000000..54524124d236
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/objswp.rsp
@@ -0,0 +1,34 @@
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj
diff --git a/dmake/msdos/microsft/msc51/public.h b/dmake/msdos/microsft/msc51/public.h
new file mode 100644
index 000000000000..c0c08e12cb82
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:44 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/microsft/msc51/template.mk b/dmake/msdos/microsft/msc51/template.mk
new file mode 100644
index 000000000000..7174197d6284
--- /dev/null
+++ b/dmake/msdos/microsft/msc51/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= msc51
diff --git a/dmake/msdos/microsft/msc60/config.mk b/dmake/msdos/microsft/msc60/config.mk
new file mode 100644
index 000000000000..5b206bec34bd
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/config.mk
@@ -0,0 +1,11 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+.IMPORT .IGNORE : MSC_VER
+MSC_VER *= 6.0
+
+CFLAGS += -I$(osedir) -D_MSC_VER=$(MSC_VER:s,.,,)0
+
+NDB_CFLAGS += -Osecgl -Gs
+NDB_LDFLAGS += -exe -packc -batch
+NDB_LDLIBS +=
diff --git a/dmake/msdos/microsft/msc60/lib.rsp b/dmake/msdos/microsft/msc60/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/msdos/microsft/msc60/libswp.rsp b/dmake/msdos/microsft/msc60/libswp.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/libswp.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/msdos/microsft/msc60/mk.bat b/dmake/msdos/microsft/msc60/mk.bat
new file mode 100755
index 000000000000..c260b6d54abd
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/mk.bat
@@ -0,0 +1,102 @@
+md objects
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs infer.c
+copy infer.obj objects
+del infer.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs make.c
+copy make.obj objects
+del make.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs stat.c
+copy stat.obj objects
+del stat.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs expand.c
+copy expand.obj objects
+del expand.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs hash.c
+copy hash.obj objects
+del hash.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dag.c
+copy dag.obj objects
+del dag.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmake.c
+copy dmake.obj objects
+del dmake.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs path.c
+copy path.obj objects
+del path.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs imacs.c
+copy imacs.obj objects
+del imacs.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs parse.c
+copy parse.obj objects
+del parse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs getinp.c
+copy getinp.obj objects
+del getinp.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs quit.c
+copy quit.obj objects
+del quit.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs state.c
+copy state.obj objects
+del state.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs macparse.c
+copy macparse.obj objects
+del macparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs percent.c
+copy percent.obj objects
+del percent.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs function.c
+copy function.obj objects
+del function.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\tee.c
+copy tee.obj objects
+del tee.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\find.c
+copy find.obj objects
+del find.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\microsft\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+link /stack:4096/exe/packc/batch @msdos\microsft\msc60\obj.rsp,dmake.exe,NUL.MAP;
+copy msdos\microsft\msc60\template.mk startup\config.mk
diff --git a/dmake/msdos/microsft/msc60/mkswp.bat b/dmake/msdos/microsft/msc60/mkswp.bat
new file mode 100755
index 000000000000..6b9ed76a5085
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/mkswp.bat
@@ -0,0 +1,104 @@
+md objects
+masm -t -mx -Dmlarge msdos\exec.asm,,,;
+mv exec.obj objects
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs infer.c
+copy infer.obj objects
+del infer.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs make.c
+copy make.obj objects
+del make.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs stat.c
+copy stat.obj objects
+del stat.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs expand.c
+copy expand.obj objects
+del expand.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs hash.c
+copy hash.obj objects
+del hash.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dag.c
+copy dag.obj objects
+del dag.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmake.c
+copy dmake.obj objects
+del dmake.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs path.c
+copy path.obj objects
+del path.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs imacs.c
+copy imacs.obj objects
+del imacs.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs parse.c
+copy parse.obj objects
+del parse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs getinp.c
+copy getinp.obj objects
+del getinp.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs quit.c
+copy quit.obj objects
+del quit.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs state.c
+copy state.obj objects
+del state.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs macparse.c
+copy macparse.obj objects
+del macparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs percent.c
+copy percent.obj objects
+del percent.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs function.c
+copy function.obj objects
+del function.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\runargv.c
+copy runargv.obj objects
+del runargv.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\switchar.c
+copy switchar.obj objects
+del switchar.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\spawn.c
+copy spawn.obj objects
+del spawn.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\find.c
+copy find.obj objects
+del find.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\microsft\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+link /stack:4096/exe/packc/batch @msdos\microsft\msc60\objswp.rsp,dmake.exe,NUL.MAP;
+copy msdos\microsft\msc60\template.mk startup\config.mk
diff --git a/dmake/msdos/microsft/msc60/obj.rsp b/dmake/msdos/microsft/msc60/obj.rsp
new file mode 100644
index 000000000000..8f79a32754c9
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/obj.rsp
@@ -0,0 +1,33 @@
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\tee.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj
diff --git a/dmake/msdos/microsft/msc60/objswp.rsp b/dmake/msdos/microsft/msc60/objswp.rsp
new file mode 100644
index 000000000000..54524124d236
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/objswp.rsp
@@ -0,0 +1,34 @@
+objects\exec.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\spawn.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj
diff --git a/dmake/msdos/microsft/msc60/public.h b/dmake/msdos/microsft/msc60/public.h
new file mode 100644
index 000000000000..dbf2e595fe8e
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/public.h
@@ -0,0 +1,170 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:56 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int spawnvpe ANSI((int, char *, char **, char **));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/microsft/msc60/template.mk b/dmake/msdos/microsft/msc60/template.mk
new file mode 100644
index 000000000000..a147c694c5f7
--- /dev/null
+++ b/dmake/msdos/microsft/msc60/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= msc60
diff --git a/dmake/msdos/microsft/optoff.h b/dmake/msdos/microsft/optoff.h
new file mode 100644
index 000000000000..b2426a1259ba
--- /dev/null
+++ b/dmake/msdos/microsft/optoff.h
@@ -0,0 +1,27 @@
+/* RCS $Id: optoff.h,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $
+--
+-- SYNOPSIS
+-- Turn off microsoft loop optimization.
+--
+-- DESCRIPTION
+-- This is broken in some pre 600 compilers so just turn it off.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#if _MSC_VER < 600
+# pragma loop_opt(off)
+#endif
diff --git a/dmake/msdos/microsft/tempnam.c b/dmake/msdos/microsft/tempnam.c
new file mode 100644
index 000000000000..1a105c6b0f3a
--- /dev/null
+++ b/dmake/msdos/microsft/tempnam.c
@@ -0,0 +1,110 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* MSC stdio.h defines P_tmpdir, so let's undo it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifdef P_tmpdir
+#undef P_tmpdir
+#endif
+static char *P_tmpdir = "";
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/msdos/rmprq.c b/dmake/msdos/rmprq.c
new file mode 100644
index 000000000000..28fa1e392811
--- /dev/null
+++ b/dmake/msdos/rmprq.c
@@ -0,0 +1,44 @@
+/* RCS $Id: rmprq.c,v 1.2 2008-03-05 18:35:28 kz Exp $
+--
+-- SYNOPSIS
+-- Remove prerequisites code.
+--
+-- DESCRIPTION
+-- This code is different for DOS and for UNIX and parallel make
+-- architectures since the parallel case requires the rm's to be
+-- run in parallel, whereas DOS guarantees to run them sequentially.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#if defined(USE_CREATEPROCESS)
+/* MSVC6.0 and newer and MinGW use the parallel build enabled runargv(). */
+Force a compile-time blowup.
+This file should not be used, use unix/rmprq.c instead.
+#endif
+
+#include "extern.h"
+
+PUBLIC void
+Remove_prq( tcp )
+CELLPTR tcp;
+{
+ tcp->ce_flag &= ~(F_MADE|F_VISITED);
+ tcp->ce_time = 0L;
+
+ Make( tcp, tcp );
+}
diff --git a/dmake/msdos/ruletab.c b/dmake/msdos/ruletab.c
new file mode 100644
index 000000000000..524723415b32
--- /dev/null
+++ b/dmake/msdos/ruletab.c
@@ -0,0 +1,45 @@
+/* RCS $Id: ruletab.c,v 1.2 2006-04-20 12:06:11 hr Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+#include <stdio.h>
+
+static char *_rules[] = {
+ "MAXLINELENGTH := 2046",
+ "MAXPROCESSLIMIT := 1",
+ "MAXPROCESS := 1",
+ ".IMPORT .IGNORE: DMAKEROOT",
+ ".MAKEFILES : makefile.mk makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ (char *)NULL };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
+
diff --git a/dmake/msdos/runargv.c b/dmake/msdos/runargv.c
new file mode 100644
index 000000000000..373b075c3fc5
--- /dev/null
+++ b/dmake/msdos/runargv.c
@@ -0,0 +1,188 @@
+/* RCS $Id: runargv.c,v 1.6 2008-03-05 18:35:53 kz Exp $
+--
+-- SYNOPSIS
+-- Run a sub process.
+--
+-- DESCRIPTION
+-- Use spawn to run a subprocess.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#if defined(USE_CREATEPROCESS)
+/* MSVC6.0 and newer and MinGW use the parallel build enabled runargv(). */
+Force a compile-time blowup.
+This file should not be used, use unix/runargv.c instead.
+#endif
+
+#include <process.h>
+#include <errno.h>
+#include "extern.h"
+#include "sysintf.h"
+
+static int _abort_flg = FALSE;
+static void _add_child ANSI((CELLPTR, int));
+static void _finished_child ANSI((int));
+
+PUBLIC int
+runargv(target, group, last, cmnd_attr, cmd)
+CELLPTR target;
+int group;
+int last;
+t_attr cmnd_attr; /* Attributes for current cmnd. */
+char **cmd; /* Simulate a reference to *cmd. */
+{
+ int ignore = (cmnd_attr & A_IGNORE)!= 0; /* Ignore errors ('-'). */
+ int shell = (cmnd_attr & A_SHELL) != 0; /* Use shell ('+'). */
+ int mute = (cmnd_attr & A_MUTE) != 0; /* Mute output ('@@'). */
+#if ! defined(_MSC_VER)
+#if defined(__BORLANDC__) && __BORLANDC__ >= 0x500
+ extern char ** _RTLENTRY _EXPDATA environ;
+#else
+ extern char **environ;
+#endif
+#endif
+ int status;
+ char **argv;
+ int old_stdout = -1; /* For redirecting shell escapes */
+ int old_stderr = -1; /* and silencing @@-recipes */
+ char *tcmd = *cmd; /* For saver/easier string arithmetic on *cmd. */
+
+ if( Measure & M_RECIPE )
+ Do_profile_output( "s", M_RECIPE, target );
+
+ _add_child(target, ignore);
+
+ /* redirect output for _exec_shell / @@-recipes. */
+ if( Is_exec_shell ) {
+ /* Add error checking? */
+ old_stdout = dup(1);
+ dup2( fileno(stdout_redir), 1 );
+ }
+ if( mute ) {
+ old_stderr = dup(2);
+ dup2( zerofd, 2 );
+
+ if( !Is_exec_shell ) {
+ old_stdout = dup(1);
+ dup2( zerofd, 1 );
+ }
+ }
+
+ /* Return immediately for empty line or noop command. */
+ if ( !*tcmd || /* empty line */
+ ( strncmp(tcmd, "noop", 4) == 0 && /* noop command */
+ (iswhite(tcmd[4]) || tcmd[4] == '\0')) ) {
+ status = 0;
+ }
+ else if( !shell && /* internal echo only if not in shell */
+ strncmp(tcmd, "echo", 4) == 0 &&
+ (iswhite(tcmd[4]) || tcmd[4] == '\0') ) {
+ int nl = 1;
+
+ tcmd = tcmd + 4;
+
+ while( iswhite(*tcmd) ) ++tcmd;
+ if ( strncmp(tcmd,"-n",2 ) == 0) {
+ nl = 0;
+ tcmd = tcmd+2;
+ while( iswhite(*tcmd) ) ++tcmd;
+ }
+ printf("%s%s", tcmd, nl ? "\n" : "");
+ fflush(stdout);
+ status = 0;
+ }
+ else {
+ argv = Pack_argv( group, shell, cmd );
+ Packed_shell = shell||group;
+
+ /* The last two arguments would need (const char *const *) casts
+ * to silence the warning when building with MinGW. */
+ status = spawnvpe(P_WAIT, *argv, argv, environ);
+ }
+
+ /* Restore stdout/stderr if needed. */
+ if( old_stdout != -1 ) {
+ dup2(old_stdout, 1);
+ if( old_stderr != -1 )
+ dup2(old_stderr, 2);
+ }
+
+ if( status == -1 ) {
+ /* spawnvpe failed */
+ fprintf(stderr, "%s: Error executing '%s': %s",
+ Pname, argv[0], strerror(errno) );
+ if( ignore||Continue ) {
+ fprintf(stderr, " (Ignored)" );
+ }
+ fprintf(stderr, "\n");
+ }
+
+ if( Measure & M_RECIPE )
+ Do_profile_output( "e", M_RECIPE, target );
+
+ _finished_child(status);
+ if( last && !Doing_bang ) Update_time_stamp( target );
+
+ return( 0 );
+}
+
+
+PUBLIC void
+Clean_up_processes()
+{
+ _abort_flg = TRUE;
+ _finished_child(-1);
+}
+
+
+PUBLIC int
+Wait_for_child( abort_flg, pid )
+int abort_flg;
+int pid;
+{
+ /* There is currently no parallel processing for this OS, always
+ * return -1 indicating that there was nothing to wait for. */
+ return(-1);
+}
+
+
+static int _valid = -1;
+static CELLPTR _tg;
+static int _ignore;
+
+static void
+_add_child( target, ignore )
+CELLPTR target;
+int ignore;
+{
+ _tg = target;
+ _ignore = ignore;
+ _valid = 0;
+
+ Current_target = NIL(CELL);
+}
+
+
+static void
+_finished_child(status)
+int status;
+{
+ if( _valid == -1 ) return;
+ _valid = -1;
+ Handle_result( status, _ignore, _abort_flg, _tg );
+}
diff --git a/dmake/msdos/spawn.c b/dmake/msdos/spawn.c
new file mode 100644
index 000000000000..bc6bb4c64783
--- /dev/null
+++ b/dmake/msdos/spawn.c
@@ -0,0 +1,415 @@
+/* RCS $Id: spawn.c,v 1.3 2007-10-15 15:43:28 ihi Exp $
+--
+-- SYNOPSIS
+-- Spawnvpe code to emulate spawnvpe call common to DOS compilers.
+--
+-- DESCRIPTION
+-- This implementation is further integrated into dmake in that it
+-- determines the program to execute and if it's extension is either
+-- .bat or .ksh it executes it using the appropriate shell based on the
+-- setting of .MKSARGS. If .MKSARGS is set then in addition
+-- to the command tail getting built the arguments are also passed in the
+-- environment pursuant to the published MKS argument passing conventions.
+-- If the variable Swap_on_exec is set and the DOS OS supports it
+-- then the dmake executable image is swapped to secondary storage prior
+-- to running the child process. This is requested by setting the
+-- appropriate flag in the call to exec.
+--
+-- This and the exec.asm routine are derived from work that was supplied
+-- to me by Kent Williams (williams@umaxc.weeg.uiowa.edu) and by
+-- Len Reed, (..!gatech!holos0!lbr or holos0!lbr@gatech.edu., Holos
+-- Software, Inc., Tucker, Ga.). I sincerely acknowledge their help since
+-- their Turbo C, and MSC 6.0 code lead directly to this combined
+-- swapping exec that hopefully works with either compiler in all memory
+-- models.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined(_MSC_VER) && _MSC_VER >= 600
+ /* Ignore the MSC 6.0 library's "const"-riddled prototype
+ for spawnvpe.
+ */
+# define spawnvpe _ignore_msc_spawnvpe
+# include <process.h>
+# undef spawnvpe
+ int spawnvpe(int, char *, char **, char **);
+#else
+# include <process.h>
+#endif
+
+#include <dos.h>
+#include <errno.h>
+#include <string.h>
+#include <alloc.h>
+#include <fcntl.h>
+#include "extern.h"
+#include "dosdta.h"
+#include "exec.h"
+#include "sysintf.h"
+
+extern int Interrupted;
+
+/* variables and functions local to this file */
+static char *_findexec ANSI((char *, int *));
+static char **_getpath ANSI(());
+static char far *_dos_alloc ANSI((uint16));
+
+static uint16 _swap_mask;
+static int _mks_args;
+static char dot_com[] = ".COM",
+ dot_exe[] = ".EXE",
+ dot_bat[] = ".BAT",
+ dot_ksh[] = ".KSH";
+
+/* Kinds of executables */
+#define SCR 1
+#define COM 2
+#define EXE 4
+#define ALL (SCR|COM|EXE)
+
+/* How to make a long pointer */
+#define CF(x) (char far *)x
+
+/* Make sure we know how to get a segment out of a long pointer */
+#ifndef FP_SEG
+#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
+#endif
+
+iz81252 changed the parameters for Pack_argv() but this file did not get fixed!
+PUBLIC int
+spawnvpe(mode, program, av, ep)/*
+=================================
+ Spawn a process using an environment and a vector of arguments.
+ The code computes a new environment, puts the MKS arguments into
+ it if need be, and calls the appropriate routines to search the
+ path and to invoke the process. */
+int mode;
+char *program;
+char **av;
+char **ep;
+{
+ char pwd[PATH_MAX+1];
+ char **envp = ep; /* Cause we are going to mess with it. */
+ char **argv = av; /* Same with this one. */
+ char cmdtail[129];
+ char far *environment;
+ char *tail;
+ char *swptmp;
+ unsigned int envsize;
+ unsigned int cmdsize;
+ int cmdtailen;
+ int i;
+ int doswap;
+
+ /* First check to see if we can find the program to execute this way we
+ * don't alloc the environment and other such stuff prior to figuring out
+ * we don't know how to run the program. */
+find_program:
+ if((program = _findexec(program, &i)) == NIL(char)) {
+ errno = ENOENT;
+ return( -1 );
+ }
+
+ /* i is set to TRUE in _findexec if the exec is a shell
+ * script (either .BAT or .KSH file), returns FALSE for all others. */
+ if( i && !Packed_shell ) {
+ /* Restore the spaces into the command line that were erased by
+ * the previous call to Pack_argv. This enables us to repack the
+ * command as a shell command using Pack_argv again. */
+ for( i=0; argv[i] != NIL(char); i++ ) {
+ int x = strlen(argv[i]);
+ if( argv[i+1] != NIL(char) ) argv[i][x] = ' ';
+ }
+
+ argv = Pack_argv( FALSE, TRUE, *argv );
+ Packed_shell = TRUE; /* Previous call implies shell = TRUE. */
+
+ /* Go and find the program again, I hate goto's but it seems silly to
+ * use tail recursion here just for aesthetic purity. */
+ program = *argv;
+ goto find_program;
+ }
+
+ /* Compute size of *argv vector for passing as MKS style arguments */
+ cmdsize = strlen(*argv)+2;
+
+ /* So we have decided on a program to run, therefore pack the command tail
+ * and build the environment to pass to the exec code. This loop packs the
+ * DOS command tail, and computes the size of all arguments for the MKS
+ * argument passing convention. Note that we reserve one less byte in the
+ * command tail if we are not using MKS style argument passing.
+ *
+ * Make sure the command tail contains at leat a space. Some commands fail
+ * to work if the command tail is only a \r, STUPID DOS! */
+ cmdtailen = ((_mks_args = ((Glob_attr & A_MKSARGS) != 0)) != 0)?3:2;
+ tail = cmdtail+1;
+
+ if( argv[1] != NIL(char) )
+ for( i=1; argv[i] != NIL(char); i++ ) {
+ int arglen = strlen(argv[i]);
+
+ cmdsize += arglen+2; /* Compute all args size for MKS */
+
+ if( (cmdtailen += arglen+1) <= 128 ) {
+ register char *p = argv[i];
+ tail[-1] = ' '; /* put in the space */
+ while( *tail++ = *p++ ); /* put in the arg */
+ }
+ else if( !_mks_args ) {
+ errno = E2BIG; /* unless its MKS exit if arglist */
+ return(-1); /* is too long. */
+ }
+ }
+ else
+ *tail++ = ' ';
+
+ /* Finish the command tail set up, placing the length in the first byte,
+ * and the \r \n \0 at the end for DOS, MKS and us respectively. */
+ *cmdtail = tail-cmdtail-2;
+ tail[-1] = '\r';
+ if( _mks_args ) *tail++ = '\n';
+ *tail = '\0';
+
+ /* Compute size of environment, skipping any MKS arguments passed in our
+ * environment */
+ for(; *envp && **envp == '~'; envp++ );
+ for(i=0, envsize=_mks_args?cmdsize:1; envp[i] != NIL(char); i++ )
+ envsize += strlen(envp[i]) + 1;
+
+ /* Check the DOS version number here. If it is < 3.0 then we don't
+ * even want to think about executing the swapping code. Permanently
+ * set swap to 0. */
+ doswap = (_osmajor < 3) ? 0 : Swap_on_exec;
+
+ /* Set up temporary file for swapping */
+ swptmp = doswap?tempnam(NIL(char),"mk"):"";
+
+ /* Allocate an appropriate sized environment block and align it on a
+ * paragraph boundary. It will later get copied to an appropriately low
+ * place in the executable image so that when we swap out the environment
+ * is still present. Use
+ * _dos_alloc
+ * to allocate the environment segment. The segment is freed by the call
+ * to exec. */
+ environment = _dos_alloc( envsize = ((envsize+16)>>4) );
+ *environment = '\0';
+
+ /* First copy the arguments preceeded by ~ character if we are using
+ * MKS style argument passing */
+ if( _mks_args )
+ for(; *argv; argv++) {
+ register char *p = *argv;
+
+ *environment++ = '~';
+ while( *environment++ = *p++ ); /* Far dest, poss near ptr */
+ }
+
+ /* Now stick in the current evironment vectors. */
+ for(; *envp; envp++) {
+ register char *p = *envp;
+ while( *environment++ = *p++ ); /* Far dest, poss near ptr */
+ }
+
+ /* Clear the interrupted flag, and exec */
+ Interrupted = 0;
+
+ /* Preserve the current working directory accross a spawn call
+ * DOS is brain dead about this. This way we have some hope of cleaning
+ * up the swapping tempfiles after we return. */
+ strcpy(pwd,Get_current_dir());
+ i = exec(doswap,CF(program),CF(cmdtail),FP_SEG(environment),CF(swptmp));
+ Set_dir(pwd);
+
+ /* Now free the temporary file name */
+ if( doswap ) FREE(swptmp);
+
+ /* If swap was interrupted then quit properly from dmake. */
+ if( Interrupted ) Quit();
+
+ return(i);
+}
+
+
+PUBLIC void
+Hook_std_writes( file )
+char *file;
+{
+ if( file!= NIL(char) ) {
+ int mode = O_BINARY | O_WRONLY | O_CREAT | O_TRUNC;
+ int handle;
+
+ if (*file == '+') {
+ ++file; /* -F +file means append to file */
+ mode = O_BINARY | O_WRONLY | O_CREAT | O_APPEND;
+ }
+ handle = open(file, mode, S_IREAD | S_IWRITE);
+ if (handle < 0) {
+ Fatal( "Could not open -F file");
+ }
+ (void) lseek(handle, 0L, SEEK_END);
+ do_hook_std_writes(handle);
+ }
+ else
+ do_unhook_std_writes();
+}
+
+
+/*
+** _findexec finds executables on the path.
+** Note that it is pretty simple to add support for other executable types
+** shell scripts, etc.
+**
+** This follows the command.com behavior very closely.
+*/
+static char *
+_findexec( s, is_shell )/*
+==========================
+ Cloned closely from code provided by Kent Williams. Stripped his down to
+ a reduced search since dmake doesn't need to recompute the PATH vector
+ each time it does the search since it cannot alter the path vector once
+ it begins to make recipes. Also modified it to use findfirst and findnext
+ as provided for dirlib package that I got off the net. */
+char *s;
+int *is_shell;
+{
+ unsigned found_flags;
+ char **pathv = NIL(char *);
+ char *ext = NIL(char);
+ char *buf = NIL(char);
+ char *p[2];
+ char *dot_scr;
+ char *dot;
+
+ p[0] = ""; p[1] = NIL(char);
+ if( strchr("./\\", *s) || s[1] == ':' )
+ pathv = p;
+ else if( (pathv = _getpath()) == NIL(char *) )
+ return( NIL(char) );
+
+ /* Compute the extension we need if any. */
+ if( (dot = strrchr(s,'.')) != NIL(char) &&
+ dot > strrchr(s,'/') && dot > strrchr(s,'\\') )
+ ext = dot+1;
+
+ dot_scr = _mks_args ? dot_ksh : dot_bat;
+ *is_shell = FALSE;
+
+ for( found_flags = 0; *pathv && !found_flags; pathv++ ) {
+ DTA dta;
+
+ if( !ext ) {
+ char *name;
+ buf = Build_path( *pathv, name=DmStrJoin(s, ".???", -1, FALSE) );
+ FREE(name);
+ }
+ else
+ buf = Build_path( *pathv, s );
+
+ if( findfirst((char *)strupr(buf), &dta) != NIL(DTA) ) {
+ if( !ext ) {
+ char *dot;
+
+ /* search order is .com .exe (.ksh || .bat)
+ * there has to be a '.' */
+ do {
+ dot = strrchr(dta.name,'.');
+ if(0 == strcmp(dot,dot_com))
+ found_flags |= COM;
+ else if(0 == strcmp(dot,dot_exe))
+ found_flags |= EXE;
+ else if( 0 == strcmp(dot,dot_scr) )
+ found_flags |= SCR;
+ } while( found_flags != ALL && findnext(&dta) != NIL(DTA) );
+
+ if(found_flags & COM) ext = dot_com;
+ else if(found_flags & EXE) ext = dot_exe;
+ else if(found_flags & SCR) {
+ ext = dot_scr;
+ *is_shell = TRUE;
+ }
+
+ if( found_flags ) {
+ char *name;
+ buf = Build_path( *pathv, name=DmStrJoin(s,ext,-1,FALSE) );
+ FREE(name);
+ strupr(buf);
+ }
+ }
+ else
+ found_flags++;
+ }
+ }
+
+ return( found_flags ? buf : NIL(char) );
+}
+
+
+/*
+** getpath turns the DOS path into a char *vector, It is gotten and
+** transformed only once since dmake can't modify the value of PATH while
+** it is making targets.
+*/
+static char **
+_getpath()
+{
+ static char **dir = NIL(char *);
+ register char *p;
+
+ if( !dir ) {
+ register char *t;
+ int i;
+ char *semi = NIL(char);
+
+ if( (p = getenv("PATH")) == NIL(char) ) p = "";
+ for( i=1, t=p; *t; t++ ) if( *t == ';' ) i++;
+
+ TALLOC(dir, i+1, char *);
+ p = DmStrDup(p);
+
+ for( i=0; p; p = semi ? (semi+1):NIL(char),i++ ){
+ if( (semi = strchr(p,';')) != NIL(char) ) *semi = '\0';
+ dir[i] = p;
+ }
+ dir[i]=NIL(char);
+ }
+
+ return( dir );
+}
+
+
+static char far *
+_dos_alloc( size )/*
+====================
+ This routine allocates size paragraphs from DOS. It changes the memory
+ allocation strategy to allocate from the tail and then changes it back.
+ to using first fit. */
+uint16 size;
+{
+ union REGS r;
+
+ r.h.ah = 0x48;
+ r.x.bx = size;
+
+ intdos( &r, &r );
+ if( r.x.cflag ) No_ram();
+
+ return( (char far *) MK_FP(r.x.ax, 0) );
+}
diff --git a/dmake/msdos/startup.h b/dmake/msdos/startup.h
new file mode 100644
index 000000000000..660285c4b19b
--- /dev/null
+++ b/dmake/msdos/startup.h
@@ -0,0 +1,26 @@
+/* RCS $Id: startup.h,v 1.2 2006-04-20 12:06:36 hr Exp $
+--
+-- SYNOPSIS
+-- Dmake startup header file definition.
+--
+-- DESCRIPTION
+-- Where we define the default value of MAKESTARTUP.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"MAKESTARTUP := $(DMAKEROOT)\\startup.mk",
diff --git a/dmake/msdos/switchar.c b/dmake/msdos/switchar.c
new file mode 100644
index 000000000000..8879a9ad7c44
--- /dev/null
+++ b/dmake/msdos/switchar.c
@@ -0,0 +1,55 @@
+/* RCS $Id: switchar.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- switch char query.
+--
+-- DESCRIPTION
+-- Get the current value of the command line switch char. Only useful
+-- in a DOS environment, otherwise we #define it to be '-'.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#if defined(_MSC_VER)
+#include <stdlib.h>
+#endif
+#include <dos.h>
+#include <stdio.h>
+#include "stdmacs.h"
+
+getswitchar()/*
+===============
+ Try the environment first. If you don't find SWITCHAR there, then use
+ the DOS call. The call is undocumented, and doesn't work for DOS versions
+ 4.0 and up, so the check of the environment will fix that. */
+{
+#if defined(__MSDOS__) || defined(M_I86)
+ union REGS rg;
+ static char *_env_switchar = NIL(char);
+
+ if( _env_switchar != NIL(char) ||
+ (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
+ return(*_env_switchar);
+
+ rg.h.ah = 0x37; /* switch char request */
+ rg.h.al = 0; /* get (not set) */
+
+ intdos(&rg, &rg);
+ return (rg.h.dl);
+#endif /* M_I86 */
+
+ return ('-');
+}
diff --git a/dmake/msdos/sysintf.h b/dmake/msdos/sysintf.h
new file mode 100644
index 000000000000..9b7b45cdaab4
--- /dev/null
+++ b/dmake/msdos/sysintf.h
@@ -0,0 +1,52 @@
+/* RCS $Id: sysintf.h,v 1.2 2007-01-18 09:34:40 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+
+extern char * tempnam();
+extern char * getcwd();
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX 12
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX 64
diff --git a/dmake/msdos/tee.c b/dmake/msdos/tee.c
new file mode 100644
index 000000000000..f2c8b5de6543
--- /dev/null
+++ b/dmake/msdos/tee.c
@@ -0,0 +1,31 @@
+/* RCS $Id: tee.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $
+--
+-- SYNOPSIS
+-- Hook_std_writes() dummy call for non swapping MSDOS versions.
+--
+-- DESCRIPTION
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+PUBLIC void
+Hook_std_writes( file )
+char *file;
+{
+}
diff --git a/dmake/msdos/zortech/config.h b/dmake/msdos/zortech/config.h
new file mode 100644
index 000000000000..dabc8b014fe6
--- /dev/null
+++ b/dmake/msdos/zortech/config.h
@@ -0,0 +1,52 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:37:45 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in ZTC */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/* in sysintf.c: tzset is not supported by ZTC */
+#define tzset()
+
+/* ZTC uses it's own swapping spawn. */
+#define spawnvpe(a,b,c,d) spawnvp(a,b,c)
+
+#ifndef CONST
+# define CONST const
+#endif
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+extern unsigned _psp;
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+#include <io.h>
diff --git a/dmake/msdos/zortech/config.mk b/dmake/msdos/zortech/config.mk
new file mode 100644
index 000000000000..e947dc87620b
--- /dev/null
+++ b/dmake/msdos/zortech/config.mk
@@ -0,0 +1,73 @@
+# This is the ZTC DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+TMPDIR :=
+.EXPORT : TMPDIR
+
+# Definition of macros for library, and C startup code.
+# Swapping for DOS versions is enabled by default. ZTC will automatically
+# perform swapping to XMS, EMS or disk by including _swapl.obj at link time.
+# To be most effective, _swapl.obj should be the first file linked so we
+# assign it to CSTARTUP if needed.
+.IF $(SWAP) == y
+ CSTARTUP = _swapl.obj
+.END
+
+# The following sources are required for ZTC
+# The tempnam supplied with ZTC doesn't handle a NULL dir.
+OSR_SRC = tempnam.c environ.c
+.SETDIR=$(osrdir) : $(OSR_SRC)
+
+SRC += $(OSR_SRC)
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS
+# If you have a 286, you can use -2 or appropriate to get better code,
+# in that case uncomment the line below. (You can also simply set
+# it in the CL environment variable.)
+#CFLAGS += -2
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+# Redefine this, it isn't needed!
+LDTAIL = ;
+
+# Debugging libraries
+DB_LDFLAGS += -g
+DB_LDLIBS +=
+
+# NO Debug ZTC flags:
+#
+
+CFLAGS += -I$(osrdir) $(C_$(MODEL))
+CFLAGS += -DM_I86=1 -DMSDOS
+CFLAGS += -b # use large compiler
+#CFLAGS += -w # no warnings
+CFLAGS += -mi # integer only
+CFLAGS += -p # no auto-prototyping
+NDB_CFLAGS += -o
+DB_CFLAGS += -g
+
+# Redefine rule for making our objects, we don't need mv
+%$O : %.c ;% $(CC) -c $(CFLAGS) -o$@ $<
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+C_s =
+C_m = -mM
+C_c = -mC
+C_l = -mL
+
+S_s = -Dmsmall
+S_m = -Dmmedium
+S_c = -Dmcompact
+S_l = -Dmlarge
diff --git a/dmake/msdos/zortech/environ.c b/dmake/msdos/zortech/environ.c
new file mode 100644
index 000000000000..c76d9a4831a6
--- /dev/null
+++ b/dmake/msdos/zortech/environ.c
@@ -0,0 +1,59 @@
+/* RCS $Id: environ.c,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $
+--
+-- SYNOPSIS
+-- environment routines.
+--
+-- DESCRIPTION
+-- Someone thought that Zortech needs this.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "alloc.h"
+
+/* ZTC++ doesn't have environ, so we have to create one. */
+
+extern char *_envptr;
+char **environ = { NULL };
+
+void
+make_env()
+{
+ int i;
+ char *cp;
+
+ for (i = 0, cp = _envptr; *cp; i++, cp += strlen(cp)+1)
+ ;
+
+ TALLOC(environ, i+1, char*);
+
+ for (i = 0, cp = _envptr; *cp; i++, cp += strlen(cp)+1)
+ environ[i] = cp;
+
+ return;
+}
+
+void
+free_env()
+{
+ FREE(environ);
+
+ return;
+}
diff --git a/dmake/msdos/zortech/lib.rsp b/dmake/msdos/zortech/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/msdos/zortech/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/msdos/zortech/libswp.rsp b/dmake/msdos/zortech/libswp.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/msdos/zortech/libswp.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/msdos/zortech/mkswp.bat b/dmake/msdos/zortech/mkswp.bat
new file mode 100755
index 000000000000..60c12d37217e
--- /dev/null
+++ b/dmake/msdos/zortech/mkswp.bat
@@ -0,0 +1,36 @@
+md objects
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\infer.obj infer.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\make.obj make.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\stat.obj stat.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\expand.obj expand.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmstring.obj dmstring.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\hash.obj hash.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dag.obj dag.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmake.obj dmake.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\path.obj path.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\imacs.obj imacs.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\sysintf.obj sysintf.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\parse.obj parse.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\getinp.obj getinp.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\quit.obj quit.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\state.obj state.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmdump.obj dmdump.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\macparse.obj macparse.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rulparse.obj rulparse.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\percent.obj percent.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\function.obj function.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\ruletab.obj msdos\ruletab.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dirbrk.obj msdos\dirbrk.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\runargv.obj msdos\runargv.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\arlib.obj msdos\arlib.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dchdir.obj msdos\dchdir.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\switchar.obj msdos\switchar.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rmprq.obj msdos\rmprq.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tee.obj msdos\tee.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\find.obj msdos\find.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dirlib.obj msdos\dirlib.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dstrlwr.obj msdos\dstrlwr.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dcache.obj unix\dcache.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tempnam.obj msdos\zortech\tempnam.c
+ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\environ.obj msdos\zortech\environ.c
+blink @msdos\zortech\objswp.rsp,dmake.exe,NUL.MAP;
diff --git a/dmake/msdos/zortech/obj.rsp b/dmake/msdos/zortech/obj.rsp
new file mode 100644
index 000000000000..c97a42f9f0aa
--- /dev/null
+++ b/dmake/msdos/zortech/obj.rsp
@@ -0,0 +1,34 @@
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\tee.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\environ.obj
diff --git a/dmake/msdos/zortech/objswp.rsp b/dmake/msdos/zortech/objswp.rsp
new file mode 100644
index 000000000000..60a33c4eb523
--- /dev/null
+++ b/dmake/msdos/zortech/objswp.rsp
@@ -0,0 +1,35 @@
+_swapl.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dirbrk.obj+
+objects\runargv.obj+
+objects\arlib.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\rmprq.obj+
+objects\tee.obj+
+objects\find.obj+
+objects\dirlib.obj+
+objects\dstrlwr.obj+
+objects\dcache.obj+
+objects\tempnam.obj+
+objects\environ.obj
diff --git a/dmake/msdos/zortech/public.h b/dmake/msdos/zortech/public.h
new file mode 100644
index 000000000000..6265caa0ce3b
--- /dev/null
+++ b/dmake/msdos/zortech/public.h
@@ -0,0 +1,169 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:45:09 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int dchdir ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+void Hook_std_writes ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/msdos/zortech/startup.mk b/dmake/msdos/zortech/startup.mk
new file mode 100644
index 000000000000..2697f738bb5b
--- /dev/null
+++ b/dmake/msdos/zortech/startup.mk
@@ -0,0 +1,153 @@
+# MSDOS DMAKE startup file. Customize to suit your needs.
+# Assumes MKS toolkit for the tool commands, and Zortech C. Change as req'd.
+# See the documentation for a description of internally defined macros.
+#
+# Disable warnings for macros redefined here that were given
+# on the command line.
+__.SILENT !:= $(.SILENT)
+.SILENT !:= yes
+
+# Configuration parameters for DMAKE startup.mk file
+# Set these to NON-NULL if you wish to turn the parameter on.
+_HAVE_RCS := yes # yes => RCS is installed.
+_HAVE_SCCS := # yes => SCCS is installed.
+
+# Applicable suffix definitions
+A := .lib # Libraries
+E := .exe # Executables
+F := .for # Fortran
+O := .obj # Objects
+P := .pas # Pascal
+S := .asm # Assembler sources
+V := # RCS suffix
+
+# See if these are defined
+.IMPORT .IGNORE : TMPDIR SHELL COMSPEC ROOTDIR
+TMPDIR *:= $(ROOTDIR)/tmp
+
+# Recipe execution configurations
+# First set SHELL, If it is not defined, use COMSPEC, otherwise
+# it is assumed to be MKS Korn SHELL.
+.IF $(SHELL) == $(NULL)
+.IF $(COMSPEC) == $(NULL)
+ SHELL := $(ROOTDIR)/bin/sh$E
+.ELSE
+ SHELL := $(COMSPEC)
+.END
+.END
+GROUPSHELL := $(SHELL)
+
+# Now set remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn Shell.
+.IF $(SHELL)==$(COMSPEC)
+ SHELLFLAGS := $(SWITCHAR)c
+ GROUPFLAGS := $(SHELLFLAGS)
+ SHELLMETAS := *"?<>
+ GROUPSUFFIX := .bat
+ DIRSEPSTR := \\\
+ DIVFILE = $(TMPFILE:s,/,\,)
+.ELSE
+ SHELLFLAGS := -c
+ GROUPFLAGS :=
+ SHELLMETAS := *"?<>|()&][$$\#`'
+ GROUPSUFFIX := .ksh
+ .MKSARGS := yes
+ DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}},)
+ DIVSEP_shell_yes := \\\
+ DIVSEP_shell_no := \\
+.END
+
+# Standard C-language command names and flags
+ CC := ztc # C-compiler and flags
+ CFLAGS +=
+
+ AS := masm # Assembler and flags
+ ASFLAGS +=
+
+ LD = blink # Loader and flags
+ LDFLAGS +=
+ LDLIBS =
+
+# Definition of $(MAKE) macro for recursive makes.
+ MAKE = $(MAKECMD) -S $(MFLAGS)
+
+# Language and Parser generation Tools and their flags
+ YACC := yacc # standard yacc
+ YFLAGS +=
+ YTAB := ytab # yacc output files name stem.
+
+ LEX := lex # standard lex
+ LFLAGS +=
+ LEXYY := lex_yy # lex output file
+
+# Other Compilers, Tools and their flags
+ PC := any_pc # pascal compiler
+ RC := anyf77 # ratfor compiler
+ FC := anyf77 # fortran compiler
+
+ CO := co # check out for RCS
+ COFLAGS += -q
+
+ AR := ar # archiver
+ ARFLAGS+= ruv
+
+ RM := rm # remove a file command
+ RMFLAGS +=
+
+# Implicit generation rules for making inferences.
+# We don't provide .yr or .ye rules here. They're obsolete.
+# Rules for making *$O
+ %$O : %.c ; $(CC) $(CFLAGS) -c $<
+ %$O : %.cpp ; $(CC) $(CFLAGS) -c $<
+ %$O : %$P ; $(PC) $(PFLAGS) -c $<
+ %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\);
+ %$O : %.cl ; class -c $<
+ %$O :| %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
+
+# Executables
+ %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
+
+# lex and yacc rules
+ %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
+ %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
+
+# RCS support
+.IF $(_HAVE_RCS)
+ % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@
+ .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V
+.END
+
+# SCCS support
+.IF $(_HAVE_SCCS)
+ % : s.% ; get $<
+ .NOINFER : s.%
+.END
+
+# Recipe to make archive files.
+%$A .SWAP .GROUP :
+ $(AR) $(ARFLAGS) $@ $?
+ $(RM) $(RMFLAGS) $?
+
+# DMAKE uses this recipe to remove intermediate targets
+.REMOVE :; $(RM) -f $<
+
+# AUGMAKE extensions for SYSV compatibility
+"@B" = $(@:b)
+"@D" = $(@:d)
+"@F" = $(@:f)
+"*B" = $(*:b)
+"*D" = $(*:d)
+"*F" = $(*:f)
+"<B" = $(<:b)
+"<D" = $(<:d)
+"<F" = $(<:f)
+"?B" = $(?:b)
+"?F" = $(?:f)
+"?D" = $(?:d)
+
+# Turn warnings back to previous setting.
+.SILENT !:= $(__.SILENT)
+
+# Local init file if any, gets parsed before user makefile
+.INCLUDE .IGNORE: "_startup.mk"
diff --git a/dmake/msdos/zortech/tempnam.c b/dmake/msdos/zortech/tempnam.c
new file mode 100644
index 000000000000..91ce19c490ad
--- /dev/null
+++ b/dmake/msdos/zortech/tempnam.c
@@ -0,0 +1,106 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $
+--
+-- SYNOPSIS
+-- temname
+--
+-- DESCRIPTION
+-- temp file name generation code.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* Zortech C stdio.h doesn't define P_tmpdir, so let's do it here */
+/* Under DOS leave the default tmpdir pointing here! */
+static char *P_tmpdir = "";
+
+char *
+tempnam(dir, prefix)
+const char *dir; /* use this directory please (if non-NULL) */
+const char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/os2/config.mk b/dmake/os2/config.mk
new file mode 100644
index 000000000000..5e2b7689bd82
--- /dev/null
+++ b/dmake/os2/config.mk
@@ -0,0 +1,54 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+OSRELEASE *= ibm
+- := $(SWITCHAR)
+
+# Memory model to compile for
+# set to s - small, m - medium, c - compact, l - large
+# Use only large model now.
+MODEL = l
+
+STARTUPFILE = $(OS)/startup.mk
+
+CPPFLAGS = $(CFLAGS)
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDHEAD) @$(LDTMPOBJ),$(TARGET),NUL.MAP,,$(LDTAIL)
+LDTAIL = $(_libs)$(LDFLAGS:s/ //)
+_libs = $(!null,$(LDLIBS) ,@$(LDTMPLIB))
+LDTMPOBJ = $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"+\n")\n)
+LDTMPLIB = $(mktmp,,$(DIVFILE) $(LDLIBS)\n)
+
+# Debug flags
+DB_CFLAGS = -DDBUG
+DB_LDFLAGS =
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS =
+NDB_LDFLAGS =
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += $-I$(OS)
+
+# OS2 does not have a swap version. The operating system will
+# handle all swapping.
+# To save copying unchanged files in from elsewhere, I shall use them in situ.
+OS_SRC += ruletab.c dchdir.c switchar.c
+DOS_SRC += dirbrk.c arlib.c dstrlwr.c runargv.c rmprq.c
+
+SRC += $(OS_SRC) $(DOS_SRC)
+.SETDIR=$(OS) : $(ASRC) $(OS_SRC)
+.SETDIR=msdos : $(DOS_SRC)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/os2/dchdir.c b/dmake/os2/dchdir.c
new file mode 100644
index 000000000000..6244c630d2a6
--- /dev/null
+++ b/dmake/os2/dchdir.c
@@ -0,0 +1,41 @@
+/* RCS $Id: dchdir.c,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- Change directory.
+--
+-- DESCRIPTION
+-- Under DOS change the current drive as well as the current directory.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <os2.h>
+#include "extern.h"
+
+PUBLIC int
+_dchdir(path)
+char *path;
+{
+ int res;
+
+ res = _chdir(path);
+
+ if (res == 0 && path[1] == ':')
+ DosSelectDisk((*path & ~0x20) - '@');
+
+ return (res);
+}
diff --git a/dmake/os2/dirent.h b/dmake/os2/dirent.h
new file mode 100644
index 000000000000..eafaccbcc38a
--- /dev/null
+++ b/dmake/os2/dirent.h
@@ -0,0 +1,36 @@
+/* DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 */
+
+#ifndef _DIRLIB_h_
+#define _DIRLIB_h_
+
+#define INCL_DOSFILEMGR
+#include <os2.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "stdmacs.h"
+
+#define MAXNAMLEN _MAX_FNAME
+
+struct dirent {
+ long d_ino;
+ unsigned short d_reclen;
+ unsigned short d_namlen;
+ char d_name[MAXNAMLEN+1];
+};
+
+typedef struct {
+ HDIR dd_handle; /* Handle for FindFirst/Next */
+ FILEFINDBUF3 dd_dta; /* Disk transfer area for this dir. */
+ ULONG dd_count; /* Count for FindFirst/Next */
+ APIRET dd_stat; /* Status return from last lookup */
+ char dd_name[1]; /* Full name of file -- struct is extended */
+} DIR;
+
+extern DIR *opendir ANSI((char *));
+extern struct dirent *readdir ANSI((DIR *));
+extern long telldir ANSI((DIR *));
+extern void seekdir ANSI((DIR *, long));
+extern void closedir ANSI((DIR *));
+
+#define rewinddir(dirp) seekdir(dirp,0L)
+#endif
diff --git a/dmake/os2/ibm/config.h b/dmake/os2/ibm/config.h
new file mode 100644
index 000000000000..cd8199445066
--- /dev/null
+++ b/dmake/os2/ibm/config.h
@@ -0,0 +1,78 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:38:08 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#if defined (_MSC_VER)
+# if _MSC_VER < 500
+ Force a compile-time blowup.
+ Do not define define _MSC_VER for MSC compilers ealier than 5.0.
+# endif
+#endif
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+#define coreleft() 0L
+
+/* MSC Version 4.0 doesn't understand SIGTERM, later versions do. */
+#ifndef SIGTERM
+# define SIGTERM SIGINT
+#endif
+
+/* This should already be defined under C6.0, also for OS/2 we want buffering
+ * to minimise the mess during parallel makes.
+ */
+#ifndef _IOLBF
+# define _IOLBF _IOFBF
+#endif
+
+/* in alloc.h: size_t is redefined
+ * defined in stdio.h which is included by alloc.h
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# define _TYPES_
+#endif
+
+/* Don't need this one either */
+#define CONST
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in MSC */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* C-lib redefinitions... */
+#define dup _dup
+#define close _close
+#define utime _utime
+#define tzset _tzset
+#define access _access
+#define getpid _getpid
+#define getcwd _getcwd
diff --git a/dmake/os2/ibm/config.mk b/dmake/os2/ibm/config.mk
new file mode 100644
index 000000000000..716addd82abf
--- /dev/null
+++ b/dmake/os2/ibm/config.mk
@@ -0,0 +1,54 @@
+# This is the MSC 4.0 and higher DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+TMPDIR :=
+.EXPORT : TMPDIR
+
+# Definition of macros for library, and C startup code.
+
+# The following sources are required for MSC
+OSR_SRC = tempnam.c
+.SETDIR=$(osrdir) : $(OSR_SRC)
+
+SRC += $(OSR_SRC)
+.SOURCE.h : $(osrdir)
+
+SET_STACK = $-stack:32768
+NDB_LDFLAGS +=
+
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+# Microsoft C doesn't need tail but needs head
+LDTAIL = ,;
+LDHEAD = $(LDFLAGS)
+
+# Debugging libraries
+DB_LDFLAGS += $-co $-li $-map $(SET_STACK)
+DB_LDLIBS +=
+
+# NO Debug MSC flags:
+# Set the environment variable MSC_VER to be one of 5.1, 6.0, 8.0 (for VC++4.0)
+# to get these by default when you make dmake using 'dmake'.
+#
+# Setting MSC_VER to one of the above sets the variable _MSC_VER appropriately
+# and sets the flags appropriately.
+
+CFLAGS += $-I$(osrdir)
+DB_CFLAGS += $-Ti+
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+S_s = -Dmsmall
+S_m = -Dmmedium
+S_c = -Dmcompact
+S_l = -Dmlarge
diff --git a/dmake/os2/ibm/icc/config.mk b/dmake/os2/ibm/icc/config.mk
new file mode 100644
index 000000000000..2042f5636262
--- /dev/null
+++ b/dmake/os2/ibm/icc/config.mk
@@ -0,0 +1,11 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+.IMPORT .IGNORE : MSC_VER
+MSC_VER *= 6.0
+
+CFLAGS += $-I$(osedir) $-Sp1 $-Q $-Fi-
+
+NDB_CFLAGS += $-O
+NDB_LDFLAGS += $-de $-pmtype:vio $-align:16 $-nologo $-m $-stack:32768
+NDB_LDLIBS +=
diff --git a/dmake/os2/ibm/icc/lib.rsp b/dmake/os2/ibm/icc/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/os2/ibm/icc/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/os2/ibm/icc/mk.cmd b/dmake/os2/ibm/icc/mk.cmd
new file mode 100755
index 000000000000..563a88aad43c
--- /dev/null
+++ b/dmake/os2/ibm/icc/mk.cmd
@@ -0,0 +1,96 @@
+md objects
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O infer.c
+copy infer.obj objects
+del infer.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O make.c
+copy make.obj objects
+del make.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O stat.c
+copy stat.obj objects
+del stat.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O expand.c
+copy expand.obj objects
+del expand.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O hash.c
+copy hash.obj objects
+del hash.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O dag.c
+copy dag.obj objects
+del dag.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O dmake.c
+copy dmake.obj objects
+del dmake.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O path.c
+copy path.obj objects
+del path.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O imacs.c
+copy imacs.obj objects
+del imacs.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O parse.c
+copy parse.obj objects
+del parse.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O getinp.c
+copy getinp.obj objects
+del getinp.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O quit.c
+copy quit.obj objects
+del quit.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O state.c
+copy state.obj objects
+del state.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O macparse.c
+copy macparse.obj objects
+del macparse.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O percent.c
+copy percent.obj objects
+del percent.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O function.c
+copy function.obj objects
+del function.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O os2\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O os2\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O os2\switchar.c
+copy switchar.obj objects
+del switchar.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O os2\dirlib.c
+copy dirlib.obj objects
+del dirlib.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O os2\runargv.c
+copy runargv.obj objects
+del runargv.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O unix\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc /Sp1 /Q /Fi- /O os2\ibm\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+link386 /de /pmtype:vio /align:16 /nologo /m /stack:32768 @os2\ibm\icc\obj.rsp,dmake.exe,NUL.MAP,,,;
+copy os2\ibm\icc\template.mk startup\config.mk
diff --git a/dmake/os2/ibm/icc/obj.rsp b/dmake/os2/ibm/icc/obj.rsp
new file mode 100644
index 000000000000..594535036c87
--- /dev/null
+++ b/dmake/os2/ibm/icc/obj.rsp
@@ -0,0 +1,31 @@
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\dirlib.obj+
+objects\runargv.obj+
+objects\dirbrk.obj+
+objects\arlib.obj+
+objects\dstrlwr.obj+
+objects\rmprq.obj+
+objects\dcache.obj+
+objects\tempnam.obj
diff --git a/dmake/os2/ibm/icc/public.h b/dmake/os2/ibm/icc/public.h
new file mode 100644
index 000000000000..b3bd37964ec3
--- /dev/null
+++ b/dmake/os2/ibm/icc/public.h
@@ -0,0 +1,169 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:45:45 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int _dchdir ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void SetSessionTitle ANSI((char *));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+int If_root_path ANSI((char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+void dstrlwr ANSI((char *, char *));
+void Remove_prq ANSI((CELLPTR));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/os2/ibm/icc/template.mk b/dmake/os2/ibm/icc/template.mk
new file mode 100644
index 000000000000..c9c5adbf21ae
--- /dev/null
+++ b/dmake/os2/ibm/icc/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= os2
+ OSRELEASE *:= ibm
+ OSENVIRONMENT *:= icc
diff --git a/dmake/os2/ibm/icc3/config.mk b/dmake/os2/ibm/icc3/config.mk
new file mode 100644
index 000000000000..2042f5636262
--- /dev/null
+++ b/dmake/os2/ibm/icc3/config.mk
@@ -0,0 +1,11 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+.IMPORT .IGNORE : MSC_VER
+MSC_VER *= 6.0
+
+CFLAGS += $-I$(osedir) $-Sp1 $-Q $-Fi-
+
+NDB_CFLAGS += $-O
+NDB_LDFLAGS += $-de $-pmtype:vio $-align:16 $-nologo $-m $-stack:32768
+NDB_LDLIBS +=
diff --git a/dmake/os2/ibm/icc3/lib.rsp b/dmake/os2/ibm/icc3/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/os2/ibm/icc3/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/os2/ibm/icc3/mk.cmd b/dmake/os2/ibm/icc3/mk.cmd
new file mode 100755
index 000000000000..f45e63e64318
--- /dev/null
+++ b/dmake/os2/ibm/icc3/mk.cmd
@@ -0,0 +1,192 @@
+md objects
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O infer.c
+
+copy infer.obj objects
+
+del infer.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O make.c
+
+copy make.obj objects
+
+del make.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O stat.c
+
+copy stat.obj objects
+
+del stat.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O expand.c
+
+copy expand.obj objects
+
+del expand.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O dmstring.c
+
+copy dmstring.obj objects
+
+del dmstring.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O hash.c
+
+copy hash.obj objects
+
+del hash.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O dag.c
+
+copy dag.obj objects
+
+del dag.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O dmake.c
+
+copy dmake.obj objects
+
+del dmake.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O path.c
+
+copy path.obj objects
+
+del path.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O imacs.c
+
+copy imacs.obj objects
+
+del imacs.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O sysintf.c
+
+copy sysintf.obj objects
+
+del sysintf.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O parse.c
+
+copy parse.obj objects
+
+del parse.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O getinp.c
+
+copy getinp.obj objects
+
+del getinp.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O quit.c
+
+copy quit.obj objects
+
+del quit.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O state.c
+
+copy state.obj objects
+
+del state.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O dmdump.c
+
+copy dmdump.obj objects
+
+del dmdump.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O macparse.c
+
+copy macparse.obj objects
+
+del macparse.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O rulparse.c
+
+copy rulparse.obj objects
+
+del rulparse.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O percent.c
+
+copy percent.obj objects
+
+del percent.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O function.c
+
+copy function.obj objects
+
+del function.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O os2\ruletab.c
+
+copy ruletab.obj objects
+
+del ruletab.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O os2\dchdir.c
+
+copy dchdir.obj objects
+
+del dchdir.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O os2\switchar.c
+
+copy switchar.obj objects
+
+del switchar.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O msdos\dirlib.c
+
+copy dirlib.obj objects
+
+del dirlib.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O msdos\runargv.c
+
+copy runargv.obj objects
+
+del runargv.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O msdos\dirbrk.c
+
+copy dirbrk.obj objects
+
+del dirbrk.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O msdos\arlib.c
+
+copy arlib.obj objects
+
+del arlib.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O msdos\dstrlwr.c
+
+copy dstrlwr.obj objects
+
+del dstrlwr.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O unix\rmprq.c
+
+copy rmprq.obj objects
+
+del rmprq.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O unix\dcache.c
+
+copy dcache.obj objects
+
+del dcache.obj
+
+icc /c /I. /Ios2 /Ios2\ibm /Ios2\ibm\icc3 /Sp1 /Q /Fi- /O tempnam.c
+
+copy tempnam.obj objects
+
+del tempnam.obj
+
+ilink /NOFREE /de /pmtype:vio /align:16 /nologo /m /stack:32768 @os2\ibm\icc3\obj.rsp,,,,,
+
+copy os2\ibm\icc3\template.mk startup\config.mk
+
diff --git a/dmake/os2/ibm/icc3/obj.rsp b/dmake/os2/ibm/icc3/obj.rsp
new file mode 100644
index 000000000000..6309577681b9
--- /dev/null
+++ b/dmake/os2/ibm/icc3/obj.rsp
@@ -0,0 +1,30 @@
+objects\dmake.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\ruletab.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\runargv.obj+
+objects\dirbrk.obj+
+objects\arlib.obj+
+objects\dstrlwr.obj+
+objects\rmprq.obj+
+objects\tempnam.obj
+
diff --git a/dmake/os2/ibm/icc3/public.h b/dmake/os2/ibm/icc3/public.h
new file mode 100644
index 000000000000..012d30129fd0
--- /dev/null
+++ b/dmake/os2/ibm/icc3/public.h
@@ -0,0 +1,169 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:45:57 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int _dchdir ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void SetSessionTitle ANSI((char *));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+int If_root_path ANSI((char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+void dstrlwr ANSI((char *, char *));
+void Remove_prq ANSI((CELLPTR));
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/os2/ibm/icc3/template.mk b/dmake/os2/ibm/icc3/template.mk
new file mode 100644
index 000000000000..c9c5adbf21ae
--- /dev/null
+++ b/dmake/os2/ibm/icc3/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= os2
+ OSRELEASE *:= ibm
+ OSENVIRONMENT *:= icc
diff --git a/dmake/os2/ibm/tempnam.c b/dmake/os2/ibm/tempnam.c
new file mode 100644
index 000000000000..5bf5c21b3544
--- /dev/null
+++ b/dmake/os2/ibm/tempnam.c
@@ -0,0 +1,111 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "config.h"
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern int access();
+int d_access();
+
+/* MSC stdio.h defines P_tmpdir, so let's undo it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifdef P_tmpdir
+#undef P_tmpdir
+#endif
+static char *P_tmpdir = "";
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL )
+ tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL )
+ tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", getpid() );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return strlwr(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ p = name+strlen(name)-1;
+ if(*p == ':' ) strcat( p++, "\\" );
+ r = access( name, flag );
+ if(*p != '/' && *p != '\\') strcat( p, "\\" );
+
+ return( r );
+}
diff --git a/dmake/os2/ruletab.c b/dmake/os2/ruletab.c
new file mode 100644
index 000000000000..dfe6f72f63da
--- /dev/null
+++ b/dmake/os2/ruletab.c
@@ -0,0 +1,47 @@
+/* RCS $Id: ruletab.c,v 1.4 2007-10-15 15:45:20 ihi Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+/*
+ * For OS/2 these are close to the Unix definitions in terms of limits.
+ * We dont need the two different cases of Makefile, so only keep the
+ * pretty one.
+ */
+static char *_rules[] = {
+ "MAXLINELENGTH := 8190",
+ "MAXPROCESSLIMIT := 16",
+#include "dmakeroot.h"
+ ".IMPORT .IGNORE: DMAKEROOT"
+ ".MAKEFILES : makefile.mk Makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ 0 };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
+
diff --git a/dmake/os2/startup.h b/dmake/os2/startup.h
new file mode 100644
index 000000000000..bf6c94ff939f
--- /dev/null
+++ b/dmake/os2/startup.h
@@ -0,0 +1,27 @@
+/* RCS $Id: startup.h,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- Definition of MAKESTARTUP
+--
+-- DESCRIPTION
+-- Default MAKESTARTUP value defining where dmake locates the
+-- startup file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"MAKESTARTUP := $(DMAKEROOT)\\startup.mk",
diff --git a/dmake/os2/switchar.c b/dmake/os2/switchar.c
new file mode 100644
index 000000000000..458030993d57
--- /dev/null
+++ b/dmake/os2/switchar.c
@@ -0,0 +1,43 @@
+/* RCS $Id: switchar.c,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- switch char query.
+--
+-- DESCRIPTION
+-- Get the current value of the command line switch char. Only useful
+-- in a DOS environment, otherwise we #define it to be '-'.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+#include "stdmacs.h"
+
+getswitchar()/*
+===============
+ Try the environment first. If you don't find SWITCHAR there, then use
+ the DOS call. The call is undocumented, and doesn't work for DOS versions
+ 4.0 and up, so the check of the environment will fix that. */
+{
+ static char *_env_switchar = NIL(char);
+
+ if( _env_switchar != NIL(char) ||
+ (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
+ return(*_env_switchar);
+
+ return ('/');
+}
diff --git a/dmake/os2/sysintf.h b/dmake/os2/sysintf.h
new file mode 100644
index 000000000000..0a624b70e8c5
--- /dev/null
+++ b/dmake/os2/sysintf.h
@@ -0,0 +1,62 @@
+/* RCS $Id: sysintf.h,v 1.4 2007-10-15 15:45:33 ihi Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define Hook_std_writes(A)
+#define GETPID getpid()
+/* Disabled for CWS os2port01
+ *#define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
+ */
+extern char * tempnam();
+extern char * getcwd();
+
+/* for directory cache */
+/* #define CacheStat(A,B) really_dostat(A,&buf)*/
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+/* Disabled for CWS os2port01
+ *#define chdir(p) _dchdir(p)
+ */
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX 12
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX 255
diff --git a/dmake/parse.c b/dmake/parse.c
new file mode 100644
index 000000000000..2344192b8541
--- /dev/null
+++ b/dmake/parse.c
@@ -0,0 +1,176 @@
+/* $RCSfile: parse.c,v $
+-- $Revision: 1.8 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:40:45 $
+--
+-- SYNOPSIS
+-- Parse the input, and perform semantic analysis
+--
+-- DESCRIPTION
+-- This file contains the routines that parse the input makefile and
+-- call the appropriate routines to perform the semantic analysis and
+-- build the internal dag.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+
+PUBLIC void
+Parse( fil )/*
+============== Parse the makefile input */
+FILE *fil;
+{
+ int rule = FALSE; /* have seen a recipe line */
+ char *p; /* termporary pointer into Buffer */
+ char *pTmpBuf;
+
+ DB_ENTER( "Parse" );
+
+ State = NORMAL_SCAN;
+ Group = FALSE; /* true if scanning a group rcpe */
+ while( TRUE ) {
+ if( Get_line( Buffer, fil ) ) {
+ if( Group ) Fatal( "Incomplete rule recipe group detected" );
+
+ /* If we are still in RULE_SCAN mode there might be unbound recipes. */
+ if( State == RULE_SCAN )
+ Bind_rules_to_targets( F_DEFAULT );
+
+ if( fil != NIL( FILE ) ) /* end of parsable input */
+ Closefile();
+
+ DB_VOID_RETURN;
+ }
+ else {
+
+#ifdef _MPW
+ if ( Buffer[0] == 10 )
+ pTmpBuf = Buffer+1;
+ else
+#endif
+ pTmpBuf = Buffer;
+
+#ifdef _MPW
+ p = pTmpBuf;
+ while ( *p )
+ {
+ if ( *p == 10 )
+ *p = '\t';
+ p++;
+ }
+#endif
+
+ switch( State ) {
+ case RULE_SCAN:
+
+ /* Check for the `[' that starts off a group recipe definition.
+ * It must appear as the first non-white space
+ * character in the line. */
+
+ p = DmStrSpn( Buffer, " \t\r\n" );
+ if( Set_group_attributes( p ) ) {
+ if( Group )
+ Fatal( "New group recipe begin found within group recipe." );
+ else if( rule )
+ Fatal( "Cannot mix single and group recipe lines." );
+ else
+ Group = TRUE;
+
+ rule = TRUE;
+
+ break; /* ignore the group start */
+ }
+
+ if( Group ) {
+ if( *p != ']' ) {
+ Add_recipe_to_list( pTmpBuf, TRUE, TRUE );
+ rule = TRUE;
+ }
+ else
+ State = NORMAL_SCAN;
+ }
+ else {
+ if( *pTmpBuf == '\t'
+ || (Notabs && *pTmpBuf == ' ') ) {
+ Add_recipe_to_list( pTmpBuf, FALSE, FALSE );
+ rule = TRUE;
+ }
+ else if( *p == ']' )
+ Fatal( "Found unmatched ']'" );
+ else if( *pTmpBuf ) /* Something that was no recipe. */
+ State = NORMAL_SCAN;
+ /* The only thing that was not handled was an empty line. */
+ }
+
+ if( State == RULE_SCAN ) break; /* ie. keep going */
+
+ Bind_rules_to_targets( (Group) ? F_GROUP: F_DEFAULT );
+
+ rule = FALSE;
+ if( Group ) {
+ Group = FALSE;
+ break;
+ }
+ /*FALLTRHOUGH*/
+
+ /* In this case we broke out of the rule scan because we do not
+ * have a recipe line that begins with a <TAB>, so lets
+ * try to scan the thing as a macro or rule definition. */
+
+
+ case NORMAL_SCAN:
+ if( !*pTmpBuf ) continue; /* we have null input line */
+
+ /* STUPID AUGMAKE uses "include" at the start of a line as
+ * a signal to include a new file, so let's look for it.
+ * if we see it replace it by .INCLUDE: and stick this back
+ * into the buffer. */
+ if( !strncmp( "include", pTmpBuf, 7 ) &&
+ (pTmpBuf[7] == ' ' || pTmpBuf[7] == '\t') )
+ {
+ char *tmp;
+
+ tmp = DmStrJoin( ".INCLUDE:", pTmpBuf+7, -1, FALSE );
+ strcpy( pTmpBuf, tmp );
+ FREE( tmp );
+ }
+
+ /* look for a macro definition, they all contain an = sign
+ * if we fail to recognize it as a legal macro op then try to
+ * parse the same line as a rule definition, it's one or the
+ * other */
+
+ if( Parse_macro(pTmpBuf, M_DEFAULT) ) break;/* it's a macro def*/
+ if( Parse_rule_def( &State ) ) break;/* it's a rule def */
+
+ /* if it is an empty or blank line then ignore it */
+ if( !*Buffer || *DmStrSpn( Buffer, " \t\r\n" ) == '\0' ) break;
+
+ /* otherwise assume it was a line of unrecognized input, or a
+ * recipe line out of place so print a message */
+
+ Fatal( "Expecting macro or rule defn, found neither" );
+ break;
+
+ default:
+ Fatal( "Internal -- UNKNOWN Parser state %d", State );
+ }
+ }
+ }
+}
+
diff --git a/dmake/path.c b/dmake/path.c
new file mode 100644
index 000000000000..ead163394175
--- /dev/null
+++ b/dmake/path.c
@@ -0,0 +1,337 @@
+/* RCS $Id: path.c,v 1.6 2008-03-05 18:29:34 kz Exp $
+--
+-- SYNOPSIS
+-- Pathname manipulation code
+--
+-- DESCRIPTION
+-- Pathname routines to handle building and pulling appart
+-- pathnames.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+#if __CYGWIN__
+#include <sys/cygwin.h>
+#include <errno.h>
+#endif
+
+
+/*
+** Return the suffix portion of a filename, assumed to begin with a `.'.
+*/
+PUBLIC char *
+Get_suffix(name)
+char *name;
+{
+ char *suff;
+
+ if(name == NIL(char) || (suff = strrchr(name, '.')) == NIL(char))
+ suff = ".NULL";
+
+ return (suff);
+}
+
+
+PUBLIC char *
+Basename(path)/*
+================
+ Return pointer to the basename part of path. path itself remains
+ unchanged. */
+char *path;
+{
+ char *p;
+ char *q;
+
+ if( path && *(q = path) ) {
+ for(; *(p=DmStrPbrk(q, DirBrkStr)) != '\0'; q = p+1 );
+ if( !*q ) {
+ for( p=q-1; p != path; --p )
+ if( strchr( DirBrkStr, *p ) == NIL(char) ) return( p+1 );
+ return( strchr(DirBrkStr, *p)?path:(p+1) );
+ }
+ path = q;
+ }
+ return( path );
+}
+
+
+PUBLIC char *
+Filedir(path)
+char *path;
+{
+ char *p;
+ char *q;
+
+ if( path && *(q = path) ) {
+ for(; *(p=DmStrPbrk(q,DirBrkStr)) != '\0'; q=p+1 );
+
+ if (q == path) return("");
+
+ for(p=q-1; p!=path; --p)
+ if( strchr(DirBrkStr,*p) == NIL(char) )
+ break;
+
+ p[1] = '\0';
+ }
+
+ return(path);
+}
+
+
+
+PUBLIC char *
+Build_path(dir, name)/*
+=======================
+ Return a path that is created by concatenating dir and name. A directory
+ separater is added between them if needed. If dir is empty name is stripped
+ of leading slashes (if there) and returned.
+
+ The returned path is also cleaned from unneeded './' and 'foo/../'
+ elements and also multiple consequtive '/' are removed.
+
+ Note, the returned path is built in a static buffer, if it is to be used
+ later strdup should be used on the result returned by Build_path to create
+ a copy. */
+
+char *dir;
+char *name;
+{
+ static char *path = NIL(char);
+ static unsigned buflen = 0;
+ int plen = 0;
+ int dlen = 0;
+ int len;
+
+ DB_ENTER( "Build_path" );
+
+ if( dir != NIL(char) ) dlen = strlen( dir );
+ if( name != NIL(char) ) plen = strlen( name );
+ len = plen+dlen+1+1; /* Reserve space for extra path separator. */
+
+ if( len > buflen ) {
+ buflen = (len+16) & ~0xf; /* buf is always multiple of 16 */
+
+ if( path == NIL(char) )
+ path = MALLOC( buflen, char );
+ else
+ path = realloc( path, (unsigned) (buflen*sizeof(char)) );
+ }
+
+ *path = '\0';
+
+ if( dlen ) {
+ strcpy( path, dir );
+ if( *path && strchr(DirBrkStr, dir[dlen-1]) == NIL(char) )
+ strcat( path, DirSepStr );
+ }
+
+ if ( plen ) {
+ while ( *name && strchr(DirBrkStr,*name) != 0 ) name++;
+ strcat( path, name );
+ }
+
+ DB_PRINT( "path", ("dir: %s name: %s", dir, name ));
+ DB_PRINT( "path", ("joined to: %s", path ));
+
+ Clean_path( path );
+ DB_PRINT( "path", ("cleaned to: %s", path ));
+
+ DB_RETURN( path );
+}
+
+
+void
+Clean_path(path)/*
+==================
+ Clean the path from irregular directory separators (if more than one are
+ allowed), remove unneeded './' and 'foo/../' elements and also multiple
+ consequtive '/'.
+
+ The resulting string is shorter than the original, therefore this function
+ works on the original string. */
+
+char *path;
+{
+ register char *p;
+ register char *q;
+ char *tpath;
+ int hasdriveletter = 0;
+ int delentry;
+ size_t len;
+
+ DB_ENTER( "Clean_path" );
+
+ /* Skip the root part. */
+ tpath=path;
+
+#ifdef HAVE_DRIVE_LETTERS
+
+ /* Change all occurences from DirBrkStr to *DirSepStr. This assumes
+ * that when HAVE_DRIVE_LETTERS is set the directory separator is
+ * either '\' or '/'. */
+ if (*DirSepStr == '/')
+ for( q = tpath; (q = strchr(q, '\\')) != NIL(char); )
+ *q = *DirSepStr;
+ else
+ for( q = tpath; (q = strchr(q, '/')) != NIL(char); )
+ *q = *DirSepStr;
+
+ /* The following dosn't trigger often because normalize_path() uses
+ * a cygwin function and bypasses Clean_path() if it encounters a path
+ * with a drive letter. */
+ if( *tpath && tpath[1] == ':' && isalpha(*tpath) ) {
+ hasdriveletter = 1;
+ tpath+=2;
+ if( *tpath != *DirSepStr )
+ Warning("Malformed DOS path %s", path);
+ }
+
+#endif
+
+ /* Collapse > 2 ( > 1 if its an absolute DOS path ) into one slash.
+ * Keep // as it is reserved in posix. */
+ q = tpath;
+ for( ; *q == *DirSepStr ; ++q )
+ ;
+ if( q - tpath > 2 - hasdriveletter ) {
+ strcpy(tpath+1, q);
+ }
+
+ /* Set tpath after leading slash / drive letter. */
+ for( ; *tpath == *DirSepStr ; ++tpath )
+ ;
+ q = tpath;
+
+ while( *q ) {
+ char *t;
+
+ /* p is NULL or greater than q. */
+ p=strchr(q, *DirSepStr);
+ if( !p ) break;
+
+ /* Remove multiple consequtive DirSepStr. */
+ if( p[1] == *DirSepStr ) {
+ t = p++; /* t points to first, p to second DirStrSep. */
+ /* Move p after the second (or possible more) DirSepStr. */
+ do {
+ p++;
+ }
+ while( *p == *DirSepStr);
+ len = strlen(p)+1;
+ memmove(t+1,p,len);
+ continue;
+ }
+
+ /* Remove './'. If OOODMAKEMODE is set do this only if it is not at
+ * the start of the path. */
+ if ( p-q == 1 && *q == '.' && (q != path || !STOBOOL(OOoDmMode)) ) {
+ len = strlen(p+1)+1;
+ memmove(q,p+1,len);
+ q = tpath;
+ continue;
+ }
+
+ /* If two '/' are in path check/remove 'foo/../' elements. */
+ t=strchr(p+1, *DirSepStr);
+ if( !t ) break;
+
+ /* Collaps this only if foo is neither '.' nor '..'. */
+ switch( p-q ) {
+ case 2:
+ delentry = !((q[0] == '.') && (q[1] == '.'));
+ break;
+ case 1:
+ delentry = !(q[0] == '.');
+ break;
+ default:
+ delentry = TRUE;
+ break;
+ }
+
+ if ( delentry
+ && (t-p-1 == 2 && strncmp(p+1,"..",2) == 0) ) {
+ /* Skip one (or possible more) DirSepStr. */
+ do {
+ t++;
+ }
+ while( *t == *DirSepStr);
+ /* q points to first letter of the current directory/file. */
+ len = strlen(t)+1;
+ memmove(q,t,len);
+ q = tpath;
+ }
+ else
+ q = p+1;
+ }
+
+ DB_PRINT( "path", ("Cleaned path: %s", path ));
+
+ DB_VOID_RETURN;
+}
+
+
+char *
+normalize_path(path)/*
+=======================
+ Normalize the given path unless it contains a $ indicating a dynamic
+ prerequisite.
+ Special case: For absolute DOSish paths under cygwin a cygwin API
+ function is used to normalize the path optherwise Clean_path() is used.
+
+ Note, the returned path is built in a static buffer, if it is to be used
+ later a copy should be created. */
+
+char *path;
+{
+ static char *cpath = NIL(char);
+
+ DB_ENTER( "normalize_path" );
+
+ if ( !cpath && ( (cpath = MALLOC( PATH_MAX, char)) == NIL(char) ) )
+ No_ram();
+
+ /* If there is a $ in the path this can either mean a '$' character in
+ * a target definition or a dynamic macro expression in a prerequisite
+ * list. As dynamic macro expression must not be normalized and is
+ * indistinguishable from a literal $ characters at this point we skip
+ * the normalization if a $ is found. */
+ if( strchr(path, '$') ) {
+ DB_RETURN( path );
+ }
+
+#if __CYGWIN__
+ /* Use cygwin function to convert a DOS path to a POSIX path. */
+ if( *path && path[1] == ':' && isalpha(*path) ) {
+ int err = cygwin_conv_to_posix_path(path, cpath);
+ if (err)
+ Fatal( "error converting \"%s\" - %s\n",
+ path, strerror (errno));
+ if( path[2] != '/' && path[2] != '\\' )
+ Warning("Malformed DOS path %s converted to %s", path, cpath);
+ }
+ else
+#endif
+ {
+ strcpy( cpath, path );
+ Clean_path( cpath );
+ }
+
+ DB_PRINT( "path", ("normalized: %s", cpath ));
+
+ DB_RETURN( cpath );
+}
diff --git a/dmake/percent.c b/dmake/percent.c
new file mode 100644
index 000000000000..8ecac4ce764d
--- /dev/null
+++ b/dmake/percent.c
@@ -0,0 +1,251 @@
+/* RCS $Id: percent.c,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $
+--
+-- SYNOPSIS
+-- Handle building or %-rule meta-target nfa.
+--
+-- DESCRIPTION
+-- Builds the NFA used by dmake to match targets against %-meta
+-- rule constructs. The NFA is built as a set of DFA's.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+static DFAPTR _build_dfa ANSI((char *));
+static char _shift_dfa ANSI((DFAPTR, char *));
+
+
+#define NO_ACTION 0
+#define START_PERCENT 1
+#define END_PERCENT 2
+#define ACCEPT 4
+#define FAIL -1
+
+static NFAPTR _nfa = NIL( NFA );
+
+
+PUBLIC DFALINKPTR
+Match_dfa( buf )/*
+==================
+ This routines runs all DFA's in parrallel and selects the one that best
+ matches the string. If no match then it returns NIL( DFA ) */
+char *buf;
+{
+ register NFAPTR nfa;
+ int adv;
+ DFALINKPTR dfa_list = NIL(DFALINK);
+
+ DB_ENTER( "Match_dfa" );
+ DB_PRINT( "dfa", ("Matching %s", buf) );
+
+ /* Run each of the DFA's on the input string in parallel, we terminate
+ * when all DFA's have either failed or ACCEPTED, if more than one DFA
+ * accepts we build a list of all accepting DFA's sorted on states with
+ * those matching in a higher numbered state heading the list. */
+
+ do {
+ adv = FALSE;
+
+ for( nfa = _nfa; nfa != NIL( NFA ); nfa = nfa->next )
+ if( nfa->status != (char) FAIL && nfa->status != (char) ACCEPT ) {
+ adv++;
+ nfa->status = _shift_dfa( nfa->dfa, buf );
+
+ /* Construct the list of matching DFA's */
+ if( nfa->status == (char) ACCEPT ) {
+ DFALINKPTR dl;
+
+ TALLOC( dl, 1, DFALINK );
+ dl->dl_meta = nfa->dfa->node;
+ dl->dl_per = DmSubStr( nfa->dfa->pstart, nfa->dfa->pend );
+ dl->dl_state = nfa->dfa->states - nfa->dfa->c_state;
+
+ if( dfa_list == NIL(DFALINK) )
+ dfa_list = dl;
+ else {
+ DFALINKPTR tdli = dfa_list;
+ DFALINKPTR tdlp = NIL(DFALINK);
+
+ for( ; tdli != NIL(DFALINK); tdli = tdli->dl_next ) {
+ if( dl->dl_state >= tdli->dl_state )
+ break;
+ tdlp = tdli;
+ }
+
+ if( tdli != NIL(DFALINK) ) {
+ tdli->dl_prev = dl;
+ dl->dl_next = tdli;
+ }
+
+ if( tdlp != NIL(DFALINK) ) {
+ tdlp->dl_next = dl;
+ dl->dl_prev = tdlp;
+ }
+ else
+ dfa_list = dl;
+ }
+
+ DB_PRINT( "dfa", ("Matched [%s]", dl->dl_meta->CE_NAME) );
+ }
+ }
+
+ buf++;
+ }
+ while ( adv );
+
+ for( nfa = _nfa; nfa != NIL( NFA ); nfa = nfa->next ) {
+ nfa->status = 0;
+ nfa->dfa->c_state = nfa->dfa->states;
+ }
+
+ DB_RETURN( dfa_list );
+}
+
+
+PUBLIC void
+Check_circle_dfa()/*
+====================
+ This function is called to test for circularities in the DFA lists
+ constructed from %-meta targets. */
+{
+ register NFAPTR nfa;
+
+ for( nfa = _nfa; nfa != NIL(NFA); nfa = nfa->next )
+ if( Test_circle( nfa->dfa->node, FALSE ) )
+ Fatal( "Detected circular dependency in inference graph at [%s]",
+ nfa->dfa->node->CE_NAME );
+}
+
+
+PUBLIC void
+Add_nfa( name )/*
+=================
+ Given name, build a DFA and add it to the NFA. The NFA is maintained as
+ a singly linked list of DFA's. */
+char *name;
+{
+ NFAPTR nfa;
+
+ TALLOC(nfa, 1, NFA);
+ nfa->dfa = _build_dfa(name);
+
+ if( _nfa != NIL(NFA) ) nfa->next = _nfa;
+
+ _nfa = nfa;
+}
+
+
+static DFAPTR
+_build_dfa( name )/*
+====================
+ Construct a dfa for the passed in cell name. The routine returns a struct
+ that represents a finite state machine that can recognize a regular
+ expression with exactly one '%' sign in it. The '%' symbol is used as a
+ wildcard character that will match anything except the character that
+ immediately follows it or NUL.
+
+ The Construction of DFA's is well known and can be found in Hopcroft and
+ Ullman or any other book discussing formal language theory.
+ A more practical treatise can be found in Compilers, Aho, Sethi and Ullman.
+*/
+char *name;
+{
+ DFAPTR dfa;
+ int nstates;
+ register STATEPTR sp;
+ STATEPTR per_state = NIL(STATE);
+ int pcount=0;
+ int end_percent=FALSE;
+
+ nstates = strlen(name)+2;
+
+ /* Allocate a DFA node and the right number of states. */
+ TALLOC(dfa, 1, DFA);
+ TALLOC(sp=dfa->c_state=dfa->states, nstates, STATE);
+ dfa->node = Def_cell( name );
+
+ /* Now construct the state table for the DFA */
+ do {
+ if( *name == '%' ) {
+ if( pcount++ > 0 )
+ Error( "Only one %% allowed within a %%-meta target" );
+
+ sp->symbol = 0;
+ sp->action = START_PERCENT;
+ sp->no_match = sp->match = per_state = sp+1;
+ end_percent = TRUE;
+ }
+ else {
+ sp->symbol = *name;
+ sp->no_match = per_state;
+
+ if( *name == '\0' ) {
+ sp->action = ACCEPT;
+ sp->match = dfa->states;
+ }
+ else {
+ sp->action = NO_ACTION;
+ sp->match = sp+1;
+ }
+
+ if( end_percent ) {
+ sp->action |= END_PERCENT;
+ end_percent = FALSE;
+ }
+ }
+
+ sp++;
+ }
+ while( *name++ );
+
+ return(dfa);
+}
+
+
+static char
+_shift_dfa( dfa, data )/*
+=========================
+ Take a given dfa and advance it based on the current state, the shift
+ action in that state, and the current data value. */
+DFAPTR dfa;
+char *data;
+{
+ register STATEPTR sp = dfa->c_state;
+ char c = *data;
+
+ /* Check if it is a START_PERCENT action if so then we need to save
+ * a pointer to the start of the string and advance to the next state. */
+ if( sp->action & START_PERCENT ) {
+ dfa->pstart = data;
+ sp++;
+ }
+
+ /* Now check if the current char matches the character expected in the
+ * current state. If it does then perform the specified action, otherwise
+ * either shift it or fail. We fail if the next state on no-match is
+ * NIL. */
+ if( sp->symbol == c ) {
+ if( sp->action & END_PERCENT ) dfa->pend = data;
+ if( sp->action & ACCEPT ) return(ACCEPT);
+ dfa->c_state = sp->match;
+ }
+ else if( (dfa->c_state = sp->no_match) == NIL(STATE) || !c )
+ return((unsigned char) FAIL);
+
+ return(NO_ACTION);
+}
diff --git a/dmake/posix.h b/dmake/posix.h
new file mode 100644
index 000000000000..b39fc0336dc4
--- /dev/null
+++ b/dmake/posix.h
@@ -0,0 +1,66 @@
+/* RCS $Id: posix.h,v 1.3 2006-04-20 12:01:40 hr Exp $
+--
+-- SYNOPSIS
+-- Definition for POSIX conforming defines in dmake.
+--
+-- DESCRIPTION
+-- This file is intended to make certain that defines used within dmake
+-- for file name lengths, and number of children processes are defined.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* Define the minimum values that each system requires, and do so only if
+ * we have not defined these includes elsewhere. These should already be
+ * defined in <limits.h> if you have a C compiler that is POSIX compliant.
+ */
+#ifndef _POSIX_NAME_MAX
+#define _POSIX_NAME_MAX 14
+#endif
+
+#ifndef _POSIX_PATH_MAX
+#define _POSIX_PATH_MAX 64
+#endif
+
+#ifndef _POSIX_CHILD_MAX
+#define _POSIX_CHILD_MAX 1
+#endif
+
+/* Now define the actual manifests used in the code. */
+#ifndef NAME_MAX
+#define NAME_MAX _POSIX_NAME_MAX
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+#ifndef CHILD_MAX
+#define CHILD_MAX _POSIX_CHILD_MAX
+#endif
+
+/* FIXME! This is a very big hammer, these values should be set to
+ * sensible values in the architecture dependent sysintf.h files. */
+#if NAME_MAX < 255
+#undef NAME_MAX
+#define NAME_MAX 255
+#endif
+
+#if PATH_MAX < 1024
+#undef PATH_MAX
+#define PATH_MAX 1024
+#endif
diff --git a/dmake/qssl/config.mk b/dmake/qssl/config.mk
new file mode 100644
index 000000000000..d5d1534996eb
--- /dev/null
+++ b/dmake/qssl/config.mk
@@ -0,0 +1,43 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# PRINTER, PRINTFLAGS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+PRINTER = hw
+PRINTFLAGS = -P$(PRINTER)
+STARTUPFILE = $(OS)/startup.mk
+CPPFLAGS = $(CFLAGS)
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDFLAGS) -o $@ $(LDOBJS) $(LDLIBS)
+
+# Debug flags
+DB_CFLAGS = -g -DDBUG
+DB_LDFLAGS = -g
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS = -O
+NDB_LDFLAGS = -N 8192
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += -I$(OS) -3
+
+# Sources that must be defined for each different version
+OSSRC := ruletab.c runargv.c tempnam.c
+UNIXSRC := dcache.c rmprq.c dirbrk.c
+DOSSRC := arlib.c
+SRC += $(OSSRC) $(UNIXSRC) $(DOSSRC)
+.SETDIR=$(OS) : $(OSSRC)
+.SETDIR=unix : $(UNIXSRC)
+.SETDIR=msdos : $(DOSSRC)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/qssl/make.sh b/dmake/qssl/make.sh
new file mode 100644
index 000000000000..042e219adde7
--- /dev/null
+++ b/dmake/qssl/make.sh
@@ -0,0 +1,62 @@
+mkdir objects
+cc -c -I. -Iqssl -3 -O infer.c
+mv infer.o objects
+cc -c -I. -Iqssl -3 -O make.c
+mv make.o objects
+cc -c -I. -Iqssl -3 -O stat.c
+mv stat.o objects
+cc -c -I. -Iqssl -3 -O expand.c
+mv expand.o objects
+cc -c -I. -Iqssl -3 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iqssl -3 -O hash.c
+mv hash.o objects
+cc -c -I. -Iqssl -3 -O dag.c
+mv dag.o objects
+cc -c -I. -Iqssl -3 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iqssl -3 -O path.c
+mv path.o objects
+cc -c -I. -Iqssl -3 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iqssl -3 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iqssl -3 -O parse.c
+mv parse.o objects
+cc -c -I. -Iqssl -3 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iqssl -3 -O quit.c
+mv quit.o objects
+cc -c -I. -Iqssl -3 -O state.c
+mv state.o objects
+cc -c -I. -Iqssl -3 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iqssl -3 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iqssl -3 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iqssl -3 -O percent.c
+mv percent.o objects
+cc -c -I. -Iqssl -3 -O function.c
+mv function.o objects
+cc -c -I. -Iqssl -3 -O qssl/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iqssl -3 -O qssl/runargv.c
+mv runargv.o objects
+cc -c -I. -Iqssl -3 -O qssl/tempnam.c
+mv tempnam.o objects
+cc -c -I. -Iqssl -3 -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iqssl -3 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iqssl -3 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iqssl -3 -O msdos/arlib.c
+mv arlib.o objects
+cc -N 8192 -o dmake objects/infer.o objects/make.o objects/stat.o \
+objects/expand.o objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o \
+objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o \
+objects/getinp.o objects/quit.o objects/state.o objects/dmdump.o \
+objects/macparse.o objects/rulparse.o objects/percent.o objects/function.o \
+objects/ruletab.o objects/runargv.o objects/tempnam.o objects/dcache.o objects/rmprq.o objects/dirbrk.o objects/arlib.o
+cp qssl/template.mk startup/config.mk
diff --git a/dmake/qssl/public.h b/dmake/qssl/public.h
new file mode 100644
index 000000000000..7f0f83faf9ce
--- /dev/null
+++ b/dmake/qssl/public.h
@@ -0,0 +1,166 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:46:09 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+void Remove_prq ANSI((CELLPTR));
+int If_root_path ANSI((char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+
+#endif
diff --git a/dmake/qssl/ruletab.c b/dmake/qssl/ruletab.c
new file mode 100644
index 000000000000..cbfd285f3d71
--- /dev/null
+++ b/dmake/qssl/ruletab.c
@@ -0,0 +1,41 @@
+/* RCS $Id: ruletab.c,v 1.2 2006-04-20 12:09:28 hr Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+static char *_rules[] = {
+ "MAXPROCESSLIMIT := 10",
+ "MAXLINELENGTH := 8190",
+ ".IMPORT .IGNORE: ROOTDIR DMAKEROOT",
+ ".MAKEFILES : makefile.mk Makefile makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ 0 };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
diff --git a/dmake/qssl/runargv.c b/dmake/qssl/runargv.c
new file mode 100644
index 000000000000..c0e602ac9f3f
--- /dev/null
+++ b/dmake/qssl/runargv.c
@@ -0,0 +1,298 @@
+/* RCS $Id: runargv.c,v 1.3 2007-10-15 15:46:20 ihi Exp $
+--
+-- SYNOPSIS
+-- Invoke a sub process.
+--
+-- DESCRIPTION
+-- Use the standard methods of executing a sub process.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <signal.h>
+#include "extern.h"
+#include "sysintf.h"
+
+typedef struct prp {
+ char *prp_cmd;
+ int prp_group;
+ int prp_ignore;
+ int prp_last;
+ int prp_shell;
+ struct prp *prp_next;
+} RCP, *RCPPTR;
+
+typedef struct pr {
+ int pr_valid;
+ int pr_pid;
+ CELLPTR pr_target;
+ int pr_ignore;
+ int pr_last;
+ RCPPTR pr_recipe;
+ RCPPTR pr_recipe_end;
+ char *pr_dir;
+} PR;
+
+static PR *_procs = NIL(PR);
+static int _proc_cnt = 0;
+static int _abort_flg= FALSE;
+static int _use_i = -1;
+static int _do_upd = 0;
+
+static void _add_child ANSI((int, CELLPTR, int, int));
+static void _attach_cmd ANSI((char *, int, int, CELLPTR, int, int));
+static void _finished_child ANSI((int, int));
+static int _running ANSI((CELLPTR));
+
+/* iz71422 changed the parameters for runargv but it (and the rest of
+ * qssl) got *NOT* fixed. */
+iz81252 changed the parameters for Pack_argv() and runargv() but this file
+did not get fixed!
+PUBLIC int
+runargv(target, ignore, group, last, shell, cmd)
+CELLPTR target;
+int ignore;
+int group;
+int last;
+int shell;
+char *cmd;
+{
+ extern int errno;
+ int pid;
+ char **argv;
+
+ if( _running(target) /*&& Max_proc != 1*/ ) {
+ /* The command will be executed when the previous recipe
+ * line completes. */
+ _attach_cmd( cmd, group, ignore, target, last, shell );
+ return(1);
+ }
+
+ while( _proc_cnt == Max_proc )
+ if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child %d", errno );
+
+ argv = Pack_argv( group, shell, cmd );
+
+ switch( pid=fork() ){
+ int wid;
+ int status;
+
+ case -1: /* fork failed */
+ Error("%s: %s", argv[0], strerror(errno));
+ Handle_result(-1, ignore, _abort_flg, target);
+ return(-1);
+
+ case 0: /* child */
+ execvp(argv[0], argv);
+ Continue = TRUE; /* survive error message */
+ Error("%s: %s", argv[0], strerror(errno));
+ kill(getpid(), SIGTERM);
+ /*NOTREACHED*/
+
+ default: /* parent */
+ _add_child(pid, target, ignore, last);
+ }
+
+ return(1);
+}
+
+
+PUBLIC int
+Wait_for_child( abort_flg, pid )
+int abort_flg;
+int pid;
+{
+ int wid;
+ int status;
+ int waitchild;
+
+ waitchild = (pid == -1)? FALSE : Wait_for_completion;
+
+ do {
+ if( (wid = wait(&status)) == -1 ) return(-1);
+
+ _abort_flg = abort_flg;
+ _finished_child(wid, status);
+ _abort_flg = FALSE;
+ }
+ while( waitchild && pid != wid );
+
+ return(0);
+}
+
+
+PUBLIC void
+Clean_up_processes()
+{
+ register int i;
+
+ if( _procs != NIL(PR) ) {
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid )
+ kill(_procs[i].pr_pid, SIGTERM);
+
+ while( Wait_for_child(TRUE, -1) != -1 );
+ }
+}
+
+
+static void
+_add_child( pid, target, ignore, last )
+int pid;
+CELLPTR target;
+int ignore;
+int last;
+{
+ register int i;
+ register PR *pp;
+
+ if( _procs == NIL(PR) ) {
+ TALLOC( _procs, Max_proc, PR );
+ }
+
+ if( (i = _use_i) == -1 )
+ for( i=0; i<Max_proc; i++ )
+ if( !_procs[i].pr_valid )
+ break;
+
+ pp = _procs+i;
+
+ pp->pr_valid = 1;
+ pp->pr_pid = pid;
+ pp->pr_target = target;
+ pp->pr_ignore = ignore;
+ pp->pr_last = last;
+ pp->pr_dir = DmStrDup(Get_current_dir());
+
+ Current_target = NIL(CELL);
+
+ _proc_cnt++;
+
+ if( Wait_for_completion ) Wait_for_child( FALSE, pid );
+}
+
+
+static void
+_finished_child(pid, status)
+int pid;
+int status;
+{
+ register int i;
+ register PR *pp;
+ char *dir;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
+ break;
+
+ /* Some children we didn't make esp true if using /bin/sh to execute a
+ * a pipe and feed the output as a makefile into dmake. */
+ if( i == Max_proc ) return;
+ _procs[i].pr_valid = 0;
+ _proc_cnt--;
+ dir = DmStrDup(Get_current_dir());
+ Set_dir( _procs[i].pr_dir );
+
+ if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
+ RCPPTR rp = _procs[i].pr_recipe;
+
+
+ Current_target = _procs[i].pr_target;
+ Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
+ Current_target = NIL(CELL);
+
+ if ( _procs[i].pr_target->ce_attr & A_ERROR ) {
+ _procs[i].pr_last = TRUE;
+ goto ABORT_REMAINDER_OF_RECIPE;
+ }
+
+ _procs[i].pr_recipe = rp->prp_next;
+
+ _use_i = i;
+ runargv( _procs[i].pr_target, rp->prp_ignore, rp->prp_group,
+ rp->prp_last, rp->prp_shell, rp->prp_cmd );
+ _use_i = -1;
+
+ FREE( rp->prp_cmd );
+ FREE( rp );
+
+ if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
+ }
+ else {
+ Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
+
+ ABORT_REMAINDER_OF_RECIPE:
+ if( _procs[i].pr_last ) {
+ FREE(_procs[i].pr_dir );
+
+ if( !Doing_bang ) Update_time_stamp( _procs[i].pr_target );
+ }
+ }
+
+ Set_dir(dir);
+ FREE(dir);
+}
+
+
+static int
+_running( cp )
+CELLPTR cp;
+{
+ register int i;
+
+ if( !_procs ) return(FALSE);
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ return( i != Max_proc );
+}
+
+
+static void
+_attach_cmd( cmd, group, ignore, cp, last, shell )
+char *cmd;
+int group;
+int ignore;
+CELLPTR cp;
+int last;
+int shell;
+{
+ register int i;
+ RCPPTR rp;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ TALLOC( rp, 1, RCP );
+ rp->prp_cmd = DmStrDup(cmd);
+ rp->prp_group = group;
+ rp->prp_ignore= ignore;
+ rp->prp_last = last;
+ rp->prp_shell = shell;
+
+ if( _procs[i].pr_recipe == NIL(RCP) )
+ _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
+ else {
+ _procs[i].pr_recipe_end->prp_next = rp;
+ _procs[i].pr_recipe_end = rp;
+ }
+}
diff --git a/dmake/qssl/setup b/dmake/qssl/setup
new file mode 100644
index 000000000000..9aa004cd604f
--- /dev/null
+++ b/dmake/qssl/setup
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+if [ ! -d /usr/local ]; then mkdir /usr/local ; fi
+if [ ! -d /usr/local/bin ]; then mkdir /usr/local/bin ; fi
+if [ ! -d /usr/local/lib ]; then mkdir /usr/local/lib ; fi
+if [ ! -d /usr/local/lib/dmake-4.1 ]; then mkdir /usr/local/lib/dmake-4.1 ; fi
+
+
+if [ -d /usr/local/lib/dmake-4.1/startup ]
+then
+ if [ -f /usr/local/lib/dmake-4.1/startup/local.mk ]; then
+ cp /usr/local/lib/dmake-4.1/startup/local.mk /tmp/local$$
+ elif [ -d /usr/local/lib/dmake ]; then
+ if [ -f /usr/local/lib/dmake/startup/local.mk ]; then
+ cp /usr/local/lib/dmake/startup/local.mk /tmp/local$$
+ fi
+ fi
+ /bin/rm -rf /usr/local/lib/dmake-4.1/startup /usr/local/lib/dmake
+fi
+
+mkdir /usr/local/lib/dmake-4.1/startup
+
+echo "Installing Dmake into /usr/local/bin"
+
+cp dmake-4.1g/dmake /usr/local/bin/dmake-4.1;
+/bin/rm -f /usr/local/bin/dmake
+(cd /usr/local/bin; ln -s dmake-4.1 dmake; chmod a+x,og-w dmake-4.1)
+cp -r dmake-4.1g/startup /usr/local/lib/dmake-4.1/startup
+(cd /usr/local/lib; ln -s dmake-4.1 dmake)
+find /usr/local/lib/dmake-4.1 -type d -exec chmod a+x {} \;
+find /usr/local/lib/dmake-4.1 -type f -exec chmod og-w,a+r {} \;
+
+if [ -f /tmp/local$$ ]
+then
+ cp /tmp/local$$ /usr/local/lib/dmake/startup/local.mk
+fi
+
+/bin/rm -rf dmake-4.1g
+
+echo "Dmake setup is complete"
diff --git a/dmake/qssl/startup.h b/dmake/qssl/startup.h
new file mode 100644
index 000000000000..139fc1e3e136
--- /dev/null
+++ b/dmake/qssl/startup.h
@@ -0,0 +1,28 @@
+/* RCS $Id: startup.h,v 1.2 2006-04-20 12:09:40 hr Exp $
+--
+-- SYNOPSIS
+-- Definition of MAKESTARTUP
+--
+-- DESCRIPTION
+-- Default MAKESTARTUP value defining where dmake locates the
+-- startup file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"DMAKEROOT *:= $(ROOTDIR)/usr/local/lib/dmake/startup",
+"MAKESTARTUP := $(DMAKEROOT)/startup.mk",
diff --git a/dmake/qssl/stdlib.h b/dmake/qssl/stdlib.h
new file mode 100644
index 000000000000..c599d7104363
--- /dev/null
+++ b/dmake/qssl/stdlib.h
@@ -0,0 +1,48 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+
+#ifndef _AIX
+/* The AIX compiler dies on illegal redefinition of free */
+extern free();
+#endif
+
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/qssl/sysintf.h b/dmake/qssl/sysintf.h
new file mode 100644
index 000000000000..323003253afb
--- /dev/null
+++ b/dmake/qssl/sysintf.h
@@ -0,0 +1,42 @@
+/* RCS $Id: sysintf.h,v 1.2 2007-01-18 09:37:51 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define Hook_std_writes(A)
+#define GETPID getpid()
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define getswitchar() '-'
+
+/*
+** make parameters
+*/
diff --git a/dmake/qssl/template.mk b/dmake/qssl/template.mk
new file mode 100644
index 000000000000..e7e9837ae671
--- /dev/null
+++ b/dmake/qssl/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= qssl
+ OSRELEASE *:=
+ OSENVIRONMENT *:=
diff --git a/dmake/qssl/tempnam.c b/dmake/qssl/tempnam.c
new file mode 100644
index 000000000000..eb683da7ee4c
--- /dev/null
+++ b/dmake/qssl/tempnam.c
@@ -0,0 +1,102 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern int access();
+
+static char *cpdir();
+static char seed[4]="AAA";
+
+/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
+#ifndef P_tmpdir
+static char *P_tmpdir = "/tmp";
+#endif
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
+ if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
+ if( access( cpdir(p, P_tmpdir), 3) != 0 )
+ if( access( cpdir(p, "/tmp"), 3) != 0 )
+ return(NULL);
+
+ (void) strcat(p, "/");
+ if(prefix)
+ {
+ *(p+strlen(p)+5) = '\0';
+ (void)strncat(p, prefix, 5);
+ }
+
+ (void)strcat(p, seed);
+ (void)strcat(p, "XXXXXX");
+
+ q = seed;
+ while(*q == 'Z') *q++ = 'A';
+ ++*q;
+
+ if(*tmpnam(p) == '\0') return(NULL);
+ return(p);
+}
+
+
+
+static char *
+cpdir(buf, str)
+char *buf;
+char *str;
+{
+ char *p;
+
+ if(str != NULL)
+ {
+ (void) strcpy(buf, str);
+ p = buf - 1 + strlen(buf);
+ if(*p == '/') *p = '\0';
+ }
+
+ return(buf);
+}
diff --git a/dmake/qssl/time.h b/dmake/qssl/time.h
new file mode 100644
index 000000000000..f3ddaf7962dd
--- /dev/null
+++ b/dmake/qssl/time.h
@@ -0,0 +1,32 @@
+/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:30 hr Exp $
+--
+-- SYNOPSIS
+-- time_t
+--
+-- DESCRIPTION
+-- Fix broken time_t definition.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef TIME_h
+#define TIME_h
+
+typedef long time_t; /* this is the thing we use */
+
+#endif TIME_h
+
diff --git a/dmake/quit.c b/dmake/quit.c
new file mode 100644
index 000000000000..54043093de24
--- /dev/null
+++ b/dmake/quit.c
@@ -0,0 +1,116 @@
+/* $RCSfile: quit.c,v $
+-- $Revision: 1.8 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:29:56 $
+--
+-- SYNOPSIS
+-- End the dmake session.
+--
+-- DESCRIPTION
+-- Handles dmake termination.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+static void _handle_quit ANSI((char*));
+static int _quitting = 0; /* Set to 1 once Quit() is called for the
+ * first time. */
+
+
+PUBLIC void
+Quit( sig )/*
+======== Error or quit */
+int sig;
+{
+ if( sig == SIGINT )
+ fprintf(stderr, "Caught SIGINT. Trying to quit ...\n");
+ else
+#ifdef SIGQUIT
+ /* MinGW, maybe others also, does not have SIGQUIT. */
+ if( sig == SIGQUIT )
+ fprintf(stderr, "Caught SIGQUIT. Trying to quit ...\n");
+ else
+#endif
+ if( sig == 0 )
+ /* Don't be verbose during regular program termination. */
+ ;
+ else
+ fprintf(stderr, "Caught signal %d. Trying to quit ...\n", sig);
+
+ if( _quitting ) return; /* Guard to only quit once. */
+ _quitting = 1;
+
+ while( Closefile() != NIL( FILE ) );
+
+ /* CTRL-c sends SIGINT and CTRL-\ sends SIGQUIT to the parent and to all
+ * children. No need to kill them. */
+ if( sig != SIGINT
+#ifdef SIGQUIT
+ /* MinGW, maybe others also, does not have SIGQUIT. */
+ && sig != SIGQUIT
+#endif
+ )
+ /* This should be called Kill_all_processes(). */
+ Clean_up_processes();
+
+ /* Wait until all Processes are done. */
+ while( Wait_for_child(TRUE, -1) != -1 )
+ ;
+
+ if( Current_target != NIL(CELL) )
+ Unlink_temp_files(Current_target);
+
+ if( _quitting == 0 ) _handle_quit( ".ERROR" );
+
+ Set_dir( Makedir ); /* No Error message if we can't do it */
+ Epilog( ERROR_EXIT_VALUE );
+}
+
+
+PUBLIC const int
+in_quit( void )/*
+=================
+ Called to check if we are already quitting.
+ (Only used in unix/runargv.c.) */
+{
+ return _quitting;
+}
+
+static void
+_handle_quit( err_target )/*
+============================
+ Called by Quit() to handle the execution of termination code
+ from within make */
+char *err_target;
+{
+ HASHPTR hp;
+ CELLPTR cp;
+
+ if( (hp = Get_name(err_target, Defs, FALSE)) != NIL(HASH) ) {
+ cp = hp->CP_OWNR;
+ Glob_attr |= A_IGNORE;
+
+ cp->ce_flag |= F_TARGET;
+ Make( cp, NIL(CELL) );
+
+ /* Beware! If the ".ERROR" target doesn't finish the following
+ * wait will never return!!! */
+ while( Wait_for_child(FALSE, -1) != -1 );
+
+ }
+}
diff --git a/dmake/rcsclean.awk b/dmake/rcsclean.awk
new file mode 100644
index 000000000000..8fdba716bacd
--- /dev/null
+++ b/dmake/rcsclean.awk
@@ -0,0 +1,57 @@
+/^\/\* RCS/ { print "/* RCS $Id: rcsclean.awk,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $"; next }
+/^-- LOG/,/^\*\// {
+ if( ! flag ) {
+ print "-- LOG";
+ print "-- Use cvs log to obtain detailed change logs.";
+ print "*/";
+ flag = 1;
+ }
+
+ next;
+}
+/^-- SYNOPSIS --/ {
+ print "--";
+ print "-- SYNOPSIS";
+ printf "-- %s%s\n", toupper(substr($0, 16,1)), substr($0,17);
+ next;
+}
+/^-- WWW/,/^--$/ {
+ if( !wflag ) {
+ print "-- WWW";
+ print "-- http://dmake.wticorp.com/";
+ print "--";
+ wflag = 1;
+ }
+ next;
+}
+/^-- AUTHOR/,/^--$/ {
+ if( !aflag ) {
+ print "-- AUTHOR";
+ print "-- Dennis Vadura, dvadura@dmake.wticorp.com";
+ print "--";
+ aflag = 1;
+ }
+ next;
+}
+/^-- COPYRIGHT/,/^--$/ {
+ if( !wflag ) {
+ print "-- WWW";
+ print "-- http://dmake.wticorp.com/";
+ print "--";
+ wflag = 1;
+ }
+
+ if( !cflag ) {
+print "-- COPYRIGHT";
+print "-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.";
+print "-- ";
+print "-- This program is NOT free software; you can redistribute it and/or";
+print "-- modify it under the terms of the Software License Agreement Provided";
+print "-- in the file <distribution-root>/readme/license.txt.";
+print "--";
+cflag = 1;
+ }
+ next;
+}
+
+{ print; }
diff --git a/dmake/readme/intro.txt b/dmake/readme/intro.txt
new file mode 100644
index 000000000000..8e25f9523b5b
--- /dev/null
+++ b/dmake/readme/intro.txt
@@ -0,0 +1,40 @@
+DMAKE
+-----
+
+The original sources of dmake were available on http://dmake.wticorp.com.
+This site has not been reachable for some time and the source is hosted
+in the OpenOffice.org http://www.openoffice.org/ cvs now. You can view
+the source at: http://tools.openoffice.org/source/browse/tools/dmake.
+
+dmake is different from other versions of Make in that it supports significant
+enhancements. A short summary of the more important features follows:
+
+ . support for portable makefiles
+ . portable accross many platforms
+ . significantly enhanced macro facilities
+ . sophisticated inference algorithm supporting transitive closure
+ over the inference graph
+ . support for traversing the file sytem both during making of targets
+ and during inference
+ . %-meta rules for specifying rules to be used for inferring
+ prerequisites
+ . conditional macros
+ . local rule macro variables
+ . proper support for libraries
+ . parallel making of targets on architectures that support it
+ . attributed targets
+ . text diversions
+ . group recipes
+ . swapping itself to DISK under MSDOS
+ . supports MKS extended argument passing convention
+ . directory caching
+ . highly configurable
+
+Current release notes can be found in the file:
+
+ NEWS
+
+Release notes for older dmake versions (4.1 and before) can be found in
+the file:
+
+ readme/release.txt
diff --git a/dmake/readme/license.txt b/dmake/readme/license.txt
new file mode 100644
index 000000000000..3c68f02bb420
--- /dev/null
+++ b/dmake/readme/license.txt
@@ -0,0 +1,248 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 1, February 1989
+
+ Copyright (C) 1989 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The license agreements of most software companies try to keep users
+at the mercy of those companies. By contrast, our General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. The
+General Public License applies to the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+You can use it for your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Specifically, the General Public License is designed to make
+sure that you have the freedom to give away or sell copies of free
+software, that you receive source code or can get it if you want it,
+that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of a such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must tell them their rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any program or other work which
+contains a notice placed by the copyright holder saying it may be
+distributed under the terms of this General Public License. The
+"Program", below, refers to any such program or work, and a "work based
+on the Program" means either the Program or any work containing the
+Program or a portion of it, either verbatim or with modifications. Each
+licensee is addressed as "you".
+
+ 1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this
+General Public License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this General Public License
+along with the Program. You may charge a fee for the physical act of
+transferring a copy.
+
+ 2. You may modify your copy or copies of the Program or any portion of
+it, and copy and distribute such modifications under the terms of Paragraph
+1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating that
+ you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish, that
+ in whole or in part contains the Program or any part thereof, either
+ with or without modifications, to be licensed at no charge to all
+ third parties under the terms of this General Public License (except
+ that you may choose to grant warranty protection to some or all
+ third parties, at your option).
+
+ c) If the modified program normally reads commands interactively when
+ run, you must cause it, when started running for such interactive use
+ in the simplest and most usual way, to print or display an
+ announcement including an appropriate copyright notice and a notice
+ that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this General
+ Public License.
+
+ d) You may charge a fee for the physical act of transferring a
+ copy, and you may at your option offer warranty protection in
+ exchange for a fee.
+
+Mere aggregation of another independent work with the Program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other work under the scope of these terms.
+
+ 3. You may copy and distribute the Program (or a portion or derivative of
+it, under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal charge
+ for the cost of distribution) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+Source code for a work means the preferred form of the work for making
+modifications to it. For an executable file, complete source code means
+all the source code for all modules it contains; but, as a special
+exception, it need not include source code for modules which are standard
+libraries that accompany the operating system on which the executable
+file runs, or for standard header files or definitions files that
+accompany that operating system.
+
+ 4. You may not copy, modify, sublicense, distribute or transfer the
+Program except as expressly provided under this General Public License.
+Any attempt otherwise to copy, modify, sublicense, distribute or transfer
+the Program is void, and will automatically terminate your rights to use
+the Program under this License. However, parties who have received
+copies, or rights to use copies, from you under this General Public
+License will not have their licenses terminated so long as such parties
+remain in full compliance.
+
+ 5. By copying, distributing or modifying the Program (or any work based
+on the Program) you indicate your acceptance of this license to do so,
+and all its terms and conditions.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these
+terms and conditions. You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein.
+
+ 7. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of the license which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+the license, you may choose any version ever published by the Free Software
+Foundation.
+
+ 8. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to humanity, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19xx name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w' and `show
+c'; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ program `Gnomovision' (a program to direct compilers to make passes
+ at assemblers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/dmake/readme/public/install.txt b/dmake/readme/public/install.txt
new file mode 100644
index 000000000000..a5ee339d2730
--- /dev/null
+++ b/dmake/readme/public/install.txt
@@ -0,0 +1,203 @@
+ DMAKE UNPACKING AND INSTALLATION INSTRUCTIONS
+
+
+We attempt to keep the information presented here accurate. However, the
+defacto location of the most up to date information is the dmake WWW site
+found at:
+
+ http://dmake.wticorp.com/
+
+DMAKE is available in several formats: a compressed tar src archive,
+a pkzip src archive, a variety of executable archives. Refer to the
+appropriate section below for unpacking instructions.
+
+
+1. UNPACKING THE DISTRIBUTION FILES
+
+ OPTION 'A' (compressed tar src archive):
+ --------------------------------------
+ Assumption: The current directory contains the latest version of dmake in
+ the file 'dm41src.tgz'.
+
+ This file is a standard GNU zip compressed tar archive. To unpack the file
+ issue the following command. gunzip is available for most UNIX platforms
+ as well as DOS.
+
+ gunzip -c dm41src.tgz | tar xf -
+
+
+ OPTION 'B' (src zip archive):
+ -----------------------------
+ Assumption: The current directory contains the latest version of DMAKE in
+ the file dm41src.zip.
+
+ To unpack the full zip distribution simply use pkunzip with the
+ following command:
+
+ pkunzip dm41src.zip
+ or
+ unzip dm41src.zip
+
+
+ Instructions for unpacking executable only versions are given on the
+ dmake WWW site.
+
+
+2. BUILDING THE EXECUTABLE
+
+ Skip this step if you have purchased a prebuilt binary distribution.
+
+ The only supported method for building a new executable from a fresh or
+ patched distribution is to use the self building scripts rather than DMAKE
+ itself. This is necessary in order to allow for the use of new DMAKE
+ features and functionality in the DMAKE 'makefile' itself. Once built
+ the DMAKE executable can be used to rebuild DMAKE.
+
+ To determine the set of supported environments issue the following
+ commands:
+
+ cd src
+ make
+
+ The output of this command will be a set of arguments representing the
+ supported environments that DMAKE can be compiled in. Choose the one
+ that most closely represents your environment and issue the command:
+
+ make environ_tag
+
+ where 'environ_tag' is from the previous list, for example on a Solaris
+ System the option is Solaris, so you would issue the command 'make Solaris'.
+
+ The script runs the appropriate set of commands; upon completion the file
+ 'dmake' or 'dmake.exe' is found in the current directory.
+ This is the binary executable.
+
+ Note: before issuing the build command please read Section 3 and decide
+ if you need or want to modify the pre-compiled value of MAKESTARTUP.
+
+ During the build it is safe to ignore any warnings that may
+ be generated by your build. If you get errors from the build then
+ it is probably the case that you have chosen a build target that is
+ not compatible with your environment.
+
+
+3. INSTALLING AND CONFIGURING THE EXECUTABLE
+
+ To install the dmake executable place the executable into the
+ location where your system normally finds executables. That is
+ place dmake into a subdirectory that is or will be in your
+ executable search PATH.
+
+ You can now issue the command 'dmake -V'; the output will be
+ similar to:
+
+ dmake - Copyright (c) 1990,...,1996 by Dennis Vadura, Version 4.10, PL 0
+
+ Default Configuration:
+ MAXPROCESSLIMIT := 10
+ MAXLINELENGTH := 8190
+ .IMPORT .IGNORE: ROOTDIR
+ .MAKEFILES : makefile.mk Makefile makefile
+ .SOURCE : .NULL
+ MAKESTARTUP := $(ROOTDIR)/usr/local/lib/dmake/startup/startup.mk
+
+ Please read the file readme/release for the latest release notes.
+
+
+ Take note of the line defining the value of MAKESTARTUP; to configure
+ the executable you must perform two steps:
+
+ 1. Copy the <dmake-distdir>/startup subtree to a suitable location,
+ 2. Tell dmake where you put it,
+
+
+ Step 1:
+ -------
+ The above example build of dmake assumes that the directory path (assuming
+ ROOTDIR is NULL)
+
+ /usr/local/lib/dmake/
+
+ is a directory which contains a copy of the "<dmake-distdir>/startup"
+ subtree. Thus to properly configure dmake so that the precompiled
+ defaults would be used you would have to perform the following:
+
+ cd <dmake-distdir>
+ mkdir /usr/local/lib/dmake
+ cp -r startup /usr/local/lib/dmake
+
+ or if you are in the MSDOS or Windows-95/NT world:
+
+ cd <dmake-distdir>
+ md \usr\local\lib\dmake
+ xcopy startup \usr\local\lib\dmake
+
+ and you are done Step 1.
+
+
+ Step 2:
+ -------
+ You must tell dmake where it is that you placed the "startup" subtree. If
+ the location is the directory that is pre-compiled into dmake then you
+ are done. If the directory where you copied the dmake subtree is not the
+ precompiled value you must either set the global environment variable
+ MAKESTARTUP to point at the new location of "startup/startup.mk" or you
+ must rebuild dmake with a new precompiled value of MAKESTARTUP. To do the
+ latter create the file:
+
+ src/startup.h
+
+ and make sure that it contains an entry similar to the following:
+
+ /* This file contains the default value of the MAKESTARTUP variable.
+ * You must set the quoted string below to the default path to the startup
+ * variable, so that it gets compiled in. LEAVE ROOTDIR at the front of
+ * the path. This allows the user to customize his environment for dmake
+ * by setting up a new ROOTDIR environment variable. */
+
+ "MAKESTARTUP := $(ROOTDIR)/usr/local/lib/dmake/startup/startup.mk",
+
+ (See src/msdos/startup.h for an example). Once set properly rerun your
+ previous build. In the rare instance that your compiler has broken
+ #include search rules, the shipped "startup.h" files are located in
+ architecture specific subdirectories as described in the file
+ "readme/srcorg".
+
+
+4. DMAKE SPECIFIC ENVIRONMENT VARIABLES
+
+ Once you have built dmake, the dmake startup directory contains the file
+ "config.mk". This file contains definitions corresponding to your installed
+ target environment for the variables:
+
+ OS - Specifies the flavour of operating system.
+ OSRELEASE - Specifies the particular version of the operating
+ system.
+ OSENVIRONMENT - An optional configuration parameter for the operating
+ system release.
+
+ Appropriate values for these variables are found in the
+
+ <install-dir>/startup/templates/<OS>/<OSRELEASE>/<OSENVIRONMENT>/template.mk
+
+ file. Select the OS, OSRELEASE, and OSENVIRONMENT that best suits your
+ setup (check readme.1st) for hints on selecting the most appropriate
+ settings.
+
+ These three variables are used to determine the correct dmake configuration
+ when dmake starts up, and loads its builtin definitions from the startup
+ subtree hierarchy. The only time you should have a need to change these
+ values or the contents of the startup subtree is when you wish to supply
+ your own customized default environment or you are building dmake for a
+ new as yet unsupported target environment.
+
+
+5. LOCALE SPECIFIC CONFIGURATION
+
+ Locale specific macro definitions that are not part of the predefined macro
+ set should be placed into the file "startup/local.mk". This ensures that
+ future dmake releases will not overwrite your prior definitions. We
+ guarantee that the file "startup/local.mk" will never be part of any future
+ dmake distribution.
+
+
diff --git a/dmake/readme/public/mac.txt b/dmake/readme/public/mac.txt
new file mode 100644
index 000000000000..34a2dca5f820
--- /dev/null
+++ b/dmake/readme/public/mac.txt
@@ -0,0 +1,43 @@
+MAC specific information for dmake. This information is provided in the
+hope that it makes it easier to install and recompile dmake in a MAC
+environment.
+
+
+1. ENVIRONMENT VARIABLE SETTINGS
+
+Only a single set of settings is available for the macintosh. There are no
+sub-selections for specific OS release and/or environment.
+
+ OS - mac
+ OSRELEASE - NULL
+ OSENVIRONMENT - NULL
+
+
+2. IMPLEMENTATION NOTES
+
+This port for the Macintosh is specifically designed to be run
+under MPW.
+
+I had to make a couple of changes to dmake in order to get it to work
+on the Mac. First, MPW provides no documented way to run a
+subprocess, so when you use dmake, you MUST use the -n option and
+execute the output. Typically, you will probably want to write a
+simple script file to do these operations for you.
+
+I added some code so that the Macintosh version of dmake can
+use UNIX-style directories to specify include paths and target
+and dependency file names. I.e., if you specify a file "/dir/file",
+dmake will look at the file "dir:file". However, Mac dmake does not
+do any translation from files specified by UNIX-style directories
+in the recipe line that gets executed. If you need to translate,
+you can use substitution commands. (For example,
+":$(RELATIVEUNIXFILE:s,/,:,)".) This code was added so one could
+execute dmake's makefile, and also so one would have an easier time
+porting other UNIX makefiles. I would suggest you stick with
+Macintosh-style directories for all other makefiles.
+
+In order to run dmake, you must set (and export) the environmental
+variable "OS" to "mac".
+
+Micah Doyle
+micah@leland.Stanford.EDU
diff --git a/dmake/readme/public/msdos.txt b/dmake/readme/public/msdos.txt
new file mode 100644
index 000000000000..72664843a644
--- /dev/null
+++ b/dmake/readme/public/msdos.txt
@@ -0,0 +1,124 @@
+MSDOS specific information for dmake. This information is provided in the
+hope that it makes it easier to install and recompile dmake under MSDOS.
+I will be happy to hear of erroneous information and will make every effort
+to correct it.
+
+NOTE: If you are seeking information for Win32 compiles please refer to
+ the file "readme/winnt".
+
+
+1. ENVIRONMENT VARIABLE SETTINGS
+
+There are many environment variable settings available for MSDOS. Each
+option is described below.
+
+ OS - msdos
+
+ OSRELEASE - borland # Borland compilers
+ - microsft # Microsoft compilers
+ - zortech # zortech compilers (unsupported)
+
+ OSENVIRONMENT - tcc20 # Borland Turbo C 2.0
+ - bcc30 # Borland C++ V3.0 MSDOS compile
+ - bcc40 # Borland C++ V4.0 MSDOS compile
+ - bcc45 # Borland C++ V4.5 MSDOS compile
+ - bcc50 # Borland C++ V5.0 MSDOS compile
+
+ - msc51 # Microsoft 5.1 Compiler MSDOS compile
+ - msc60 # Microsoft 6.0 Compiler MSDOS compile
+
+ MSC_VER - 5.1 # Microsoft Compiler version
+ - 6.0 # Microsoft Compiler version
+
+
+2. IMPLEMENTATION NOTES
+
+Bootstrapping the binary:
+-------------------------
+ A make.bat file is provided to bootstrap the binary. The file contains
+ several targets for bootstrapping. Invoking the batch file with no
+ arguments lists the possibilities shown below.
+
+ INDEX: You must specify one of:
+ tccswp - Turbo C 2.0 compile of swapping dmake.
+ bcc30swp - Borland C++ 3.0 compile of swapping dmake.
+ bcc40swp - Borland C++ 4.0 compile of swapping dmake.
+ bcc45swp - Borland C++ 4.5 compile of swapping dmake.
+ bcc50swp - Borland C++ 5.0 compile of swapping dmake.
+
+ msc51 - Microsoft C 5.1 compile.
+ msc51swp - Microsoft C 5.1, MASM 5.1 compile of swapping dmake.
+ msc60 - Microsoft C 6.0 compile.
+ msc60swp - Microsoft C 6.0, MASM 5.1 compile of swapping dmake.
+
+ Based on the compiler you have installed and whether or not you
+ want the swapping version of dmake, you should select the appropriate
+ target and issue 'make.bat target'.
+
+ The batch file runs a second batch script that comes with the distribution
+ which compiles the sources using the appropriate compiler and flags. The
+ MSC Versions of the batch files should not require any further user
+ intervention during the build. The Borland versions, as a final step,
+ invoke tlink with two response files. The second of these response files,
+ named in msdos/borland/{bcc*,tcc20}/mk*.bat, contains absolute path names to
+ Borland's libraries. You likely need to edit these before getting a
+ successful binary linked. The reason for this is that not all of us
+ install the Borland compiler in the same place.
+
+ Note that the file msdos/exec.uue is a uuencoded version of a BCC++
+ compiled exec.obj (from exec.asm). If you do not have an assembler
+ either microsoft MASM or Borland TASM (or some other), you can uudecode
+ this file and put it into src/objects/exec.obj. The build will then
+ link against it to build your binary.
+
+
+Using dmake to Make itself:
+---------------------------
+ See the file "readme/install" for information on building dmake by using
+ dmake itself. Once successfully built using the presupplied scripts it
+ should be straight forward to rebuild dmake.
+
+
+Memory Requirements and Swapping:
+---------------------------------
+ The swapping code currently only swaps to DISK, there are hooks
+ in the code to accomodate XMS and EMS, but have not been used (and
+ probably never will).
+
+ It appears that a ramdisk seems to work just fine. If anyone
+ wishes to fill in the hooks please do so and send us the differences.
+
+
+^C and stopping a make:
+-----------------------
+ Thanks to the efforts of Len Reed, appears to now work. I have been unable
+ to hang my machine if it's swapped out and I hit ^C a couple thousand times.
+
+
+Other notes:
+------------
+ dmake does not care if you are running command.com or some other command
+ interpretter, you must however specify the proper values of the environment
+ variables SHELL, SHELLFLAGS, GROUPSHELL, and GROUPFLAGS in order for things
+ to work correctly. Read the man page FIRST, if you still have trouble
+ then send email.
+
+ Group recipes under DOS that use command.com as the command interpretter
+ require you to set the GROUPSUFFIX macro.
+
+ As shipped the startup.mk files for the DOS version try to figure out what
+ command interpretter you are using and set things up appropriately.
+ Two command interpretters are supported in the shipped startup.mk file,
+ command.com, and the MKS Korn shell.
+
+ The dos version of dmake contains one builtin command. noop which
+ simply ignores the remainder of the line and always retuns success,
+
+ dmake supports the MKS argument passing conventions. The facility is
+ enabled by setting .MKSARGS:=1. It is set by default in the startup.mk file
+ if an MKS Korn shell is detected as being the active command interpretter.
+
+ At this time there are no plans to support the other popular UNIX like
+ argument passing conventions available under DOS. We recommend you get
+ a copy of the MKS Toolkit from Mortice Kern Systems in Waterloo, Ontario,
+ Canada [http://www.mks.com/].
diff --git a/dmake/readme/public/os2.txt b/dmake/readme/public/os2.txt
new file mode 100644
index 000000000000..5acf4cc6ab0a
--- /dev/null
+++ b/dmake/readme/public/os2.txt
@@ -0,0 +1,76 @@
+OS/2 specific information for dmake. This information is provided in the
+hope that it makes it easier to install and recompile dmake in a OS/2
+environment.
+
+Notes on the OS/2 implementation of dmake:
+==========================================
+
+As shipped the DOS versions of dmake will run under OS/2 protected mode.
+However, support for a full OS/2 version is also provided. The OS/2 version
+will run in parallel under OS/2.
+
+Bootstrapping the binary:
+-------------------------
+ A make.cmd file is provided to bootstrap the binary. The file contains
+ several targets for bootstrapping. Invoking the batch file with no
+ arguments lists the possibilities shown below.
+
+ INDEX: You must specify one of:
+ ibm - IBM C2 compile.
+
+ The only supported compiler under OS/2 is the Visual Age ICC compiler.
+ I have tested the build using this compiler. The resulting binary
+ performs proper directory caching and file-name case mapping for cached
+ directories and is capable of parallel target builds. The only known
+ limitation of the OS/2 implementation is the treatment of library time
+ stamps. Libraries do not have time stamps on members and the timestamp
+ of the library is used instead.
+
+
+OS/2 Specifics
+--------------
+
+ There is a small number of OS/2 specific features that need to be
+ stated.
+
+ 1. The environment variables TMP as well as TMPDIR are checked for the
+ location of the directory where dmake should place any temporary files.
+ TMPDIR is checked before TMP.
+
+ 2. Appropriate limits are setup for MAXPROCESSES and buffer sizes etc.
+ See output of 'dmake -V'.
+
+ 3. By default dmake will look for the startup.mk file in the path:
+
+ $(ROOTDIR)/dmake/startup/startup.mk
+
+ This is more in keeping with OS/2 philosophy. You may still rename
+ and put it anywhere else you like by defining the MAKESTARTUP
+ environment variable.
+
+ 4. Swapping the dmake binary to disk is not supported under OS/2.
+
+
+Other notes:
+------------
+ dmake does not care if you are running cmd.exe or some other command
+ interpretter, you must however specify the proper values of the environment
+ variables SHELL, SHELLFLAGS, GROUPSHELL, and GROUPFLAGS in order for things
+ to work correctly. Read the man page first.
+
+ Group recipes under OS/2 that use cmd.exe as the command interpretter
+ require you to set the GROUPSUFFIX macro.
+
+ As shipped the startup.mk files try to figure out what
+ command interpretter you are using and set things up appropriately.
+ Two command interpretters are supported in the shipped startup.mk file,
+ cmd.exe (via COMSPEC), and the MKS Korn shell.
+
+ dmake does not contain any builtin commands. It gets all commands it
+ executes from an external file system. It is therefore most useful if it
+ is used in conjunction with an environment similar to that provided by
+ the MKS Tool kit, or equivalent.
+
+ dmake now supports the MKS argument passing conventions. The facility is
+ enabled by setting .MKSARGS:=1 and is set by default in the startup.mk file
+ if an MKS Korn shell is detected as being the active command interpretter.
diff --git a/dmake/readme/public/qssl-qnx.txt b/dmake/readme/public/qssl-qnx.txt
new file mode 100644
index 000000000000..80fc8b56aa4d
--- /dev/null
+++ b/dmake/readme/public/qssl-qnx.txt
@@ -0,0 +1,5 @@
+QNX differs from UNIX only in that the library format is that of MSDOS and
+as such the normal stating of library members does not work. QNX versions of
+dmake stat the library instead of the members (as does the MSDOS
+implementation). Otherwise see the readme/unix file for further unix related
+information.
diff --git a/dmake/readme/public/srcorg.txt b/dmake/readme/public/srcorg.txt
new file mode 100644
index 000000000000..89ff914eec4b
--- /dev/null
+++ b/dmake/readme/public/srcorg.txt
@@ -0,0 +1,74 @@
+SOURCE CODE ORGANIZATION:
+-------------------------
+The source code is organized as follows:
+
+ dmake [source for all common functions]
+ |
+ |
+ ----------------------------
+ | | | | |
+ unix tos qnx os2 msdos [source for OS specific functions]
+ | | |
+ -------------------- | -------------------
+ | | | | | | |
+386ix bsd43 sysvr[134] | tccdos bccdos mscdos [source for OSRELEASE
+ | | | specific functions]
+ | --------- ------------------
+ | | | | | |
+ | ibm mscdos bcc30 bcc32 bcc40
+ |
+ |
+ |
+ --------
+ | |
+ uw vf [source for OSENVIRONMENT specific functions]
+
+
+Each of the directories (eg. bsd43, mscdos, tccdos, and sysvr3) contain source
+that is specific to that release of the OS (and possibly C-library)
+
+
+CREATING A NEW VERSION:
+-----------------------
+To create yet another version of dmake you should follow the following steps.
+
+The sysvr3 version as sent is the base version, all dmake versions must provide
+the equivalent of the functions defined in the sysvr3 directory, and MUST
+provide the same semantics (MSDOS archive lib searches are an exception since
+we cannot search libraries for timestamps in MSDOS, Actually the MKS version
+of dmake does this, I don't have the inclination to add this code though).
+
+1. Create a new directory for the version you will be making at the level
+ that is appropriate. If it is a new OS then add the dir at the top level,
+ if it is a new version of UNIX then add it below the unix directory.
+
+2. Copy the files from the unix and unix/sysvr3 directories to the new dir.
+ (Or from any other directory sub-tree that is more appropriate)
+
+3. Not all OS/OSRELEASE combinations are compatible so in order to make
+ dmake on each, the particular directory may contain C-source for functions
+ present in the SVID SysV R3 distribution which are used by dmake but are
+ not supplied by the C-library in the target system. For example the bsd43
+ directory contains source for tempnam.c since it is not provided with
+ the BSD C-library. Before writing a new version of the source file
+ check the other directories to see if one already exists.
+
+4. Under some systems the standard include files may be missing or incorrect.
+ eg. under BSD stdarg.h and string.h. If this is the case
+ you should create the proper .h file in the proper directory.
+ This works as expected as the compile line includes the flag -Idir
+ where dir is the configuration dir, (bsd43 for example) and any
+ standard include files will be searched for in dir before the compiler
+ looks in the normal places (if you have a sane compiler :-).
+
+5. Modify dmake.sh to contain the appropriate C compiler flags and link command
+ and to include any specific C files that you have had to add for this
+ version of dmake, and run the result through the shell.
+ (make the same changes to config.mk so that once you have a working copy of
+ dmake you can use it to bring itself up to date)
+
+6. Send me the changes :-) so that I can incorporate them into future
+ distributions.
+
+7. This should be all that you require to create a new version of dmake.
+ If you have any questions send e-mail to dvadura@plg.uwaterloo.ca
diff --git a/dmake/readme/public/tos.txt b/dmake/readme/public/tos.txt
new file mode 100644
index 000000000000..ddcc43104483
--- /dev/null
+++ b/dmake/readme/public/tos.txt
@@ -0,0 +1,31 @@
+Atari TOS specific information for dmake. This information is provided in the
+hope that it makes it easier to install and recompile dmake in a TOS
+environment. I do not own an ST. As a result I rely on others to insure that
+this version of dmake works as advertized. If you have any problems with it
+please fix them and send me the differences so that I can incorporate them
+into future releases and patches.
+
+
+1. ENVIRONMENT VARIABLE SETTINGS
+
+Only a single set of settings is available for Atari TOS. There are no
+sub-selections for specific OS release and/or environment.
+
+ OS - tos
+ OSRELEASE - NULL
+ OSENVIRONMENT - NULL
+
+
+2. IMPLEMENTATION NOTES
+
+The code to compile on an Atari-ST using GCC was supplied by Edgar Roeder
+(roeder@cs.uni-sb.de). I do not have an ST on which to verify the
+distribution sources but I have no reason to believe them to not work.
+If there are any problems please let Edgar or myself know.
+
+I know of no bugs or limitation to the Atari-ST implementation. Note that
+it is similar to the DOS version but it does not swap itself out. This does
+not appear to be as much of a problem on the Atari as it is on MSDOS boxes :-).
+See the msdos specific info file for further information.
+
+-dennis
diff --git a/dmake/readme/public/unix.txt b/dmake/readme/public/unix.txt
new file mode 100644
index 000000000000..b50ab9afad1c
--- /dev/null
+++ b/dmake/readme/public/unix.txt
@@ -0,0 +1,171 @@
+UNIX specific information for dmake. This information is provided in the
+hope that it makes it easier to install and recompile dmake under UNIX.
+I will be happy to hear of erroneous information and will make every effort
+to correct it.
+
+
+1. ENVIRONMENT VARIABLE SETTINGS
+
+There are many environment variable settings available for UNIX. Each
+option is described below.
+
+ OS - unix
+
+ OSRELEASE - bsd43 # generic BSD 4.3
+ - solaris # Solaris environments
+ - sysvr1 # System V R1
+ - sysvr3 # System V R3
+ - sysvr4 # System V R4
+ - xenix # Xenix
+ - 386ix # Sun IPX 386 boxen
+ - coherent # Coherent...
+ - qnx # QNX
+
+ OSENVIRONMENT - uw # U of Waterloo mfcf environment for BSD4.3
+ - vf # for environments needing vfprintf
+ - pwd # for environments needing new pwd
+ - gcc # for GCC compiles with Solaris2.3 and greater
+ - verxx # for specific OS versions.
+
+
+The table below lists valid combinations for settings of OS, OSRELEASE, and
+OSENVIRONMENT.
+
+ OS OSRELEASE OSENVIRONMENT
+ -- --------- -------------
+ unix bsd43
+ unix bsd43 uw
+ unix bsd43 vf
+ unix solaris
+ unix solaris gcc
+ unix sysvr1
+ unix sysvr3
+ unix sysvr3 pwd
+ unix sysvr4
+ unix xenix
+ unix xenix pwd
+ unix 386ix
+ unix coherent ver40
+ unix coherent ver42
+
+You must set OS and OSRELEASE, OSENVIRONMENT to correspond to one of the
+configurations in the above table.
+
+
+2. IMPLEMENTATION NOTES
+
+Bootstrapping the binary:
+-------------------------
+ A 'makefile' file is provided to bootstrap the binary. The file contains
+ many targets for bootstrapping. Issuing 'make' will provide the list of
+ possible targets that can be built. A restricted sample is shown below:
+
+ INDEX: You must specify 'make target' where target is one of:
+ -------------
+ make bsd43 - Generic BSD 4.3 System
+ make bsd43uw - Generic BSD 4.3 at U of Waterloo
+ make bsd43vf - Generic BSD 4.3 that needs vfprintf
+ make sysvr4 - Generic SysV R4 UNIX System
+ make sysvr3 - Generic SysV R3 UNIX System
+ make sysvr3pwd - Generic SysV R3 UNIX System, our PWD
+ make sysvr1 - Generic SysV R1 UNIX System
+ make dynix - Sequent DYNIX System
+ make linux - Linux
+ make ultrix - Ultrix 3.0 System
+ make mips - Any MIPS System
+ make coherent40 - Any Coherent Version 4.0 System
+ make coherent42 - Any Coherent Version 4.2 or greater System
+ make hpux - HP Unix
+ make 386ix - 386/ix (SysV R3) System
+ make xenix - 386 Xenix System
+ make xenixpwd - 386 Xenix System, our PWD
+ make aix - IBM RS6000/AIX System
+ make Solaris - SUN Solaris 1.0 to 2.0
+ make Solaris2.1 - SUN Solaris 2.1 or greater
+ make gccSolaris2.1 - SUN Solaris 2.1 or greater with gcc
+
+ The above shows only the possible builds for UNIX like operating systems.
+ Choose the one that best suits your needs and issue the command
+
+ 'make target'
+
+
+Using dmake to Make itself:
+---------------------------
+ If you use dmake to make itself you must first set a number of makefile
+ control variables, either through the environment or on the command line.
+
+ The following variables must be set:
+
+ OS - defines operating system (must be set)
+ OSRELEASE - particular version of it.
+ OSENVIRNOMENT - more customization
+
+ These three variables should be defined in your environment. Valid values
+ for UNIX are listed above in Section 1. You must chose one a setting from
+ the table that best matches your system.
+
+ Once set simply issue the command: 'dmake' and the sources will be
+ automatically rebuilt. You do not need to specify a target when you
+ use dmake and the environment variables are correctly set.
+
+
+.NAMEMAX and length of file names:
+----------------------------------
+dmake assumes that no file name component has a name longer than .NAMEMAX
+(a user-settable variable, see the man page). Files whose basename is
+longer than .NAMEMAX return a timestamp of 0 when statted. The reason for
+this test is to handle broken versions of stat that return non-zero times
+for stating files that are longer than the legal file name length but for
+which a file whose name is the legal maximum file name length and is a prefix
+of the longer name exists. This used to cause infinite loops in the inference
+engine.
+
+As a result the value of .NAMEMAX is important. dmake attempts to determine
+it at from your system header files when compiled however sometimes even these
+may be erroneous thus as a result as of dmake 4.0 users may set the value of
+.NAMEMAX to any value they wish.
+
+
+Library Name Length:
+--------------------
+By default the maximum length of library member names is defined in the the
+ar.h header file and is usually 14. Elf libraries allow for a arbitrarily
+long member names, if your archiver supports the elf archiver extension for
+long member names then edit the file unix/arlib.c and set the CHECKELF define
+to indicate that the Elf archiver extension is to be checked for.
+
+If Elf is not supported and your archiver truncates member names you should
+set (in unix/arlib.c) the macro AR_TRUNCATE_MEMBER_NAMES. dmake will then
+also truncate member names and perform a length limitted comparison when
+scanning the library for matching member names.
+
+
+UNIX Sysv R3 and getcwd:
+------------------------
+Some versions of UNIX SysV R3 and Xenix use the popen call to capture the
+output of pwd when invoking the C library function getcwd(). These versions
+of the function cause dmake to terminate with the "lost a child" message
+due to the fact that the parent dmake process may catch the pwd and not
+recognize it as a child. For systems that have this problem use the version
+of dmake that supplies its own getcwd function. The settings are:
+
+ OS = unix
+ OSRELEASE = sysvr3
+ OSENVIRONMENT = pwd
+
+It is directly available through the 'makefile' by typing one of:
+
+ make sysvr3pwd
+ make xenixpwd
+
+both include the getcwd code but the xenixpwd target compiles for a Xenix
+system.
+
+
+UNIX and "limits.h":
+--------------------
+Some compilers do not yet provide the "limits.h" file, if yours is one of
+these then simply copy the file "namemax.h" in the source root directory to
+"limits.h". Make sure the length of a file name is correctly set in
+"limits.h" as it is processed prior to "namemax.h".
diff --git a/dmake/readme/read1st.txt b/dmake/readme/read1st.txt
new file mode 100644
index 000000000000..1ff1229e6b32
--- /dev/null
+++ b/dmake/readme/read1st.txt
@@ -0,0 +1,58 @@
+DMAKE 4.12
+==========
+
+This directory tree contains a number of files. Here is a short
+description of what each file contains so that you do not need to
+search as much. There is also a recommended order for reading them.
+
+ read1st.txt - This file; generic information.
+ intro.txt - Short note describing what 'dmake' is and where to
+ get it from.
+ release.txt - Changes of previous releases, and release specific
+ notes. (Not longer continued.)
+ ../NEWS - Changes from previous release. (Continuation of
+ release.txt.)
+ ../man/ - directory containing DMAKE manual page.
+
+ public/ - Old build and installation instructions
+ for the Dmake 4.1 public release. As of Dmake 4.2
+ dmake switched to an autotools based build system
+ and these instructions are not longer valid for
+ operating systems that are supported by the autotools
+ system.
+ If you are on a system that is not supported you
+ might still find some useful information there.
+
+Building Dmake
+==============
+
+With autotools
+--------------
+Building dmake on systems that are supported by the autotools build system
+only requires the usual "./configure && make && make install" command.
+The configure command will notify you when your platform is not supported.
+
+With Microsoft C++ compiler
+---------------------------
+For MS Visual C++ 6 and up run "make.bat win95-vpp40" in a command shell.
+This should create a dmake.exe in the top-level directory.
+
+It is possible to rename this to, say, dmake0.exe, delete the objects/
+sub-directory and then simply run "dmake0.exe" to build a new dmake.exe.
+Note that it is not necessary to have dmake rebuild itself in this way,
+but it is a nice test that your new dmake is working to see that it can.
+
+To install dmake, simply copy dmake.exe and the startup/ sub-directory to
+a directory of your choice. You may also want to copy the man/
+sub-directory for future access to the manual page.
+
+
+All other systems might look in the public/ directory for usefull hints.
+
+
+The original sources of dmake were available on http://dmake.wticorp.com.
+This site has not been reachable for some time and the source is hosted
+in the OpenOffice.org http://www.openoffice.org/ cvs now. You can view
+the source at: http://tools.openoffice.org/source/browse/tools/dmake.
+Please send questions regarding dmake to the tools project mailing list
+at dev@tools.openoffice.org.
diff --git a/dmake/readme/release.txt b/dmake/readme/release.txt
new file mode 100644
index 000000000000..41b95097679c
--- /dev/null
+++ b/dmake/readme/release.txt
@@ -0,0 +1,196 @@
+This file is superseded/continued by the toplevel NEWS file.
+
+DMAKE Version 4.1
+=================
+FINAL FREE RELEASE OF DMAKE, REPLACES VERSION 4.0
+
+Nature: This distribution advances dmake to Version 4.1, patch level 0.
+------- This release adds significant functionality and eliminates
+ bugs that were introduced with release 4.0.
+
+
+DETAILS OF ENHANCEMENTS/TWEAKS:
+===============================
+
+BUG FIXES:
+----------
+
+1. General clean up all over to fix small incompatibilities and obvious
+ typos.
+
+2. Fixed bug in getinp.c where buffer was being erroneously overwritten,
+ this caused the invalidation of the return address on the stack on
+ DOS systems.
+
+3. Fixed a bug that caused the "<target> is up to date" message to be
+ suppressed.
+
+4. Fixed a bug involving the value of $@ in conjunction with dynamic
+ prerequisites.
+
+5. Relegated the warning associated with duplicate entries in prerequisite
+ lists to a non-essential warning. Added an option flag -Vw to display
+ it if you wish to check your makefile for duplicate entries. Either way
+ the parser ignores duplicates.
+
+6. Better default action on checking out RCS targets. If an RCS target has
+ no directory prefix of its own it is checked out into the directory
+ which contains the RCS subdirectory, otherwise it ends up in its directory
+ qualified location.
+
+7. Improved the speed of lookups in the directory cache; handle mixed case
+ file name entries on OS/2 and Win95/NT.
+
+8. Improved prerequisite list generation for long prerequisite lists.
+
+9. Rearanged startup macro files to form an architectural hierarchy.
+ This greatly simplifies the maintenance of the startup files. They
+ might even be right at some point in the future. Please let me know if
+ you encounter difficulties, as I don't have access to all possible
+ platforms, this sub-hierarchy is bound to have ommisions at this release
+ and hence is intended to be evolutionary over time.
+
+10. A build that only touches targets (-t) uses the same algorithm to decide
+ valid names as a normal build.
+
+11. Conditional macro assignments fixed, and now work for builtin macro
+ variables as well.
+
+
+NEW FEATURES:
+-------------
+
+0. Complete reorganization of Dmake STARTUP scripts. Please refer to the
+ installation notes for details. THIS ONE IS IMPORTANT!!!
+
+1. Support for long archive member names if Elf is available, plus better
+ support for archivers that truncate member names (see comments in
+ unix/arlib.c for details).
+
+2. Added variable MAKEVERSION which contains a string indicating the current
+ version of dmake.
+
+3. Added the .EXECUTE attribute, see man page for details.
+
+4. Added the .ERRREMOVE attribute, see man page for details.
+
+5. Added support for gmake style if/else/endif, but only if not part of
+ a Group recipe.
+
+6. Added initial build target for Coherent version 4.2 UNIX
+ and for Windows-NT/Windows-95 32-bit app using Borland C++ 4.0,4.5, 5.0,
+ and Microsoft Visual C++ 4.0.
+
+7. MSDOS version now supports two builtin runtime commands, noop, and echo.
+
+8. Added new macro $(uniq list) which returns a sorted version of the
+ white space separated tokens in list such that there are no repetitions.
+
+9. Added the function macro $(echo list) which simply returns list.
+ This is most useful in conjunction with the new $(foreach ...)
+ function macro.
+
+10. Added gmake style function macro
+
+ $(foreach,var,list data)
+
+ where var and list are expanded, and the result is the concatenation of
+ expanding data with var being set to each white space separated token in
+ list in turn. For example:
+
+ list = a b c
+ all :
+ echo [$(foreach,i,$(list) [$i])]
+
+ will output
+
+ [[a] [b] [c]]
+
+ The iterator variable is defined as a local variable to this foreach
+ instance. The following expression illustrates this:
+
+ $(foreach,i,$(foreach,i,$(sort c a b) root/$i) [$i/f.h])
+
+ when evaluated the result is:
+
+ [root/a/f.h] [root/b/f.h] [root/c/f.h]
+
+ The specification of list must be a valid macro expression, such as:
+
+ $($(assign list=a b c))
+ $(sort d a b c)
+ $(echo a b c)
+
+ and cannot just be the list itself. That is, the following foreach
+ expression:
+
+ $(foreach,i,a b c [$i])
+
+ yields:
+
+ "b c [a]"
+
+ when evaluated.
+
+11. Added the macro $(and list).
+
+12. Added the macro $(or list).
+
+13. Added the macro $(not term).
+
+14. Added the .NOINFER attribute to the .INCLUDE directive. When specified
+ any prerequisite of the .INCLUDE directive which cannot be found in
+ the .INCLUDEDIRS search list is not automatically made.
+
+15. Improved the handling of internal macros for proper functioning of the *=
+ and *:= assignment constructs. Macros that are internally initially
+ defined are considered to be undefined for the purpose of *= and *:=
+ assignment until they are the target of an explicit assignment operation.
+
+16. Improved the caching of file names, and their matching on case insensitive
+ file systems. Two control macros help to manage the functionality:
+
+ .DIRCACHE := yes
+
+ Implies that the directory cache will be used. This is on by default for
+ systems that support the reading of directories. Setting the value of this
+ macro to 'no' is equivalent to supplying the '-d' command line switch.
+
+ .DIRCACHERESPCASE := yes
+
+ Causes dmake to respect the case of the directory entries when the cache
+ is enabled, thereby treating directory entries in a case sensitive manner.
+ Setting this to 'no' disables the matching of case. This macro has effect
+ only if .DIRCACHE := yes. Otherwise the facilities provided by the native
+ OS are used to match file names using 'stat'.
+
+17. Added parameterized user defined function macros. Yes it's true
+ you may now define your own parametized function macros. Here is
+ how it works. Any macro that is not a predefined function macro and
+ is invoked with parameters is looked up as a user defined function
+ macro. A new macro scope is created. The n'th argument to the
+ macro is then assigned to the value of the the macro $n where n is 0
+ for the first argument, 1 for the second argument and so on. The
+ argument is expanded before it is assigned. The original macro is
+ then expanded. For example:
+
+ FOO = a $0 b $1 c $2 d
+ echo :; $(FOO x y z)
+
+ Will produce the result string "a z b y c z d". The
+ expansion of $(FOO) on it's own behaves as expected and returns the
+ string "a b c d" (assuming that each of $0, $1, $2
+ are undefined). The only restriction when specifying function
+ macro arguments is as before: they cannot contain spaces
+ themselves.
+
+
+ACKNOWLEDGEMENTS:
+=================
+ Thanks to all who submitted code for new features, suggestions for
+ improvements, and bug fixes. I have tried to make sure no gotchas
+ remain, if you encounter problems installing or running dmake please
+ let me know. As always, I am always happy to receive e-mail.
+
+ Many have contributed suggestions and bug fixes that make this
+ release possible. The NET thanks you.
diff --git a/dmake/rulparse.c b/dmake/rulparse.c
new file mode 100644
index 000000000000..471c83577d18
--- /dev/null
+++ b/dmake/rulparse.c
@@ -0,0 +1,1734 @@
+/* $RCSfile: rulparse.c,v $
+-- $Revision: 1.12 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:41:24 $
+--
+-- SYNOPSIS
+-- Perform semantic analysis on input
+--
+-- DESCRIPTION
+-- This code performs semantic analysis on the input, and builds
+-- the complex internal datastructure that is used to represent
+-- the user makefile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+/* prototypes for local functions */
+static void _add_indirect_prereq ANSI((CELLPTR));
+static int _add_root ANSI((CELLPTR));
+static CELLPTR _build_graph ANSI((int, CELLPTR, CELLPTR));
+static char* _build_meta ANSI((char*));
+static int _do_magic ANSI((int, char*, CELLPTR, CELLPTR, t_attr, char*));
+static void _do_special ANSI((int, int, t_attr,char*,CELLPTR,CELLPTR,int*));
+static int _do_targets ANSI((int, t_attr, char*, CELLPTR, CELLPTR));
+static t_attr _is_attribute ANSI((char*));
+static int _is_special ANSI((char*));
+static char* _is_magic ANSI((char*));
+static int _is_percent ANSI((char*));
+static CELLPTR _make_multi ANSI((CELLPTR));
+static CELLPTR _replace_cell ANSI((CELLPTR,CELLPTR,CELLPTR));
+static void _set_attributes ANSI((t_attr, char*, CELLPTR ));
+static void _stick_at_head ANSI((CELLPTR, CELLPTR));
+static void _set_global_attr ANSI((t_attr));
+
+
+/* static variables that must persist across invocation of Parse_rule_def */
+static CELLPTR _sv_targets = NIL(CELL);
+static STRINGPTR _sv_rules = NIL(STRING); /* first recipe element. */
+static STRINGPTR _sv_crule = NIL(STRING); /* current/last recipe element. */
+static CELLPTR _sv_edgel = NIL(CELL);
+static LINKPTR _sv_ind_prq = NIL(LINK); /* indirect prerequisites for % cell */
+static int _sp_target = FALSE;
+static t_attr _sv_attr;
+static int _sv_flag;
+static int _sv_op;
+static char *_sv_setdir;
+static char _sv_globprq_only = 0;
+
+/* Define for global attribute mask (A_SWAP == A_WINPATH) */
+#define A_GLOB (A_PRECIOUS | A_SILENT | A_IGNORE | A_EPILOG | A_SWAP |\
+ A_SHELL | A_PROLOG | A_NOINFER | A_SEQ | A_MKSARGS )
+
+
+PUBLIC int
+Parse_rule_def( state )/*
+=========================
+ Parse the rule definition contained in Buffer, and modify the state
+ if appropriate. The function returns 0, if the definition is found to
+ be an illegal rule definition, and it returns 1 if it is a rule definition.
+ */
+int *state;
+{
+ TKSTR input; /* input string struct for token search */
+ CELLPTR targets; /* list of targets if any */
+ CELLPTR prereq; /* list of prereq if any */
+ CELLPTR prereqtail; /* tail of prerequisite list */
+ CELLPTR cp; /* temporary cell pointer for list making */
+ char *result; /* temporary storage for result */
+ char *tok; /* temporary pointer for tokens */
+ char *set_dir; /* value of setdir attribute */
+ char *brk; /* break char list for Get_token */
+ char *firstrcp; /* first recipe line, from ; in rule line */
+ t_attr attr; /* sum of attribute flags for current tgts*/
+ t_attr at; /* temp place to keep an attribute code */
+ int op; /* rule operator */
+ int special; /* indicate special targets in rule */
+ int augmeta; /* indicate .<suffix> like target */
+ int percent; /* indicate percent rule target */
+ int percent_prq; /* indicate mixed %-rule prereq possible */
+
+ DB_ENTER( "Parse_rule_def" );
+
+ op = 0;
+ attr = 0;
+ special = 0;
+ augmeta = 0;
+ percent = 0;
+ set_dir = NIL( char );
+ targets = NIL(CELL);
+ prereq = NIL(CELL);
+ prereqtail = NIL(CELL);
+ percent_prq = 0;
+
+ /* Check to see if the line is of the form:
+ * targets : prerequisites; first recipe line
+ * If so remember the first_recipe part of the line. */
+
+ firstrcp = strchr( Buffer, ';' );
+ if( firstrcp != NIL( char ) ) {
+ *firstrcp++ = 0;
+ firstrcp = DmStrSpn( firstrcp, " \t" );
+ }
+
+ result = Expand( Buffer );
+ /* Remove CONTINUATION_CHAR, keep the <nl> */
+ for( brk=strchr(result,CONTINUATION_CHAR); brk != NIL(char); brk=strchr(brk,CONTINUATION_CHAR) )
+ if( brk[1] == '\n' )
+ *brk = ' ';
+ else
+ brk++;
+
+ DB_PRINT( "par", ("Scanning: [%s]", result) );
+
+ SET_TOKEN( &input, result );
+ brk = ":-^!|";
+ Def_targets = TRUE;
+
+ /* Scan the input rule line collecting targets, the operator, and any
+ * prerequisites. Stop when we run out of targets and prerequisites. */
+
+ while( *(tok = Get_token( &input, brk, TRUE )) != '\0' )
+ if( !op ) {
+ /* we are scanning targets and attributes
+ * check to see if token is an operator. */
+
+ op = Rule_op( tok );
+
+ if( !op ) {
+ /* Define a new cell, or get pointer to pre-existing cell. */
+ /* Do we need cells for attributes? If not move the definition
+ * to the target part. */
+ cp = Def_cell( tok );
+ /* A $ character indicates either a literal $ in the pathname (this
+ * was broken before) or a dynamic macro (this is a syntax error).
+ * FIXME: Here would be the place to add a sanity check. */
+ DB_PRINT( "par", ("tg_cell [%s]", tok) );
+
+ if( (at = _is_attribute(tok)) != 0 ) {
+ /* Ignore .SILENT when -vr is active. */
+ if( (Verbose & V_FORCEECHO) && (at == A_SILENT) )
+ at = 0;
+
+ /* Logically OR the attributes specified into one main
+ * ATTRIBUTE mask. */
+
+ if( at == A_SETDIR ) {
+ if( set_dir != NIL( char ) )
+ Warning( "Multiple .SETDIR attribute ignored" );
+ else
+ set_dir = DmStrDup( tok );
+ }
+
+ attr |= at;
+ }
+ else {
+ /* Not an attribute, this must be a target. */
+ int tmp;
+
+ tmp = _is_special( tok );
+
+ if( _is_percent( tok ) ) {
+ /* First %-target checks if there were non-%-targets before. */
+ if( !percent && targets != NIL(CELL) )
+ Fatal( "A %%-target must not be mixed with non-%%-targets, offending target [%s]", tok );
+
+ percent++;
+ cp->ce_flag |= F_PERCENT;
+ } else {
+ if( percent )
+ Fatal( "A non-%%-target must not be mixed with %%-targets, offending target [%s]", tok );
+ }
+
+ if( _is_magic( tok ) ) {
+ /* Check that AUGMAKE targets are not mixed with other
+ * targets. The return value of _is_magic() is discarded and
+ * calculated again in _do_targets() if this rule definition
+ * really is a .<suffix> like target.
+ * If we would allow only one target per line we could easily
+ * store the result for later, but for multiple .<suffix>
+ * targets this creates too much overhead.
+ * These targets should be rare (obsolete?) anyway. */
+ if( !augmeta && targets != NIL(CELL) )
+ Fatal( "An AUGMAKE meta target must not be mixed with non AUGMAKE meta targets, offending target [%s]", tok );
+
+ augmeta++;
+ cp->ce_flag |= F_MAGIC; /* do_magic will also add F_PERCENT later. */
+ } else {
+ if( augmeta )
+ Fatal( "A non AUGMAKE meta target must not be mixed with AUGMAKE meta targets, offending target [%s]", tok );
+ }
+
+ if( special )
+ Fatal( "Special target must appear alone, found [%s]", tok );
+ else if( !(cp->ce_flag & F_MARK) ) {
+ /* Targets are kept in this list in lexically sorted order.
+ * This allows for easy equality comparison of target
+ * sets.*/
+ CELLPTR prev,cur;
+ for(prev=NIL(CELL),cur=targets;cur;prev=cur,cur=cur->ce_link)
+ if(strcmp(cur->CE_NAME,cp->CE_NAME) > 0)
+ break;
+
+ cp->ce_link = cur;
+
+ if (!prev)
+ targets = cp;
+ else
+ prev->ce_link = cp;
+
+ cp->ce_flag |= F_MARK | F_EXPLICIT;
+ special = tmp;
+ }
+ else
+ Warning( "Duplicate target [%s]", cp->CE_NAME );
+ }
+ }
+ else {
+ /* found an operator so empty out break list and clear mark
+ * bits on target list, setting them all to F_VISITED*/
+
+ brk = "";
+ for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) {
+ cp->ce_flag ^= F_MARK;
+ cp->ce_flag |= F_VISITED;
+ }
+
+ Def_targets = FALSE;
+ }
+ }
+ else {
+ /* Scanning prerequisites so build the prerequisite list. We use
+ * F_MARK flag to make certain we have only a single copy of the
+ * prerequisite in the list */
+
+ cp = Def_cell( tok );
+
+ /* %-prerequisits require eiter a %-target or this might be a rule of
+ * the "ATTRIBUTE_LIST : targets" form. */
+ if( _is_percent( tok ) ) {
+ if( percent || ((targets == NIL(CELL)) && attr) )
+ percent_prq = 1;
+ else
+ Fatal( "Syntax error in %% rule, missing %% target");
+ }
+
+ if( cp->ce_flag & F_VISITED ) {
+ if( cp->ce_attr & A_COMPOSITE )
+ continue;
+ else
+ Fatal( "Detected circular dependency in graph at [%s]",
+ cp->CE_NAME );
+ }
+ else if( !(cp->ce_flag & F_MARK) ) {
+ DB_PRINT( "par", ("pq_cell [%s]", tok) );
+ cp->ce_flag |= F_MARK;
+
+ if( prereqtail == NIL(CELL) ) /* keep prereq's in order */
+ prereq = cp;
+ else
+ prereqtail->ce_link = cp;
+
+ prereqtail = cp;
+ cp->ce_link = NIL(CELL);
+ }
+ else if( !(cp->ce_attr & A_LIBRARY) && (Verbose & V_WARNALL))
+ Warning("Duplicate entry [%s] in prerequisite list",cp->CE_NAME);
+ }
+
+ /* Check to see if we have a percent rule that has only global
+ * prerequisites, i.e. they are of the form: "%.a : foo".
+ * If so then set the flag so that later on, we don't issue
+ * an error if such targets supply an empty set of rules. */
+
+ if( percent && !percent_prq && (prereq != NIL(CELL)) )
+ _sv_globprq_only = 1;
+
+ /* It's ok to have targets with attributes, and no prerequisites, but it's
+ * not ok to have no targets and no attributes, or no operator */
+
+ if( !op ) {
+ CLEAR_TOKEN( &input );
+ DB_PRINT( "par", ("Not a rule [%s]", Buffer) );
+ DB_RETURN( 0 );
+ }
+
+ /* More than one percent target didn't work with prior versions. */
+ if( (percent > 1) && !(op & R_OP_OR) )
+ Warning( "Prior to dmake 4.5 only one\n"
+ "%%-target per target-definition worked reliably. Check your makefiles.\n" );
+
+ if( !attr && targets == NIL(CELL) ) {
+ Fatal( "Missing targets or attributes in rule" );
+ if( set_dir != NIL( char )) FREE( set_dir );
+ DB_RETURN( 0 );
+ }
+
+ /* We have established we have a legal rules line, so we must process it.
+ * In doing so we must handle any special targets. Special targets must
+ * appear alone possibly accompanied by attributes.
+ * NOTE: special != 0 ==> targets != NIL(CELL) */
+
+ if( prereqtail != NIL(CELL) ) prereqtail->ce_link = NIL(CELL);
+
+ /* Clear out MARK bits used in duplicate checking. I originally wanted
+ * to do this as the lists get processed but that got too error prone
+ * so I bit the bullit and added these two loops. */
+
+ for( cp=prereq; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_MARK;
+ for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_VISITED;
+
+ /* Check to see if the previous recipe was bound, if not the call
+ * Bind_rules_to_targets() to bind the recipe (_sv_rules) to the
+ * target(s) (_sv_targets). */
+ /* was: if( _sv_rules != NIL(STRING) ) Bind_rules_to_targets( F_DEFAULT );*/
+ /* Only Add_recipe_to_list() sets _sv_rules and Bind_rules_to_targets()
+ * clears the (static) variables again. Bind_rules_to_targets() is
+ * (should be) called after State is leaving RULE_SCAN in Parse().
+ * Abort if there are unbound recipes. FIXME: Remove this paragraph
+ * if this never occurs. */
+ if( _sv_rules != NIL(STRING) )
+ Fatal( "Internal Error: _sv_rules not empty." );
+
+ /* Add the first recipe line to the list */
+ if( firstrcp != NIL( char ) )
+ Add_recipe_to_list( firstrcp, TRUE, FALSE );
+
+ /* Save these prior to calling _do_targets, since _build_graph needs the
+ * _sv_setdir value for matching edges. */
+ _sv_op = op;
+ _sv_setdir = set_dir;
+
+ if( special )
+ /* _do_special() can alter *state */
+ _do_special( special, op, attr, set_dir, targets, prereq, state );
+ else
+ *state = _do_targets( op, attr, set_dir, targets, prereq );
+
+ if( (*state != RULE_SCAN) && (_sv_rules != NIL(STRING)) )
+ Fatal( "Unexpected recipe found." );
+
+ DB_RETURN( 1 );
+}
+
+
+PUBLIC int
+Rule_op( op )/*
+================
+ Check the passed in op string and map it to one of the rule operators */
+char *op;
+{
+ int ret = 0;
+
+ DB_ENTER( "rule_op" );
+
+ if( *op == TGT_DEP_SEP ) {
+ ret = R_OP_CL;
+ op++;
+
+ /* All rule operations begin with a :, but may include any one of the
+ * four modifiers. In order for the rule to be properly mapped we must
+ * check for each of the modifiers in turn, building up our return bit
+ * string. */
+
+ while( *op && ret )
+ switch( *op ) {
+ case ':': ret |= R_OP_DCL; op++; break;
+ case '!': ret |= R_OP_BG; op++; break;
+ case '^': ret |= R_OP_UP; op++; break;
+ case '-': ret |= R_OP_MI; op++; break;
+ case '|': ret |= R_OP_OR; op++; break;
+
+ default : ret = 0; /* an invalid modifier, chuck whole string */
+ }
+
+ if( *op != '\0' ) ret = 0;
+ }
+
+ DB_RETURN( ret );
+}
+
+
+PUBLIC void
+Add_recipe_to_list( rule, white_too, no_check )/*
+=================================================
+ Take the provided string and add it to the list of recipe lines
+ we are saving to be added to the list of targets we have built
+ previously. If white_too == TRUE add the rule EVEN IF it contains only
+ an empty string (whitespace is handled by Def_recipe()). */
+char *rule;
+int white_too;
+int no_check;
+{
+ DB_ENTER( "Add_recipe_to_list" );
+
+ if( rule != NIL( char ) && (*rule != '\0' || white_too) ) {
+ DB_PRINT( "par", ("Adding recipe [%s]", rule) );
+ _sv_crule = Def_recipe( rule, _sv_crule, white_too, no_check );
+
+ /* If _sv_rules is not yet set this must be the first recipe line,
+ * remember it. */
+ if( _sv_rules == NIL(STRING) )
+ _sv_rules = _sv_crule;
+ }
+
+ DB_VOID_RETURN;
+}
+
+
+PUBLIC void
+Bind_rules_to_targets( flag )/*
+===============================
+ Take the recipe lines we have defined and bind them with proper attributes
+ to the targets that were previously defined in the parse. The
+ attributes that get passed here are merged with those that are were
+ previously defined. (namely attribute F_SINGLE) */
+int flag;
+{
+ CELLPTR tg; /* pointer to current target in list */
+ LINKPTR lp; /* pointer to link cell */
+ int magic; /* TRUE if target of % or .xxx.yyy form */
+ int tflag; /* TRUE if we assigned targets here */
+
+ DB_ENTER( "Bind_rules_to_targets" );
+
+ /* This line is needed since Parse may call us twice when the last
+ * GROUP rule appears at the end of file. In this case the rules
+ * have already been bound and we want to ignore them. */
+
+ if( _sv_targets == NIL(CELL) ) { DB_VOID_RETURN; }
+
+ tflag = FALSE;
+ flag |= (_sv_flag & F_SINGLE);
+ flag |= ((_sv_attr & A_GROUP) ? F_GROUP : 0);
+
+ for( tg = _sv_targets; tg != NIL(CELL); tg = tg->ce_link ) {
+ DB_PRINT( "par", ("Binding to %s, %04x", tg->CE_NAME, tg->ce_flag) );
+ magic = tg->ce_flag & F_PERCENT;
+
+
+ /* NOTE: For targets that are magic or special we ignore any
+ * previously defined rules, ie. We throw away the old definition
+ * and use the new, otherwise we complain. */
+ if( !(tg->ce_flag & F_MULTI) && !magic && (tg->CE_RECIPE != NIL(STRING))
+ && !_sp_target && (_sv_rules != NIL(STRING)) )
+ Fatal( "Multiply defined recipe for target %s", tg->CE_NAME );
+
+ if( (magic || _sp_target) && (_sv_rules == NIL(STRING)) &&
+ !(tg->ce_flag & F_SPECIAL) && !_sv_globprq_only )
+ Warning( "Empty recipe for special or meta target %s", tg->CE_NAME );
+
+ if( magic ) {
+ CELLPTR ep;
+
+ for( ep=_sv_edgel; ep != NIL(CELL); ep=ep->ce_link ) {
+ DB_PRINT( "par", ("ep address: %#x", ep) );
+ /* %.xx :| '%.yy' abc xx '%.tt' ; touch $@
+ * loops here ... */
+ _set_attributes( _sv_attr, _sv_setdir, ep );
+ ep->ce_flag |= (F_TARGET|flag);
+
+ if( _sv_rules != NIL(STRING) ) {
+ ep->ce_recipe = _sv_rules;
+ ep->ce_indprq = _sv_ind_prq;
+ }
+ }
+ }
+ else {
+ tg->ce_attr |= _sv_attr;
+ tg->ce_flag |= flag;
+
+ if( _sv_rules != NIL(STRING) ) {
+ tg->ce_recipe = _sv_rules;
+ tg->ce_flag |= F_RULES | F_TARGET;
+
+ /* Bind the current set of prerequisites as belonging to the
+ * original recipe given for the target */
+ for( lp=tg->ce_prq; lp != NIL(LINK); lp = lp->cl_next )
+ if( !(lp->cl_flag & F_VISITED) ) lp->cl_flag |= F_TARGET;
+ }
+ else for( lp=tg->ce_prq; lp != NIL(LINK); lp = lp->cl_next )
+ lp->cl_flag |= F_VISITED;
+ }
+
+ tflag |= _add_root(tg);
+ }
+
+ if( tflag ) Target = TRUE;
+ if( _sv_setdir ) FREE(_sv_setdir);
+ _sv_rules = NIL(STRING);
+ _sv_crule = NIL(STRING);
+ _sv_targets = NIL(CELL);
+ _sv_ind_prq = NIL(LINK);
+ _sv_edgel = NIL(CELL);
+ _sp_target = FALSE;
+ _sv_globprq_only = 0;
+
+ DB_VOID_RETURN;
+}
+
+
+
+PUBLIC int
+Set_group_attributes( list )/*
+==============================
+ Scan list looking for the standard @,-,% and + (as in recipe line
+ defs) (+ is set but ignored for group recipes)
+ and set the flags accordingly so that they apply when we bind the
+ rules to the appropriate targets.
+ Return TRUE if group recipe start '[' was found, otherwise FALSE. */
+char *list;
+{
+ int res = FALSE;
+ char *s;
+
+ if ( !((_sv_attr|Glob_attr)&A_IGNOREGROUP) ) {
+ s = DmStrSpn(list,"@-%+ \t");
+ res = (*s == '[');
+ if( res ) {
+ /* Check for non-white space characters after the [. */
+ for( s++; *s && iswhite(*s) ; s++ )
+ ;
+ if( *s )
+ Warning("Found non-white space character after '[' in [%s].", list);
+
+ _sv_attr |= Rcp_attribute(list);
+ }
+ }
+
+ return(res);
+}
+
+
+static void
+_do_special( special, op, attr, set_dir, target, prereq, state )/*
+==================================================================
+ Process a special target (always only a single target). So far the only
+ special targets we have are those recognized by the _is_special function.
+ Some of the special targets can take recipes, they call _do_targets()
+ and (implicitly) set *state to to RULE_SCAN. Otherwise *state remains
+ unaffected, i.e. NORMAL_SCAN.
+
+ target is always only a single special target.
+
+ NOTE: For the cases of .IMPORT, and .INCLUDE, the cells created by the
+ parser are never freed. This is due to the fact that it is too much
+ trouble to get them out of the hash table once they are defined, and
+ if they are per chance used again it will be ok, anyway, since the
+ cell is not really used by the code below. */
+
+int special;
+int op;
+t_attr attr;
+char *set_dir;
+CELLPTR target;
+CELLPTR prereq;
+int *state;
+{
+ HASHPTR hp; /* pointer to macro def cell */
+ CELLPTR cp; /* temporary pointer into cells list */
+ CELLPTR dp; /* pointer to directory dir cell */
+ LINKPTR lp; /* pointer at prerequisite list */
+ char *dir; /* current dir to prepend */
+ char *path; /* resulting path to try to read */
+ char *name; /* File name for processing a .INCLUDE */
+ char *tmp; /* temporary string pointer */
+ FILE *fil; /* File descriptor returned by Openfile */
+
+ DB_ENTER( "_do_special" );
+
+ target->ce_flag = F_SPECIAL; /* mark the target as special */
+
+ switch( special ) {
+ case ST_EXPORT:
+ for( ; prereq != NIL(CELL); prereq = prereq->ce_link ) {
+ DB_PRINT( "par", ("Exporting [%s]", prereq->CE_NAME) );
+ hp = GET_MACRO( prereq->CE_NAME );
+
+ if( hp != NIL(HASH) ) {
+ char *tmpstr = hp->ht_value;
+
+ if( tmpstr == NIL(char) ) tmpstr = "";
+
+ if( Write_env_string( prereq->CE_NAME, tmpstr ) != 0 )
+ Warning( "Could not export %s", prereq->CE_NAME );
+ }
+ }
+ break;
+
+ /* Simply cause the parser to fail on the next input read */
+ case ST_EXIT:
+ Skip_to_eof = TRUE;
+ break;
+
+ case ST_IMPORT:
+ for( ; prereq != NIL(CELL); prereq = prereq->ce_link ) {
+ char *tmpstr;
+
+ DB_PRINT( "par", ("Importing [%s]", prereq->CE_NAME) );
+
+ if( strcmp(prereq->CE_NAME, ".EVERYTHING") == 0 ) {
+ t_attr sattr = Glob_attr;
+ Glob_attr |= A_SILENT;
+
+ ReadEnvironment();
+
+ Glob_attr = sattr;
+ }
+ else {
+ tmpstr = Read_env_string( prereq->CE_NAME );
+
+ if( tmpstr != NIL(char) )
+ Def_macro(prereq->CE_NAME, tmpstr, M_EXPANDED|M_LITERAL);
+ else
+ if( !((Glob_attr | attr) & A_IGNORE) )
+ Fatal("Imported macro `%s' not found",prereq->CE_NAME);
+ }
+ }
+
+ attr &= ~A_IGNORE;
+ break;
+
+ case ST_INCLUDE:
+ {
+ int pushed = FALSE;
+ int first = (attr & A_FIRST);
+ int ignore = (((Glob_attr | attr) & A_IGNORE) != 0);
+ int found = FALSE;
+ int noinf = (attr & A_NOINFER);
+ LINKPTR prqlnk = NIL(LINK);
+ LINKPTR prqlst = NIL(LINK);
+
+ if( prereq == NIL(CELL) ) Fatal( "No .INCLUDE file(s) specified" );
+
+ dp = Def_cell( ".INCLUDEDIRS" );
+
+ if( (attr & A_SETDIR) && *(dir = strchr(set_dir, '=')+1) )
+ pushed = Push_dir( dir, ".INCLUDE", ignore );
+
+ for( cp=prereq; cp != NIL(CELL); cp = cp->ce_link ) {
+ LINKPTR ltmp;
+ TALLOC(ltmp, 1, LINK);
+ ltmp->cl_prq = cp;
+
+ if( prqlnk == NIL(LINK) )
+ prqlst = ltmp;
+ else
+ prqlnk->cl_next = ltmp;
+
+ prqlnk = ltmp;
+ }
+
+ for( ; prqlst != NIL(LINK); FREE(prqlst), prqlst=prqlnk ) {
+ prqlnk = prqlst->cl_next;
+ cp = prqlst->cl_prq;
+ name = cp->CE_NAME;
+
+ /* Leave this here, it ensures that prqlst gets propely free'd */
+ if ( first && found )
+ continue;
+
+ if( *name == '<' ) {
+ /* We have a file name enclosed in <....>
+ * so get rid of the <> arround the file name */
+
+ name++;
+ if( (tmp = strrchr( name, '>' )) != NIL( char ) )
+ *tmp = 0;
+
+ if( If_root_path( name ) )
+ fil = Openfile( name, FALSE, FALSE );
+ else
+ fil = NIL(FILE);
+ }
+ else
+ fil = Openfile( name, FALSE, FALSE );
+
+ if( fil == NIL(FILE) && !If_root_path( name ) ) { /*if true ==> not found in current dir*/
+
+ /* Now we must scan the list of prerequisites for .INCLUDEDIRS
+ * looking for the file in each of the specified directories.
+ * if we don't find it then we issue an error. The error
+ * message is suppressed if the .IGNORE attribute of attr is
+ * set. If a file is found we call Parse on the file to
+ * perform the parse and then continue on from where we left
+ * off. */
+
+ for(lp=dp->CE_PRQ; lp && fil == NIL(FILE); lp=lp->cl_next) {
+ dir = lp->cl_prq->CE_NAME;
+ if( strchr(dir, '$') ) dir = Expand(dir);
+ path = Build_path( dir, name );
+
+ DB_PRINT( "par", ("Trying to include [%s]", path) );
+
+ fil = Openfile( path, FALSE, FALSE );
+ if( dir != lp->cl_prq->CE_NAME ) FREE(dir);
+ }
+ }
+
+ if (!noinf && fil == NIL(FILE)) {
+ t_attr glob = Glob_attr;
+ t_attr cattr = prqlst->cl_prq->ce_attr;
+
+ prqlst->cl_next = NIL(LINK);
+ Glob_attr |= (attr&A_IGNORE);
+ prqlst->cl_prq->ce_attr &= ~A_FRINGE;
+
+ if( Verbose & V_FILE_IO )
+ printf( "%s: Inferring include file [%s].\n",
+ Pname, name );
+ fil = TryFiles(prqlst);
+
+ Glob_attr = glob;
+ prqlst->cl_prq->ce_attr |= (cattr & A_FRINGE);
+ }
+
+ if( fil != NIL(FILE) ) {
+ if( Verbose & V_FILE_IO )
+ printf( "%s: Parsing include file [%s].\n",
+ Pname, name );
+ Parse( fil );
+ found = TRUE;
+ }
+ else if( !(ignore || first) )
+ Fatal( "Include file %s, not found", name );
+ else if( Verbose & V_FILE_IO )
+ printf( "%s: Include file [%s] was not found.\n",
+ Pname, name );
+ }
+
+ if ( !ignore && first && !found )
+ Fatal( "No include file was found" );
+
+ if( pushed ) Pop_dir(FALSE);
+ attr &= ~(A_IGNORE|A_SETDIR|A_FIRST|A_NOINFER);
+ }
+ break;
+
+ case ST_SOURCE:
+ if( prereq != NIL(CELL) )
+ _do_targets( op & (R_OP_CL | R_OP_MI | R_OP_UP), attr, set_dir,
+ target, prereq );
+ else {
+ /* The old semantics of .SOURCE were that an empty list of
+ * prerequisites clears the .SOURCE list. So we must implement
+ * that here as a clearout prerequisite operation. Since this is
+ * a standard operation with the :- opcode we can simply call the
+ * proper routine with the target cell and it should do the trick
+ */
+
+ if( op == R_OP_CL || (op & R_OP_MI) )
+ Clear_prerequisites( target );
+ }
+
+ op &= ~(R_OP_MI | R_OP_UP);
+ break;
+
+ case ST_KEEP:
+ if( Keep_state != NIL(char) ) break;
+ Def_macro( ".KEEP_STATE", "_state.mk", M_EXPANDED );
+ break;
+
+ case ST_REST:
+ /* The rest of the special targets can all take recipes, as such they
+ * must be able to affect the state of the parser. */
+
+ {
+ int s_targ = Target;
+
+ Target = TRUE;
+ _sp_target = TRUE;
+ *state = _do_targets( op, attr, set_dir, target, prereq );
+ Target = s_targ;
+
+ target->ce_flag |= F_TARGET;
+
+ attr = A_DEFAULT;
+ op = R_OP_CL;
+ }
+ break;
+
+ default:break;
+ }
+
+ if( op != R_OP_CL ) Warning( "Modifier(s) for operator ignored" );
+ if( attr != A_DEFAULT ) Warning( "Extra attributes ignored" );
+
+ DB_VOID_RETURN;
+}
+
+
+
+static int
+_do_targets( op, attr, set_dir, targets, prereq )/*
+===================================================
+ Evaluate the values derived from the current target definition
+ line. Helper functions _build_graph(), _do_magic(), _make_multi(),
+ _add_root(), _replace_cell(), _set_attributes(), Clear_prerequisites()
+ _stick_at_head(), Add_prerequisite() and _set_global_attr() are used.
+ If successfull "_sv_targets" is set to "targets".
+ Return RULE_SCAN if a recipe is expected to follow, otherwise
+ NORMAL_SCAN. */
+int op; /* rule operator */
+t_attr attr; /* attribute flags for current targets */
+char *set_dir; /* value of setdir attribute */
+CELLPTR targets; /* list of targets (each cell maybe already
+ * defined by a previous target definition
+ * line. */
+CELLPTR prereq; /* list of prerequisites */
+{
+ CELLPTR tg1; /* temporary target pointer */
+ CELLPTR tp1; /* temporary prerequisite pointer */
+ LINKPTR prev_cell; /* pointer for .UPDATEALL processing */
+ char *p; /* temporary char pointer */
+ int tflag = FALSE; /* set to TRUE if we add target to root */
+ int ret_state = RULE_SCAN; /* Return state */
+
+ DB_ENTER( "_do_targets" );
+
+ /* If .UPDATEALL is set sort the target list that was temporary linked
+ * with ce_link into a list using ce_link with ce_set pointing to the first
+ * element. */
+ /* FIXME: Check that .UPDATEALL and %-targets on one line work together. */
+ if( attr & A_UPDATEALL ) {
+ if( targets == NIL(CELL) )
+ Fatal( ".UPDATEALL attribute requires non-empty list of targets" );
+
+ if (targets->ce_set == NIL(CELL)) {
+ for(
+ prev_cell=CeMeToo(targets),tg1=targets->ce_link;
+ tg1 != NIL(CELL);
+ tg1=tg1->ce_link
+ ) {
+ if (tg1->ce_set)
+ Fatal( "Target [%s] appears on multiple .UPDATEALL lists",
+ tg1->CE_NAME);
+ tg1->ce_set = targets;
+ TALLOC(prev_cell->cl_next, 1, LINK);
+ prev_cell = prev_cell->cl_next;
+ prev_cell->cl_prq = tg1;
+ }
+ targets->ce_set = targets;
+ }
+ else {
+ LINKPTR ap;
+ CELLPTR tp;
+
+ tp = targets;
+ ap = CeMeToo(targets);
+ while (ap && tp && ap->cl_prq == tp && tp->ce_set == targets) {
+ ap = ap->cl_next;
+ tp = tp->ce_link;
+ }
+ if (ap || tp)
+ Fatal("Inconsistent .UPDATEALL lists for target [%s]",
+ targets->CE_NAME);
+ }
+ targets->ce_link = NIL(CELL);
+ }
+
+ for( tg1 = targets; tg1 != NIL(CELL); tg1 = tg1->ce_link ) {
+ /* Check if tg1 is already marked as a %-target, but not a magic
+ * (.xxx.yyy) target. */
+ int purepercent = (tg1->ce_flag & F_PERCENT) && !(tg1->ce_flag & F_MAGIC);
+
+ /* Check each target. Check for inconsistencies between :: and : rule
+ * sets. :: may follow either : or :: but not the reverse.
+ *
+ * Any F_MULTI target (contains :: rules) is represented by a prerequisite
+ * list hanging off the main target cell where each of the prerequisites
+ * is a copy of the target cell but is not entered into the hash table.
+ */
+ if( !(op & R_OP_DCL ) && (tg1->ce_flag & F_MULTI) && !purepercent )
+ Fatal( "':' vs '::' inconsistency in rules for %s", tg1->CE_NAME );
+
+ if( purepercent ) {
+ /* Handle %-targets. */
+ CELLPTR cur;
+ CELLPTR tpq = NIL(CELL);
+ CELLPTR nprq = NULL;
+
+#ifdef DBUG
+ DB_PRINT( "%", ("Handling %%-target [%s : : <prerequisites follow, maybe empty>]",
+ tg1->CE_NAME) );
+ for(cur=prereq;cur;cur=cur->ce_link) {
+ DB_PRINT( "%", (" %%-prerequisites : %s ",
+ cur->CE_NAME ? cur->CE_NAME : "<empty>") );
+ }
+#endif
+
+ /* Handle indirect (global) prerequisites first. */
+ for(cur=prereq;cur;cur=cur->ce_link) {
+ char *name = cur->CE_NAME;
+ int len = strlen(name);
+
+ if( *name == '\'' && name[len-1]=='\'' ){
+ name[len-1] = '\0';
+ len = strlen(name+1)+1;
+ memmove(name,name+1,len);
+ /* add indirect prerequisite */
+ _add_indirect_prereq( cur );
+ }
+ else {
+ /* Sort all "other" prerequisits into tpq, with nprq
+ * pointing to the first element. */
+ if (tpq)
+ tpq->ce_link = cur;
+ else
+ nprq = cur;
+ tpq = cur;
+ }
+ }
+ /* Mark the last element of nprq. */
+ if(tpq)
+ tpq->ce_link=NIL(CELL);
+ else
+ nprq = NIL(CELL);
+
+ /* Handle "normal" prerequisites now. */
+
+ if ( op & R_OP_OR ) {
+ /* for op == ':|' transform:
+ * <%-target> :| <prereq_1> ... <prereq_n> ; <recipe>
+ * into:
+ * <%-target> : <prereq_1> ; <recipe>
+ * ..
+ * <%-target> : <prereq_n> ; <recipe>
+ */
+ for(tp1=nprq; tp1; tp1=tp1->ce_link) {
+ CELLPTR tmpcell = tp1->ce_link;
+ tp1->ce_link = NIL(CELL);
+ _build_graph(op,tg1,tp1);
+ tp1->ce_link = tmpcell;
+ }
+ }
+ else {
+ /* The inference mechanism for %-targets limits the number of
+ * (non-indirect) prerequisite to one, but an unlimited number
+ * of indirect prerequisites is possible. */
+ if ( nprq && nprq->ce_link && !(op & R_OP_OR))
+ Warning("More than one prerequisite\n"
+ "for %%-target. Use :| ruleop or indirect prerequisites.");
+
+ _build_graph(op,tg1,nprq);
+ }
+ }
+ else if( tg1->ce_flag & F_MAGIC &&
+ (p = _is_magic( tg1->CE_NAME )) != NIL(char) &&
+ _do_magic( op, p, tg1, prereq, attr, set_dir ) )
+ ; /* _do_magic() does all that is needed (if return value is TRUE). */
+ else if( op & R_OP_DCL ) { /* op == :: */
+ CELLPTR tmp_cell = _make_multi(tg1);
+
+ /* Add the F_MULTI master to .TARGETS (If not set already).
+ * Do this here so that the member cell is not added instead
+ * when the recipies are bound in Bind_rules_to_targets(). */
+ tflag |= _add_root(tg1);
+
+ /* Replace the F_MULTI master with the member cell. */
+ targets = _replace_cell( targets, tg1, tmp_cell );
+
+ /* We have to set (add) the attributes also for the F_MULTI master
+ * target cell. As there is no recipe the setdir value is not
+ * needed. _set_attributes() that follows in approx. 8 lines
+ * will set the attributes for the F_MULTI member cell. */
+ tg1->ce_attr |= (attr & ~A_SETDIR);
+
+ /* Now switch tg1 to the current (F_MULTI prereq.) target.
+ * All recipes have to be added to that cell and not to the
+ * F_MULTI master. */
+ tg1 = tmp_cell;
+ }
+
+ if( !purepercent ) _set_attributes( attr, set_dir, tg1 );
+
+ /* Build the proper prerequisite list of the target. If the `-',
+ * modifier was used clear the prerequisite list before adding any
+ * new prerequisites. Else add them to the head/tail as appropriate.
+ *
+ * If the target has F_PERCENT set then no prerequisites are used. */
+
+ if( !(tg1->ce_flag & F_PERCENT) ) {
+ if( op & R_OP_MI ) Clear_prerequisites( tg1 ); /* op == :- */
+
+ if( (op & R_OP_UP) && (tg1->ce_prq != NIL(LINK)) ) /* op == :^ */
+ _stick_at_head( tg1, prereq );
+ else for( tp1=prereq; tp1 != NIL(CELL); tp1 = tp1->ce_link )
+ Add_prerequisite( tg1, tp1, FALSE, FALSE );
+ }
+ else if( op & (R_OP_MI | R_OP_UP) )
+ Warning( "Modifier(s) `^-' for %-meta target ignored" );
+ }
+
+ /* In case a F_MULTI member that was the first prerequisite of .TARGETS */
+ if(tflag)
+ Target = TRUE;
+
+ /* Check to see if we have NO targets but some attributes, i.e. an
+ * Attribute-Definition. If so then apply all of the attributes to the
+ * complete list of prerequisites. No recipes are allowed to follow. */
+
+ if( (targets == NIL(CELL)) && attr ) {
+ ret_state = NORMAL_SCAN;
+ if( prereq != NIL(CELL) )
+ for( tp1=prereq; tp1 != NIL(CELL); tp1 = tp1->ce_link )
+ _set_attributes( attr, set_dir, tp1 );
+ else
+ _set_global_attr( attr );
+ }
+
+ /* Now that we have built the lists of targets, the parser must parse the
+ * recipes if there are any. However we must start the recipe list with the
+ * recipe specified as via the ; kludge, if there is one */
+ _sv_targets = targets;
+ _sv_attr = attr;
+ _sv_flag = ((op & R_OP_BG) ? F_SINGLE : F_DEFAULT);
+
+ DB_RETURN( ret_state );
+}
+
+
+static int
+_do_magic( op, dot, target, prereq, attr, set_dir )/*
+=====================================================
+ This function investigates dot for being a magic target of the form
+ .<chars>.<chars> or .<chars> and creates the appropriate % rules for
+ that target.
+ If the target is given with an undefined syntax, i.e. with prerequisites,
+ then this function terminates early without creating % rules and
+ returns 0.
+ If successful the function returns 1.
+
+ The function builds the % rule, `%.o : %.c' from .c.o, and
+ `% : %.a' from .a */
+
+int op;
+char *dot;
+CELLPTR target;
+CELLPTR prereq;
+t_attr attr;
+char *set_dir;
+{
+ CELLPTR tg;
+ CELLPTR prq;
+ char *tmp, *tmp2;
+
+ DB_ENTER( "_do_magic" );
+
+ DB_PRINT("%", ("Analysing magic target [%s]", target->CE_NAME));
+
+ if( prereq != NIL(CELL) ) {
+ Warning( "Ignoring AUGMAKE meta-target [%s] because prerequisites are present.", target->CE_NAME );
+ DB_RETURN(0);
+ }
+
+ if( dot == target->CE_NAME ) { /* its of the form .a */
+ tg = Def_cell( "%" );
+ tmp = _build_meta( target->CE_NAME );
+ prq = Def_cell( tmp );
+ FREE( tmp );
+
+ _build_graph( op, tg, prq );
+ }
+ else {
+ tmp = _build_meta( dot );
+ tg = Def_cell( tmp );
+ FREE( tmp );
+
+ tmp = _build_meta( tmp2 = DmSubStr( target->CE_NAME, dot ) );
+ prq = Def_cell( tmp );
+ FREE( tmp );
+ FREE( tmp2 );
+
+ _build_graph( op, tg, prq );
+ }
+
+ tg->ce_flag |= F_PERCENT;
+ target->ce_flag |= (F_MAGIC|F_PERCENT);
+
+ _set_attributes( attr, set_dir, tg );
+
+ DB_RETURN(1);
+}
+
+
+static CELLPTR
+_replace_cell( lst, cell, rep )/*
+=================================
+ Replace cell with rep in lst. Note if cell is not part of lst we are in
+ real trouble. */
+CELLPTR lst;
+CELLPTR cell;
+CELLPTR rep;
+{
+ register CELLPTR tp;
+
+ if( lst == cell ) {
+ rep->ce_link = lst->ce_link;
+ lst = rep;
+ }
+ else {
+ for( tp=lst; tp->ce_link != cell && tp ; tp=tp->ce_link );
+ if( !tp )
+ Fatal( "Internal Error: cell not part of lst." );
+ rep->ce_link = tp->ce_link->ce_link;
+ tp->ce_link = rep;
+ }
+
+ return(lst);
+}
+
+
+static char *
+_build_meta( name )/*
+=====================
+ Check to see if the name is of the form .c~ if so and if Augmake
+ translation is enabled then return s.%.c, else return %.suff, where if the
+ suffix ends in '~' then leave it be.*/
+char *name;
+{
+ char *tmp;
+ int test = (STOBOOL(Augmake) ? name[strlen(name)-1] == '~' : 0);
+
+ tmp = DmStrJoin( test ? "s.%" : "%", name, -1, FALSE);
+ if( test ) tmp[ strlen(tmp)-1 ] = '\0';
+
+ return(tmp);
+}
+
+
+static CELLPTR
+_build_graph( op, target, prereq )/*
+====================================
+ This function is called to build the graph for the % rule given by
+ target : prereq cell combination. This function assumes that target
+ is a % target and that prereq is one or multiple non-indirect prerequisite.
+ It also assumes that target cell has F_PERCENT set already.
+
+ NOTE: If more than one prerequisite is present this function handles them
+ correctly but the lookup still only uses the first (BUG!).
+
+ R_OP_CL (:) rules replace existing rules if any, %.o :: %.c is meaningless.
+
+ The function always returns NIL(CELL). */
+int op;
+CELLPTR target;
+CELLPTR prereq;
+{
+ LINKPTR edl;
+ CELLPTR edge = 0;
+ CELLPTR tpq,cur;
+ int match;
+
+#ifdef DBUG
+ DB_ENTER( "_build_graph" );
+ DB_PRINT( "%", ("Building graph for [%s : <prerequisites follow, maybe empty>]",
+ target->CE_NAME) );
+ for(tpq=prereq;tpq;tpq=tpq->ce_link) {
+ DB_PRINT( "%", (" %%-prerequisites : %s ",
+ tpq->CE_NAME ? tpq->CE_NAME : "<empty>") );
+ }
+#endif
+
+ /* Currently multiple prerequisites are not (yet) handled correctly.
+ * We already issue a warning in _do_targets(), don't issue it here
+ * again.
+ if ( prereq && prereq->ce_link )
+ Warning( "Internal Error: more than one prerequisite in _build_graph." );
+ */
+
+ /* There cannot be more than one target name ( linked with
+ * (CeMeToo(target))->cl_next ) per %-target master.
+ * FIXME: remove this check after verifying that it never triggers. */
+ if ( (CeMeToo(target))->cl_next )
+ Fatal( "Internal Error: more than one target name in _build_graph." );
+
+ /* Search the list of prerequisites for the current target and see if
+ * any of them match the current %-meta's : prereq's pair. NOTE that
+ * %-metas are built as if they were F_MULTI targets, i.e. the target
+ * definitions for the %-target members are stored in the prerequisites
+ * list of the master target. */
+ /* This relies on target->ce_prq being NULL if this is the first
+ * occurence of this %-target and therefore not yet having a %-target
+ * master. */
+ match = FALSE;
+ for(edl=target->ce_prq; !match && edl != NIL(LINK); edl=edl->cl_next) {
+ LINKPTR l1,l2;
+ edge = edl->cl_prq;
+
+ DB_PRINT("%", ("Trying to match [%s]",edge?edge->CE_NAME:"(nil)"));
+
+ /* First we match the target sets, if this fails then we don't have to
+ * bother with the prerequisite sets. The targets sets are sorted.
+ * this makes life very simple. */
+ /* ce_dir is handled per member target, no check needed for the
+ * master target. */
+
+ /* FIXME: We already checked above that there is only one target
+ * name. Remove the comparisons for following names. */
+ l1 = CeMeToo(target); /* Used by .UPDATEALL !!! */
+ l2 = CeMeToo(edge);
+ while(l1 && l2 && l1->cl_prq == l2->cl_prq) {
+ l1=l1->cl_next;
+ l2=l2->cl_next;
+ }
+ /* If both l1 and l2 are NULL we had a match. */
+ if (l1 || l2)
+ continue;
+
+ /* target sets match, so check prerequisites. */
+ if( (!edge->ce_prq && !prereq) /* matches both empty - separate this. */
+ || ( edge->ce_prq
+ && ( edge->ce_dir == _sv_setdir
+ || ( edge->ce_dir
+ && _sv_setdir
+ && !strcmp(edge->ce_dir,strchr(_sv_setdir,'=')+1)
+ )
+ )
+ )
+ ) {
+ LINKPTR prql;
+
+ /* this is a really gross way to compare two sets, it's n^2 but
+ * since the sets are assumed to always be tiny, it should be ok. */
+ for(tpq=prereq; tpq; tpq=tpq->ce_link) {
+ for(prql=edge->ce_prq;prql;prql=prql->cl_next)
+ if (prql->cl_prq == tpq)
+ break;
+
+ if(prql == NIL(LINK))
+ break;
+
+ prql->cl_prq->ce_flag |= F_MARK;
+ }
+
+ if (tpq == NIL(CELL)) {
+ for(prql=edge->ce_prq;prql;prql=prql->cl_next)
+ if(!(prql->cl_prq->ce_flag & F_MARK))
+ break;
+
+ if(prql == NIL(LINK))
+ match = TRUE;
+ }
+
+ /* clean up the mark bits. */
+ for(prql=edge->ce_prq;prql;prql=prql->cl_next)
+ prql->cl_prq->ce_flag &= ~F_MARK;
+ }
+ }
+
+ if( match ) {
+ /* match is TRUE hence, we found an edge joining the target and the
+ * prerequisite so reset the new edge so that new values replace it. */
+ DB_PRINT( "%", ("It's an old edge") );
+
+ edge->ce_dir = NIL(char);
+ edge->ce_flag &= (F_PERCENT|F_MAGIC|F_DFA);
+ edge->ce_attr &= A_NOINFER;
+ }
+ else {
+ DB_PRINT( "%", ("Adding a new edge") );
+
+ edge = _make_multi(target);
+
+ /* FIXME: There can be only one %-target. */
+ for(edl=CeMeToo(target);edl;edl=edl->cl_next) {
+ if( !((tpq=edl->cl_prq)->ce_flag & F_DFA) ) {
+ Add_nfa( tpq->CE_NAME );
+ tpq->ce_flag |= F_DFA;
+ }
+
+ edl->cl_prq->ce_set = edge;
+ }
+
+ edge->ce_all = target->ce_all;
+ target->ce_all.cl_next = NIL(LINK);
+ target->ce_set = NIL(CELL);
+
+ /* Add all prerequisites to edge. */
+ for(tpq=prereq; tpq; tpq=tpq->ce_link)
+ Add_prerequisite(edge, tpq, FALSE, TRUE);
+ }
+
+ if( op & R_OP_DCL )
+ Warning("'::' operator for meta-target '%s' ignored, ':' operator assumed.",
+ target->CE_NAME );
+
+ /* If edge was already added we're in BIG trouble. */
+ /* Re-use cur as temporary variable. */
+ for( cur=_sv_edgel; cur != NIL(CELL); cur=cur->ce_link ) {
+ if( cur == edge )
+ Fatal( "Internal Error: edge already in _sv_edgel." );
+ }
+
+ edge->ce_link = _sv_edgel;
+ _sv_edgel = edge;
+ _sv_globprq_only = 0;
+
+ DB_RETURN(NIL(CELL));
+}
+
+
+static CELLPTR
+_make_multi( tg )/*
+===================
+ This function is called to convert tg into an F_MULTI target.
+ Return a pointer to the new member cell.
+ I don't know what the author intended but the ce_index entry is only
+ used in this function (set to 0 for added targets) and undefined otherwise!
+ The undefined value is hopefully set to 0 by the C compiler as each added
+ target sets its ce_count to ++ce_index (==1). (FIXME) */
+CELLPTR tg;
+{
+ CELLPTR cp;
+
+ /* This creates a new master F_MULTI target if tg existed before as a normal
+ * target with prerequisites or recipes. */
+ if( !(tg->ce_flag & F_MULTI) && (tg->ce_prq || tg->ce_recipe) ) {
+ /* Allocate a new master cell. */
+ TALLOC(cp, 1, CELL);
+ *cp = *tg;
+
+ /* F_MULTI master */
+ tg->ce_prq = NIL(LINK);
+ tg->ce_flag |= F_RULES|F_MULTI|F_TARGET;
+ tg->ce_attr |= A_SEQ;
+ tg->ce_recipe = NIL(STRING);
+ tg->ce_dir = NIL(char);
+
+ /* F_MULTI member for preexisting elements */
+ cp->ce_count = ++tg->ce_index;
+ cp->ce_cond = NIL(STRING);
+ cp->ce_set = NIL(CELL);
+ cp->ce_all.cl_prq = cp;
+ CeNotMe(cp) = NIL(LINK);
+
+ Add_prerequisite(tg, cp, FALSE, TRUE);
+ }
+
+ /* Alocate memory for new member of F_MULTI target */
+ TALLOC(cp, 1, CELL);
+ *cp = *tg;
+
+ /* This is reached if the target already exists, but without having
+ * prerequisites or recepies. Morph it into a F_MULTI master cell. */
+ if( !(tg->ce_flag & F_MULTI) ) {
+ tg->ce_prq = NIL(LINK);
+ tg->ce_flag |= F_RULES|F_MULTI|F_TARGET;
+ tg->ce_attr |= A_SEQ;
+ tg->ce_recipe = NIL(STRING);
+ tg->ce_dir = NIL(char);
+ cp->ce_cond = NIL(STRING);
+ }
+ /* This handles the case of adding an additional target as a
+ * prerequisite to a F_MULTI target. */
+ else {
+ cp->ce_flag &= ~(F_RULES|F_MULTI);
+ cp->ce_attr &= ~A_SEQ;
+ cp->ce_prq = NIL(LINK);
+ cp->ce_index = 0;
+ cp->ce_cond = NIL(STRING);
+ }
+ cp->ce_count = ++tg->ce_index;
+ cp->ce_flag |= F_TARGET;
+ cp->ce_set = NIL(CELL);
+ cp->ce_all.cl_prq = cp;
+ CeNotMe(cp) = NIL(LINK);
+
+ Add_prerequisite(tg, cp, FALSE, TRUE);
+ return(cp);
+}
+
+
+static void
+_add_indirect_prereq( pq )/*
+==========================
+ Prerequisite is an indirect prerequisite for a %-target, add it to
+ the target's list of indirect prerequsites to add on match. */
+CELLPTR pq;
+{
+ register LINKPTR ln;
+
+ /* Only add to list of indirect prerequsites if it is not in already. */
+ for(ln=_sv_ind_prq; ln; ln=ln->cl_next)
+ if(strcmp(ln->cl_prq->CE_NAME,pq->CE_NAME) == 0)
+ return;
+
+ /* Not in, add it. */
+ TALLOC( ln, 1, LINK );
+ ln->cl_next = _sv_ind_prq;
+ ln->cl_prq = pq;
+ _sv_ind_prq = ln;
+}
+
+
+
+static void
+_set_attributes( attr, set_dir, cp )/*
+======================================
+ Set the appropriate attributes for a cell */
+t_attr attr;
+char *set_dir;
+CELLPTR cp;
+{
+ char *dir = 0;
+
+ DB_ENTER( "_set_attributes" );
+
+ /* If .SETDIR attribute is set then we have at least .SETDIR= in the
+ * set_dir string. So go and fishout what is at the end of the =.
+ * If not set and not NULL then propagate it to the target cell. */
+
+ if( attr & A_SETDIR ) {
+ char *p;
+ if( (p = strchr( set_dir, '=' )) != NULL )
+ dir = p + 1;
+
+ if( cp->ce_dir )
+ Warning( "Multiple .SETDIR for %s ignored", cp->CE_NAME );
+ else if( *dir )
+ cp->ce_dir = DmStrDup(dir);
+ }
+ cp->ce_attr |= attr; /* set rest of attributes for target */
+
+ DB_VOID_RETURN;
+}
+
+
+
+static void
+_set_global_attr( attr )/*
+==========================
+ Handle the setting of the global attribute functions based on
+ The attribute flags set in attr. */
+t_attr attr;
+{
+ t_attr flag;
+
+ /* Some compilers can't handle a switch on a long, and t_attr is now a long
+ * integer on some systems. foey! */
+ for( flag = MAX_ATTR; flag; flag >>= 1 )
+ if( flag & attr ) {
+ if( flag == A_PRECIOUS) Def_macro(".PRECIOUS", "y", M_EXPANDED);
+ else if( flag == A_SILENT) Def_macro(".SILENT", "y", M_EXPANDED);
+ else if( flag == A_IGNORE ) Def_macro(".IGNORE", "y", M_EXPANDED);
+ else if( flag == A_EPILOG ) Def_macro(".EPILOG", "y", M_EXPANDED);
+ else if( flag == A_PROLOG ) Def_macro(".PROLOG", "y", M_EXPANDED);
+ else if( flag == A_NOINFER ) Def_macro(".NOINFER", "y", M_EXPANDED);
+ else if( flag == A_SEQ ) Def_macro(".SEQUENTIAL","y", M_EXPANDED);
+ else if( flag == A_SHELL ) Def_macro(".USESHELL", "y", M_EXPANDED);
+ else if( flag == A_MKSARGS ) Def_macro(".MKSARGS", "y", M_EXPANDED);
+#if !defined(__CYGWIN__)
+ else if( flag == A_SWAP ) Def_macro(".SWAP", "y", M_EXPANDED);
+#else
+ else if( flag == A_WINPATH ) Def_macro(".WINPATH", "y", M_EXPANDED);
+#endif
+ }
+
+ attr &= ~A_GLOB;
+ if( attr ) Warning( "Non global attribute(s) ignored" );
+}
+
+
+
+static void
+_stick_at_head( cp, pq )/*
+==========================
+ Add the prerequisite list to the head of the existing prerequisite
+ list */
+
+CELLPTR cp; /* cell for target node */
+CELLPTR pq; /* list of prerequisites to add */
+{
+ DB_ENTER( "_stick_at_head" );
+
+ if( pq->ce_link != NIL(CELL) ) _stick_at_head( cp, pq->ce_link );
+ Add_prerequisite( cp, pq, TRUE, FALSE );
+
+ DB_VOID_RETURN;
+}
+
+
+
+static t_attr
+_is_attribute( name )/*
+=======================
+ Check the passed name against the list of valid attributes and return the
+ attribute index if it is, else return 0, indicating the name is not a valid
+ attribute. The present attributes are defined in dmake.h as A_xxx #defines,
+ with the corresponding makefile specification: (note they must be named
+ exactly as defined below)
+
+ Valid attributes are: .IGNORE, .SETDIR=, .SILENT, .PRECIOUS, .LIBRARY,
+ .EPILOG, .PROLOG, .LIBRARYM, .SYMBOL, .UPDATEALL,
+ .USESHELL, .NOINFER, .PHONY, .SWAP/.WINPATH, .SEQUENTIAL
+ .NOSTATE, .MKSARGS, .IGNOREGROUP, .GROUP, .FIRST
+ .EXECUTE, .ERRREMOVE
+
+ NOTE: The strcmp's are OK since at most three are ever executed for any
+ one attribute check, and that happens only when we can be fairly
+ certain we have an attribute. */
+char *name;
+{
+ t_attr attr = 0;
+
+ DB_ENTER( "_is_attribute" );
+
+ if( *name++ == '.' )
+ switch( *name )
+ {
+ case 'E':
+ if( !strcmp(name, "EPILOG") ) attr = A_EPILOG;
+ else if( !strcmp(name, "EXECUTE")) attr = A_EXECUTE;
+ else if( !strcmp(name, "ERRREMOVE")) attr = A_ERRREMOVE;
+ else attr = 0;
+ break;
+
+ /* A_FIRST implies A_IGNORE, handled in ST_INCLUDE */
+ case 'F':
+ attr = (strcmp(name, "FIRST")) ? 0 : A_FIRST;
+ break;
+
+ case 'G': attr = (strcmp(name, "GROUP")) ? 0 : A_GROUP; break;
+ case 'L': attr = (strcmp(name, "LIBRARY")) ? 0 : A_LIBRARY; break;
+ case 'M': attr = (strcmp(name, "MKSARGS")) ? 0 : A_MKSARGS; break;
+
+ case 'I':
+ if( !strcmp(name, "IGNORE") ) attr = A_IGNORE;
+ else if( !strcmp(name, "IGNOREGROUP")) attr = A_IGNOREGROUP;
+ else attr = 0;
+ break;
+
+ case 'N':
+ if( !strcmp(name, "NOINFER") ) attr = A_NOINFER;
+ else if( !strcmp(name, "NOSTATE")) attr = A_NOSTATE;
+ else attr = 0;
+ break;
+
+ case 'U':
+ if( !strcmp(name, "UPDATEALL") ) attr = A_UPDATEALL;
+ else if( !strcmp(name, "USESHELL")) attr = A_SHELL;
+ else attr = 0;
+ break;
+
+ case 'P':
+ if( !strcmp(name, "PRECIOUS") ) attr = A_PRECIOUS;
+ else if( !strcmp(name, "PROLOG") ) attr = A_PROLOG;
+ else if( !strcmp(name, "PHONY") ) attr = A_PHONY;
+ else attr = 0;
+ break;
+
+ case 'S':
+ if( !strncmp(name, "SETDIR=", 7) ) attr = A_SETDIR;
+ else if( !strcmp(name, "SILENT") ) attr = A_SILENT;
+ else if( !strcmp(name, "SYMBOL") ) attr = A_SYMBOL;
+ else if( !strcmp(name, "SEQUENTIAL")) attr = A_SEQ;
+ /* A_SWAP has no meaning except for MSDOS. */
+ else if( !strcmp(name, "SWAP")) attr = A_SWAP;
+ else attr = 0;
+ break;
+
+ case 'W': attr = (strcmp(name, "WINPATH")) ? 0 : A_WINPATH; break;
+ }
+
+ DB_RETURN( attr );
+}
+
+
+
+static int
+_is_special( tg )/*
+===================
+ This function returns TRUE if the name passed in represents a special
+ target, otherwise it returns false. A special target is one that has
+ a special meaning to dmake, and may require processing at the time that
+ it is parsed.
+
+ Current Special targets are:
+ .GROUPPROLOG .GROUPEPILOG .INCLUDE .IMPORT
+ .EXPORT .SOURCE .SUFFIXES .ERROR .EXIT
+ .INCLUDEDIRS .MAKEFILES .REMOVE .KEEP_STATE
+ .TARGETS .ROOT
+*/
+char *tg;
+{
+ DB_ENTER( "_is_special" );
+
+ if( *tg++ != '.' ) DB_RETURN( 0 );
+
+ switch( *tg )
+ {
+ case 'E':
+ if( !strcmp( tg, "ERROR" ) ) DB_RETURN( ST_REST );
+ else if( !strcmp( tg, "EXPORT" ) ) DB_RETURN( ST_EXPORT );
+ else if( !strcmp( tg, "EXIT" ) ) DB_RETURN( ST_EXIT );
+ break;
+
+ case 'G':
+ if( !strcmp( tg, "GROUPPROLOG" )) DB_RETURN( ST_REST );
+ else if( !strcmp( tg, "GROUPEPILOG" )) DB_RETURN( ST_REST );
+ break;
+
+ case 'I':
+ if( !strcmp( tg, "IMPORT" ) ) DB_RETURN( ST_IMPORT );
+ else if( !strcmp( tg, "INCLUDE" ) ) DB_RETURN( ST_INCLUDE );
+ else if( !strcmp( tg, "INCLUDEDIRS" )) DB_RETURN( ST_REST );
+ break;
+
+ case 'K':
+ if( !strcmp( tg, "KEEP_STATE" ) ) DB_RETURN( ST_KEEP );
+ break;
+
+ case 'M':
+ if( !strcmp( tg, "MAKEFILES" ) ) DB_RETURN( ST_REST );
+ break;
+
+ case 'R':
+ if( !strcmp( tg, "REMOVE" ) ) DB_RETURN( ST_REST );
+ else if( !strcmp( tg, "ROOT" ) ) DB_RETURN( ST_REST );
+ break;
+
+ case 'S':
+ if( !strncmp( tg, "SOURCE", 6 ) ) DB_RETURN( ST_SOURCE );
+ else if( !strncmp(tg, "SUFFIXES", 8 )) {
+ if (Verbose & V_WARNALL)
+ Warning( "The .SUFFIXES target has no special meaning and is deprecated." );
+ DB_RETURN( ST_SOURCE );
+ }
+ break;
+
+ case 'T':
+ if( !strcmp( tg, "TARGETS" ) ) DB_RETURN( ST_REST );
+ break;
+ }
+
+ DB_RETURN( 0 );
+}
+
+
+
+static int
+_is_percent( np )/*
+===================
+ return TRUE if np points at a string containing a % sign */
+char *np;
+{
+ return( (strchr(np,'%') && (*np != '\'' && np[strlen(np)-1] != '\'')) ?
+ TRUE : FALSE );
+}
+
+
+static char *
+_is_magic( np )/*
+=================
+ return NULL if np does not points at a string of the form
+ .<chars>.<chars> or .<chars>
+ where chars are "visible characters" for the current locale. If np is of the
+ first form we return a pointer to the second '.' and for the second form we
+ return a pointer to the '.'.
+
+ NOTE: reject target if it contains / or begins with ..
+ reject also .INIT and .DONE because they are mentioned in the
+ man page. */
+char *np;
+{
+ register char *n;
+
+ n = np;
+ if( *n != '.' ) return( NIL(char) );
+ if (strchr(DirBrkStr, *(n+1))!=NULL || *(n+1) == '.' )
+ return (NIL(char));
+ if( !strcmp( n+1, "INIT" ) || !strcmp( n+1, "DONE" ) )
+ return (NIL(char));
+
+ for( n++; isgraph(*n) && (*n != '.'); n++ );
+
+ if( *n != '\0' ) {
+ if( *n != '.' ) return( NIL(char) );
+ for( np = n++; isgraph( *n ) && (*n != '.'); n++ );
+ if( *n != '\0' ) return( NIL(char) );
+ }
+ /* Until dmake 4.5 a .<suffix> target was ignored when AUGMAKE was
+ * set and evaluated as a meta target if unset (also for -A).
+ * To keep maximum compatibility accept this regardles of the AUGMAKE
+ * status. */
+
+ /* np points at the second . of .<chars>.<chars> string.
+ * if the special target is of the form .<chars> then np points at the
+ * first . in the token. */
+
+ return( np );
+}
+
+
+static int
+_add_root(tg)/*
+===============
+ Adds "tg" to the prerequisits list of "Targets" if "Target" is not TRUE,
+ i.e. to the list of targets that are to be build.
+ Instead io setting "Target" to TRUE, TRUE is returned as more targets
+ might be defined in the current makefile line and they all have to be
+ add to "Targets" in this case. */
+
+CELLPTR tg;
+{
+ int res = FALSE;
+
+ if(tg == Targets)
+ return(TRUE);
+
+ if( !Target && !(tg->ce_flag & (F_SPECIAL|F_PERCENT)) ) {
+ Add_prerequisite(Targets, tg, FALSE, TRUE);
+
+ tg->ce_flag |= F_TARGET;
+ tg->ce_attr |= A_FRINGE;
+ res = TRUE;
+ }
+
+ return(res);
+}
diff --git a/dmake/stamp-h b/dmake/stamp-h
new file mode 100755
index 000000000000..9788f70238c9
--- /dev/null
+++ b/dmake/stamp-h
@@ -0,0 +1 @@
+timestamp
diff --git a/dmake/startup/Makefile.am b/dmake/startup/Makefile.am
new file mode 100755
index 000000000000..ca907266c38b
--- /dev/null
+++ b/dmake/startup/Makefile.am
@@ -0,0 +1,7 @@
+
+startupdir = $(datadir)/startup
+
+startup_DATA = startup.mk config.mk
+
+DIST_SUBDIRS = unix winnt
+SUBDIRS = @OS_TYPE@
diff --git a/dmake/startup/Makefile.in b/dmake/startup/Makefile.in
new file mode 100644
index 000000000000..0bede9b62255
--- /dev/null
+++ b/dmake/startup/Makefile.in
@@ -0,0 +1,492 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.mk.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = config.mk
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup
+startup_DATA = startup.mk config.mk
+DIST_SUBDIRS = unix winnt
+SUBDIRS = @OS_TYPE@
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+config.mk: $(top_builddir)/config.status $(srcdir)/config.mk.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-recursive ctags ctags-recursive \
+ distclean distclean-generic distclean-recursive distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/config.mk.in b/dmake/startup/config.mk.in
new file mode 100644
index 000000000000..b2429a8fbe81
--- /dev/null
+++ b/dmake/startup/config.mk.in
@@ -0,0 +1,5 @@
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+
+OS := @OS_TYPE@
+OSRELEASE := @OS_VERSION@
+#OSENVIRONMENT := ???
diff --git a/dmake/startup/msdos/borland/bcc30/macros.mk b/dmake/startup/msdos/borland/bcc30/macros.mk
new file mode 100644
index 000000000000..599ba52c0a61
--- /dev/null
+++ b/dmake/startup/msdos/borland/bcc30/macros.mk
@@ -0,0 +1,4 @@
+# MSDOS Borland-C customization.
+
+# Standard C-language command names and flags
+CC *:= bcc # C compiler
diff --git a/dmake/startup/msdos/borland/bcc40/macros.mk b/dmake/startup/msdos/borland/bcc40/macros.mk
new file mode 100644
index 000000000000..599ba52c0a61
--- /dev/null
+++ b/dmake/startup/msdos/borland/bcc40/macros.mk
@@ -0,0 +1,4 @@
+# MSDOS Borland-C customization.
+
+# Standard C-language command names and flags
+CC *:= bcc # C compiler
diff --git a/dmake/startup/msdos/borland/bcc45/macros.mk b/dmake/startup/msdos/borland/bcc45/macros.mk
new file mode 100644
index 000000000000..599ba52c0a61
--- /dev/null
+++ b/dmake/startup/msdos/borland/bcc45/macros.mk
@@ -0,0 +1,4 @@
+# MSDOS Borland-C customization.
+
+# Standard C-language command names and flags
+CC *:= bcc # C compiler
diff --git a/dmake/startup/msdos/borland/bcc50.32/macros.mk b/dmake/startup/msdos/borland/bcc50.32/macros.mk
new file mode 100644
index 000000000000..599ba52c0a61
--- /dev/null
+++ b/dmake/startup/msdos/borland/bcc50.32/macros.mk
@@ -0,0 +1,4 @@
+# MSDOS Borland-C customization.
+
+# Standard C-language command names and flags
+CC *:= bcc # C compiler
diff --git a/dmake/startup/msdos/borland/bcc50/macros.mk b/dmake/startup/msdos/borland/bcc50/macros.mk
new file mode 100644
index 000000000000..599ba52c0a61
--- /dev/null
+++ b/dmake/startup/msdos/borland/bcc50/macros.mk
@@ -0,0 +1,4 @@
+# MSDOS Borland-C customization.
+
+# Standard C-language command names and flags
+CC *:= bcc # C compiler
diff --git a/dmake/startup/msdos/borland/macros.mk b/dmake/startup/msdos/borland/macros.mk
new file mode 100644
index 000000000000..1e8915171ff1
--- /dev/null
+++ b/dmake/startup/msdos/borland/macros.mk
@@ -0,0 +1,33 @@
+# MSDOS Borland-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= tasm # Assembler and flags
+ASFLAGS *=
+LD *= tlink # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= tlib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= tpc # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
diff --git a/dmake/startup/msdos/borland/tcc20/macros.mk b/dmake/startup/msdos/borland/tcc20/macros.mk
new file mode 100644
index 000000000000..7d922e44d03a
--- /dev/null
+++ b/dmake/startup/msdos/borland/tcc20/macros.mk
@@ -0,0 +1,4 @@
+# MSDOS Turbo-C customization.
+
+# Standard C-language command names and flags
+CC *:= tcc # C compiler
diff --git a/dmake/startup/msdos/macros.mk b/dmake/startup/msdos/macros.mk
new file mode 100644
index 000000000000..8f8c57c5a479
--- /dev/null
+++ b/dmake/startup/msdos/macros.mk
@@ -0,0 +1,62 @@
+# Define additional MSDOS specific settings.
+#
+
+# Execution environment configuration.
+# Grab the current setting of COMSPEC.
+#
+.IMPORT .IGNORE : COMSPEC ROOTDIR
+
+# First check if SHELL is defined to be something other than COMSPEC.
+# If it is, then assume that SHELL is a Korn compatible shell like MKS's
+.IF $(SHELL) == $(NULL)
+ .IF $(COMSPEC) == $(NULL)
+ SHELL *:= $(ROOTDIR)$/bin$/sh$E
+ .ELSE
+ SHELL *:= $(COMSPEC)
+ .END
+.END
+GROUPSHELL *:= $(SHELL)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
+
+# Applicable suffix definitions
+A *:= .lib # Libraries
+E *:= .exe # Executables
+F *:= .for # Fortran
+O *:= .obj # Objects
+P *:= .pas # Pascal
+S *:= .asm # Assembler sources
+V *:= # RCS suffix
+
+# Now set the remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn shell.
+.IF $(SHELL) == $(COMSPEC)
+ SHELLFLAGS *:= $(SWITCHAR)c
+ GROUPFLAGS *:= $(SHELLFLAGS)
+ SHELLMETAS *:= "<>|
+ GROUPSUFFIX *:= .bat
+ DIVFILE *= $(TMPFILE:s,/,\,)
+ RM *= del
+ RMFLAGS *=
+ MV *= rename
+ __.DIVSEP-sh-yes *:= \\
+ __.DIVSEP-sh-no *:= \\
+.ELSE
+ SHELLFLAGS *:= -c
+ GROUPFLAGS *:=
+ SHELLMETAS *:= *";?<>|()&][$$\#`'
+ GROUPSUFFIX *:= .ksh
+ .MKSARGS *:= yes
+ RM *= $(ROOTDIR)$/bin$/rm
+ RMFLAGS *= -f
+ MV *= $(ROOTDIR)$/bin$/mv
+ DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}},)
+ __.DIVSEP-sh-yes *:= \\\
+ __.DIVSEP-sh-no *:= \\
+.ENDIF
+
+
+# Does not respect case of filenames.
+.DIRCACHERESPCASE := no
diff --git a/dmake/startup/msdos/microsft/macros.mk b/dmake/startup/msdos/microsft/macros.mk
new file mode 100644
index 000000000000..3891f84fde21
--- /dev/null
+++ b/dmake/startup/msdos/microsft/macros.mk
@@ -0,0 +1,34 @@
+# MSDOS Microsoft-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CC *:= cl # C compiler
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= masm # Assembler and flags
+ASFLAGS *=
+LD *= link # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= lib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= ??? # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
diff --git a/dmake/startup/msdos/recipes.mk b/dmake/startup/msdos/recipes.mk
new file mode 100644
index 000000000000..39a5965e844c
--- /dev/null
+++ b/dmake/startup/msdos/recipes.mk
@@ -0,0 +1,9 @@
+# Define additional MSDOS specific build recipes.
+#
+
+# Executables
+ %$E .SWAP : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
+ %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/recipes.mk
diff --git a/dmake/startup/msdos/zortech/macros.mk b/dmake/startup/msdos/zortech/macros.mk
new file mode 100644
index 000000000000..f9166150f13d
--- /dev/null
+++ b/dmake/startup/msdos/zortech/macros.mk
@@ -0,0 +1,30 @@
+# MSDOS Zortech-C environment customization.
+
+# Standard C-language command names and flags
+CC *:= ztc # C compiler
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= masm # Assembler and flags
+ASFLAGS *=
+LD *= blink # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= ???? # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= ??? # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
diff --git a/dmake/startup/os2/ibm/macros.mk b/dmake/startup/os2/ibm/macros.mk
new file mode 100644
index 000000000000..4b848d93cc4c
--- /dev/null
+++ b/dmake/startup/os2/ibm/macros.mk
@@ -0,0 +1,30 @@
+# OS/2 1.3 and 2.1 specific customization.
+
+# Standard C-language command names and flags
+CC *:= icc # C compiler
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= masm # Assembler and flags
+ASFLAGS *=
+LD *= link386 # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= lib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= ??? # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
diff --git a/dmake/startup/os2/macros.mk b/dmake/startup/os2/macros.mk
new file mode 100644
index 000000000000..08c829ba0c58
--- /dev/null
+++ b/dmake/startup/os2/macros.mk
@@ -0,0 +1,60 @@
+# Define additional OS/2 specific macros.
+#
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
+
+# Execution environment configuration.
+# Grab the current setting of COMSPEC.
+#
+.IMPORT .IGNORE : COMSPEC ROOTDIR
+
+# First check if SHELL is defined to be something other than COMSPEC.
+# If it is assume that SHELL is a Korn compatible shell like MKS's
+.IF $(SHELL) == $(NULL)
+ .IF $(COMSPEC) == $(NULL)
+ SHELL *:= $(ROOTDIR)$/bin$/sh$E
+ .ELSE
+ SHELL *:= $(COMSPEC)
+ .END
+.END
+GROUPSHELL *:= $(SHELL)
+
+# Directory entries are case incensitive
+.DIRCACHERESPCASE *:= no
+
+# Applicable suffix definitions
+A *:= .lib # Libraries
+E *:= .exe # Executables
+F *:= .for # Fortran
+O *:= .obj # Objects
+P *:= .pas # Pascal
+S *:= .asm # Assembler sources
+V *:= # RCS suffix
+
+# Now set the remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn shell.
+.IF $(SHELL) == $(COMSPEC)
+ SHELLFLAGS *:= $(SWITCHAR)c
+ GROUPFLAGS *:= $(SHELLFLAGS)
+ SHELLMETAS *:= *"?<>
+ GROUPSUFFIX *:= .bat
+ DIRSEPSTR *:= \\\
+ DIVFILE *= $(TMPFILE:s,/,\,)
+ RM *= del
+ RMFLAGS *=
+ MV *= rename
+.ELSE
+ SHELLFLAGS *:= -c
+ GROUPFLAGS *:=
+ SHELLMETAS *:= *"?<>|()&][$$\#`'
+ GROUPSUFFIX *:= .ksh
+ .MKSARGS *:= yes
+ RM *= $(ROOTDIR)$/bin$/rm
+ RMFLAGS *= -f
+ MV *= $(ROOTDIR)$/bin$/mv
+ DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}},)
+ __.DIVSEP-sh-yes !:= \\\
+ __.DIVSEP-sh-no !:= \\
+.ENDIF
diff --git a/dmake/startup/qssl/macros.mk b/dmake/startup/qssl/macros.mk
new file mode 100644
index 000000000000..de89485e8541
--- /dev/null
+++ b/dmake/startup/qssl/macros.mk
@@ -0,0 +1,11 @@
+# QNX Specific macro definitions
+#
+
+# Primary suffixes in common use
+A *:= .lib # Libraries
+
+# Standard C-language command names and flags
+AS *:= # Don't have an assembler
+
+AR *:= wlib # archiver
+ARFLAGS *=
diff --git a/dmake/startup/qssl/qnx/macros.mk b/dmake/startup/qssl/qnx/macros.mk
new file mode 100644
index 000000000000..de89485e8541
--- /dev/null
+++ b/dmake/startup/qssl/qnx/macros.mk
@@ -0,0 +1,11 @@
+# QNX Specific macro definitions
+#
+
+# Primary suffixes in common use
+A *:= .lib # Libraries
+
+# Standard C-language command names and flags
+AS *:= # Don't have an assembler
+
+AR *:= wlib # archiver
+ARFLAGS *=
diff --git a/dmake/startup/qssl/qnx/recipes.mk b/dmake/startup/qssl/qnx/recipes.mk
new file mode 100644
index 000000000000..4458b43924a7
--- /dev/null
+++ b/dmake/startup/qssl/qnx/recipes.mk
@@ -0,0 +1,8 @@
+# Define additional QNX specific build recipes.
+#
+
+# Recipe to make archive files.
+# --Figure out what to do about the librarian--
+%$A .GROUP :
+ $(AR) $(ARFLAGS) $@ $?
+ $(RM) $(RMFLAGS) $?
diff --git a/dmake/startup/qssl/recipes.mk b/dmake/startup/qssl/recipes.mk
new file mode 100644
index 000000000000..4458b43924a7
--- /dev/null
+++ b/dmake/startup/qssl/recipes.mk
@@ -0,0 +1,8 @@
+# Define additional QNX specific build recipes.
+#
+
+# Recipe to make archive files.
+# --Figure out what to do about the librarian--
+%$A .GROUP :
+ $(AR) $(ARFLAGS) $@ $?
+ $(RM) $(RMFLAGS) $?
diff --git a/dmake/startup/startup.mk b/dmake/startup/startup.mk
new file mode 100644
index 000000000000..524ad1efba26
--- /dev/null
+++ b/dmake/startup/startup.mk
@@ -0,0 +1,211 @@
+# This is the root DMAKE startup file.
+#
+# Definitions common to all environments are given at the root.
+# Definitions parameterized at the root have their parameters specified
+# in sub-makefiles which are included based on the values of the three
+# make variables:
+#
+# OS - core operating system flavour
+# OSRELEASE - specific release of the operating system
+# OSENVIRONMENT - software construction environment in use
+#
+# See the file 'summary', found in this directory for a list of
+# environments supported by this release.
+
+# Disable warnings for macros given on the command line but redefined here.
+__.silent !:= $(.SILENT) # Preserve user's .SILENT flag
+.SILENT !:= yes
+
+# startup.mk configuration parameters, for each, set it to non-null if you wish
+# to enable the named facility.
+__.HAVE_RCS !:= yes # yes => RCS is installed.
+__.HAVE_SCCS !:= # yes => SCCS is installed.
+__.DEFAULTS !:= yes # yes => define default construction rules.
+__.EXECS !:= yes # yes => define how to build executables.
+
+# Grab key definitions from the environment
+# The variables OS OSRELEASE OSENVIRONMENT were removed from this
+# list because of windows. See issue 43254 for details.
+.IMPORT .IGNORE : TMPDIR SHELL
+
+# Default DMAKE configuration, if not overriden by environment
+.INCLUDE .NOINFER $(!null,$(OS) .IGNORE) : $(INCFILENAME:d)config.mk
+
+# Look for a local defaults configuration
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)local.mk
+
+# Define the directory separator string.
+/ *= $(DIRSEPSTR)
+
+# Customize macro definitions based on setings of OS, OSRELEASE and
+# OSENVIRONMENT, this must come before the default macro definitions which
+# follow.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OS)$/macros.mk
+
+# ----------------- Default Control Macro definitions -----------------------
+# Select appropriate defaults for basic macros
+ MAKE *= $(MAKECMD) -S $(MFLAGS)
+ TMPDIR *:= $/tmp
+ DIVFILE *= $(TMPFILE)
+ AUGMAKE *:= no
+
+# Recipe execution configuration
+ SHELL *:= $/bin$/sh
+ SHELLFLAGS *:= -ce
+ GROUPSHELL *:= $(SHELL)
+ GROUPFLAGS *:=
+ SHELLMETAS *:= |();&<>?*][$$:\\#`'"
+ GROUPSUFFIX *:=
+
+# Intermediate target removal configuration
+ RM *:= $/bin$/rm
+ RMFLAGS *= -f
+ RMTARGET *= $<
+
+# Default recipe that is used to remove intermediate targets.
+.REMOVE :; $(RM) $(RMFLAGS) $(RMTARGET)
+
+# Check and enable AUGMAKE extensions for SYSV compatibility
+.IF $(AUGMAKE)
+ "@B" != $(@:b)
+ "@D" != $(@:d)
+ "@F" != $(@:f)
+ "*B" != $(*:b)
+ "*D" != $(*:d)
+ "*F" != $(*:f)
+ "<B" != $(<:b)
+ "<D" != $(<:d)
+ "<F" != $(<:f)
+ "?B" != $(?:b)
+ "?F" != $(?:f)
+ "?D" != $(?:d)
+.ENDIF
+
+# Directory caching configuration.
+ .DIRCACHE *:= yes
+ .DIRCACHERESPCASE *:= yes
+
+# Define the special NULL Prerequisite
+NULLPRQ *:= __.NULLPRQ
+
+# ---------- Default Construction Macro and Rule definitions --------------
+# The construction rules may be customized further in subsequent recipes.mk
+# files.
+.IF $(__.DEFAULTS)
+ # Primary suffixes in common use
+ A *:= .a # Libraries
+ E *:= # Executables
+ F *:= .f # Fortran
+ O *:= .o # Objects
+ P *:= .p # Pascal
+ S *:= .s # Assembler sources
+ V *:= ,v # RCS suffix
+ YTAB *:= y.tab # name-stem for yacc output files.
+ LEXYY *:= lex.yy # lex output file
+
+ # Standard C-language command names and flags
+ CPP *:= $/lib$/cpp # C-preprocessor
+ CC *:= cc # C compiler
+ CFLAGS *= # C compiler flags
+ "C++" *:= CC # C++ Compiler
+ "C++FLAGS" *= # C++ Compiler flags
+
+ AS *:= as # Assembler and flags
+ ASFLAGS *=
+
+ LD *= $(CC) # Loader and flags
+ LDFLAGS *=
+ LDLIBS *= # Default libraries
+
+ AR *:= ar # archiver
+ ARFLAGS *= -rv
+
+ # Definition of Print command for this system.
+ PRINT *= lp
+
+ # Language and Parser generation Tools and their flags
+ YACC *:= yacc # standard yacc
+ YFLAGS *=
+ LEX *:= lex # standard lex
+ LFLAGS *=
+
+ # Other Compilers, Tools and their flags
+ PC *:= pc # pascal compiler
+ RC *:= f77 # ratfor compiler
+ FC *:= f77 # fortran compiler
+ MV *:= $/bin$/mv # File rename command
+
+ # Implicit generation rules for making inferences.
+ # lex and yacc rules
+ %.c : %.y %.Y
+ $(YACC) $(YFLAGS) $<
+ $(MV) $(YTAB).c $@
+
+ %.c : %.l %.L
+ $(LEX) $(LFLAGS) $<
+ $(MV) $(LEXYY).c $@
+
+ # Rules for making *$O
+ %$O : %.c ; $(CC) $(CFLAGS) -c $<
+ %$O : %$P ; $(PC) $(PFLAGS) -c $<
+ %$O : %$S ; $(AS) $(ASFLAGS) -o $@ $<
+ %$O : %.cl ; class -c $<
+ %$O :| %.e %.r %.F %$F
+ $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
+
+ # Defibe how to build simple executables
+ .IF $(__.EXECS)
+ %$E : %$O ; $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
+ .ENDIF
+
+ # Recipe to make archive files, defined only if we have
+ # an archiver defined.
+ .IF $(AR)
+ %$A .SWAP .GROUP :
+ $(AR) $(ARFLAGS) $@ $?
+ $(RM) $(RMFLAGS) $?
+ .ENDIF
+
+ # RCS support
+ .IF $(__.HAVE_RCS)
+ CO *:= co # check out for RCS
+ COFLAGS !+= -q
+
+ % : $$(@:d)RCS$$/$$(@:f)$V
+ -$(CO) $(COFLAGS) $(null,$(@:d) $@ $(<:d:s/RCS/)$@)
+ .NOINFER : $$(@:d)RCS$$/$$(@:f)$V
+
+ .IF $V
+ % : %$V
+ -$(CO) $(COFLAGS) $(null,$(@:d) $@ $(<:d:s/RCS/)$@)
+ .NOINFER : %$V
+ .ENDIF
+ .END
+
+ # SCCS support
+ .IF $(__.HAVE_SCCS)
+ GET *:= get
+ GFLAGS !+=
+
+ % : "$$(null,$$(@:d) s.$$@ $$(@:d)s.$$(@:f))"
+ -$(GET) $(GFLAGS) $@
+ .NOINFER : "$$(null,$$(@:d) s.$$@ $$(@:d)s.$$(@:f))"
+ .END
+
+ # Customize default recipe definitions for OS, OSRELEASE, etc. settings.
+ .INCLUDE .NOINFER .IGNORE: $(INCFILENAME:d)$(OS)$/recipes.mk
+.ENDIF
+
+
+# Finally, define the default construction strategy
+.ROOT .PHONY .NOSTATE .SEQUENTIAL :- .INIT .TARGETS .DONE;
+.INIT .DONE .PHONY: $(NULLPRQ);
+
+# Define the NULL Prerequisite as having no recipe.
+$(NULLPRQ) .PHONY :;
+
+# Reset warnings back to previous setting.
+.SILENT !:= $(__.silent)
+
+# Check for a Local project file, gets parsed before user makefile.
+.INCLUDE .IGNORE .NOINFER: "project.mk"
diff --git a/dmake/startup/summary b/dmake/startup/summary
new file mode 100644
index 000000000000..4ae18860da41
--- /dev/null
+++ b/dmake/startup/summary
@@ -0,0 +1,3 @@
+The following is a summary of the supported dmake environments. When you
+issue the build command 'dmake tag' where tag is the target environment it
+will build one of these by default.
diff --git a/dmake/startup/template.mk b/dmake/startup/template.mk
new file mode 100644
index 000000000000..58544ee35848
--- /dev/null
+++ b/dmake/startup/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= xxOSxx
+ OSRELEASE *:= xxOSRELEASExx
+ OSENVIRONMENT *:= xxOSENVIRONMENTxx
diff --git a/dmake/startup/templates/mac/template.mk b/dmake/startup/templates/mac/template.mk
new file mode 100644
index 000000000000..0cf10289c826
--- /dev/null
+++ b/dmake/startup/templates/mac/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= mac
+ OSRELEASE *:=
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/msdos/borland/bcc30/template.mk b/dmake/startup/templates/msdos/borland/bcc30/template.mk
new file mode 100644
index 000000000000..df574e09c7aa
--- /dev/null
+++ b/dmake/startup/templates/msdos/borland/bcc30/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc30
diff --git a/dmake/startup/templates/msdos/borland/bcc40/template.mk b/dmake/startup/templates/msdos/borland/bcc40/template.mk
new file mode 100644
index 000000000000..30a27692f3ed
--- /dev/null
+++ b/dmake/startup/templates/msdos/borland/bcc40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc40
diff --git a/dmake/startup/templates/msdos/borland/bcc45/template.mk b/dmake/startup/templates/msdos/borland/bcc45/template.mk
new file mode 100644
index 000000000000..83b5e009033d
--- /dev/null
+++ b/dmake/startup/templates/msdos/borland/bcc45/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc45
diff --git a/dmake/startup/templates/msdos/borland/bcc50/template.mk b/dmake/startup/templates/msdos/borland/bcc50/template.mk
new file mode 100644
index 000000000000..51b575677985
--- /dev/null
+++ b/dmake/startup/templates/msdos/borland/bcc50/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc50
diff --git a/dmake/startup/templates/msdos/borland/tcc20/template.mk b/dmake/startup/templates/msdos/borland/tcc20/template.mk
new file mode 100644
index 000000000000..3cac6b22a240
--- /dev/null
+++ b/dmake/startup/templates/msdos/borland/tcc20/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= tcc20
diff --git a/dmake/startup/templates/msdos/microsft/msc51/template.mk b/dmake/startup/templates/msdos/microsft/msc51/template.mk
new file mode 100644
index 000000000000..7174197d6284
--- /dev/null
+++ b/dmake/startup/templates/msdos/microsft/msc51/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= msc51
diff --git a/dmake/startup/templates/msdos/microsft/msc60/template.mk b/dmake/startup/templates/msdos/microsft/msc60/template.mk
new file mode 100644
index 000000000000..a147c694c5f7
--- /dev/null
+++ b/dmake/startup/templates/msdos/microsft/msc60/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= msdos
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= msc60
diff --git a/dmake/startup/templates/os2/ibm/icc/template.mk b/dmake/startup/templates/os2/ibm/icc/template.mk
new file mode 100644
index 000000000000..c9c5adbf21ae
--- /dev/null
+++ b/dmake/startup/templates/os2/ibm/icc/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= os2
+ OSRELEASE *:= ibm
+ OSENVIRONMENT *:= icc
diff --git a/dmake/startup/templates/qssl/template.mk b/dmake/startup/templates/qssl/template.mk
new file mode 100644
index 000000000000..e7e9837ae671
--- /dev/null
+++ b/dmake/startup/templates/qssl/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= qssl
+ OSRELEASE *:=
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/tos/template.mk b/dmake/startup/templates/tos/template.mk
new file mode 100644
index 000000000000..91ce656f14b0
--- /dev/null
+++ b/dmake/startup/templates/tos/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= tos
+ OSRELEASE *:=
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/386ix/template.mk b/dmake/startup/templates/unix/386ix/template.mk
new file mode 100644
index 000000000000..e59d37c7ca72
--- /dev/null
+++ b/dmake/startup/templates/unix/386ix/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= 386ix
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/bsd43/template.mk b/dmake/startup/templates/unix/bsd43/template.mk
new file mode 100644
index 000000000000..14a7cab8ed4b
--- /dev/null
+++ b/dmake/startup/templates/unix/bsd43/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsd43
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/bsd43/uw/template.mk b/dmake/startup/templates/unix/bsd43/uw/template.mk
new file mode 100644
index 000000000000..6afe91c1fc7a
--- /dev/null
+++ b/dmake/startup/templates/unix/bsd43/uw/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsd43
+ OSENVIRONMENT *:= uw
diff --git a/dmake/startup/templates/unix/bsd43/vf/template.mk b/dmake/startup/templates/unix/bsd43/vf/template.mk
new file mode 100644
index 000000000000..395cd4718fa0
--- /dev/null
+++ b/dmake/startup/templates/unix/bsd43/vf/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsd43
+ OSENVIRONMENT *:= vf
diff --git a/dmake/startup/templates/unix/coherent/ver40/template.mk b/dmake/startup/templates/unix/coherent/ver40/template.mk
new file mode 100644
index 000000000000..ef23550cf651
--- /dev/null
+++ b/dmake/startup/templates/unix/coherent/ver40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= coherent
+ OSENVIRONMENT *:= ver40
diff --git a/dmake/startup/templates/unix/coherent/ver42/template.mk b/dmake/startup/templates/unix/coherent/ver42/template.mk
new file mode 100644
index 000000000000..e5dd9f99ffac
--- /dev/null
+++ b/dmake/startup/templates/unix/coherent/ver42/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= coherent
+ OSENVIRONMENT *:= ver42
diff --git a/dmake/startup/templates/unix/linux/gnu/template.mk b/dmake/startup/templates/unix/linux/gnu/template.mk
new file mode 100644
index 000000000000..a0bcef64097b
--- /dev/null
+++ b/dmake/startup/templates/unix/linux/gnu/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= linux
+ OSENVIRONMENT *:= gnu
diff --git a/dmake/startup/templates/unix/solaris/gnu/template.mk b/dmake/startup/templates/unix/solaris/gnu/template.mk
new file mode 100644
index 000000000000..3f9282027c5c
--- /dev/null
+++ b/dmake/startup/templates/unix/solaris/gnu/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= solaris
+ OSENVIRONMENT *:= gnu
diff --git a/dmake/startup/templates/unix/solaris/template.mk b/dmake/startup/templates/unix/solaris/template.mk
new file mode 100644
index 000000000000..233917a6ba92
--- /dev/null
+++ b/dmake/startup/templates/unix/solaris/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= solaris
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/sysvr1/template.mk b/dmake/startup/templates/unix/sysvr1/template.mk
new file mode 100644
index 000000000000..4eb40febb3a1
--- /dev/null
+++ b/dmake/startup/templates/unix/sysvr1/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr1
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/sysvr3/pwd/template.mk b/dmake/startup/templates/unix/sysvr3/pwd/template.mk
new file mode 100644
index 000000000000..fa6b4aa6bd1b
--- /dev/null
+++ b/dmake/startup/templates/unix/sysvr3/pwd/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr3
+ OSENVIRONMENT *:= pwd
diff --git a/dmake/startup/templates/unix/sysvr3/template.mk b/dmake/startup/templates/unix/sysvr3/template.mk
new file mode 100644
index 000000000000..3cb518671142
--- /dev/null
+++ b/dmake/startup/templates/unix/sysvr3/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr3
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/sysvr4/template.mk b/dmake/startup/templates/unix/sysvr4/template.mk
new file mode 100644
index 000000000000..553878268e59
--- /dev/null
+++ b/dmake/startup/templates/unix/sysvr4/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr4
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/unix/xenix/pwd/template.mk b/dmake/startup/templates/unix/xenix/pwd/template.mk
new file mode 100644
index 000000000000..abd4066c347b
--- /dev/null
+++ b/dmake/startup/templates/unix/xenix/pwd/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= xenix
+ OSENVIRONMENT *:= pwd
diff --git a/dmake/startup/templates/unix/xenix/template.mk b/dmake/startup/templates/unix/xenix/template.mk
new file mode 100644
index 000000000000..7ab223fbdb9f
--- /dev/null
+++ b/dmake/startup/templates/unix/xenix/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= xenix
+ OSENVIRONMENT *:=
diff --git a/dmake/startup/templates/win95/borland/bcc50/template.mk b/dmake/startup/templates/win95/borland/bcc50/template.mk
new file mode 100644
index 000000000000..b5095c40ce2a
--- /dev/null
+++ b/dmake/startup/templates/win95/borland/bcc50/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= win95
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc50
diff --git a/dmake/startup/templates/win95/microsft/vpp40/template.mk b/dmake/startup/templates/win95/microsft/vpp40/template.mk
new file mode 100644
index 000000000000..d4e6c9eb9f40
--- /dev/null
+++ b/dmake/startup/templates/win95/microsft/vpp40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= win95
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= vpp40
diff --git a/dmake/startup/templates/winnt/borland/bcc50/template.mk b/dmake/startup/templates/winnt/borland/bcc50/template.mk
new file mode 100644
index 000000000000..b94ac034e0a1
--- /dev/null
+++ b/dmake/startup/templates/winnt/borland/bcc50/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= winnt
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc50
diff --git a/dmake/startup/templates/winnt/microsft/vpp40/template.mk b/dmake/startup/templates/winnt/microsft/vpp40/template.mk
new file mode 100644
index 000000000000..e53922df68c3
--- /dev/null
+++ b/dmake/startup/templates/winnt/microsft/vpp40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= winnt
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= vpp40
diff --git a/dmake/startup/tos/macros.mk b/dmake/startup/tos/macros.mk
new file mode 100644
index 000000000000..1023dfc9acd1
--- /dev/null
+++ b/dmake/startup/tos/macros.mk
@@ -0,0 +1,24 @@
+# Define Atari TOS specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Set default to GCC Compiler.
+CPP *:= /gnu/lib/cpp
+CC *:= gcc
+"C++" *:= g++
+AS *:= gas
+YACC *:= bison
+LEX *:= flex
+RM *:= /bin/rm
+
+# Common flag settings
+ARFLAGS *= -rvs
+
+# Other appropriate macro settings.
+A *:= .olb
+SHELLFLAGS *:=
+GROUPSUFFIX *:= .bat
diff --git a/dmake/startup/unix/386ix/macros.mk b/dmake/startup/unix/386ix/macros.mk
new file mode 100644
index 000000000000..a359b302f546
--- /dev/null
+++ b/dmake/startup/unix/386ix/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/sysvr3
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/Makefile.am b/dmake/startup/unix/Makefile.am
new file mode 100755
index 000000000000..d7861ffffa1d
--- /dev/null
+++ b/dmake/startup/unix/Makefile.am
@@ -0,0 +1,8 @@
+
+startupdir = $(datadir)/startup/unix
+
+startup_DATA = macros.mk recipes.mk
+
+DIST_SUBDIRS = cygwin linux macosx solaris sysvr4
+SUBDIRS = @OS_VERSION@
+
diff --git a/dmake/startup/unix/Makefile.in b/dmake/startup/unix/Makefile.in
new file mode 100644
index 000000000000..7abbdf7f7de7
--- /dev/null
+++ b/dmake/startup/unix/Makefile.in
@@ -0,0 +1,489 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix
+startup_DATA = macros.mk recipes.mk
+DIST_SUBDIRS = cygwin linux macosx solaris sysvr4
+SUBDIRS = @OS_VERSION@
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-recursive ctags ctags-recursive \
+ distclean distclean-generic distclean-recursive distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/bsd43/macros.mk b/dmake/startup/unix/bsd43/macros.mk
new file mode 100644
index 000000000000..be4ae5fe45e9
--- /dev/null
+++ b/dmake/startup/unix/bsd43/macros.mk
@@ -0,0 +1,11 @@
+# Define additional Berkely UNIX specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Set defaults for local OS release
+RANLIB *:= ranlib
+PRINT *:= lpr
diff --git a/dmake/startup/unix/bsd43/recipes.mk b/dmake/startup/unix/bsd43/recipes.mk
new file mode 100644
index 000000000000..557ac7c8c17b
--- /dev/null
+++ b/dmake/startup/unix/bsd43/recipes.mk
@@ -0,0 +1,13 @@
+# Define additional Berkeley UNIX specific build rules and recipes.
+#
+
+# Recipe to make archive files.
+%$A .GROUP :
+ $(AR) $(ARFLAGS) $@ $?
+ $(RM) $(RMFLAGS) $?
+ $(RANLIB) $@
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/recipes.mk
+.ENDIF
diff --git a/dmake/startup/unix/coherent/macros.mk b/dmake/startup/unix/coherent/macros.mk
new file mode 100644
index 000000000000..e0201ebd14ba
--- /dev/null
+++ b/dmake/startup/unix/coherent/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard BSD'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/bsd43
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/coherent/recipes.mk b/dmake/startup/unix/coherent/recipes.mk
new file mode 100644
index 000000000000..5966640d3621
--- /dev/null
+++ b/dmake/startup/unix/coherent/recipes.mk
@@ -0,0 +1,6 @@
+# Use the same file as
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/bsd43
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : recipes.mk
diff --git a/dmake/startup/unix/cygwin/Makefile.am b/dmake/startup/unix/cygwin/Makefile.am
new file mode 100644
index 000000000000..97848b4abeee
--- /dev/null
+++ b/dmake/startup/unix/cygwin/Makefile.am
@@ -0,0 +1,6 @@
+startupdir = $(datadir)/startup/unix/cygwin
+
+startup_DATA = macros.mk
+
+
+
diff --git a/dmake/startup/unix/cygwin/Makefile.in b/dmake/startup/unix/cygwin/Makefile.in
new file mode 100644
index 000000000000..9b8adb8245ba
--- /dev/null
+++ b/dmake/startup/unix/cygwin/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix/cygwin
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix/cygwin
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/cygwin/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/cygwin/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/cygwin/macros.mk b/dmake/startup/unix/cygwin/macros.mk
new file mode 100644
index 000000000000..91956ca4736a
--- /dev/null
+++ b/dmake/startup/unix/cygwin/macros.mk
@@ -0,0 +1,10 @@
+# Define additional Cygwin specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Make OS-release-specific settings
+#PRINT *:= lpr
diff --git a/dmake/startup/unix/linux/Makefile.am b/dmake/startup/unix/linux/Makefile.am
new file mode 100755
index 000000000000..c19307b12a21
--- /dev/null
+++ b/dmake/startup/unix/linux/Makefile.am
@@ -0,0 +1,6 @@
+
+startupdir = $(datadir)/startup/unix/linux
+
+startup_DATA = macros.mk
+
+
diff --git a/dmake/startup/unix/linux/Makefile.in b/dmake/startup/unix/linux/Makefile.in
new file mode 100644
index 000000000000..6c58d38dcd51
--- /dev/null
+++ b/dmake/startup/unix/linux/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix/linux
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix/linux
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/linux/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/linux/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/linux/gnu/macros.mk b/dmake/startup/unix/linux/gnu/macros.mk
new file mode 100644
index 000000000000..3d9c437d9e70
--- /dev/null
+++ b/dmake/startup/unix/linux/gnu/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d:d:d)/sysvr3/gnu
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/linux/macros.mk b/dmake/startup/unix/linux/macros.mk
new file mode 100644
index 000000000000..228dafff2992
--- /dev/null
+++ b/dmake/startup/unix/linux/macros.mk
@@ -0,0 +1,10 @@
+# Define additional Linux specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Make OS-release-specific settings
+PRINT *:= lpr
diff --git a/dmake/startup/unix/macosx/Makefile.am b/dmake/startup/unix/macosx/Makefile.am
new file mode 100755
index 000000000000..54bf5b17b5d3
--- /dev/null
+++ b/dmake/startup/unix/macosx/Makefile.am
@@ -0,0 +1,6 @@
+
+startupdir = $(datadir)/startup/unix/macosx
+
+startup_DATA = macros.mk
+
+
diff --git a/dmake/startup/unix/macosx/Makefile.in b/dmake/startup/unix/macosx/Makefile.in
new file mode 100644
index 000000000000..b391080f6e80
--- /dev/null
+++ b/dmake/startup/unix/macosx/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix/macosx
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix/macosx
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/macosx/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/macosx/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/macosx/gnu/macros.mk b/dmake/startup/unix/macosx/gnu/macros.mk
new file mode 100644
index 000000000000..3d9c437d9e70
--- /dev/null
+++ b/dmake/startup/unix/macosx/gnu/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d:d:d)/sysvr3/gnu
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/macosx/macros.mk b/dmake/startup/unix/macosx/macros.mk
new file mode 100644
index 000000000000..b29e917ec8e1
--- /dev/null
+++ b/dmake/startup/unix/macosx/macros.mk
@@ -0,0 +1,10 @@
+# Define additional Mac OS X specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Make OS-release-specific settings
+PRINT *:= lpr
diff --git a/dmake/startup/unix/macros.mk b/dmake/startup/unix/macros.mk
new file mode 100644
index 000000000000..362b81d2c2f6
--- /dev/null
+++ b/dmake/startup/unix/macros.mk
@@ -0,0 +1,5 @@
+# Define additional UNIX specific macros.
+#
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
diff --git a/dmake/startup/unix/os2/Makefile.am b/dmake/startup/unix/os2/Makefile.am
new file mode 100644
index 000000000000..be69ae315058
--- /dev/null
+++ b/dmake/startup/unix/os2/Makefile.am
@@ -0,0 +1,6 @@
+
+startupdir = $(datadir)/startup/unix/os2
+
+startup_DATA = macros.mk
+
+
diff --git a/dmake/startup/unix/os2/Makefile.in b/dmake/startup/unix/os2/Makefile.in
new file mode 100644
index 000000000000..3fabee1a12a9
--- /dev/null
+++ b/dmake/startup/unix/os2/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix/os2
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix/os2
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/os2/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/os2/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/os2/macros.mk b/dmake/startup/unix/os2/macros.mk
new file mode 100644
index 000000000000..08c829ba0c58
--- /dev/null
+++ b/dmake/startup/unix/os2/macros.mk
@@ -0,0 +1,60 @@
+# Define additional OS/2 specific macros.
+#
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
+
+# Execution environment configuration.
+# Grab the current setting of COMSPEC.
+#
+.IMPORT .IGNORE : COMSPEC ROOTDIR
+
+# First check if SHELL is defined to be something other than COMSPEC.
+# If it is assume that SHELL is a Korn compatible shell like MKS's
+.IF $(SHELL) == $(NULL)
+ .IF $(COMSPEC) == $(NULL)
+ SHELL *:= $(ROOTDIR)$/bin$/sh$E
+ .ELSE
+ SHELL *:= $(COMSPEC)
+ .END
+.END
+GROUPSHELL *:= $(SHELL)
+
+# Directory entries are case incensitive
+.DIRCACHERESPCASE *:= no
+
+# Applicable suffix definitions
+A *:= .lib # Libraries
+E *:= .exe # Executables
+F *:= .for # Fortran
+O *:= .obj # Objects
+P *:= .pas # Pascal
+S *:= .asm # Assembler sources
+V *:= # RCS suffix
+
+# Now set the remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn shell.
+.IF $(SHELL) == $(COMSPEC)
+ SHELLFLAGS *:= $(SWITCHAR)c
+ GROUPFLAGS *:= $(SHELLFLAGS)
+ SHELLMETAS *:= *"?<>
+ GROUPSUFFIX *:= .bat
+ DIRSEPSTR *:= \\\
+ DIVFILE *= $(TMPFILE:s,/,\,)
+ RM *= del
+ RMFLAGS *=
+ MV *= rename
+.ELSE
+ SHELLFLAGS *:= -c
+ GROUPFLAGS *:=
+ SHELLMETAS *:= *"?<>|()&][$$\#`'
+ GROUPSUFFIX *:= .ksh
+ .MKSARGS *:= yes
+ RM *= $(ROOTDIR)$/bin$/rm
+ RMFLAGS *= -f
+ MV *= $(ROOTDIR)$/bin$/mv
+ DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}},)
+ __.DIVSEP-sh-yes !:= \\\
+ __.DIVSEP-sh-no !:= \\
+.ENDIF
diff --git a/dmake/startup/unix/recipes.mk b/dmake/startup/unix/recipes.mk
new file mode 100644
index 000000000000..1650430f3ed8
--- /dev/null
+++ b/dmake/startup/unix/recipes.mk
@@ -0,0 +1,15 @@
+# Define additional UNIX specific build recipes.
+#
+
+# Define additional build targets.
+%$E : %.sh; cp $< $@; chmod 0777 $@
+
+# This rule tells how to make a non-suffixed executable from its single
+# file source.
+% : %$O; $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
+
+# This rule tells how to make a.out from it's immediate list of prerequisites.
+%.out :; $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/recipes.mk
diff --git a/dmake/startup/unix/solaris/Makefile.am b/dmake/startup/unix/solaris/Makefile.am
new file mode 100755
index 000000000000..2eb9126720e6
--- /dev/null
+++ b/dmake/startup/unix/solaris/Makefile.am
@@ -0,0 +1,6 @@
+
+startupdir = $(datadir)/startup/unix/solaris
+
+startup_DATA = macros.mk
+
+
diff --git a/dmake/startup/unix/solaris/Makefile.in b/dmake/startup/unix/solaris/Makefile.in
new file mode 100644
index 000000000000..66503539efda
--- /dev/null
+++ b/dmake/startup/unix/solaris/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix/solaris
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix/solaris
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/solaris/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/solaris/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/solaris/macros.mk b/dmake/startup/unix/solaris/macros.mk
new file mode 100644
index 000000000000..a359b302f546
--- /dev/null
+++ b/dmake/startup/unix/solaris/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/sysvr3
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/sysvr1/macros.mk b/dmake/startup/unix/sysvr1/macros.mk
new file mode 100644
index 000000000000..a359b302f546
--- /dev/null
+++ b/dmake/startup/unix/sysvr1/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/sysvr3
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/sysvr3/gnu/macros.mk b/dmake/startup/unix/sysvr3/gnu/macros.mk
new file mode 100644
index 000000000000..13141971fe40
--- /dev/null
+++ b/dmake/startup/unix/sysvr3/gnu/macros.mk
@@ -0,0 +1,12 @@
+# System V R3 GCC compiler specific macro definitions...
+#
+
+# Common tool renamings
+CC *:= gcc
+"C++" *:= g++
+AS *:= gas
+YACC *:= bison
+LEX *:= flex
+
+# Common flag settings
+ARFLAGS *= -rvs
diff --git a/dmake/startup/unix/sysvr3/macros.mk b/dmake/startup/unix/sysvr3/macros.mk
new file mode 100644
index 000000000000..2ccd730acfc0
--- /dev/null
+++ b/dmake/startup/unix/sysvr3/macros.mk
@@ -0,0 +1,7 @@
+# Define additional UNIX specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
diff --git a/dmake/startup/unix/sysvr4/Makefile.am b/dmake/startup/unix/sysvr4/Makefile.am
new file mode 100755
index 000000000000..6c1b9590f54e
--- /dev/null
+++ b/dmake/startup/unix/sysvr4/Makefile.am
@@ -0,0 +1,6 @@
+
+startupdir = $(datadir)/startup/unix/sysvr4
+
+startup_DATA = macros.mk
+
+
diff --git a/dmake/startup/unix/sysvr4/Makefile.in b/dmake/startup/unix/sysvr4/Makefile.in
new file mode 100644
index 000000000000..2722634d7b4f
--- /dev/null
+++ b/dmake/startup/unix/sysvr4/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/unix/sysvr4
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/unix/sysvr4
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/unix/sysvr4/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/unix/sysvr4/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/unix/sysvr4/macros.mk b/dmake/startup/unix/sysvr4/macros.mk
new file mode 100644
index 000000000000..a359b302f546
--- /dev/null
+++ b/dmake/startup/unix/sysvr4/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/sysvr3
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/unix/xenix/macros.mk b/dmake/startup/unix/xenix/macros.mk
new file mode 100644
index 000000000000..a359b302f546
--- /dev/null
+++ b/dmake/startup/unix/xenix/macros.mk
@@ -0,0 +1,6 @@
+# We hang off the standard sysvr3'isms
+#
+__.incdir !:= $(INCFILENAME:d:d:d:d)/sysvr3
+
+# Process environment-specific refinements, if any.
+.INCLUDE .SETDIR=$(__.incdir) .NOINFER .IGNORE : macros.mk
diff --git a/dmake/startup/win95/borland/macros.mk b/dmake/startup/win95/borland/macros.mk
new file mode 100644
index 000000000000..2017f02d3f1f
--- /dev/null
+++ b/dmake/startup/win95/borland/macros.mk
@@ -0,0 +1,34 @@
+# MSDOS Borland-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CPP *:= # C-preprocessor
+CC *:= bcc32
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= tasm # Assembler and flags
+ASFLAGS *=
+LD *= tlink32 # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= tlib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= tpc # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
diff --git a/dmake/startup/win95/macros.mk b/dmake/startup/win95/macros.mk
new file mode 100644
index 000000000000..5490634e6762
--- /dev/null
+++ b/dmake/startup/win95/macros.mk
@@ -0,0 +1,75 @@
+# Define additional MSDOS specific settings.
+#
+
+# Execution environment configuration.
+# Grab the current setting of COMSPEC.
+#
+.IMPORT .IGNORE : COMSPEC ROOTDIR
+
+# First check if SHELL is defined to be something other than COMSPEC.
+# If it is, then assume that SHELL is a Korn compatible shell like MKS's
+.IF $(SHELL) == $(NULL)
+ .IF $(COMSPEC) == $(NULL)
+ SHELL *:= $(ROOTDIR)$/bin$/sh$E
+ .ELSE
+ SHELL *:= $(COMSPEC)
+ .END
+.END
+GROUPSHELL *:= $(SHELL)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
+
+# Applicable suffix definitions
+A *:= .lib # Libraries
+E *:= .exe # Executables
+F *:= .for # Fortran
+O *:= .obj # Objects
+P *:= .pas # Pascal
+S *:= .asm # Assembler sources
+V *:= # RCS suffix
+
+# Now set the remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn shell.
+.IF $(SHELL) == $(COMSPEC)
+.IF $(COMSPEC:lf) == cmd.exe
+ SHELLFLAGS *:= $(SWITCHAR)S $(SWITCHAR)c
+ SHELLCMDQUOTE *:= "
+# " fix syntax highlighting
+.ELIF $(COMSPEC:lf) == command.com
+ SHELLFLAGS *:= $(SWITCHAR)c
+ SHELLCMDQUOTE *:= "
+# " fix syntax highlighting
+.ELSE
+ SHELLFLAGS *:= $(SWITCHAR)c
+.END
+ GROUPFLAGS *:= $(SWITCHAR)c
+ SHELLMETAS *:= "<>|
+# " fix syntax highlighting
+ GROUPSUFFIX *:= .bat
+ DIVFILE *= $(TMPFILE:s,/,\,)
+ RM *= del
+ RMFLAGS *=
+ MV *= rename
+ __.DIVSEP-sh-yes *:= \\
+ __.DIVSEP-sh-no *:= \\
+.ELSE
+ SHELL !:= $(SHELL:s,/,\,)
+ COMMAND *= $(CMNDNAME:s,/,\,) $(CMNDARGS)
+ SHELLFLAGS *:= -c
+ GROUPFLAGS *:=
+ SHELLMETAS *:= *";?<>|()&][$$\#`'
+ GROUPSUFFIX *:= .ksh
+ .MKSARGS *:= yes
+ RM *= $(ROOTDIR)$/bin$/rm
+ RMFLAGS *= -f
+ MV *= $(ROOTDIR)$/bin$/mv
+ DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}},)
+ __.DIVSEP-sh-yes *:= \\\
+ __.DIVSEP-sh-no *:= \\
+.ENDIF
+
+
+# Does not respect case of filenames.
+.DIRCACHERESPCASE := no
diff --git a/dmake/startup/win95/microsft/macros.mk b/dmake/startup/win95/microsft/macros.mk
new file mode 100644
index 000000000000..f10b1fdfa69d
--- /dev/null
+++ b/dmake/startup/win95/microsft/macros.mk
@@ -0,0 +1,38 @@
+# MSDOS Microsoft-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CC *:= cl # C compiler
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= masm # Assembler and flags
+ASFLAGS *=
+LD *= link # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= lib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= ??? # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
+
+
+# Directory cache configuration.
+.DIRCACHE *:= no
diff --git a/dmake/startup/win95/recipes.mk b/dmake/startup/win95/recipes.mk
new file mode 100644
index 000000000000..5a98f22b1e05
--- /dev/null
+++ b/dmake/startup/win95/recipes.mk
@@ -0,0 +1,9 @@
+# Define additional MSDOS specific build recipes.
+#
+
+# Executables
+ %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
+ %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/recipes.mk
diff --git a/dmake/startup/winnt/Makefile.am b/dmake/startup/winnt/Makefile.am
new file mode 100644
index 000000000000..5bbd4d63247b
--- /dev/null
+++ b/dmake/startup/winnt/Makefile.am
@@ -0,0 +1,8 @@
+
+startupdir = $(datadir)/startup/winnt
+
+startup_DATA = macros.mk recipes.mk
+
+DIST_SUBDIRS = mingw msvc6
+SUBDIRS = @OS_VERSION@
+
diff --git a/dmake/startup/winnt/Makefile.in b/dmake/startup/winnt/Makefile.in
new file mode 100644
index 000000000000..48812e431714
--- /dev/null
+++ b/dmake/startup/winnt/Makefile.in
@@ -0,0 +1,489 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/winnt
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/winnt
+startup_DATA = macros.mk recipes.mk
+DIST_SUBDIRS = mingw msvc6
+SUBDIRS = @OS_VERSION@
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/winnt/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/winnt/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-recursive ctags ctags-recursive \
+ distclean distclean-generic distclean-recursive distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/winnt/borland/macros.mk b/dmake/startup/winnt/borland/macros.mk
new file mode 100644
index 000000000000..2017f02d3f1f
--- /dev/null
+++ b/dmake/startup/winnt/borland/macros.mk
@@ -0,0 +1,34 @@
+# MSDOS Borland-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CPP *:= # C-preprocessor
+CC *:= bcc32
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= tasm # Assembler and flags
+ASFLAGS *=
+LD *= tlink32 # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= tlib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= tpc # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
diff --git a/dmake/startup/winnt/macros.mk b/dmake/startup/winnt/macros.mk
new file mode 100644
index 000000000000..507773b36c45
--- /dev/null
+++ b/dmake/startup/winnt/macros.mk
@@ -0,0 +1,75 @@
+# Define additional MSDOS specific settings.
+#
+
+# Execution environment configuration.
+# Grab the current setting of COMSPEC.
+#
+.IMPORT .IGNORE : COMSPEC ROOTDIR
+
+# First check if SHELL is defined to be something other than COMSPEC.
+# If it is, then assume that SHELL is a Korn compatible shell like MKS's
+.IF $(SHELL) == $(NULL)
+ .IF $(COMSPEC) == $(NULL)
+ SHELL *:= $(ROOTDIR)$/bin$/sh$E
+ .ELSE
+ SHELL *:= $(COMSPEC)
+ .END
+.END
+GROUPSHELL *:= $(SHELL)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
+
+# Applicable suffix definitions
+A *:= .lib # Libraries
+E *:= .exe # Executables
+F *:= .for # Fortran
+O *:= .obj # Objects
+P *:= .pas # Pascal
+S *:= .asm # Assembler sources
+V *:= # RCS suffix
+
+# Now set the remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn shell.
+.IF $(SHELL) == $(COMSPEC)
+.IF $(COMSPEC:lf) == cmd.exe
+ SHELLFLAGS *:= $(SWITCHAR)S $(SWITCHAR)c
+ SHELLCMDQUOTE *:= "
+# " fix syntax highlighting
+.ELIF $(COMSPEC:lf) == command.com
+ SHELLFLAGS *:= $(SWITCHAR)c
+ SHELLCMDQUOTE *:= "
+# " fix syntax highlighting
+.ELSE
+ SHELLFLAGS *:= $(SWITCHAR)c
+.END
+ GROUPFLAGS *:= $(SWITCHAR)c
+ SHELLMETAS *:= "<>|
+# " fix syntax highlighting
+ GROUPSUFFIX *:= .cmd
+ DIVFILE *= $(TMPFILE:s,/,\,)
+ RM *= del
+ RMFLAGS *=
+ MV *= rename
+ __.DIVSEP-sh-yes *:= \\
+ __.DIVSEP-sh-no *:= \\
+.ELSE
+ SHELL !:= $(SHELL:s,/,\,)
+ COMMAND *= $(CMNDNAME:s,/,\,) $(CMNDARGS)
+ SHELLFLAGS *:= -c
+ GROUPFLAGS *:=
+ SHELLMETAS *:= *";?<>|()&][$$\#`'
+ GROUPSUFFIX *:= .ksh
+ .MKSARGS *:= yes
+ RM *= $(ROOTDIR)$/bin$/rm
+ RMFLAGS *= -f
+ MV *= $(ROOTDIR)$/bin$/mv
+ DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}},)
+ __.DIVSEP-sh-yes *:= \\\
+ __.DIVSEP-sh-no *:= \\
+.ENDIF
+
+
+# Does not respect case of filenames.
+.DIRCACHERESPCASE := no
diff --git a/dmake/startup/winnt/microsft/macros.mk b/dmake/startup/winnt/microsft/macros.mk
new file mode 100644
index 000000000000..eed3fbdeeedb
--- /dev/null
+++ b/dmake/startup/winnt/microsft/macros.mk
@@ -0,0 +1,37 @@
+# MSDOS Microsoft-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CC *:= cl # C compiler
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= masm # Assembler and flags
+ASFLAGS *=
+LD *= link # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= lib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= ??? # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
+
+# Directory cache configuration.
+.DIRCACHE *:= no
diff --git a/dmake/startup/winnt/mingw/Makefile.am b/dmake/startup/winnt/mingw/Makefile.am
new file mode 100644
index 000000000000..7b91888be5bc
--- /dev/null
+++ b/dmake/startup/winnt/mingw/Makefile.am
@@ -0,0 +1,6 @@
+startupdir = $(datadir)/startup/winnt/mingw
+
+startup_DATA = macros.mk
+
+
+
diff --git a/dmake/startup/winnt/mingw/Makefile.in b/dmake/startup/winnt/mingw/Makefile.in
new file mode 100644
index 000000000000..5ded188bb9e4
--- /dev/null
+++ b/dmake/startup/winnt/mingw/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/winnt/mingw
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/winnt/mingw
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/winnt/mingw/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/winnt/mingw/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/winnt/mingw/macros.mk b/dmake/startup/winnt/mingw/macros.mk
new file mode 100644
index 000000000000..77cc4ef04d5f
--- /dev/null
+++ b/dmake/startup/winnt/mingw/macros.mk
@@ -0,0 +1,10 @@
+# Define additional MinGW specific macros.
+#
+
+# Process environment-specific refinements, if any.
+.IF $(OSENVIRONMENT)
+ .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Make OS-release-specific settings
+#PRINT *:= lpr
diff --git a/dmake/startup/winnt/msvc6/Makefile.am b/dmake/startup/winnt/msvc6/Makefile.am
new file mode 100644
index 000000000000..d621377de8ed
--- /dev/null
+++ b/dmake/startup/winnt/msvc6/Makefile.am
@@ -0,0 +1,6 @@
+startupdir = $(datadir)/startup/winnt/msvc6
+
+startup_DATA = macros.mk
+
+
+
diff --git a/dmake/startup/winnt/msvc6/Makefile.in b/dmake/startup/winnt/msvc6/Makefile.in
new file mode 100644
index 000000000000..10c03813f21f
--- /dev/null
+++ b/dmake/startup/winnt/msvc6/Makefile.in
@@ -0,0 +1,331 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = startup/winnt/msvc6
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(startupdir)"
+startupDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(startup_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+startupdir = $(datadir)/startup/winnt/msvc6
+startup_DATA = macros.mk
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign startup/winnt/msvc6/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign startup/winnt/msvc6/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-startupDATA: $(startup_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(startupdir)" || $(mkdir_p) "$(DESTDIR)$(startupdir)"
+ @list='$(startup_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(startupDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(startupdir)/$$f'"; \
+ $(startupDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+
+uninstall-startupDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(startup_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(startupdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(startupdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(startupdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-startupDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-startupDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-startupDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am uninstall-startupDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/startup/winnt/msvc6/macros.mk b/dmake/startup/winnt/msvc6/macros.mk
new file mode 100644
index 000000000000..eed3fbdeeedb
--- /dev/null
+++ b/dmake/startup/winnt/msvc6/macros.mk
@@ -0,0 +1,37 @@
+# MSDOS Microsoft-C environment customization.
+
+.IF $(OSENVIRONMENT)
+ .INCLUDE .IGNORE .NOINFER : $(INCFILENAME:d)$(OSENVIRONMENT)$/macros.mk
+.ENDIF
+
+# Standard C-language command names and flags
+CC *:= cl # C compiler
+CPP *:= # C-preprocessor
+CFLAGS *= # C compiler flags
+"C++" *:= # C++ Compiler
+"C++FLAGS" *= # C++ Compiler flags
+
+AS *:= masm # Assembler and flags
+ASFLAGS *=
+LD *= link # Loader and flags
+LDFLAGS *=
+LDLIBS *= # Default libraries
+AR *:= lib # archiver
+ARFLAGS *= ????
+
+# Definition of Print command for this system.
+PRINT *= print
+
+# Language and Parser generation Tools and their flags
+YACC *:= yacc # standard yacc
+YFLAGS *=
+LEX *:= lex # standard lex
+LFLAGS *=
+
+# Other Compilers, Tools and their flags
+PC *:= ??? # pascal compiler
+RC *:= ??? # ratfor compiler
+FC *:= ??? # fortran compiler
+
+# Directory cache configuration.
+.DIRCACHE *:= no
diff --git a/dmake/startup/winnt/recipes.mk b/dmake/startup/winnt/recipes.mk
new file mode 100644
index 000000000000..5a98f22b1e05
--- /dev/null
+++ b/dmake/startup/winnt/recipes.mk
@@ -0,0 +1,9 @@
+# Define additional MSDOS specific build recipes.
+#
+
+# Executables
+ %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
+ %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\)
+
+# Process release-specific refinements, if any.
+.INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/recipes.mk
diff --git a/dmake/stat.c b/dmake/stat.c
new file mode 100644
index 000000000000..4bd4db810af1
--- /dev/null
+++ b/dmake/stat.c
@@ -0,0 +1,278 @@
+/* RCS $Id: stat.c,v 1.3 2007-10-15 15:41:38 ihi Exp $
+--
+-- SYNOPSIS
+-- Bind a target name to a file.
+--
+-- DESCRIPTION
+-- This file contains the code to go and stat a target. The stat rules
+-- follow a predefined order defined in the comment for Stat_target.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+
+static int _check_dir_list ANSI((CELLPTR, CELLPTR, int, int));
+
+#ifdef DBUG
+ /* Just a little ditty for debugging this thing */
+ static time_t
+ _do_stat( name, lib, sym, force )
+ char *name;
+ char *lib;
+ char **sym;
+ int force;
+ {
+ time_t res;
+ DB_ENTER( "_do_stat" );
+
+ res = Do_stat(name, lib, sym, force);
+ DB_PRINT( "stat", ("Statted [%s,%s,%d,%ld]", name, lib, sym, res) );
+
+ DB_RETURN( res );
+ }
+#define DO_STAT(A,B,C,D) _do_stat(A,B,C,D)
+#else
+#define DO_STAT(A,B,C,D) Do_stat(A,B,C,D)
+#endif
+
+static char *_first; /* If set this variable saves the first pathname that was
+ * used to stat the target in, if subsequently a match is
+ * found it is overridden by the matched path name. */
+
+PUBLIC void
+Stat_target( cp, setfname, force )/*
+====================================
+ Stat a target. When doing so follow the following rules, suppose
+ that cp->CE_NAME points at a target called fred.o:
+ (See also man page: BINDING TARGETS)
+
+ 0. If A_SYMBOL attribute set look into the library
+ then do the steps 1 thru 4 on the resulting name.
+ 1. Try path's obtained by prepending any dirs found as
+ prerequisites for .SOURCE.o.
+ 2. If not found, do same as 2 but use .SOURCE
+ The predefined '.SOURCE : .NULL' targets takes care
+ of local/absolute paths.
+ 3. If not found and .LIBRARYM attribute for the target is
+ set then look for it in the corresponding library.
+ 4. If found in step 0 thru 3, then ce_fname points at
+ file name associate with target, else ce_fname points
+ at a file name built by the first .SOURCE* dir that
+ applied.
+ If setfname is != 0 this tells _check_dir_list() to set the static
+ _first variable. setfname also controls the use of _first.
+ If it is -1 ce_fname (the file name associated with target) is only
+ set if a matching file was found and statted, if it is 1 ce_fname
+ is set to _first even if target doesn't exist yet.
+
+ If force is TRUE really stat the target. Do not use the directory
+ cache but update the files entry if it's enabled. */
+
+CELLPTR cp;
+int setfname;
+int force;
+{
+ register HASHPTR hp;
+ static HASHPTR srchp = NIL(HASH);
+ char *name;
+ char *tmp;
+ int res = 0;
+
+ DB_ENTER( "Stat_target" );
+
+ name = cp->CE_NAME;
+ DB_PRINT( "stat", ("called on [%s]", name) );
+
+ if( srchp == NIL(HASH) ) srchp = Get_name(".SOURCE",Defs,FALSE);
+
+ /* Look for a symbol of the form lib((symbol)) the name of the symbol
+ * as entered in the hash table is (symbol) so pull out symbol and try
+ * to find it's module. If successful DO_STAT will return the module
+ * as well as the archive member name (pointed at by tmp). We then
+ * replace the symbol name with the archive member name so that we
+ * have the proper name for any future refrences. */
+
+ if( cp->ce_attr & A_SYMBOL ) {
+ DB_PRINT( "stat", ("Binding lib symbol [%s]", name) );
+
+ cp->ce_time = DO_STAT( name, cp->ce_lib, &tmp, force );
+
+ if( cp->ce_time != (time_t) 0L ) {
+ /* stat the new member name below note tmp must point at a string
+ * returned by MALLOC... ie. the Do_stat code should use DmStrDup */
+
+ if( Verbose & V_MAKE )
+ printf( "%s: Mapped ((%s)) to %s(%s)\n", Pname,
+ name, cp->ce_lib, tmp );
+
+ FREE( name );
+ name = cp->CE_NAME = tmp;
+ cp->ce_attr &= ~(A_FFNAME | A_SYMBOL);
+ }
+ else
+ { DB_VOID_RETURN; }
+ }
+
+ _first = NIL(char);
+ tmp = DmStrJoin( ".SOURCE", Get_suffix(name), -1, FALSE);
+
+ /* Check .SOURCE.xxx target */
+ if( (hp = Get_name(tmp, Defs, FALSE)) != NIL(HASH) )
+ res = _check_dir_list( cp, hp->CP_OWNR, setfname, force );
+
+ /* Check just .SOURCE */
+ if( !res && (srchp != NIL(HASH)) )
+ res = _check_dir_list( cp, srchp->CP_OWNR, setfname, force );
+
+ /* If libmember and we haven't found it check the library */
+ if( !res && (cp->ce_attr & A_LIBRARYM) ) {
+ cp->ce_time = DO_STAT(name, cp->ce_lib, NIL(char *), force);
+
+ if( !cp->ce_time && Tmd && *Tmd && cp->ce_lib ) {
+ char *tmplib;
+ tmplib=DmStrDup(Build_path(Tmd,cp->ce_lib));
+
+ if ((cp->ce_time = DO_STAT(name, tmplib, NIL(char *),force)) != (time_t)0L){
+ cp->ce_lib=DmStrDup(tmplib);
+ }
+ }
+
+ if( Verbose & V_MAKE )
+ printf( "%s: Checking library '%s' for member [%s], time %ld\n",
+ Pname, cp->ce_lib, name, cp->ce_time );
+ }
+
+ FREE( tmp );
+
+ if( setfname == 1 || (setfname == -1 && cp->ce_time != (time_t)0L) ) {
+ int setlib = (cp->ce_lib == cp->ce_fname);
+
+ if( (cp->ce_attr & A_FFNAME) && (cp->ce_fname != NIL(char)) )
+ FREE( cp->ce_fname );
+
+ if( _first != NIL(char) ) {
+ cp->ce_fname = _first;
+ cp->ce_attr |= A_FFNAME;
+ }
+ else {
+ cp->ce_fname = cp->CE_NAME;
+ cp->ce_attr &= ~A_FFNAME;
+ }
+
+ if ( setlib ) cp->ce_lib = cp->ce_fname;
+ }
+ else if( _first )
+ FREE( _first );
+
+ /* set it as stated only if successful, this way, we shall try again
+ * later. */
+ if( cp->ce_time != (time_t)0L ) {
+ cp->ce_flag |= F_STAT;
+
+ /* If it is a whatif this changed scenario then return the current
+ * time, but do so only if the stat was successful. */
+ if ( (cp->ce_attr & A_WHATIF) && !(cp->ce_flag & F_MADE) ) {
+ cp->ce_time = Do_time();
+ }
+ }
+
+ DB_VOID_RETURN;
+}
+
+
+static int
+_check_dir_list( cp, sp, setfname, force )/*
+============================================
+ Check the list of dir's given by the prerequisite list of sp, for a
+ file pointed at by cp. Returns 0 if path not bound, else returns
+ 1 and replaces old name for cell with new cell name. */
+
+CELLPTR cp;
+CELLPTR sp;
+int setfname;
+int force;
+{
+ /* FIXME: BCC 5.0 BUG??? If lp is assigned to a register variable then
+ * BCC 5.0 corrupts a field of the member structure when DO_STAT
+ * calls the native win95 stat system call. Blech!!!
+ *
+ * Making this a static variable forces it out of a register and
+ * seems to avoid the problem. */
+ static LINKPTR lp;
+ char *dir;
+ char *path;
+ char *name;
+ int res = 0;
+ int fset = 0;
+
+ DB_ENTER( "_check_dir_list" );
+ DB_PRINT( "mem", ("%s:-> mem %ld", cp->CE_NAME, (long) coreleft()) );
+
+ if( sp->ce_prq != NIL(LINK) ) /* check prerequisites if any */
+ {
+ /* Use the real name instead of basename, this prevents silly
+ * loops in inference code, and is consistent with man page */
+ name = cp->CE_NAME;
+
+ /* Here we loop through each directory on the list, and try to stat
+ * the target. We always save the first pathname we try to stat in
+ * _first. If we subsequently get a match we then replace the value of
+ * _first by the matched path name. */
+
+ for( lp=sp->CE_PRQ; lp != NIL(LINK) && !res; lp=lp->cl_next ) {
+ int nodup = 0;
+ dir = lp->cl_prq->CE_NAME;
+
+ if( strchr( dir, '$' ) ) dir = Expand(dir);
+ if( strcmp( dir, ".NULL" ) == 0 ) {
+ nodup = 1;
+ path = cp->CE_NAME;
+ } else {
+ path = DmStrDup(Build_path(dir,name));
+ }
+
+ res = ((cp->ce_time=DO_STAT(path,NIL(char),NIL(char *),force))!=(time_t)0L);
+
+ /* Have to use DmStrDup to set _first since Build_path, builds it's
+ * path names inside a static buffer. */
+ if( setfname )
+ if( (_first == NIL(char) && !fset) || res ) {
+ if( _first != NIL(char) ) FREE( _first );
+ if (nodup)
+ _first = NIL(char);
+ else {
+ _first = path;
+ path = NIL(char);
+ }
+ fset = 1;
+ }
+
+ DB_PRINT( "stat", ("_first [%s], path [%s]", _first, path) );
+ if( dir != lp->cl_prq->CE_NAME ) FREE(dir);
+ if( path && path != cp->CE_NAME ) FREE(path);
+ }
+ }
+
+ DB_PRINT( "mem", ("%s:-< mem %ld", cp->CE_NAME, (long) coreleft()) );
+ DB_RETURN( res );
+}
+
+
+
+
diff --git a/dmake/state.c b/dmake/state.c
new file mode 100644
index 000000000000..5179ead4fd14
--- /dev/null
+++ b/dmake/state.c
@@ -0,0 +1,231 @@
+/* RCS $Id: state.c,v 1.3 2007-09-20 14:33:53 vg Exp $
+--
+-- SYNOPSIS
+-- .KEEP_STATE state file management
+--
+-- DESCRIPTION
+-- Three routines to interface to the .KEEP_STATE state file.
+--
+-- Read_state() - reads the state file if any.
+-- Write_state() - writes the state file.
+--
+-- Check_state(cp,how) - checks an entry returns 0 or 1
+-- and updates the entry.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+typedef struct se {
+ char *st_name; /* name of cell */
+ uint32 st_nkey; /* name hash key */
+ int st_count; /* how count for how */
+ uint32 st_dkey; /* directory hash key */
+ uint32 st_key; /* hash key */
+ struct se *st_next;
+} KSTATE, *KSTATEPTR;
+
+static KSTATEPTR _st_head = NIL(KSTATE);
+static KSTATEPTR _st_tail = NIL(KSTATE);
+static int _st_upd = FALSE;
+static char *_st_file = NIL(char);
+
+static int _my_fgets ANSI((char *, int, FILE *));
+
+PUBLIC void
+Read_state()
+{
+ char *buf;
+ char sizeb[20];
+ int size;
+ FILE *fp;
+ KSTATEPTR sp;
+
+ if( (fp = Search_file(".KEEP_STATE", &_st_file)) != NIL(FILE) ) {
+ if( _my_fgets( sizeb, 20, fp ) ) {
+ size = atol(sizeb);
+ buf = MALLOC(size+2, char);
+
+ while( _my_fgets(buf, size, fp) ) {
+ TALLOC(sp, 1, KSTATE);
+ sp->st_name = DmStrDup(buf);
+ (void) Hash(buf, &sp->st_nkey);
+
+ if( _my_fgets(buf, size, fp) ) sp->st_count = atoi(buf);
+ if( _my_fgets(buf, size, fp) ) sp->st_dkey = (uint32) atol(buf);
+
+ if( _my_fgets(buf, size, fp) )
+ sp->st_key = (uint32) atol(buf);
+ else {
+ FREE(sp);
+ break;
+ }
+
+ if( _st_head == NIL(KSTATE) )
+ _st_head = sp;
+ else
+ _st_tail->st_next = sp;
+
+ _st_tail = sp;
+ }
+
+ FREE(buf);
+ }
+
+ Closefile();
+ }
+}
+
+
+PUBLIC void
+Write_state()
+{
+ static int in_write = 0;
+ register KSTATEPTR sp;
+ FILE *fp;
+
+ if( !_st_upd || !_st_file || (_st_file && !*_st_file) ||
+ Trace || in_write ) return;
+
+ in_write++;
+ if( (fp = Openfile(_st_file, TRUE, TRUE)) != NIL(FILE) ) {
+ int maxlen = 0;
+ int tmplen;
+
+ for( sp = _st_head; sp; sp=sp->st_next )
+ if( (tmplen = strlen(sp->st_name)+2) > maxlen )
+ maxlen = tmplen;
+
+ /* A nice arbitrary minimum size */
+ if( maxlen < 20 ) maxlen = 20;
+ fprintf( fp, "%d\n", maxlen );
+
+ for( sp = _st_head; sp; sp=sp->st_next ) {
+ uint16 hv;
+ uint32 hk;
+
+ if( Search_table(Defs, sp->st_name, &hv, &hk) ) {
+ fprintf( fp, "%s\n", sp->st_name );
+ fprintf( fp, "%d\n", sp->st_count );
+ /* long unsigned can be != uint32, silence the warning. */
+ fprintf( fp, "%lu\n", (unsigned long)sp->st_dkey );
+ fprintf( fp, "%lu\n", (unsigned long)sp->st_key );
+ }
+ }
+
+ Closefile();
+ }
+ else
+ Fatal("Cannot open STATE file %s", _st_file);
+
+ in_write = 0;
+}
+
+
+PUBLIC int
+Check_state( cp, recipes, maxrcp )
+CELLPTR cp;
+STRINGPTR *recipes;
+int maxrcp;
+{
+ KSTATEPTR st;
+ STRINGPTR sp;
+ int i;
+ uint32 thkey;
+ uint32 hkey;
+ uint32 nkey;
+ uint32 dkey;
+ int update = FALSE;
+
+ if( !_st_file || (_st_file && !*_st_file) || Trace )
+ return(FALSE);
+
+ if( strcmp(cp->CE_NAME,".REMOVE") == 0
+ || (cp->ce_attr & (A_PHONY|A_NOSTATE)) )
+ return(FALSE);
+
+ (void) Hash( cp->CE_NAME, &nkey ); thkey = nkey + (uint32) cp->ce_count;
+ (void) Hash( Pwd, &dkey ); thkey += dkey;
+
+ Suppress_temp_file = TRUE;
+ for( i=0 ; i<maxrcp; i++ )
+ for(sp=recipes[i]; sp != NIL(STRING); sp=sp->st_next ) {
+ CELLPTR svct = Current_target;
+ char *cmnd;
+ t_attr silent = (Glob_attr & A_SILENT);
+
+ Current_target = cp;
+ Glob_attr |= A_SILENT;
+ cmnd = Expand(sp->st_string);
+ Glob_attr = (Glob_attr & ~A_SILENT)|silent;
+ Current_target = svct;
+
+ (void) Hash(cmnd, &hkey); thkey += hkey;
+ FREE(cmnd);
+ }
+ Suppress_temp_file = FALSE;
+
+ for( st=_st_head; st != NIL(KSTATE); st=st->st_next ) {
+ if( st->st_nkey == nkey
+ && st->st_dkey == dkey
+ && st->st_count == cp->ce_count
+ && !strcmp(cp->CE_NAME, st->st_name) )
+ break;
+ }
+
+ if( st == NIL(KSTATE) ) {
+ KSTATEPTR nst;
+
+ TALLOC(nst, 1, KSTATE);
+ nst->st_name = cp->CE_NAME;
+ nst->st_nkey = nkey;
+ nst->st_dkey = dkey;
+ nst->st_key = thkey;
+ nst->st_count = cp->ce_count;
+
+ if( _st_head == NIL(KSTATE) )
+ _st_head = nst;
+ else
+ _st_tail->st_next = nst;
+
+ _st_tail = nst;
+ _st_upd = TRUE;
+ }
+ else if( st->st_key != thkey ) {
+ st->st_key = thkey;
+ _st_upd = update = TRUE;
+ }
+
+ return(st != NIL(KSTATE) && update);
+}
+
+
+static int
+_my_fgets(buf, size, fp)
+char *buf;
+int size;
+FILE *fp;
+{
+ char *p;
+
+ if( fgets(buf, size, fp) == NULL ) return(0);
+
+ if( (p=strrchr(buf,'\n')) != NIL(char) ) *p='\0';
+ if( (p=strrchr(buf,'\r')) != NIL(char) ) *p='\0';
+ return(1);
+}
diff --git a/dmake/stdmacs.h b/dmake/stdmacs.h
new file mode 100644
index 000000000000..3ce3623e5ad7
--- /dev/null
+++ b/dmake/stdmacs.h
@@ -0,0 +1,60 @@
+/* $RCSfile: stdmacs.h,v $
+-- $Revision: 1.5 $
+-- last change: $Author: hr $ $Date: 2006-04-20 12:02:29 $
+--
+-- SYNOPSIS
+-- General use macros.
+--
+-- DESCRIPTION
+-- ANSI macro relies on the fact that it can be replaced by (), or by
+-- its value, where the value is one value due to the preprocessors
+-- handling of arguments that are surrounded by ()'s as a single
+-- argument.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef MACROS_h
+#define MACROS_h
+
+/* AIX and Mac MPW define __STDC__ as special, but defined(__STDC__) is false,
+ * and it has no value. */
+#ifndef __STDC__
+#define __STDC__ 0
+#endif
+
+/* MSVC 6 and newer understand ANSI prototypes */
+#if __STDC__ || defined(__TURBOC__) || defined(__IBMC__) || defined (_MSC_VER)
+#define ANSI(x) x
+#else
+#define ANSI(x) ()
+#endif
+
+#define NIL(p) ((p*)NULL)
+
+/* Cygwin defines _STDDEF_H with only one leading '_' */
+#if !defined(atarist) && !defined(__STDDEF_H) && !defined(_STDDEF_H)
+#define offsetof(type,id) ((size_t)&((type*)NULL)->id)
+#endif
+
+#define FALSE 0
+#define TRUE 1
+
+#define PUBLIC
+
+#endif
+
diff --git a/dmake/struct.h b/dmake/struct.h
new file mode 100644
index 000000000000..3c1c350a8a06
--- /dev/null
+++ b/dmake/struct.h
@@ -0,0 +1,261 @@
+/* RCS $Id: struct.h,v 1.2 2006-06-29 11:24:50 ihi Exp $
+--
+-- SYNOPSIS
+-- Structure definitions
+--
+-- DESCRIPTION
+-- dmake main data structure definitions. See each of the individual
+-- struct declarations for more detailed information on the defined
+-- fields and their use.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STRUCT_INCLUDED_
+#define _STRUCT_INCLUDED_
+
+typedef uint32 t_attr;
+
+/* The following struct is the cell used in the hash table.
+ * NOTE: It contains the actual hash value. This allows the hash table
+ * insertion to compare hash values and to do a string compare only
+ * for entries that have matching hash_key values. This elliminates
+ * 99.9999% of all extraneous string compare operations when searching
+ * a hash table chain for matching entries. */
+
+typedef struct hcell {
+ struct hcell *ht_next; /* next entry in the hash table */
+ struct hcell *ht_link; /* for temporary lists */
+ char *ht_name; /* name of this cell */
+ char *ht_value; /* cell value if any */
+ uint32 ht_hash; /* actual hash_key of cell */
+ int ht_flag; /* flags belonging to hash entry */
+
+ /* NOTE: some macros have corresponding variables defined
+ * that control program behaviour. For these macros a
+ * bit of ht_flag indicates the variable value will be set, and the
+ * type of the value that will be set.
+ *
+ * The struct below contains a mask for bit variables, and a
+ * pointer to the global STATIC location for that variable.
+ * String and char variables point to the same place as ht_value
+ * and must be updated when ht_value changes, bit variables must
+ * have their value recomputed. See Def_macro code for more
+ * details.
+ *
+ * NOTE: Macro variables and Targets are always distinct. Thus
+ * the value union contains pointers back at cells that own
+ * a particular name entry. A conflict in this can never
+ * arise, ie pointers at cells will never be used as
+ * values for a macro variable, since the cell and macro
+ * name spaces are completely distinct. */
+
+ struct {
+ int mv_mask; /* bit mask for bit variable */
+ union {
+ char** mv_svar;/* ptr to string valued glob var */
+ char* mv_cvar;/* ptr to char valued glob var */
+ t_attr* mv_bvar;/* ptr to bit valued glob var */
+ int* mv_ivar;/* ptr to int valued glob var */
+
+ struct {
+ struct tcell* ht_owner;/* ptr to CELL owning name */
+ struct tcell* ht_root; /* root ptr for explode */
+ } ht;
+ } val;
+ } var; /* variable's static equivalent */
+} HASH, *HASHPTR;
+
+#define MV_MASK var.mv_mask
+#define MV_SVAR var.val.mv_svar
+#define MV_CVAR var.val.mv_cvar
+#define MV_BVAR var.val.mv_bvar
+#define MV_IVAR var.val.mv_ivar
+#define CP_OWNR var.val.ht.ht_owner
+#define CP_ROOT var.val.ht.ht_root
+
+
+
+/* This struct holds the list of temporary files that have been created.
+ * It gets unlinked when Quit is called due to an execution error */
+typedef struct flst {
+ char *fl_name; /* file name */
+ FILE *fl_file; /* the open file */
+ struct flst *fl_next; /* pointer to next file */
+} FILELIST, *FILELISTPTR;
+
+
+/* The next struct is used to link together prerequisite lists. It
+ * is also used to link multiple targets together. */
+typedef struct lcell {
+ struct tcell *cl_prq; /* link to a prerequisite */
+ struct lcell *cl_next; /* next cell on dependency list */
+ int cl_flag; /* flags for link cell */
+} LINK, *LINKPTR;
+
+
+/* This is the structure of a target cell in the dag which represents the
+ * graph of dependencies. Each possible target is represented as a cell.
+ *
+ * Each cell contains a pointer to the hash table entry for this cell.
+ * The hash table entry records the name of the cell. */
+
+typedef struct tcell {
+ struct hcell *ce_name; /* name of this cell */
+ struct hcell *ce_pushed; /* local pushed macro definitions */
+
+ /* Def_cell sets ce_all.cl_prq to point back to itself. .UPDATEALL
+ * uses ce_all.cl_next to link the cells together. */
+ struct lcell ce_all;
+
+ /* If set it points to first element of the list linked by ce_all. */
+ struct tcell *ce_set;
+ struct tcell *ce_setdir; /* SETDIR ROOT pointer for this cell*/
+ struct tcell *ce_link; /* link for temporary list making */
+ struct tcell *ce_parent; /* used by inner loop, not a static */
+
+ struct lcell *ce_prq; /* list of prerequisites for cell */
+ struct lcell *ce_prqorg; /* list of original prerequisites */
+ struct lcell *ce_indprq; /* indirect prerequisites for % cell*/
+
+ struct str *ce_recipe; /* recipe for making this cell */
+ FILELISTPTR ce_files; /* list of temporary files for cell */
+ struct str *ce_cond; /* conditional macro assignments */
+
+ char *ce_per; /* value of % in %-meta expansion */
+ char *ce_fname; /* file name associated with target */
+ char *ce_lib; /* archive name, if A_LIBRARYM */
+ char *ce_dir; /* value for .SETDIR attribute */
+
+ int ce_count; /* value for :: recipe set */
+ int ce_index; /* value of count for next :: child */
+ int ce_flag; /* all kinds of goodies */
+ t_attr ce_attr; /* attributes for this target */
+ time_t ce_time; /* time stamp value of target if any*/
+} CELL, *CELLPTR;
+
+#define CE_NAME ce_name->ht_name
+#define CE_RECIPE ce_recipe
+#define CE_PRQ ce_prq
+#define CeMeToo(C) &((C)->ce_all)
+#define CeNotMe(C) (C)->ce_all.cl_next
+
+
+/* This struct represents that used by Get_token to return and control
+ * access to a token list inside a particular string. This gives the
+ * ability to access non overlapping tokens simultaneously from
+ * multiple strings. */
+
+typedef struct {
+ char *tk_str; /* the string to search for tokens */
+ char tk_cchar; /* current char under *str */
+ int tk_quote; /* if we are scanning a quoted str */
+} TKSTR, *TKSTRPTR;
+
+
+
+/* Below is the struct used to represent a string. It points at possibly
+ * another string, since the set of rules for making a target is a collection
+ * of strings. */
+
+
+typedef struct str {
+ char *st_string; /* the string value */
+ struct str *st_next; /* pointer to the next string */
+ t_attr st_attr; /* attr for rule operations */
+} STRING, *STRINGPTR;
+
+
+
+/* These structs are used in processing of the % rules, and in building
+ * the NFA machine that is used to match an arbitrary target string to
+ * one of the % rules that is represented by each DFA */
+
+typedef int16 statecnt; /* limits the max number of dfa states */
+
+
+/* Each state of the DFA contains four pieces of information. */
+typedef struct st {
+ struct st *no_match; /* state to go to if no match */
+ struct st *match; /* state to go to if we do match */
+ char symbol; /* symbol on which we transit */
+ char action; /* action to perform if match */
+} STATE, *STATEPTR;
+
+
+/* Each DFA machine looks like this. It must have two pointers that represent
+ * the value of % in the matched string, and it contains a pointer into the
+ * current state, as well as the array of all states. */
+typedef struct {
+ char *pstart; /* start of % string match */
+ char *pend; /* end of % string match */
+ STATEPTR c_state; /* current DFA state */
+ CELLPTR node; /* % target represented by this DFA */
+ STATEPTR states; /* table of states for the DFA */
+} DFA, *DFAPTR;
+
+
+/* An NFA is a collection of DFA's. For each DFA we must know it's current
+ * state and where the next NFA is. */
+typedef struct nfa_machine {
+ DFAPTR dfa; /* The DFA for this eps transition */
+ char status; /* DFA state */
+ struct nfa_machine *next; /* the next DFA in NFA */
+} NFA, *NFAPTR;
+
+
+
+/* The next struct is used to link together DFA nodes for inference. */
+
+typedef struct dfal {
+ struct tcell *dl_meta; /* link to %-meta cell */
+ struct dfal *dl_next; /* next cell on matched DFA list*/
+ struct dfal *dl_prev; /* prev cell on matched DFA list*/
+ struct dfal *dl_member; /* used during subset calc */
+ char dl_delete; /* used during subset calc */
+ char *dl_per; /* value of % for matched DFA */
+ statecnt dl_state; /* matched state of the DFA */
+ int dl_prep; /* repetion count for the cell */
+} DFALINK, *DFALINKPTR;
+
+
+/* This struct is used to store the stack of DFA sets during inference */
+typedef struct dfst {
+ DFALINKPTR df_set; /* pointer to the set */
+ struct dfst *df_next; /* next element in the stack */
+} DFASET, *DFASETPTR;
+
+
+/* We need sets of items during inference, here is the item, we form sets
+ * by linking them together. */
+
+typedef struct ic {
+ CELLPTR ic_meta; /* Edge we used to make this cell*/
+ DFALINKPTR ic_dfa; /* Dfa that we matched against */
+ CELLPTR ic_setdirroot; /* setdir root pointer for cell */
+ DFASET ic_dfastack; /* set of dfas we're working with*/
+ int ic_dmax; /* max depth of cycles in graph */
+ char *ic_name; /* name of the cell to insert */
+ char *ic_dir; /* dir to CD to prior to recurse */
+ struct ic *ic_next; /* next pointer to link */
+ struct ic *ic_link; /* link all ICELL'S together */
+ struct ic *ic_parent; /* pointer to post-requisite */
+ char ic_flag; /* flag, used for NOINFER only */
+ char ic_exists; /* TRUE if prerequisite exists */
+} ICELL, *ICELLPTR;
+
+#endif
diff --git a/dmake/sysintf.c b/dmake/sysintf.c
new file mode 100644
index 000000000000..d7b482a3e405
--- /dev/null
+++ b/dmake/sysintf.c
@@ -0,0 +1,1157 @@
+/* RCS $Id: sysintf.c,v 1.13 2008-03-05 18:30:58 kz Exp $
+--
+-- SYNOPSIS
+-- System independent interface
+--
+-- DESCRIPTION
+-- These are the routines constituting the system interface.
+-- The system is taken to be essentially POSIX conformant.
+-- The original code was extensively revised by T J Thompson at MKS,
+-- and the library cacheing was added by Eric Gisin at MKS. I then
+-- revised the code yet again, to improve the lib cacheing, and to
+-- make it more portable.
+--
+-- The following is a list of routines that are required by this file
+-- in order to work. These routines are provided as functions by the
+-- standard C lib of the target system or as #defines in system/sysintf.h
+-- or via appropriate C code in the system/ directory for the given
+-- system.
+--
+-- The first group must be provided by a file in the system/ directory
+-- the second group is ideally provided by the C lib. However, there
+-- are instances where the C lib implementation of the specified routine
+-- does not exist, or is incorrect. In these instances the routine
+-- must be provided by the the user in the system/ directory of dmake.
+-- (For example, the bsd/ dir contains code for putenv(), and tempnam())
+--
+-- DMAKE SPECIFIC:
+-- seek_arch()
+-- touch_arch()
+-- void_lcache()
+-- runargv()
+-- DMSTAT()
+-- Remove_prq()
+--
+-- C-LIB SPECIFIC: (should be present in your C-lib)
+-- utime()
+-- time()
+-- getenv()
+-- putenv()
+-- getcwd()
+-- signal()
+-- chdir()
+-- tempnam()
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+/* The following definition controls the use of GetModuleFileName() */
+#if defined(_MSC_VER) || defined(__MINGW32__)
+# define HAVE_GETMODULEFILENAMEFUNC 1
+
+/* this is needed for the _ftime call below. Only needed here. */
+# include <sys/timeb.h>
+#endif
+
+/* for cygwin_conv_to_posix_path() in Prolog() and for cygdospath()*/
+#if __CYGWIN__
+# include <sys/cygwin.h>
+#endif
+
+#include "sysintf.h"
+#if HAVE_ERRNO_H
+# include <errno.h>
+#else
+ extern int errno;
+#endif
+
+/*
+** Tries to stat the file name. Returns 0 if the file
+** does not exist. Note that if lib is not null it tries to stat
+** the name found inside lib.
+**
+** If member is NOT nil then look for the library object which defines the
+** symbol given by name. If found DmStrDup the name and return make the
+** pointer pointed at by sym point at it. Not handled for now!
+*/
+static time_t
+really_dostat(name, buf)
+char *name;
+struct stat *buf;
+{
+ return( ( DMSTAT(name,buf)==-1
+ || (STOBOOL(Augmake) && (buf->st_mode & S_IFDIR)))
+ ? (time_t)0L
+ : (time_t) buf->st_mtime
+ );
+}
+
+
+PUBLIC time_t
+Do_stat(name, lib, member, force)
+char *name;
+char *lib;
+char **member;
+int force;
+{
+ struct stat buf;
+ time_t seek_arch();
+
+ if( member != NIL(char *) )
+ Fatal("Library symbol names not supported");
+
+ buf.st_mtime = (time_t)0L;
+ if( lib != NIL(char) )
+ return( seek_arch(Basename(name), lib) );
+ else if( strlen(Basename(name)) > NameMax ) {
+ Warning( "Filename [%s] longer than value of NAMEMAX [%d].\n\
+ Assume unix time 0.\n", Basename(name), NameMax );
+ return((time_t)0L);
+ }
+ else if( STOBOOL(UseDirCache) )
+ return(CacheStat(name,force));
+ else
+ return(really_dostat(name,&buf));
+}
+
+
+/* Touch existing file to force modify time to present.
+ */
+PUBLIC int
+Do_touch(name, lib, member)
+char *name;
+char *lib;
+char **member;
+{
+ if( member != NIL(char *) )
+ Fatal("Library symbol names not supported");
+
+ if (lib != NIL(char))
+ return( touch_arch(Basename(name), lib) );
+ else if( strlen(Basename(name)) > NameMax ) {
+ Warning( "Filename [%s] longer than value of NAMEMAX [%d].\n\
+ File timestamp not updated to present time.\n", Basename(name), NameMax );
+ return(-1);
+ }
+ else
+#ifdef HAVE_UTIME_NULL
+ return( utime(name, NULL) );
+#else
+# error "Utime NULL not supported"
+#endif
+}
+
+
+
+PUBLIC void
+Void_lib_cache( lib_name, member_name )/*
+=========================================
+ Void the library cache for lib lib_name, and member member_name. */
+char *lib_name;
+char *member_name;
+{
+ VOID_LCACHE( lib_name, member_name );
+}
+
+
+
+/*
+** return the current time
+*/
+PUBLIC time_t
+Do_time()
+{
+ return (time( NIL(time_t) ));
+}
+
+
+
+/*
+** Print profiling information
+*/
+PUBLIC void
+Do_profile_output( text, mtype, target )
+char *text;
+uint16 mtype;
+CELLPTR target;
+{
+
+ time_t time_sec;
+ uint32 time_msec;
+ char *tstrg;
+ char *tname;
+
+#ifdef HAVE_GETTIMEOFDAY
+ struct timeval timebuffer;
+ gettimeofday(&timebuffer, NULL);
+ time_sec = timebuffer.tv_sec;
+ time_msec = timebuffer.tv_usec/1000;
+#else
+#if defined(_MSC_VER) || defined(__MINGW32__)
+ struct _timeb timebuffer;
+ _ftime( &timebuffer );
+ time_sec = timebuffer.time;
+ time_msec = timebuffer.millitm;
+# else
+ time_sec = time( NIL(time_t) );
+ time_msec = 0;
+# endif
+#endif
+
+ tname = target->CE_NAME;
+ if( mtype & M_TARGET ) {
+ tstrg = "target";
+ /* Don't print special targets .TARGETS and .ROOT */
+ if( tname[0] == '.' && (strcmp(".TARGETS", tname) == 0 || \
+ strcmp(".ROOT", tname) == 0) ) {
+ return;
+ }
+ } else {
+ tstrg = "recipe";
+ }
+
+ /* Don't print shell escape targets if not especially requested. */
+ if( (target->ce_attr & A_SHELLESC) && !(Measure & M_SHELLESC) ) {
+ return;
+ }
+
+ /* Print absolute path if requested. */
+ if( !(target->ce_attr & A_SHELLESC) && (Measure & M_ABSPATH) ) {
+ printf("%s %s %lu.%.3u %s%s%s\n",text, tstrg, time_sec, time_msec, Pwd, DirSepStr, tname);
+ } else {
+ printf("%s %s %lu.%.3u %s\n",text, tstrg, time_sec, time_msec, tname);
+ }
+}
+
+
+
+PUBLIC int
+Do_cmnd(cmd, group, do_it, target, cmnd_attr, last)/*
+=====================================================
+ Execute the string passed in as a command and return
+ the return code. The command line arguments are
+ assumed to be separated by spaces or tabs. The first
+ such argument is assumed to be the command.
+
+ If group is true then this is a group of commands to be fed to the
+ the shell as a single unit. In this case cmd is of the form
+ "file" indicating the file that should be read by the shell
+ in order to execute the command group.
+
+ If Wait_for_completion is TRUE add the A_WFC attribute to the new
+ process.
+*/
+char **cmd; /* Simulate a reference to *cmd. */
+int group; /* if set cmd contains the filename of a (group-)shell
+ * script. */
+int do_it; /* Only execute cmd if not set to null. */
+CELLPTR target;
+t_attr cmnd_attr; /* Attributes for current cmnd. */
+int last; /* Last recipe line in target. */
+{
+ int i;
+
+ DB_ENTER( "Do_cmnd" );
+
+ if( !do_it ) {
+ if( last && !Doing_bang ) {
+ /* Don't execute, just update the target when using '-t'
+ * switch. */
+ Update_time_stamp( target );
+ }
+ DB_RETURN( 0 );
+ }
+
+ /* Stop making the rest of the recipies for this target if an error occured
+ * but the Continue (-k) flag is set to build as much as possible. */
+ if ( target->ce_attr & A_ERROR ) {
+ if ( last ) {
+ Update_time_stamp( target );
+ }
+ DB_RETURN( 0 );
+ }
+
+ if( Max_proc == 1 ) Wait_for_completion = TRUE;
+
+ /* Tell runargv() to wait if needed. */
+ if( Wait_for_completion ) cmnd_attr |= A_WFC;
+
+ /* remove leading whitespace - This should never trigger! */
+ if( iswhite(**cmd) ) {
+ char *p;
+ if( (p = DmStrSpn(*cmd," \t") ) != *cmd )
+ strcpy(*cmd,p);
+ }
+
+ /* set shell if shell metas are found */
+ if( (cmnd_attr & A_SHELL) || group || (*DmStrPbrk(*cmd, Shell_metas)!='\0') )
+ cmnd_attr |= A_SHELL; /* If group is TRUE this doesn't hurt. */
+
+ /* runargv() returns either 0 or 1, 0 ==> command executed, and
+ * we waited for it to return, 1 ==> command started and is still
+ * running. */
+ i = runargv(target, group, last, cmnd_attr, cmd);
+
+ DB_RETURN( i );
+}
+
+
+#define MINARGV 64
+
+PUBLIC char **
+Pack_argv( group, shell, cmd )/*
+================================
+ Take a command and pack it into an argument vector to be executed.
+ If group is true cmd holds the group script file.
+*/
+int group;
+int shell;
+char **cmd; /* Simulate a reference to *cmd. */
+{
+ static char **av = NIL(char *);
+ static int avs = 0;
+ int i = 0;
+ char *s; /* Temporary string pointer. */
+
+ if( av == NIL(char *) ) {
+ TALLOC(av, MINARGV, char*);
+ avs = MINARGV;
+ }
+ av[0] = NIL(char);
+
+ if (**cmd) {
+ if( shell||group ) {
+ char* sh = group ? GShell : Shell;
+
+ if( sh != NIL(char) ) {
+ av[i++] = sh;
+ if( (av[i] = (group?GShell_flags:Shell_flags)) != NIL(char) ) i++;
+
+ if( shell && Shell_quote && *Shell_quote ) {
+ /* Enclose the shell command with SHELLCMDQUOTE. */
+ s = DmStrJoin(Shell_quote, *cmd, -1, FALSE);
+ FREE(*cmd);
+ *cmd = DmStrJoin(s, Shell_quote, -1, TRUE);
+ }
+ av[i++] = *cmd;
+
+#if defined(USE_CREATEPROCESS)
+ /* CreateProcess() needs one long command line. */
+ av[0] = DmStrAdd(av[0], av[1], FALSE);
+ av[1] = NIL(char);
+ /* i == 3 means Shell_flags are given. */
+ if( i == 3 ) {
+ s = av[0];
+ av[0] = DmStrAdd(s, av[2], FALSE);
+ FREE(s);
+ av[2] = NIL(char);
+ }
+ /* The final free of cmd will free the concated command line. */
+ FREE(*cmd);
+ *cmd = av[0];
+#endif
+ av[i] = NIL(char);
+ }
+ else
+ Fatal("%sSHELL macro not defined", group?"GROUP":"");
+ }
+ else {
+ char *tcmd = *cmd;
+
+#if defined(USE_CREATEPROCESS)
+ /* CreateProcess() needs one long command line, fill *cmd
+ * into av[0]. */
+ while( iswhite(*tcmd) ) ++tcmd;
+ if( *tcmd ) av[i++] = tcmd;
+#else
+ /* All other exec/spawn functions need the parameters separated
+ * in the argument vector. */
+ do {
+ /* Fill *cmd into av[]. Whitespace is converted into '\0' to
+ * terminate each av[] member. */
+ while( iswhite(*tcmd) ) ++tcmd;
+ if( *tcmd ) av[i++] = tcmd;
+
+ while( *tcmd != '\0' && !iswhite(*tcmd) ) ++tcmd;
+ if( *tcmd ) *tcmd++ = '\0';
+
+ /* dynamically increase av size. */
+ if( i == avs ) {
+ avs += MINARGV;
+ av = (char **) realloc( av, avs*sizeof(char *) );
+ }
+ } while( *tcmd );
+#endif
+
+ av[i] = NIL(char);
+ }
+ }
+
+ return(av);
+}
+
+
+/*
+** Return the value of ename from the environment
+** if ename is not defined in the environment then
+** NIL(char) should be returned
+*/
+PUBLIC char *
+Read_env_string(ename)
+char *ename;
+{
+ return( getenv(ename) );
+}
+
+
+
+/*
+** Set the value of the environment string ename to value.
+** Returns 0 if success, non-zero if failure
+*/
+PUBLIC int
+Write_env_string(ename, value)
+char *ename;
+char *value;
+{
+ char* p;
+ char* envstr = DmStrAdd(ename, value, FALSE);
+
+ p = envstr+strlen(ename); /* Don't change this code, DmStrAdd does not */
+ *p++ = '='; /* add the space if *value is 0, it does */
+ if( !*value ) *p = '\0'; /* allocate enough memory for one though. */
+
+ return( putenv(envstr) );
+}
+
+
+
+PUBLIC void
+ReadEnvironment()
+{
+ extern char **Rule_tab;
+#if !defined(_MSC_VER)
+#if defined(__BORLANDC__) && __BORLANDC__ >= 0x500
+ extern char ** _RTLENTRY _EXPDATA environ;
+#else
+ extern char **environ;
+#endif
+#endif
+ char **rsave;
+
+#if !defined(__ZTC__) && !defined(_MPW)
+# define make_env()
+# define free_env()
+#else
+ void make_env();
+ void free_env();
+#endif
+
+ make_env();
+
+ rsave = Rule_tab;
+ Rule_tab = environ;
+ Readenv = TRUE;
+
+ Parse( NIL(FILE) );
+
+ Readenv = FALSE;
+ Rule_tab = rsave;
+
+ free_env();
+}
+
+
+
+/*
+** All we have to catch is SIGINT
+*/
+PUBLIC void
+Catch_signals(fn)
+void (*fn)(int);
+{
+ /* FIXME: Check this and add error handling. */
+ if( (void (*)(int)) signal(SIGINT, SIG_IGN) != (void (*)(int))SIG_IGN )
+ signal( SIGINT, fn );
+ if( (void (*)(int)) signal(SIGQUIT, SIG_IGN) != (void (*)(int))SIG_IGN )
+ signal( SIGQUIT, fn );
+}
+
+
+
+/*
+** Clear any previously set signals
+*/
+PUBLIC void
+Clear_signals()
+{
+ if( (void (*)())signal(SIGINT, SIG_IGN) != (void (*)())SIG_IGN )
+ signal( SIGINT, SIG_DFL );
+ if( (void (*)())signal(SIGQUIT, SIG_IGN) != (void (*)())SIG_IGN )
+ signal( SIGQUIT, SIG_DFL );
+}
+
+
+
+/*
+** Set program name
+*/
+PUBLIC void
+Prolog(argc, argv)
+int argc;
+char* argv[];
+{
+ Pname = (argc == 0) ? DEF_MAKE_PNAME : argv[0];
+
+ /* Only some native Windows compilers provide this functionality. */
+#ifdef HAVE_GETMODULEFILENAMEFUNC
+ if( (AbsPname = MALLOC( PATH_MAX, char)) == NIL(char) ) No_ram();
+ GetModuleFileName(NULL, AbsPname, PATH_MAX*sizeof(char));
+#else
+ AbsPname = "";
+#endif
+
+#if __CYGWIN__
+ /* Get the drive letter prefix used by cygwin. */
+ if ( (CygDrvPre = MALLOC( PATH_MAX, char)) == NIL(char) )
+ No_ram();
+ else {
+ int err = cygwin_conv_to_posix_path("c:", CygDrvPre);
+ if (err)
+ Fatal( "error converting \"%s\" - %s\n",
+ CygDrvPre, strerror (errno));
+ if( (CygDrvPreLen = strlen(CygDrvPre)) == 2 ) {
+ /* No prefix */
+ *CygDrvPre = '\0';
+ CygDrvPreLen = 0;
+ } else {
+ /* Cut away the directory letter. */
+ CygDrvPre[CygDrvPreLen-2] = '\0';
+ /* Cut away the leading '/'. We don't free the pointer, i.e. choose
+ * the easy way. */
+ CygDrvPre++;
+ CygDrvPreLen -= 3;
+ }
+ }
+#endif
+
+ /* DirSepStr is used from Clean_path() in Def_cell(). Set it preliminary
+ * here, it will be redefined later in Create_macro_vars() in imacs.c. */
+ DirSepStr = "/";
+
+ Root = Def_cell( ".ROOT" );
+ Targets = Def_cell( ".TARGETS" );
+ Add_prerequisite(Root, Targets, FALSE, FALSE);
+
+ Targets->ce_flag = Root->ce_flag = F_RULES|F_TARGET|F_STAT;
+ Targets->ce_attr = Root->ce_attr = A_NOSTATE|A_PHONY;
+
+ Root->ce_flag |= F_MAGIC;
+ Root->ce_attr |= A_SEQ;
+
+ tzset();
+}
+
+
+
+/*
+** Do any clean up for exit.
+*/
+PUBLIC void
+Epilog(ret_code)
+int ret_code;
+{
+ Write_state();
+ Unlink_temp_files(Root);
+ Hook_std_writes(NIL(char)); /* For MSDOS tee (-F option) */
+ exit( ret_code );
+}
+
+
+
+/*
+** Use the built-in functions of the operating system to get the current
+** working directory.
+*/
+PUBLIC char *
+Get_current_dir()
+{
+ static char buf[PATH_MAX+2];
+
+ if( !getcwd(buf, sizeof(buf)) )
+ Fatal("Internal Error: Error when calling getcwd()!");
+
+#ifdef __EMX__
+ char *slash;
+ slash = buf;
+ while( (slash=strchr(slash,'/')) )
+ *slash = '\\';
+#endif
+
+ return buf;
+}
+
+
+
+/*
+** change working directory
+*/
+PUBLIC int
+Set_dir(path)
+char* path;
+{
+ return( chdir(path) );
+}
+
+
+
+/*
+** return switch char
+*/
+PUBLIC char
+Get_switch_char()
+{
+ return( getswitchar() );
+}
+
+
+int Create_temp(tmpdir, path)/*
+===============================
+ Create a temporary file and open with exclusive access
+ Path is updated with the filename and the file descriptor
+ is returned. Note that the new name should be freed when
+ the file is removed.
+*/
+char *tmpdir;
+char **path;
+{
+ int fd; /* file descriptor */
+
+#if defined(HAVE_MKSTEMP)
+ mode_t mask;
+
+ *path = DmStrJoin( tmpdir, DirSepStr, -1, FALSE);
+ *path = DmStrJoin( *path, "mkXXXXXX", -1, TRUE );
+
+ mask = umask(0066);
+ fd = mkstemp( *path );
+ umask(mask);
+
+#elif defined(HAVE_TEMPNAM)
+ char pidbuff[32];
+#if _MSC_VER >= 1300
+ /* Create more unique filename for .NET2003 and newer. */
+ long npid;
+ long nticks;
+
+ npid = _getpid();
+ nticks = GetTickCount() & 0xfff;
+ sprintf(pidbuff,"mk%d_%d_",npid,nticks);
+#else
+ sprintf(pidbuff,"mk");
+#endif
+ *path = tempnam(tmpdir, pidbuff);
+ fd = open(*path, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0600);
+#else
+
+#error mkstemp() or tempnam() is needed
+
+#endif
+
+ return fd;
+}
+
+
+PUBLIC FILE*
+Get_temp(path, mode)/*
+======================
+ Generate a temporary file name and open the file for writing.
+ If a name cannot be generated or the file cannot be opened
+ return -1, else return the fileno of the open file.
+ and update the source file pointer to point at the new file name.
+ Note that the new name should be freed when the file is removed.
+ The file stream is opened with the given mode.
+*/
+char **path;
+char *mode;
+{
+ int fd;
+ FILE *fp;
+ char *tmpdir;
+ int tries = 20;
+
+ tmpdir = Read_env_string( "TMPDIR" );
+ if( tmpdir == NIL(char) )
+ tmpdir = "/tmp";
+
+ while( --tries )
+ {
+ /* This sets path to the name of the created temp file. */
+ if( (fd = Create_temp(tmpdir, path)) != -1)
+ break;
+
+ free(*path); /* free var if creating temp failed. */
+ }
+
+ if( fd != -1)
+ {
+ Def_macro( "TMPFILE", DO_WINPATH(*path), M_MULTI|M_EXPANDED );
+ /* associate stream with file descriptor */
+ fp = fdopen(fd, mode);
+ }
+ else
+ fp = NIL(FILE);
+
+ return fp;
+}
+
+
+PUBLIC FILE *
+Start_temp( suffix, cp, fname )/*
+=================================
+ Open a new temporary file and set it up for writing. The file is linked
+ to cp and will be removed if once the target is finished.
+ If a suffix for the temporary files is requested two temporary files are
+ created. This is done because the routines that create a save temporary
+ file do not provide a definable suffix. The first (provided by Get_temp())
+ is save and unique and the second file is generated by adding the desired
+ suffix the the first temporary file. The extra file is also linked to cp
+ so that it gets removed later.
+ The function returns the FILE pointer to the temporary file (with suffix
+ if specified) and leaves the file name in *fname.
+*/
+char *suffix;
+CELLPTR cp;
+char **fname;
+{
+ FILE *fp, *fp2;
+ char *tmpname;
+ char *name;
+ char *fname_suff;
+
+ name = (cp != NIL(CELL))?cp->CE_NAME:"makefile text";
+
+ /* This sets tmpname to the name that was used. */
+ if( (fp = Get_temp(&tmpname, "w")) == NIL(FILE) )
+ Open_temp_error( tmpname, name );
+
+ /* Don't free tmpname, it's stored in a FILELIST member in Link_temp(). */
+ Link_temp( cp, fp, tmpname );
+ *fname = tmpname;
+
+ /* As Get_temp() doesn't provide a definable suffix (anymore) we create an
+ * additional temporary file with that suffix. */
+ if ( suffix && *suffix ) {
+
+#ifdef HAVE_MKSTEMP
+ /* Only use umask if we are also using mkstemp - this basically
+ * avoids using the incompatible implementation from MSVC. */
+ mode_t mask;
+
+ mask = umask(0066);
+#endif
+
+ fname_suff = DmStrJoin( tmpname, suffix, -1, FALSE );
+
+ /* Overwrite macro, Get_temp didn't know of the suffix. */
+ Def_macro( "TMPFILE", DO_WINPATH(fname_suff), M_MULTI|M_EXPANDED );
+
+ if( (fp2 = fopen(fname_suff, "w" )) == NIL(FILE) )
+ Open_temp_error( fname_suff, name );
+#ifdef HAVE_MKSTEMP
+ umask(mask);
+#endif
+
+ /* Don't free fname_suff. */
+ Link_temp( cp, fp2, fname_suff );
+ fp = fp2;
+ *fname = fname_suff;
+ }
+
+ return( fp );
+}
+
+
+/*
+** Issue an error on failing to open a temporary file
+*/
+PUBLIC void
+Open_temp_error( tmpname, name )
+char *tmpname;
+char *name;
+{
+ Fatal("Cannot open temp file `%s' while processing `%s'", tmpname, name );
+}
+
+
+/*
+** Link a temp file onto the list of files.
+*/
+PUBLIC void
+Link_temp( cp, fp, fname )
+CELLPTR cp;
+FILE *fp;
+char *fname;
+{
+ FILELISTPTR new;
+
+ if( cp == NIL(CELL) ) cp = Root;
+
+ TALLOC( new, 1, FILELIST );
+
+ new->fl_next = cp->ce_files;
+ new->fl_name = fname;
+ new->fl_file = fp; /* indicates temp file is open */
+
+ cp->ce_files = new;
+}
+
+
+/*
+** Close a previously used temporary file.
+*/
+PUBLIC void
+Close_temp(cp, file)
+CELLPTR cp;
+FILE *file;
+{
+ FILELISTPTR fl;
+ if( cp == NIL(CELL) ) cp = Root;
+
+ for( fl=cp->ce_files; fl && fl->fl_file != file; fl=fl->fl_next );
+ if( fl ) {
+ fl->fl_file = NIL(FILE);
+ fclose(file);
+ }
+}
+
+
+/*
+** Clean-up, and close all temporary files associated with a target.
+*/
+PUBLIC void
+Unlink_temp_files( cp )/*
+==========================
+ Unlink the tempfiles if any exist. Make sure you close the files first
+ though. This ensures that under DOS there is no disk space lost. */
+CELLPTR cp;
+{
+ FILELISTPTR cur, next;
+
+ if( cp == NIL(CELL) || cp->ce_files == NIL(FILELIST) ) return;
+
+ for( cur=cp->ce_files; cur != NIL(FILELIST); cur=next ) {
+ next = cur->fl_next;
+
+ if( cur->fl_file ) fclose( cur->fl_file );
+
+ if( Verbose & V_LEAVE_TMP )
+ fprintf( stderr, "%s: Left temp file [%s]\n", Pname, cur->fl_name );
+ else
+ (void) Remove_file( cur->fl_name );
+
+ FREE(cur->fl_name);
+ FREE(cur);
+ }
+
+ cp->ce_files = NIL(FILELIST);
+}
+
+
+PUBLIC void
+Handle_result(status, ignore, abort_flg, target)/*
+==================================================
+ Handle return value of recipe.
+*/
+int status;
+int ignore;
+int abort_flg;
+CELLPTR target;
+{
+ status = ((status&0xff)==0 ? status>>8 /* return from exit() */
+ : (status & 0xff)==SIGTERM ? -1 /* terminated from SIGTERM */
+ : (status & 0x7f)+128); /* terminated from signal
+ * ( =status-128 ) */
+
+ if( status ) {
+ if( !abort_flg ) {
+ char buf[512];
+
+ sprintf(buf, "%s: Error code %d, while making '%s'",
+ Pname, status, target->ce_fname );
+
+ if( ignore || Continue ) {
+ if (!(Glob_attr & A_SILENT)) {
+ strcat(buf, " (Ignored" );
+
+ if ( Continue ) {
+ /* Continue after error if '-k' was used. */
+ strcat(buf,",Continuing");
+ target->ce_attr |= A_ERROR;
+ }
+ strcat(buf,")");
+ if (Verbose)
+ fprintf(stderr, "%s\n", buf);
+ }
+
+ if( target->ce_attr & A_ERRREMOVE
+ && Remove_file( target->ce_fname ) == 0
+ && !(Glob_attr & A_SILENT))
+ fprintf(stderr,"%s: '%s' removed.\n", Pname, target->ce_fname);
+ }
+ else {
+ fprintf(stderr, "%s\n",buf);
+
+ if(!(target->ce_attr & A_PRECIOUS)||(target->ce_attr & A_ERRREMOVE))
+ if( Remove_file( target->ce_fname ) == 0 )
+ fprintf(stderr,"%s: '%s' removed.\n", Pname,
+ target->ce_fname);
+
+ Quit(0);
+ }
+ }
+ else if(!(target->ce_attr & A_PRECIOUS)||(target->ce_attr & A_ERRREMOVE))
+ Remove_file( target->ce_fname );
+ }
+}
+
+
+PUBLIC void
+Update_time_stamp( cp )/*
+=========================
+ Update the time stamp of cp and scan the list of its prerequisites for
+ files being marked as removable (ie. an inferred intermediate node).
+ Remove them if there are any. */
+CELLPTR cp;
+{
+ HASHPTR hp;
+ LINKPTR dp;
+ CELLPTR tcp;
+ time_t mintime;
+ int phony = ((cp->ce_attr&A_PHONY) != 0);
+
+ for(dp=CeMeToo(cp); dp; dp=dp->cl_next) {
+ tcp=dp->cl_prq;
+ /* When calling Make() on this target ce_time was set to the minimal
+ * required time the target should have after building, i.e. the time
+ * stamp of the newest prerequisite or 1L if there is no
+ * prerequisite. */
+ mintime = tcp->ce_time;
+
+ if( tcp->ce_attr & A_LIBRARY )
+ Void_lib_cache( tcp->ce_fname, NIL(char) );
+ else if( !Touch && (tcp->ce_attr & A_LIBRARYM) )
+ Void_lib_cache( tcp->ce_lib, tcp->ce_fname );
+
+ /* phony targets are treated as if they were recently made
+ * and get the current time assigned. */
+ if( phony ) {
+ tcp->ce_time = Do_time();
+ }
+ else if (Trace) {
+ tcp->ce_time = Do_time();
+ }
+ else {
+ Stat_target(tcp, -1, TRUE);
+
+ if( tcp->ce_time == (time_t) 0L ) {
+ /* If the target does not exist after building set its
+ * time stamp depending if it has recipes or not. Virtual
+ * Targets (without recipes) get the newest time stamp of
+ * its prerequisites assigned. (This was conveniently stored
+ * in mintime.)
+ * Targets with recipes are treated as if they were recently
+ * made and get the current time assigned. */
+ if( cp->ce_recipe == NIL(STRING) && mintime > 1 ) {
+ tcp->ce_time = mintime;
+ }
+ else {
+ tcp->ce_time = Do_time();
+ }
+ }
+ else {
+ /* The target exist. If the target does not have recipe
+ * lines use the newest time stamp of either the target or
+ * the newest time stamp of its prerequisites and issue
+ * a warning. */
+ if( cp->ce_recipe == NIL(STRING) ) {
+ time_t newtime = ( mintime > 1 ? mintime : Do_time() );
+
+ if( !(tcp->ce_attr & A_SILENT) )
+ Warning( "Found file corresponding to virtual target [%s].",
+ tcp->CE_NAME );
+
+ if( newtime > tcp->ce_time )
+ tcp->ce_time = mintime;
+ }
+ }
+ }
+
+ if( Trace ) {
+ tcp->ce_flag |= F_STAT; /* pretend we stated ok */
+ }
+
+ if( Verbose & V_MAKE )
+ printf( "%s: <<<< Set [%s] time stamp to %lu\n",
+ Pname, tcp->CE_NAME, tcp->ce_time );
+
+ if( Measure & M_TARGET )
+ Do_profile_output( "e", M_TARGET, tcp );
+
+ /* At this point cp->ce_time is updated to either the actual file
+ * time or the current time. */
+ DB_PRINT( "make", ("time stamp: %ld, required mintime: %ld",
+ cp->ce_time, mintime) );
+ if( tcp->ce_time < mintime && !(tcp->ce_attr & A_SILENT) ) {
+ Warning( "Target [%s] was made but the time stamp has not been updated.",
+ tcp->CE_NAME );
+ }
+
+ /* The target was made, remove the temp files now. */
+ Unlink_temp_files( tcp );
+ tcp->ce_flag |= F_MADE;
+ tcp->ce_attr |= A_UPDATED;
+ }
+
+ /* Scan the list of prerequisites and if we find one that is
+ * marked as being removable, (ie. an inferred intermediate node)
+ * then remove it. We remove a prerequisite by running the recipe
+ * associated with the special target .REMOVE.
+ * Typically .REMOVE is defined in the startup file as:
+ * .REMOVE :; $(RM) $<
+ * with $< being the list of prerequisites specified in the current
+ * target. (Make() sets $< .) */
+
+ /* Make sure we don't try to remove prerequisites for the .REMOVE
+ * target. */
+ if( strcmp(cp->CE_NAME,".REMOVE") != 0 &&
+ (hp = Get_name(".REMOVE", Defs, FALSE)) != NIL(HASH) ) {
+ register LINKPTR dp;
+ int flag = FALSE;
+ int rem;
+ t_attr attr;
+
+ tcp = hp->CP_OWNR;
+
+ /* The .REMOVE target is re-used. Remove old prerequisites. */
+ tcp->ce_flag |= F_TARGET;
+ Clear_prerequisites( tcp );
+
+ for(dp=cp->ce_prq; dp != NIL(LINK); dp=dp->cl_next) {
+ register CELLPTR prq = dp->cl_prq;
+
+ attr = Glob_attr | prq->ce_attr;
+ /* We seem to have problems here that F_MULTI subtargets get removed
+ * that even though they are still needed because the A_PRECIOUS
+ * was not propagated correctly. Solution: Don't remove subtargets, the
+ * master target will be removed if is not needed. */
+ rem = (prq->ce_flag & F_REMOVE) &&
+ (prq->ce_flag & F_MADE ) &&
+ !(prq->ce_count ) && /* Don't remove F_MULTI subtargets. */
+ !(prq->ce_attr & A_PHONY) &&
+ !(attr & A_PRECIOUS);
+
+ /* remove if rem is != 0 */
+ if(rem) {
+ LINKPTR tdp;
+
+ /* Add the target plus all that are linked to it with the .UPDATEALL
+ * attribute. */
+ for(tdp=CeMeToo(prq); tdp; tdp=tdp->cl_next) {
+ CELLPTR tmpcell=tdp->cl_prq;
+
+ (Add_prerequisite(tcp,tmpcell,FALSE,FALSE))->cl_flag|=F_TARGET;
+ tmpcell->ce_flag &= ~F_REMOVE;
+ }
+ flag = TRUE;
+ }
+ }
+
+ if( flag ) {
+ int sv_force = Force;
+
+ Force = FALSE;
+ Remove_prq( tcp );
+ Force = sv_force;
+
+ for(dp=tcp->ce_prq; dp != NIL(LINK); dp=dp->cl_next) {
+ register CELLPTR prq = dp->cl_prq;
+
+ prq->ce_flag &= ~(F_MADE|F_VISITED|F_STAT);
+ prq->ce_flag |= F_REMOVE;
+ prq->ce_time = (time_t)0L;
+ }
+ }
+ }
+}
+
+
+PUBLIC int
+Remove_file( name )
+char *name;
+{
+ struct stat buf;
+
+ if( stat(name, &buf) != 0 )
+ return 1;
+ if( (buf.st_mode & S_IFMT) == S_IFDIR )
+ return 1;
+ return(unlink(name));
+}
+
+
+#if defined(__CYGWIN__)
+char *
+cygdospath(char *src, int winpath)/*
+====================================
+ Convert to DOS path if winpath is true. The returned pointer is
+ either the original pointer or a pointer to a static buffer.
+*/
+{
+ static char *buf = NIL(char);
+
+ if ( !buf && ( (buf = MALLOC( PATH_MAX, char)) == NIL(char) ) )
+ No_ram();
+
+ DB_PRINT( "cygdospath", ("converting [%s] with winpath [%d]", src, winpath ) );
+
+ /* Return immediately on NULL pointer or when .WINPATH is
+ * not set. */
+ if( !src || !winpath )
+ return src;
+
+ if( *src && src[0] == '/' ) {
+ char *tmp;
+ int err = cygwin_conv_to_win32_path(src, buf);
+ if (err)
+ Fatal( "error converting \"%s\" - %s\n",
+ src, strerror (errno));
+
+ tmp = buf;
+ while ((tmp = strchr (tmp, '\\')) != NULL) {
+ *tmp = '/';
+ tmp++;
+ }
+
+ return buf;
+ }
+ else
+ return src;
+}
+#endif
diff --git a/dmake/tests/Makefile.am b/dmake/tests/Makefile.am
new file mode 100644
index 000000000000..87be868bec2d
--- /dev/null
+++ b/dmake/tests/Makefile.am
@@ -0,0 +1,22 @@
+## Makefile for the tests subdirectory of dmake.
+
+TESTS = infra-0 function_macros-1 function_macros-2 function_macros-3 \
+ function_macros-4 function_macros-5 function_macros-6 \
+ function_macros-7 function_macros-8 function_macros-9 \
+ function_macros-10 \
+ macros-1 macros-2 macros-3 macros-4 macros-5 macros-6 macros-7 \
+ macros-8 macros-9 macros-10 macros-11 \
+ recipes-1 recipes-2 recipes-3 recipes-4 recipes-5 recipes-6 \
+ recipes-7 recipes-8 recipes-9 \
+ misc-1 misc-2 misc-3 misc-4 misc-5 misc-6 misc-7 misc-8 misc-9 \
+ misc-10 misc-11 misc-12 misc-13 misc-14 misc-15 misc-16 misc-17 \
+ misc-18 misc-19 misc-20 misc-21 \
+ targets-1 targets-2 targets-3 targets-4 targets-5 targets-6 \
+ targets-7 targets-8 targets-9 targets-10 targets-11 targets-12 \
+ targets-13 targets-14 targets-15 targets-16 targets-17 targets-18 \
+ targets-19 targets-20 targets-21 targets-22 targets-23 targets-24 \
+ targets-25 targets-26 targets-27 targets-28 targets-29 targets-30
+
+TESTS_ENVIRONMENT = DMAKEPROG="../dmake"
+
+EXTRA_DIST = $(TESTS)
diff --git a/dmake/tests/Makefile.in b/dmake/tests/Makefile.in
new file mode 100644
index 000000000000..40868002e6be
--- /dev/null
+++ b/dmake/tests/Makefile.in
@@ -0,0 +1,392 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = tests
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OSTYPEUNIX_FALSE = @OSTYPEUNIX_FALSE@
+OSTYPEUNIX_TRUE = @OSTYPEUNIX_TRUE@
+OSTYPEWIN32_FALSE = @OSTYPEWIN32_FALSE@
+OSTYPEWIN32_TRUE = @OSTYPEWIN32_TRUE@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+TESTS = infra-0 function_macros-1 function_macros-2 function_macros-3 \
+ function_macros-4 function_macros-5 function_macros-6 \
+ function_macros-7 function_macros-8 function_macros-9 \
+ function_macros-10 \
+ macros-1 macros-2 macros-3 macros-4 macros-5 macros-6 macros-7 \
+ macros-8 macros-9 macros-10 macros-11 \
+ recipes-1 recipes-2 recipes-3 recipes-4 recipes-5 recipes-6 \
+ recipes-7 recipes-8 recipes-9 \
+ misc-1 misc-2 misc-3 misc-4 misc-5 misc-6 misc-7 misc-8 misc-9 \
+ misc-10 misc-11 misc-12 misc-13 misc-14 misc-15 misc-16 misc-17 \
+ misc-18 misc-19 misc-20 misc-21 \
+ targets-1 targets-2 targets-3 targets-4 targets-5 targets-6 \
+ targets-7 targets-8 targets-9 targets-10 targets-11 targets-12 \
+ targets-13 targets-14 targets-15 targets-16 targets-17 targets-18 \
+ targets-19 targets-20 targets-21 targets-22 targets-23 targets-24 \
+ targets-25 targets-26 targets-27 targets-28 targets-29 targets-30
+
+TESTS_ENVIRONMENT = DMAKEPROG="../dmake"
+EXTRA_DIST = $(TESTS)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+ distclean distclean-generic distdir dvi dvi-am html html-am \
+ info info-am install install-am install-data install-data-am \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+ uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/tests/README b/dmake/tests/README
new file mode 100644
index 000000000000..ac0af7a8e571
--- /dev/null
+++ b/dmake/tests/README
@@ -0,0 +1,12 @@
+DMAKE TESTCASES
+===============
+
+The testcases in this directory will be executed by "make check" in
+this or the top directory.
+
+Each test can be executed as a standalone script that will test the
+first dmake that is found in the path. A different dmake to be tested
+can be specified by setting the DMAKEPROG environment variable.
+
+Example:
+$ DMAKEPROG=../dmake ./misc-4
diff --git a/dmake/tests/function_macros-1 b/dmake/tests/function_macros-1
new file mode 100755
index 000000000000..6e5368005a63
--- /dev/null
+++ b/dmake/tests/function_macros-1
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# 01.06.2005 Volker Quetschke
+# Tests for dmake function macros. (issue 36027, issue 37053)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing function macros
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+TEST1:=a b c
+
+all:
+ @echo \$\$(and ...) section
+ test "::" = ":\$(and \$(nil) \$(nil) ):"
+ test ":t:" = ":\$(and a b ):"
+ test "::" = ":\$(and \$(nil) \
+ \$(nil) ):"
+ test "::" = ":\$(and \
+ ):"
+
+ @echo -e \n\$\$(assign ...) section
+ test ":A:" = ":\$(assign A := B ):"
+ test "\$(A)" = "B"
+ test ":A:" = ":\$(assign A\
+ := C ):"
+ test "\$(A)" = "C"
+
+ @echo -e \n\$\$(echo ...) section
+ test ":123:" = ":\$(echo 123 ):"
+ test ":123:" = ":\$(echo 123 ):"
+ test ":123:" = ":\$(echo\
+ 123 ):"
+ test ":123:" = ":\$(echo \
+ 123 ):"
+
+ @echo -e \n\$\$(eq ...) section
+ test ":true:" = ":\$(eq,1,1 true false):"
+ test ":true:" = ":\$(eq,1,1\
+ true false):"
+
+# These tests need to use a shell
+ +@echo -e '\n\$\$(foreach ...) section'
+ +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) [\$i]):"
+ +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) [\$i]):"
+ +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) [\$i] ):"
+ +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) \
+ [\$i] ):"
+
+ @echo -e \n\$\$(nil ...) section
+ test "::" = ":\$(nil abc):"
+# Fails with syntax error
+ test "::" = ":\$(nil \
+ ):"
+
+ @echo -e \n\$\$(not ...) section
+ test "::" = ":\$(not abc):"
+ test ":t:" = ":\$(not \$(NULL)):"
+ test ":t:" = ":\$(not ):"
+ test ":t:" = ":\$(not \
+ ):"
+
+ @echo -e \n\$\$(null ...) section
+ test ":true:" = ":\$(null, true false):"
+ test ":false:" = ":\$(null,a true false):"
+ test ":false:" = ":\$(null,a true false ):"
+ test ":false:" = ":\$(null,a \
+ true false ):"
+ test ":true:" = ":\$(null, \
+ true false ):"
+
+ @echo -e \n\$\$(or ...) section
+ test "::" = ":\$(or \$(nil) \$(nil) ):"
+ test ":t:" = ":\$(or a \$(nil) ):"
+ test "::" = ":\$(or \$(nil) \
+ \$(nil) ):"
+ test "::" = ":\$(or \
+ ):"
+
+EOT
+
+${DMAKEPROG} -r -f $file1
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result \ No newline at end of file
diff --git a/dmake/tests/function_macros-10 b/dmake/tests/function_macros-10
new file mode 100755
index 000000000000..db6ce88b0ded
--- /dev/null
+++ b/dmake/tests/function_macros-10
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+# 28.08.2007 Volker Quetschke
+# Test mktmp function macro.
+# (issue 64234)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Check that mktmp can write special characters into a file.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+FOO:=test1\n\ttest2\n\
+ test3
+
+all :
+ @cat \$(mktmp \$(FOO:m))
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+comparewith=`printf "test1\n\ttest2\n test3"`
+if test $result1 = 0 -a "$output1" = "$comparewith" ; then
+ echo "Subtest 1: OK"
+ result1=0
+else
+ echo "Subtest 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 2 - Check output of '('
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ @cat \${mktmp text (to dump to file}
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test $result2 = 0 -a "$output2" = "text (to dump to file" ; then
+ echo "Subtest 2: OK"
+ result2=0
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 3 - Test multiple line output.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+OBJ = fred.obj mary.obj
+
+./all :
+ @cat \$(mktmp \$(OBJ:t"+\n"))
+EOT
+
+output3=`eval OOODMAKEMODE=y ${DMAKEPROG} -r -f $file1`
+result3=$?
+comparewith=`printf "fred.obj+\nmary.obj"`
+if test $result3 = 0 -a "$output3" = "$comparewith" ; then
+ echo "Subtest 3: OK"
+ result3=0
+else
+ echo "Subtest 3: Wrong result: $output3"
+ echo
+ result3=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 4 - Test <+ ... +>
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+OBJ = fred.obj mary.obj joe.obj
+
+./all :
+ @cat <+\$(OBJ)+>
+EOT
+
+output4=`eval ${DMAKEPROG} -r -f $file1`
+result4=$?
+if test $result4 = 0 -a "$output4" = "fred.obj mary.obj joe.obj" ; then
+ echo "Subtest 4: OK"
+ result4=0
+else
+ echo "Subtest 4: Wrong result: $output4"
+ echo
+ result4=1
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/function_macros-2 b/dmake/tests/function_macros-2
new file mode 100755
index 000000000000..c17501f2aa5d
--- /dev/null
+++ b/dmake/tests/function_macros-2
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# 01.06.2005 Volker Quetschke
+# Tests for dmake function macros - part 2.
+# (issue 36027, issue 37053, issue 37491)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing function macros
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+TEST1:=a b c
+PAT:=Z
+
+all:
+ +@echo -e '\n\$\$(shell ...) section'
+ +test ":123:" = ":\$(shell echo 123 ):"
+ +test ":123:" = ":\$(shell \
+ echo 123 ):"
+ +test ":123:" = ":\$(shell echo \
+ 123 ):"
+
+ +@echo -e '\n\$\$(sort ...) section'
+ +test ":a b c:" = ":\$(sort c a b ):"
+ +test ":a b c:" = ":\$(sort\
+ c a b ):"
+ +test ":a b c:" = ":\$(sort c \
+ a b ):"
+
+ +@echo -e '\n\$\$(strip ...) section'
+ +test ":c a b:" = ":\$(strip c a b ):"
+ +test ":c a b:" = ":\$(strip c \
+ a b ):"
+
+ +@echo -e '\n\$\$(subst ...) section'
+ +test ":aZbZc:" = ":\$(subst,\$(SPACECHAR),\$(PAT) \$(TEST1)):"
+ +test ":aZbZc:" = ":\$(subst,%Z*Z%,\$(PAT) \$(TEST1:s/ /%Z*Z%/)):"
+ +test ":aZbZc:" = ":\$(subst,Y,\$(PAT) aYbYc ):"
+ +test ":aZbZc:" = ":{\$(subst,Y,Z aYbYc )}:"
+# Undefined
+# +test ":Should error out:BUG:\$(subst, ,\$(PAT) \$(TEST1)):"
+
+ +@echo -e '\n\$\$(uniq ...) section'
+ +test ":a b c:" = ":\$(uniq c a b c ):"
+ +test ":a b c:" = ":\$(uniq c \
+ a b c ):"
+
+EOT
+
+${DMAKEPROG} -r -f $file1
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result \ No newline at end of file
diff --git a/dmake/tests/function_macros-3 b/dmake/tests/function_macros-3
new file mode 100755
index 000000000000..bd8d06b3de27
--- /dev/null
+++ b/dmake/tests/function_macros-3
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# 04.09.2005 Volker Quetschke
+# Tests $(shell ..) function macro when using two concurrend processes.
+# (issue 53148)
+
+: ${DMAKEPROG:=dmake}
+file1="makefile.mk"
+file2="stdout.txt"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+AA=X\$(shell +echo shellexec)X
+
+$file2 :
+ +@echo b0
+ +@echo b1
+ +@echo b2
+ +@echo A\$(AA)A > $file2
+EOT
+
+${DMAKEPROG} -P2 -r -f $file1
+result=$?
+if test "`cat $file2`" != "AXshellexecXA"; then
+ echo "Wrong result: `cat $file2`, AXshellexecXA expected!"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/function_macros-4 b/dmake/tests/function_macros-4
new file mode 100755
index 000000000000..eef22e334ab9
--- /dev/null
+++ b/dmake/tests/function_macros-4
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# 04.09.2005 Volker Quetschke
+# Tests $(shell ..) if function macro is executed after previous recipe lines
+# when using two concurrend (or more) processes.
+# (issue 53148)
+
+: ${DMAKEPROG:=dmake}
+file1="makefile.mk"
+file2="stdout.txt"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+aaa :
+ +echo b0
+ +echo b1
+ +echo teststring > $file2
+ +echo A\$(shell cat $file2)A
+EOT
+
+${DMAKEPROG} -P2 -r -f $file1
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/function_macros-5 b/dmake/tests/function_macros-5
new file mode 100755
index 000000000000..1be199068c7b
--- /dev/null
+++ b/dmake/tests/function_macros-5
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# 03.14.2006 Volker Quetschke
+# Verifies that $(shell ..) does not pick up stdout output from
+# concurrent processes. (Stronger test for the spawn case.)
+# (issue 61856 / issue 61940)
+
+: ${DMAKEPROG:=dmake}
+file1="makefile.mk"
+file2="stdout.txt"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all : all1 all2
+ @+echo "Y\$(DYNMAC)Y" > $file2
+
+all1 :
+ @+echo "Before the sleeps ..."
+ @+echo A; sleep 1; echo B; sleep 1; echo C; sleep 1; echo D; sleep 1; echo E
+ @+echo "After the sleeps ..."
+
+all2 :
+ @+sleep 1;
+ @+echo "X\$(assign DYNMAC:=\$(shell @+echo "(shellpre)";sleep 2; echo "(shellpost)"))X"
+ @+echo "Z\$(DYNMAC)Z"
+EOT
+
+${DMAKEPROG} -P3 -r -f $file1
+result=$?
+if test "`cat $file2`" != "Y(shellpre) (shellpost)Y"; then
+ echo "Wrong result: `cat $file2`, Y(shellpre) (shellpost)Y expected!"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/function_macros-6 b/dmake/tests/function_macros-6
new file mode 100755
index 000000000000..ce22d9c6e913
--- /dev/null
+++ b/dmake/tests/function_macros-6
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# 22.07.2006 Volker Quetschke
+# Verifies that $(nil expression) expand expression but returns "".
+# (issue 67585)
+
+: ${DMAKEPROG:=dmake}
+file1="makefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing nil function macro
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all : dep
+ @+echo "X\$(AAA)X"
+
+dep :
+ \$(nil \$(assign AAA := OK))
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test $output1 = "XOKX" ; then
+ dummy=1
+ # OK
+else
+ echo "Wrong result: $output1"
+ result1=1
+fi
+
+test $result1 -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result1 -ne 0 && echo "Failure!"
+exit $result1
diff --git a/dmake/tests/function_macros-7 b/dmake/tests/function_macros-7
new file mode 100755
index 000000000000..e6fc03a3d84a
--- /dev/null
+++ b/dmake/tests/function_macros-7
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# 24.07.2006 Volker Quetschke
+# Checks that $(mktmp ...) works.
+# (issue 64583)
+
+: ${DMAKEPROG:=dmake}
+file1="makefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing mktmp function macro
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ @+cat \$(mktmp WRITTENTODISK)
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test $output1 = "WRITTENTODISK" ; then
+ dummy=1
+ # OK
+else
+ echo "Wrong result: $output1"
+ result1=1
+fi
+
+test $result1 -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result1 -ne 0 && echo "Failure!"
+exit $result1
diff --git a/dmake/tests/function_macros-8 b/dmake/tests/function_macros-8
new file mode 100755
index 000000000000..911b1cff306a
--- /dev/null
+++ b/dmake/tests/function_macros-8
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+# 24.07.2007 Volker Quetschke
+# Test the $(normpath ..) function macro.
+# (issue 78776)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Test if normpath works.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.WINPATH:=
+
+all :
+ @echo 1\$(normpath /tmp/./a "/tmp/a b/xxx/../b" /tmp)1
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != "1/tmp/a \"/tmp/a b/b\" /tmp1"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2 - Test if normpath honors .WINPATH setting
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all .WINPATH :
+ @echo 2\$(normpath /tmp)2
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ if test "$output2" != "2`cygpath -m /tmp`2"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+ else
+ echo "Subtest 2: OK"
+ fi
+else
+ if test "$output2" != "2/tmp2"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+ else
+ echo "Subtest 2: OK"
+ fi
+fi
+
+# Test 3 - Test if the optional parameter works
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ @echo 3\$(normpath,"" /tmp)3\$(normpath,"abc" /tmp)3
+
+EOT
+
+output3=`eval ${DMAKEPROG} -r -f $file1`
+result3=$?
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ if test "$output3" != "3/tmp3`cygpath -m /tmp`3"; then
+ echo "Subtest 3: Wrong result: $output3"
+ result3=1
+ else
+ echo "Subtest 3: OK"
+ fi
+else
+ if test "$output3" != "3/tmp3/tmp3"; then
+ echo "Subtest 3: Wrong result: $output3"
+ result3=1
+ else
+ echo "Subtest 3: OK"
+ fi
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/function_macros-9 b/dmake/tests/function_macros-9
new file mode 100755
index 000000000000..e8d4d3a070a7
--- /dev/null
+++ b/dmake/tests/function_macros-9
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# 05.08.2007 Volker Quetschke
+# Test the $(shell,expand ..) function macro.
+# (issue 50092)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Test if it works.
+cat > $file1 <<EOT
+# The printf on Solaris seems to need bash.
+SHELL:=/bin/bash
+SHELLFLAGS*:=-ce
+
+AAA!=123
+
+all :
+ noop X\$(shell,expand +@printf "\x24(AAA)")Y\$(shell +@printf \\\\x24\\(AAA\\))Z
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != "noop X123Y\$(AAA)Z"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2 - Test if wrong arguments are catched.
+cat > $file1 <<EOT
+# The printf on Solaris seems to need bash.
+SHELL:=/bin/bash
+SHELLFLAGS*:=-ce
+
+AAA!=123
+
+all :
+ noop X\$(shell,XXX +@printf ABC\\\\x24\\(AAA\\))Y
+
+EOT
+
+output2=`eval ${DMAKEPROG} -rf $file1 2>&1`
+result2=$?
+
+if echo $output2 | grep 'Error: -- Unknown argument \[XXX\] to shell' > /dev/null 2>&1 ; then
+ echo "Subtest 2: OK"
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=0
+fi
+
+
+
+if test $result1 -eq 0 -a $result2 -ne 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/infra-0 b/dmake/tests/infra-0
new file mode 100755
index 000000000000..494ffa44283a
--- /dev/null
+++ b/dmake/tests/infra-0
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# 01.06.2005 Volker Quetschke
+# Basic test of dmake existence and the needed infrastructure.
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+file2="mytestfile"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Test for "test" programm in path
+which test > /dev/null || { echo "Failure! \"test\" program missing." ; exit 1; }
+echo "Found \"test\" program."
+test=`which test`
+
+# Test for "echo" programm in path
+which echo > /dev/null || { echo "Failure! \"echo\" program missing." ; exit 1; }
+echo "Found \"echo\" program."
+
+# Test for dmake program
+${test} -x "${DMAKEPROG}" || { echo "Failure! \"dmake\" is missing." ; exit 1; }
+echo "Found \"dmake\" program."
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# simple makefile
+${file2}:
+ @echo 'Generating ${file2}'
+ touch ${file2}
+EOT
+
+${DMAKEPROG} -r -f $file1
+result=$?
+if ${test} ! -e "${file2}"; then
+ echo "File missing"
+ result=1
+fi
+
+${test} $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+${test} $result -ne 0 && echo "Failure!"
+exit $result
+
diff --git a/dmake/tests/macros-1 b/dmake/tests/macros-1
new file mode 100755
index 000000000000..3eb0d57704f3
--- /dev/null
+++ b/dmake/tests/macros-1
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# 01.06.2005 Volker Quetschke
+# Tests for special dmake macros.
+# (issue 37491)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing macros
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+TEST1:=a b c
+PAT:=Z
+
+all:
+ +@echo -e '\n\$\$(SPACECHAR) section'
+ +test ": :" = ":\$(SPACECHAR):"
+
+ +@echo -e '\n\$\$(MACRO:s/pat/rep/) section'
+ +test ":aZbZc:" = ":\$(TEST1:s/ /Z/):"
+ +test ":aZbZc:" = ":\$(TEST1:s/\$(SPACECHAR)/Z/):"
+ +test ":aZbZc:" = ":\$(TEST1:s/ /\$(PAT)/ ):"
+
+EOT
+
+${DMAKEPROG} -r -f $file1
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
+
diff --git a/dmake/tests/macros-10 b/dmake/tests/macros-10
new file mode 100755
index 000000000000..b2e7d373713f
--- /dev/null
+++ b/dmake/tests/macros-10
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+# 08.08.2007 Volker Quetschke
+# Test macro assignment syntax check.
+# (issue 69510)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+AAA:=BBB
+\$(AAA) := 123
+
+X) := YYY
+
+all :
+ @echo :\$(BBB):\${X)}:
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != ":123:YYY:"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+{ := fail
+
+all :
+ @echo Should fail
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result2=$?
+
+if test $result2 != 0 && echo $output2 | grep 'Error: -- Syntax error in macro assignment' > /dev/null 2>&1 ; then
+ echo "Subtest 2: OK"
+ result2=0
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+# Test 3
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+X := :
+
+AA\$XBB = 098
+
+all :
+ @echo Should fail
+
+EOT
+
+output3=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result3=$?
+if test $result3 != 0 && echo $output3 | grep 'Error: -- Syntax error in macro assignment' > /dev/null 2>&1 ; then
+ echo "Subtest 3: OK"
+ result3=0
+else
+ echo "Subtest 3: Wrong result: $output3"
+ echo
+ result3=1
+fi
+
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/macros-11 b/dmake/tests/macros-11
new file mode 100755
index 000000000000..023b8a140e1d
--- /dev/null
+++ b/dmake/tests/macros-11
@@ -0,0 +1,147 @@
+#!/bin/sh
+
+# 26.08.2007 Volker Quetschke
+# Test OOODMAKEMODE macro.
+# (issue 74007)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="startup.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Without OOODMAKEMODE set strip leading ./
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+#OOODMAKEMODE=
+
+./all :
+ @echo X\$@Y
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test $result1 = 0 -a "$output1" = "XallY" ; then
+ echo "Subtest 1: OK"
+ result1=0
+else
+ echo "Subtest 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 2 - With OOODMAKEMODE=y do not strip leading ./
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+OOODMAKEMODE:=y
+
+./all :
+ @echo X\$@Y
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test $result2 = 0 -a "$output2" = "X./allY" ; then
+ echo "Subtest 2: OK"
+ result2=0
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 3 - Test OOODMAKEMODE from environment.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.IMPORT : OOODMAKEMODE
+
+./all :
+ @echo X\$@Y
+EOT
+
+output3=`eval OOODMAKEMODE=y ${DMAKEPROG} -r -f $file1`
+result3=$?
+if test $result3 = 0 -a "$output3" = "X./allY" ; then
+ echo "Subtest 3: OK"
+ result3=0
+else
+ echo "Subtest 3: Wrong result: $output3"
+ echo
+ result3=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 4 - With OOODMAKEMODE= leading ./
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+OOODMAKEMODE:=
+
+./all :
+ @echo X\$@Y
+EOT
+
+output4=`eval ${DMAKEPROG} -r -f $file1`
+result4=$?
+if test $result4 = 0 -a "$output4" = "XallY" ; then
+ echo "Subtest 4: OK"
+ result4=0
+else
+ echo "Subtest 4: Wrong result: $output4"
+ echo
+ result4=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 5 - Import from environment / targets from command line.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%target :
+ @echo X\$@Y
+EOT
+
+cat > $file2 <<EOT
+.IMPORT : OOODMAKEMODE
+EOT
+
+output5=`eval DMAKEROOT=. OOODMAKEMODE=y ${DMAKEPROG} -f $file1 ./mytarget`
+result5=$?
+if test $result5 = 0 -a "$output5" = "X./mytargetY" ; then
+ echo "Subtest 5: OK"
+ result5=0
+else
+ echo "Subtest 5: Wrong result: $output5"
+ echo
+ result5=1
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 \
+ -a $result5 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/macros-2 b/dmake/tests/macros-2
new file mode 100755
index 000000000000..c0d26260e0b6
--- /dev/null
+++ b/dmake/tests/macros-2
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# 26.01.2006 Volker Quetschke
+# TMD is sometimes set incorrectly (issue 61170).
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+file3="dirwith space"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles "$file3"; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles "$file3"
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all .SETDIR=${TMP} :
+ +@echo \$(TMD)
+
+EOT
+
+# Testcase 2
+mkdir -p "$file3"
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+
+all ".SETDIR=dirwith space" :
+ +@echo \$(TMD)
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+output2=`eval ${DMAKEPROG} -r -f $file2`
+result2=$?
+
+if test "$output1" = ""; then
+ echo "Test 1: Wrong result"
+ result1=1
+fi
+if test "$output2" != ".."; then
+ echo "Test 2: Wrong result"
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles "$file3"
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/macros-3 b/dmake/tests/macros-3
new file mode 100755
index 000000000000..f3428fb8307c
--- /dev/null
+++ b/dmake/tests/macros-3
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# 17.05.2006 Volker Quetschke
+# Check that .INIT and .DONE are not mistaken for .<suffix> targets
+# and that dmake warns if .<suffix> targets have prerequisites.
+# (issue 65333).
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - No warning expected
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +@echo "all"
+
+.INIT .DONE : something
+ +@echo "Dummy recipe"
+
+something :
+ +@echo "just a target"
+
+EOT
+
+# Testcase 2 - dmake should warn
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.MYTARGET : something
+ +@echo ".MYTARGET"
+
+something :
+ +@echo "just a target"
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
+result2=$?
+
+if test "$output1" != "all"; then
+ echo "Test 1: Wrong result: $output1"
+ result1=1
+fi
+if echo $output2 | grep -v 'Warning: -- Ignoring' ; then
+ echo "Test 2: Wrong result: $output2"
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/macros-4 b/dmake/tests/macros-4
new file mode 100755
index 000000000000..89134d2fa9c3
--- /dev/null
+++ b/dmake/tests/macros-4
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+# 15.08.2006 Volker Quetschke
+# Check that single letter macros with (, {, ), } and : are rejected.
+# (issue 44961).
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+file3="mfile3.mk"
+file4="mfile4.mk"
+tmpfiles="$file1 $file2 $file3 $file4"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - Warn about miising closing braket.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +@echo "X\$(subst Y"
+EOT
+
+# Testcase 2 - warn about $)
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +@echo "X\$)Y"
+EOT
+
+# Testcase 3 - warn about $:
+cat > $file3 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +@echo "X\$:Y"
+EOT
+
+# Testcase 4 - don't warn
+cat > $file4 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +@printf "X\$BLA)Y"
+ +@echo "X\$XX:Y"
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
+result2=$?
+output3=`eval ${DMAKEPROG} -r -f $file3 2>&1 `
+result3=$?
+output4=`eval ${DMAKEPROG} -r -f $file4 2>&1 `
+result4=$?
+
+if echo $output1 | grep -v 'Error: -- Syntax error'; then
+ echo "Test 1: Missing error: $output1"
+ result1=0
+fi
+if echo $output2 | grep -v 'Error: -- Syntax error' ; then
+ echo "Test 2: Missing error: $output2"
+ result2=0
+fi
+if echo $output3 | grep -v 'Error: -- Syntax error'; then
+ echo "Test 3: Missing error: $output3"
+ result3=0
+fi
+if test "$output4" != "XLA)YXX:Y"; then
+ echo "Test 2: Wrong result: $output4"
+ result4=1
+fi
+
+if test $result1 -ne 0 -a $result2 -ne 0 -a $result3 -ne 0 -a $result4 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/macros-5 b/dmake/tests/macros-5
new file mode 100755
index 000000000000..d175271ee6f9
--- /dev/null
+++ b/dmake/tests/macros-5
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# 24.09.2006 Volker Quetschke
+# TMD is sometimes set incorrectly (issue 69821).
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+file3="test1/aaa"
+file4="test2/aaa"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles test1 test2; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles test1 test2
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +@echo \$(TMD)
+
+EOT
+
+# Testcase 2
+mkdir -p "$file3"
+mkdir -p "$file4"
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+
+all ".SETDIR=../../$file3" :
+ +@echo \$(TMD)
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+output2=`eval cd $file4 ; ../../${DMAKEPROG} -r -f ../../$file2`
+result2=$?
+
+if test "$output1" != "."; then
+ echo "Test 1: Wrong result: $output1"
+ result1=1
+else
+ echo " Subtest 1: OK"
+fi
+if test "$output2" != "../../test2/aaa"; then
+ echo "Test 2: Wrong result: $output2"
+ result2=1
+else
+ echo " Subtest 2: OK"
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles test1 test2
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/macros-6 b/dmake/tests/macros-6
new file mode 100755
index 000000000000..8119f2ae84bb
--- /dev/null
+++ b/dmake/tests/macros-6
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# 09.11.2006 Volker Quetschke
+# Check that TMD honors if .SETDIR is used (with drive letters on cygwin)
+# (issue 69821).
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.IMPORT .IGNORE : TEMP
+.IF "\$(TEMP)"==""
+TEMP:=/tmp
+.ENDIF
+
+
+# Test if .SETDIR works with drive letters
+.IF "\$(subst,Cygwin, \$(shell @uname))"!="\$(shell @uname)"
+SDIR:=\$(shell @+cygpath -d "\$(TEMP)")
+.ELSE
+SDIR:=\$(TEMP)
+.ENDIF
+
+# Make TEMP the target directory, cd to TMD should go back to
+# the original directory
+all ".SETDIR=\$(SDIR)" :
+ @+cd \$(TMD); pwd
+
+EOT
+
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+
+if test "$output1" != "`pwd`"; then
+ echo "Test 1: Wrong result: ${output1}"
+ result1=1
+else
+ echo "Test 1: OK"
+fi
+
+if test $result1 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/macros-7 b/dmake/tests/macros-7
new file mode 100755
index 000000000000..2c7d0849172f
--- /dev/null
+++ b/dmake/tests/macros-7
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# 24.07.2007 Volker Quetschke
+# Test the $(macro:n) macro extension.
+# (issue 78776)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Test if :n works.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.WINPATH:=
+
+MACRO:=/tmp/./a "/tmp/a b/xxx/../b" /tmp
+
+all :
+ @echo 1\$(MACRO:n)1
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != "1/tmp/a \"/tmp/a b/b\" /tmp1"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2 - Test if the .WINPATH setting is honored
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:=/tmp
+
+all .WINPATH :
+ @echo 2\$(MACRO:n)2
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ if test "$output2" != "2`cygpath -m /tmp`2"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+ else
+ echo "Subtest 2: OK"
+ fi
+else
+ if test "$output2" != "2/tmp2"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+ else
+ echo "Subtest 2: OK"
+ fi
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/macros-8 b/dmake/tests/macros-8
new file mode 100755
index 000000000000..705a92878ad0
--- /dev/null
+++ b/dmake/tests/macros-8
@@ -0,0 +1,157 @@
+#!/bin/sh
+
+# 24.07.2007 Volker Quetschke
+# Test the :b :d :e :f macro extensions.
+# (issue 80009)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Test if :f works.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.WINPATH:=
+
+MACRO:=/tmp/yyy.ext "/tmp/a b/xxx.ext"
+
+all :
+ @echo f:\$(MACRO:f):
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != "f:yyy.ext \"xxx.ext\":"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:=/tmp/yyy.ext "/tmp/a b/xxx.ext"
+
+all :
+ @echo d:\$(MACRO:d):
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test "$output2" != "d:/tmp/ \"/tmp/a b/\":"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+else
+ echo "Subtest 2: OK"
+fi
+
+
+# Test 3
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:=/tmp/yyy.ext "/tmp/a b/xxx.ext"
+
+all :
+ @echo e:\$(MACRO:e):
+
+EOT
+
+output3=`eval ${DMAKEPROG} -r -f $file1`
+result3=$?
+if test "$output3" != "e:.ext \".ext\":"; then
+ echo "Subtest 3: Wrong result: $output3"
+ result3=1
+else
+ echo "Subtest 3: OK"
+fi
+
+
+# Test 4
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:=/tmp/yyy.ext "/tmp/a b/xxx.ext"
+
+all :
+ @echo b:\$(MACRO:b):
+
+EOT
+
+output4=`eval ${DMAKEPROG} -r -f $file1`
+result4=$?
+if test "$output4" != "b:yyy \"xxx\":"; then
+ echo "Subtest 4: Wrong result: $output4"
+ result4=1
+else
+ echo "Subtest 4: OK"
+fi
+
+
+# Test 5
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:=/tmp/yyy.ext "/tmp/a b/xxx.ext"
+
+all :
+ @echo de:\$(MACRO:de):
+
+EOT
+
+output5=`eval ${DMAKEPROG} -r -f $file1`
+result5=$?
+if test "$output5" != "de:/tmp/.ext \"/tmp/a b/.ext\":"; then
+ echo "Subtest 5: Wrong result: $output5"
+ result5=1
+else
+ echo "Subtest 5: OK"
+fi
+
+
+# Test 6
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACROd:=/tmp/yyy "/tmp/a b/xxx"
+
+all :
+ @echo e:\$(MACROd:e):
+
+EOT
+
+output6=`eval ${DMAKEPROG} -r -f $file1`
+result6=$?
+if test "$output6" != "e::"; then
+ echo "Subtest 6: Wrong result: $output6"
+ result6=1
+else
+ echo "Subtest 6: OK"
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 \
+ -a $result5 -eq 0 -a $result6 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/macros-9 b/dmake/tests/macros-9
new file mode 100755
index 000000000000..edfaf343fccf
--- /dev/null
+++ b/dmake/tests/macros-9
@@ -0,0 +1,141 @@
+#!/bin/sh
+
+# 27.07.2007 Volker Quetschke
+# Test the :i :1 macro extensions.
+# (issue 80010)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.WINPATH:=
+
+MACRO:="/tmp/yyy.ext" "/tmp/a b/xxx.ext"
+
+all :
+ @echo 1:\$(MACRO:1):
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != "1:\"/tmp/yyy.ext\":"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO2:=/tmp/zzz.ext /tmp/aaa
+
+all :
+ @echo 1:\$(MACRO2:1):
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test "$output2" != "1:/tmp/zzz.ext:"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+else
+ echo "Subtest 2: OK"
+fi
+
+
+# Test 3
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:="/tmp/yyy.ext" "/tmp/a b/xxx.ext"
+
+all :
+ @echo i:\$(MACRO:i):
+
+EOT
+
+output3=`eval ${DMAKEPROG} -r -f $file1`
+result3=$?
+if test "$output3" != "i:\"/tmp/yyy.ext\" \"/tmp/a b/xxx.ext\":"; then
+ echo "Subtest 3: Wrong result: $output3"
+ result3=1
+else
+ echo "Subtest 3: OK"
+fi
+
+
+# Test 4
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACRO:="/tmp/yyy.ext" "/tmp/a b/xxx.ext"
+
+.WINPATH=
+
+all :
+ @echo 1n:\$(MACRO:1n):
+
+EOT
+
+output4=`eval ${DMAKEPROG} -r -f $file1`
+result4=$?
+if test "$output4" != "1n:\"/tmp/yyy.ext\":"; then
+ echo "Subtest 4: Wrong result: $output4"
+ result4=1
+else
+ echo "Subtest 4: OK"
+fi
+
+
+# Test 5
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MACROi:="./expand.c"
+
+.WINPATH=
+
+.SOURCE : ..
+
+all : expand.c
+ @echo i:\$(MACROi:i):
+
+EOT
+
+output5=`eval ${DMAKEPROG} -r -f $file1`
+result5=$?
+if test "$output5" != "i:\"../expand.c\":"; then
+ echo "Subtest 5: Wrong result: $output5"
+ result5=1
+else
+ echo "Subtest 5: OK"
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 \
+ -a $result5 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/misc-1 b/dmake/tests/misc-1
new file mode 100755
index 000000000000..5b4f581afda4
--- /dev/null
+++ b/dmake/tests/misc-1
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# 04.06.2005 Volker Quetschke
+# Test for a bug that dmake complained about a continuation char followed
+# by a newline. This could happen if \<nl> was used in an imported
+# environment variable.
+# This bug was <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=310107?>
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles ( $ -> \$ ).
+# Also quote line continuations ( \<nl> -> \\<nl> ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+.IMPORT : MYMACRO
+all:
+ +echo "\$(MYMACRO)"
+
+EOT
+
+MYMACRO=`echo 'aa\\\\\naa'` ;export MYMACRO; ${DMAKEPROG} -r -f $file1
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
+
diff --git a/dmake/tests/misc-10 b/dmake/tests/misc-10
new file mode 100755
index 000000000000..42d2bea5bfba
--- /dev/null
+++ b/dmake/tests/misc-10
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# 10.05.2006 Volker Quetschke
+# A comparison with the empty string crashes dmake.
+# (issue 65182/65281)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+MYVAR=
+
+all:
+.IF \$(MYVAR) >= "122"
+ +@echo "true"
+.ELSE
+ +@echo "false"
+.ENDIF
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+
+if test "$output" != "false"; then
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-11 b/dmake/tests/misc-11
new file mode 100755
index 000000000000..93829497474c
--- /dev/null
+++ b/dmake/tests/misc-11
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# 16.06.2006 Volker Quetschke
+# A comparison with the empty string crashes dmake - equality test with empty
+# string must work too.
+# (issue 65281)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+RHS=
+
+all:
+.IF \$(LHS) == \$(RHS)
+ +@echo "true"
+.ELSE
+ +@echo "false"
+.ENDIF
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+
+if test "$output" != "true"; then
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-12 b/dmake/tests/misc-12
new file mode 100755
index 000000000000..f8e4f7a1dcdb
--- /dev/null
+++ b/dmake/tests/misc-12
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# 22.06.2006 Volker Quetschke
+# Conditional expressions failed before with line continuations.
+# (issue 66659)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles ( $ -> \$ ).
+# Also quote line continuations ( \<nl> -> \\<nl> ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all:
+.IF "a" == "a" && \\
+ "b" == "b"
+ @+echo OK
+.ELSE
+ @+echo WRONG
+.ENDIF
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+
+if test "$output" != "OK"; then
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-13 b/dmake/tests/misc-13
new file mode 100755
index 000000000000..7493e744b6b6
--- /dev/null
+++ b/dmake/tests/misc-13
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# 29.09.2006 Volker Quetschke
+# Check if the directory cache can be made case insensitive
+# (issue 69814)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="TeSt.target"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+echo "Something" > $file2
+
+# Remember to quote variables in generated makefiles ( $ -> \$ ).
+# Also quote line continuations ( \<nl> -> \\<nl> ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.DIRCACHE=yes
+
+# Only test the directory cache for case insensitivity if the FS is also
+# case insensitive.
+.IF "\$(.DIRCACHERESPCASE)"!="y"
+test.target :
+ @echo "Building \$@"
+
+.ELSE
+TeSt.target :
+ @echo "Building \$@"
+
+.ENDIF
+
+EOT
+
+output=`eval ${DMAKEPROG} -vm -r -f $file1`
+result=$?
+
+if echo "$output" | grep -v ".target' is up to date" > /dev/null 2>&1 ; then
+ echo "Wrong result: ${output}"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-14 b/dmake/tests/misc-14
new file mode 100755
index 000000000000..6f71b373c2df
--- /dev/null
+++ b/dmake/tests/misc-14
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# 07.10.2006 Volker Quetschke
+# Check if the line of the error is issued
+# (issue 70027)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles ( $ -> \$ ).
+# Also quote line continuations ( \<nl> -> \\<nl> ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +echo allA
+
+all :
+ +echo allB
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result=$?
+
+if echo "$output" | grep 'line .: Error: --' > /dev/null 2>&1 ; then
+ dummy=1
+ result=0
+ # OK
+else
+ echo "Test 1: Wrong result: $output"
+ echo
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-15 b/dmake/tests/misc-15
new file mode 100755
index 000000000000..a213c2d885af
--- /dev/null
+++ b/dmake/tests/misc-15
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# 09.11.2006 Volker Quetschke
+# Check DOS style paths and directory caching with cygwin dmake or just
+# normal paths with other versions.
+# issue 69742, 69943
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="target.abc"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+echo "Something" > $file2
+
+# Remember to quote variables in generated makefiles ( $ -> \$ ).
+# Also quote line continuations ( \<nl> -> \\<nl> ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.DIRCACHE=yes
+
+# Test if .SETDIR works with drive letters
+.IF "\$(subst,Cygwin, \$(shell @uname))"!="\$(shell @uname)"
+MYTARGET:=\$(shell @+cygpath -d "\$(PWD)")\target.abc
+.ELSE
+MYTARGET:=\$(PWD)/target.abc
+.ENDIF
+
+"\$(MYTARGET)" :
+ @echo "Building \$@ - \$(MYTARGET)"
+
+EOT
+
+output=`eval ${DMAKEPROG} -vm -r -f $file1`
+result=$?
+
+if echo "$output" | grep "target.abc' is up to date" > /dev/null 2>&1 ; then
+ # OK
+ dummy=1
+else
+ echo "Wrong result: ${output}"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-16 b/dmake/tests/misc-16
new file mode 100755
index 000000000000..2e234d3d15a1
--- /dev/null
+++ b/dmake/tests/misc-16
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# 17.11.2006 Volker Quetschke
+# Check that parallel builds $(shell ...) only waits its own target and
+# not for all previous recipe lines.
+# (issue 61856)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mytarget.dpcc"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all : all1 all2
+ @+echo all
+
+all1 :
+ @+printf "1"
+ @+sleep 2
+ @+printf "4"
+
+all2 :
+ @+sleep 1
+ @+printf "2"
+ @+printf "\$(shell @+echo "3")"
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -P2 -f $file1`
+result=$?
+
+if test "$output" != "1234all"; then
+ echo "Wrong result: $output - expecting: 1234all"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-17 b/dmake/tests/misc-17
new file mode 100755
index 000000000000..158b11575752
--- /dev/null
+++ b/dmake/tests/misc-17
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# 19.11.2006 Volker Quetschke
+# Check that a global .SEQUENTIAL attribute enforces MAXPROCESS=1.
+# (issue 71704)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="my.inc"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL=/bin/sh
+SHELLFLAGS=-c
+
+my.inc :
+ @+echo "MYMAXPROCESS!:=\$(MAXPROCESS)" > my.inc
+
+.INCLUDE : my.inc
+
+all:
+ @+echo "MYMAXPROCESS:\$(MYMAXPROCESS):"
+
+EOT
+
+output=`eval ${DMAKEPROG} -S -P2 -rf $file1 all`
+result=$?
+
+if test "$output" != "MYMAXPROCESS:1:"; then
+ echo "Wrong result: $output - expecting: MYMAXPROCESS:1:"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-18 b/dmake/tests/misc-18
new file mode 100755
index 000000000000..a676df6580e2
--- /dev/null
+++ b/dmake/tests/misc-18
@@ -0,0 +1,169 @@
+#!/bin/sh
+
+# 23.03.2007 Volker Quetschke
+# Test .WINPATH attribute (A cygwin only attribute that is ignored
+# elsewhere).
+# (issue 73499)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Test if .WINPATH is accepted as global attribute
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.WINPATH :
+
+all :
+ @echo OK1
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != "OK1"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+# Test 2 - Test if .WINPATH is accepted as local attribute
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all .WINPATH :
+ @echo OK2
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1`
+result2=$?
+if test "$output2" != "OK2"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+else
+ echo "Subtest 2: OK"
+fi
+
+
+# Test 3 - Test if $@ and $* are DOSified.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+/tmp/blah.xx .WINPATH :
+ @echo at:\$@:star:\$*:
+
+EOT
+
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ output3=`eval ${DMAKEPROG} -r -f $file1`
+ result3=$?
+ if test "$output3" != "at:`cygpath -m /tmp/blah.xx`:star:`cygpath -m /tmp/blah`:"; then
+ echo "Subtest : Wrong result: $output3"
+ result3=1
+ else
+ echo "Subtest 3: OK"
+ fi
+else
+ echo "Subtest 3 ignored for non cygwin environment"
+ result3=0
+fi
+
+
+# Test 4 - Test if $(PWD), $(MAKEDIR) are DOSified.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all .WINPATH .SETDIR=/tmp :
+ @echo :\$(PWD):\$(MAKEDIR):
+
+EOT
+
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ output4=`eval ${DMAKEPROG} -r -f $file1`
+ result4=$?
+ mypwd=`pwd`
+ if test "$output4" != ":`cygpath -m /tmp`:`cygpath -m $mypwd`:"; then
+ echo "Subtest : Wrong result: $output4"
+ result4=1
+ else
+ echo "Subtest 4: OK"
+ fi
+else
+ echo "Subtest 4 ignored for non cygwin environment"
+ result4=0
+fi
+
+
+# Test 5 - Test if $(TMD) is DOSified (if it is an absolute path).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all .WINPATH .SETDIR=/ :
+ @echo :\$(PWD):\$(TMD):
+
+EOT
+
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ output5=`eval ${DMAKEPROG} -r -f $file1`
+ result5=$?
+ mypwd=`pwd`
+ if test "$output5" != ":`cygpath -m /`:`cygpath -m $mypwd`:"; then
+ echo "Subtest : Wrong result: $output5"
+ result5=1
+ else
+ echo "Subtest 5: OK"
+ fi
+else
+ echo "Subtest 5 ignored for non cygwin environment"
+ result5=0
+fi
+
+
+# Test 6 - Test if .WINPATH changes $@ in conditional macro.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+/tmp/all.bla ?= QQQ=\$@
+/tmp/all.bla .WINPATH :
+ @echo :\$(QQQ):
+EOT
+
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ output6=`eval ${DMAKEPROG} -r -f $file1`
+ result6=$?
+ if test "$output6" != ":`cygpath -m /tmp/all.bla`:"; then
+ echo "Subtest : Wrong result: $output6"
+ result6=1
+ else
+ echo "Subtest 6: OK"
+ fi
+else
+ echo "Subtest 6 ignored for non cygwin environment"
+ result6=0
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 \
+ -a $result5 -eq 0 -a $result6 -eq 0; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/misc-19 b/dmake/tests/misc-19
new file mode 100755
index 000000000000..af824571219d
--- /dev/null
+++ b/dmake/tests/misc-19
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# 02.09.2007 Volker Quetschke
+# Check that temporary filenames are kept alive between recipe lines.
+# (issue 67911)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ @noop \$(assign TMPFILE:=\$(mktmp abcd))
+ @cat \$(TMPFILE)
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test $result1 = 0 -a "$output1" = "abcd"; then
+ echo "OK"
+else
+ echo "Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/misc-2 b/dmake/tests/misc-2
new file mode 100755
index 000000000000..06748dd98037
--- /dev/null
+++ b/dmake/tests/misc-2
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# 01.09.2005 Volker Quetschke
+# Tests if dmake can work with makefiles with DOS lineendings.
+# (issue 52238)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+file2="mymakefile_dos.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.NOTABS !:= yes
+
+all:
+
+ echo aaa
+
+EOT
+
+#more compatible version of: unix2dos $file1
+: ${AWK:=awk}
+#$AWK 'sub("$", "\r")' $file1 > $file2
+$AWK '{print $0"\r"}' $file1 > $file2
+
+${DMAKEPROG} -r -f $file2
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-20 b/dmake/tests/misc-20
new file mode 100755
index 000000000000..c25bf05d8342
--- /dev/null
+++ b/dmake/tests/misc-20
@@ -0,0 +1,121 @@
+#!/bin/sh
+
+# 16.09.2007 Volker Quetschke
+# Check that inferred makefiles for .INCLUDE do not disturb the dependency
+# checking afterwards.
+# (issue 81296)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="my.c"
+file3="my.obj"
+file4="my.foo"
+tmpfiles="$file1 $file2 $file3 $file4"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - from testcase t_81296_5.mk
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+# Test that my.c is build when my.foo is newer.
+
+# rules.mk ---
+%.obj : %.c ; @+printf "\$@:"
+# @sleep 1
+ @touch \$@
+
+%.dpo : %.c ; @+printf "incbuild:\$@:"
+# @sleep 1
+
+# target.mk ---
+all : my.obj ; @echo all
+
+# If the file exist no inference is done for it.
+.INCLUDE .IGNORE : my.dpo
+
+# When inference was run on the %.dpo with an existing
+# %.c these rule gets ignored.
+# local makefile.mk ---
+%.c : %.foo ; @+printf "\$@:"
+# @sleep 1
+ @touch \$@
+EOT
+
+# Create test environment
+touch my.c
+sleep 1
+touch my.foo
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test $result1 = 0 -a "$output1" = "incbuild:my.dpo:my.c:my.obj:all"; then
+ echo "Subtest 1: OK"
+else
+ echo "Subtest 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+# Remove files from prior run
+rm -rf $tmpfiles
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 2 - from testcase t_81296_6.mk
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+# Test that no circular dependency error is issued:
+# $ rm -f my.* ; touch my.c ; ./dmake/dmake.exe -rf t_81296_6.mk
+
+# rules.mk ---
+%.obj : %.c ; @+printf "\$@:"
+ @touch \$@
+
+%.dpo : %.c ; @+printf "incbuild:\$@:"
+
+# target.mk ---
+all : my.obj ; @echo all
+
+# If the file exist no inference is done for it.
+.INCLUDE .IGNORE : my.dpo
+
+%.c : %.foo ; @+printf "\$@:"
+ @touch \$@
+
+# This leads to a (wrong) circular dependency error
+my.obj : my.c
+
+EOT
+
+# Create test environment
+touch my.c
+sleep 1
+touch my.foo
+
+output2=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result2=$?
+
+if test $result2 = 0 -a "$output2" = "incbuild:my.dpo:my.c:my.obj:all"; then
+ echo "Subtest 2: OK"
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/misc-21 b/dmake/tests/misc-21
new file mode 100755
index 000000000000..9dea6cc234a2
--- /dev/null
+++ b/dmake/tests/misc-21
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# 13.10.2007 Volker Quetschke
+# Check that SHELLCMDQUOTE adds the characters to the command.
+# issue 81252
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles ( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL!:=printf
+SHELLFLAGS!:=
+
+SHELLCMDQUOTE=X
+
+all :
+ @+testtest
+
+EOT
+
+output=`eval ${DMAKEPROG} -rf $file1`
+result=$?
+
+if test "$result" = "0" && test "$output" = "XtesttestX" ; then
+ # OK
+ dummy=1
+else
+ echo "Wrong result: ${output}"
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-3 b/dmake/tests/misc-3
new file mode 100755
index 000000000000..acd7ce4822b4
--- /dev/null
+++ b/dmake/tests/misc-3
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# 17.09.2005 Volker Quetschke
+# Test for line continuation in comments.
+# (issue 49461)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+AAA:=aaa
+
+# A continued comment line followed/ended by an empty line \
+
+AAA+=bbb
+
+all:
+ +@echo \$(AAA)
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+
+# The space between aaa and bbb comes from the +=
+if test "$output" != "aaa bbb"; then
+ echo "Wrong result"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-4 b/dmake/tests/misc-4
new file mode 100755
index 000000000000..ed11a8e20098
--- /dev/null
+++ b/dmake/tests/misc-4
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# 06.10.2005 Volker Quetschke
+# Test for parallel operation.
+# (no issue, sanity check only)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+file2="testfile"
+file3="testfile1"
+file4="testfile2"
+file5="testfile3"
+tmpfiles="$file1 $file2 $file3 $file4 $file5"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing parallel execution
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+testfile : testfile2 testfile3 testfile1
+ +@echo xx > \$@
+
+testfile1 :
+ +@echo making \$@ 1>&2
+ +@sleep 1
+ +@printf t1
+ +@echo 1 > \$@
+
+testfile2 :
+ +@echo making \$@ 1>&2
+ +@sleep 2
+ +@printf t2
+ +@echo 2 > \$@
+
+testfile3 :
+ +@echo making \$@ 1>&2
+ +@sleep 3
+ +@printf t3
+ +@echo 3 > \$@
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -P3 -f $file1`
+result=$?
+
+# In parallel operation the targets with the smaller sleep value
+# will finish first.
+if test "$output" != "t1t2t3"; then
+ echo "Wrong result"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-5 b/dmake/tests/misc-5
new file mode 100755
index 000000000000..5c458482d7c7
--- /dev/null
+++ b/dmake/tests/misc-5
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# 06.10.2005 Volker Quetschke
+# Test if infered makefile generation works.
+# (issue 54938)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+file2="incfile.mk"
+file3="incfiledepend"
+tmpfiles="$file1 $file2 $file3"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Verify that makefile generation is finished when using it
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+incfile.mk : incfiledepend
+ +@echo AA:=123 > \$@
+
+incfiledepend :
+ +@sleep 1
+ +@echo 1234 > \$@
+
+.INCLUDE : incfile.mk
+
+all :
+ +@echo aa:\$(AA):bb
+EOT
+
+output=`eval ${DMAKEPROG} -r -P2 -f $file1 all`
+result=$?
+
+# The space between aaa and bbb comes from the +=
+if test "$output" != "aa:123:bb"; then
+ echo "Wrong result"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/misc-6 b/dmake/tests/misc-6
new file mode 100755
index 000000000000..9f74f1e77cc6
--- /dev/null
+++ b/dmake/tests/misc-6
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# 05.01.2006 Volker Quetschke
+# Old dmakes throw a segmentation fault in special cases with
+# dynamic prerequisits ( $$@ ).
+# (issue 58259)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all : allA allB
+
+all : \$\$@A \$\$@B
+
+allA :
+ +echo XaX
+
+allB :
+ +echo XbX
+EOT
+
+# Testcase 2
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all : \$\$@A \$\$@B
+
+all : allA allB
+
+allA :
+ +echo XaX
+
+allB :
+ +echo XbX
+EOT
+
+${DMAKEPROG} -r -f $file1 >/dev/null 2>&1
+result1=$?
+${DMAKEPROG} -r -f $file2 >/dev/null 2>&1
+result2=$?
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -f ${tmpfiles}
+ result=0
+else
+ test $result1 -ne 0 && echo "Failure in testcase 1! Remove the corefile!"
+ test $result2 -ne 0 && echo "Failure in testcase 2! Remove the corefile!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/misc-7 b/dmake/tests/misc-7
new file mode 100755
index 000000000000..285f44d50e81
--- /dev/null
+++ b/dmake/tests/misc-7
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# 06.02.2006 Volker Quetschke
+# Verify that the .SETDIR attribute works separately from the target
+# definition. (issue 61714)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="subdir"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.SETDIR=subdir : all
+
+all :
+ @+echo ":\$(PWD:f):"
+
+EOT
+
+mkdir -p "$file2"
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+
+if test "$output1" != ":$file2:"; then
+ echo "Wrong result - use of .SETDIR was not successful."
+ result1=1
+fi
+
+if test $result1 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf ${tmpfiles}
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/misc-8 b/dmake/tests/misc-8
new file mode 100755
index 000000000000..28d27595ab84
--- /dev/null
+++ b/dmake/tests/misc-8
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# 26.02.2006 Volker Quetschke
+# Test if dmake complains about circular dependencies when using
+# infered .INCLUDE targets
+# (issue 62118)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mytarget.dpcc"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Verify that makefile generation is finished when using it
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.dpcc :
+ @echo making: \$@
+ @+echo AA=123 > \$@
+
+.INCLUDE : mytarget.dpcc
+
+ALL : mytarget.dpcc
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure! Invalid circular dependency detected."
+exit $result
diff --git a/dmake/tests/misc-9 b/dmake/tests/misc-9
new file mode 100755
index 000000000000..c3f8aad1ab39
--- /dev/null
+++ b/dmake/tests/misc-9
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# 01.03.2006 Volker Quetschke
+# If a dependency is added to a target after it is already build as an
+# indered .INCLUDE makefile the new dependency can be lost in parallel
+# builds.
+# (issue 61969)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mytarget.dpcc"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.dpcc :
+ @sleep 1
+# The following line adds a dependency to %.obj when the %.dpcc is included
+ @+echo \$@ : \$(@:b).obj > \$@
+
+# This has to be build if mytarget.dpcc is included and is requested
+# as a target
+# Adding the wait makes sure that the unpatched dmake is ended before the
+# next recipe line is started, therefore loosing it.
+%.obj :
+ @sleep 1
+ @echo making: \$@
+
+.INCLUDE : mytarget.dpcc
+
+# Make this the main target
+mytarget.dpcc :
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -P2 -f $file1`
+result=$?
+
+if test "$output" != "making: mytarget.obj"; then
+ result=1
+fi
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure! Recipe line got lost."
+exit $result
diff --git a/dmake/tests/recipes-1 b/dmake/tests/recipes-1
new file mode 100755
index 000000000000..c9108d86198f
--- /dev/null
+++ b/dmake/tests/recipes-1
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# 01.06.2005 Volker Quetschke
+# Tests for line continuation in recipes.
+# (issue 37053)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Testing continuation char in recipes
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all:
+ +@echo line1\
+line2
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+if test "$output" != "line1line2"; then
+ echo "Wrong result"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
+
diff --git a/dmake/tests/recipes-2 b/dmake/tests/recipes-2
new file mode 100755
index 000000000000..3e31fa1eb619
--- /dev/null
+++ b/dmake/tests/recipes-2
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# 24.07.2006 Volker Quetschke
+# Simple tests for group recipes.
+# (issue 64583)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Test group recipes
+SHELL:=/bin/sh
+SHELLFLAGS:=-ce
+GROUPSHELL:=/bin/sh
+GROUPSUFFIX:=.sh
+
+all :
+@[
+ printf "line1"
+ printf "line2"
+]
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+if test "$output" != "line1line2"; then
+ echo "Wrong result: $output"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
+
diff --git a/dmake/tests/recipes-3 b/dmake/tests/recipes-3
new file mode 100755
index 000000000000..a4e4a24b6653
--- /dev/null
+++ b/dmake/tests/recipes-3
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# 29.07.2006 Volker Quetschke
+# Test builtin commands.
+# (issue 67589)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Test noop and empty lines
+SHELL:=/bin/sh
+SHELLFLAGS:=-ce
+
+all :
+ \$(NULL)
+ +\$(NULL)
+ @noop bla bla \$(assign NOSHELL:=ABC)
+ @+noop bla bla \$(assign WITHSHELL:=DEF)
+ @echo \$(NOSHELL)\$(WITHSHELL)
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+if test "$output" != "ABCDEF"; then
+ echo "Wrong result: $output"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/recipes-4 b/dmake/tests/recipes-4
new file mode 100755
index 000000000000..378a2b4fa372
--- /dev/null
+++ b/dmake/tests/recipes-4
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# 29.07.2006 Volker Quetschke
+# Test builtin echo command.
+# (issue 67589)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# internal echo - This test might fail later if the internal echo ever
+# learns to handle quotes.
+SHELL:=/bin/sh
+SHELLFLAGS:=-ce
+
+all :
+ @echo -n "AB CD"
+ @+echo XY
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1`
+result=$?
+if test "$output" != "\"AB CD\"XY"; then
+ echo "Wrong result: $output"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/recipes-5 b/dmake/tests/recipes-5
new file mode 100755
index 000000000000..b8887212a272
--- /dev/null
+++ b/dmake/tests/recipes-5
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# 13.11.2006 Volker Quetschke
+# Test @@ recipe property.
+# (issue 71422)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="ofile1.out"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Test @@ recipe
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ @@+echo someoutput > $file2
+ @@+echo something
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != ""; then
+ echo "Wrong result: $output1"
+ result1=1
+fi
+if test -f $file2; then
+ if test `cat $file2 ` != "someoutput"; then
+ echo "Wrong file content: `cat $file2`"
+ result1=1
+ fi
+else
+ echo "No such file : $file2"
+ result1=1
+fi
+
+# Test if -vr enables the output again
+output2=`eval ${DMAKEPROG} -vr -rf $file1`
+result2=$?
+if echo $output2 | grep -v 'echo someoutput > ofile1.out'; then
+ echo "Missing output: echo someoutput > ofile1.out"
+ result2=1
+fi
+if echo $output2 | grep -v 'something'; then
+ echo "Missing output: something"
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -f ${tmpfiles}
+ exit 0
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/recipes-6 b/dmake/tests/recipes-6
new file mode 100755
index 000000000000..2a0af305ef6a
--- /dev/null
+++ b/dmake/tests/recipes-6
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# 13.11.2006 Volker Quetschke
+# Test @@ recipe property with group recipes.
+# (issue 71422)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="ofile1.out"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# Test @@ recipe
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+GROUPSHELL*:=/bin/sh
+GROUPSUFFIX:=.sh
+
+all :
+@@[
+ echo someoutput > $file2
+ echo something
+]
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+if test "$output1" != ""; then
+ echo "Wrong result: $output1"
+ result1=1
+fi
+if test -f $file2; then
+ if test `cat $file2` != "someoutput"; then
+ echo "Wrong file content: `cat $file2`"
+ result1=1
+ fi
+else
+ echo "No such file : $file2"
+ result1=1
+fi
+
+# Test if -vr enables the output again
+output2=`eval ${DMAKEPROG} -vr -rf $file1`
+result2=$?
+if echo $output2 | grep -v 'echo someoutput > ofile1.out'; then
+ echo "Missing output: echo someoutput > ofile1.out"
+ result2=1
+fi
+if echo $output2 | grep -v 'something'; then
+ echo "Missing output: something"
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -f ${tmpfiles}
+ exit 0
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/recipes-7 b/dmake/tests/recipes-7
new file mode 100755
index 000000000000..3a932bb597b0
--- /dev/null
+++ b/dmake/tests/recipes-7
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# 01.12.2006 Volker Quetschke
+# Test that the '-' recipe switch is honored.
+# (issue 72210)
+
+: ${DMAKEPROG:=dmake}
+file1="mymakefile.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+trap 'rm -rf $tmpfiles' 1 2 3 15
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+# internal echo - This test might fail later if the internal echo ever
+# learns to handle quotes.
+SHELL:=/bin/sh
+SHELLFLAGS:=-ce
+
+all :
+ @-blabla
+ @echo OK
+
+EOT
+
+output=`eval ${DMAKEPROG} -r -f $file1 2> /dev/null`
+result=$?
+if test $result -eq 0 -a "$output" != "OK"; then
+ echo "Wrong result: $output"
+ result=1
+fi
+
+
+test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
+test $result -ne 0 && echo "Failure!"
+exit $result
diff --git a/dmake/tests/recipes-8 b/dmake/tests/recipes-8
new file mode 100755
index 000000000000..b4264a33df0c
--- /dev/null
+++ b/dmake/tests/recipes-8
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+# 08.08.2007 Volker Quetschke
+# Test group recipes syntax check.
+# (issue 67709)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+GROUPSHELL*:=/bin/sh
+
+all :
+[ This should warn!
+ @echo "Group recipe line"
+]
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result1=$?
+
+if test $result1 != 0 && echo $output1 | grep 'Warning: -- Found non-white space character after' > /dev/null 2>&1 ; then
+ echo "Subtest 1: OK"
+ result1=0
+else
+ echo "Subtest 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+
+# Test 2
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+GROUPSHELL*:=/bin/sh
+
+all :
+ echo hallo
+[
+ echo "Group recipe line"
+]
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result2=$?
+
+if test $result2 != 0 && echo $output2 | grep 'Error: -- Cannot mix single and group recipe lines.' > /dev/null 2>&1 ; then
+ echo "Subtest 2: OK"
+ result2=0
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+# Test 3
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+GROUPSHELL*:=/bin/sh
+
+all :
+[
+ [
+ echo "Group recipe line"
+]
+
+EOT
+
+output3=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result3=$?
+if test $result3 != 0 && echo $output3 | grep 'Error: -- New group recipe begin found within group recipe.' > /dev/null 2>&1 ; then
+ echo "Subtest 3: OK"
+ result3=0
+else
+ echo "Subtest 3: Wrong result: $output3"
+ echo
+ result3=1
+fi
+
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/recipes-9 b/dmake/tests/recipes-9
new file mode 100755
index 000000000000..409b6cbabe33
--- /dev/null
+++ b/dmake/tests/recipes-9
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+# 11.08.2007 Volker Quetschke
+# Test that recipes with error can be ignored.
+# (issue 80598)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Ignore, but display failed execution.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all .IGNORE :
+ tttouch all
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result1=$?
+
+if test "$result1" = "0" && echo $output1 | grep '(Ignored)' > /dev/null 2>&1 ; then
+ echo "Subtest 1: OK"
+ result1=0
+else
+ echo "Subtest 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+
+# Test 2 - Ignore, but display failed execution.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ -ttttouch all
+
+EOT
+
+output2=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result2=$?
+
+if test "$result2" = "0" && echo $output2 | grep '(Ignored)' > /dev/null 2>&1 ; then
+ echo "Subtest 2: OK"
+ result2=0
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+# Test 3
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+GROUPSHELL*:=/bin/sh
+
+all :
+ ttttouch all
+
+EOT
+
+output3=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result3=$?
+if test $result3 != 0 && echo $output3 | grep 'Error code -1, while making ' > /dev/null 2>&1 ; then
+ echo "Subtest 3: OK"
+ result3=0
+else
+ echo "Subtest 3: Wrong result: $output3"
+ echo
+ result3=1
+fi
+
+
+# Test 4 - Ignore a succesfully executed, but failing recipe.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ -false all
+
+EOT
+
+output4=`eval ${DMAKEPROG} -r -f $file1 2>&1`
+result4=$?
+
+if test "$result4" = "0" -a "$output4" = "false all" ; then
+ echo "Subtest 4: OK"
+ result4=0
+else
+ echo "Subtest 4: Wrong result: $output4"
+ echo
+ result4=1
+fi
+
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 ; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-1 b/dmake/tests/targets-1
new file mode 100644
index 000000000000..688c33cf024b
--- /dev/null
+++ b/dmake/tests/targets-1
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# 03.06.2006 Volker Quetschke
+# Percent target definitions were not handled properly before.
+# (issue 64869)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - This segfaulted before 4.5
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+allnew : all
+
+%.x all : %.c
+ +true $@
+
+qqq.c :
+ +echo OK
+
+EOT
+
+# Testcase 2 - earlier than dmake 4.5 the second %-target was defined
+# without the prerequisites, i.e. qqq.c was not build
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+allnew : qqq.y
+
+%.x %.y : %.c
+ +true "building %.y"
+
+qqq.c :
+ +echo building qqq.c
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
+result2=$?
+
+if echo $output1 | grep 'Error: -- A non-%' > /dev/null 2>&1 ; then
+ #echo "Test 1: Right result: $output1"
+ result1=0
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if echo $output2 | grep -v 'building qqq.c' > /dev/null 2>&1 ; then
+ echo "Test 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-10 b/dmake/tests/targets-10
new file mode 100644
index 000000000000..3f7931242b02
--- /dev/null
+++ b/dmake/tests/targets-10
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# 14.06.2006 Volker Quetschke
+# If %-targets are defined with more than one (not indirect) prerequisite
+# only the first is used. This is supposed to be fixed at one point but
+# currently we issue a warning that it not working (yet).
+# (issue 48087)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we warn.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.xx : %.yy %.pp ; touch $@
+
+abc.xx : ; echo nix
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Warning: -- More than one prerequisite' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-11 b/dmake/tests/targets-11
new file mode 100644
index 000000000000..5dbff149d806
--- /dev/null
+++ b/dmake/tests/targets-11
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# 09.07.2006 Volker Quetschke
+# If %-targets are defined with the .SILENT attribute and the -vr verbose
+# flag is used dmake 4.5 stops falsely with an error.
+# (issue 67025)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we don't issue an error.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.xx .SILENT :
+ +echo "OK"
+EOT
+
+output1=`eval ${DMAKEPROG} -vr -rf $file1 all.xx 2>&1 `
+result1=$?
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure! dmake failed with error."
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-12 b/dmake/tests/targets-12
new file mode 100644
index 000000000000..ba9982c4f6be
--- /dev/null
+++ b/dmake/tests/targets-12
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# 10.07.2006 Volker Quetschke
+# Check that dmake warns if it encounters .SUFFIXES
+# (issue 66567)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we issue a warning.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.SUFFIXES : .aa .bb
+
+all: ; @echo OK
+EOT
+
+output1=`eval ${DMAKEPROG} -vw -rf $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Warning: -- The .SUFFIXES' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure! dmake failed to issue a warning."
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-13 b/dmake/tests/targets-13
new file mode 100755
index 000000000000..702a9b0a10ca
--- /dev/null
+++ b/dmake/tests/targets-13
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# 16.07.2006 Volker Quetschke
+# Check that dmake warns if a previously unset macro (i.e. it is
+# assumed to be empty) is used and later set to a different value.
+# (issue 67166)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we issue a warning.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all: \$(NEWDEP)
+ @+echo all
+
+NEWDEP=my_dependency
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Warning: -- Macro .* redefined after use' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure! dmake failed to issue a warning."
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-14 b/dmake/tests/targets-14
new file mode 100755
index 000000000000..7e1fae45f8d4
--- /dev/null
+++ b/dmake/tests/targets-14
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# 16.07.2006 Volker Quetschke
+# Check that evaluating an empty macro and thereby initializing it does not
+# prevent the *= and *:= operator from assigning a new value.
+# (issue 67166)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we set AAA to set_AAA.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.IF \$(AAA)!=321
+BLA=bla
+.ENDIF
+
+AAA*=set_AAA
+
+all:
+ @+echo "\$(AAA)"
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test $output1 = "set_AAA" ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure! Unexpected result."
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-15 b/dmake/tests/targets-15
new file mode 100755
index 000000000000..6a5310a6e4b0
--- /dev/null
+++ b/dmake/tests/targets-15
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# 06.10.2006 Volker Quetschke
+# Check that normalized targets are treated as equal.
+# (issue 69742)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we set AAA to set_AAA.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+# On cygwin add c:/temp/try5.xx to the prerequisites to test cygwin related
+# normalization
+all : try1.xx try2.xx ../..//d/try3.xx xxx//yyy/../../try4.xx
+# c:/temp/try5.xx
+ echo all
+
+./try1.xx :
+ echo try1
+
+./././try2.xx :
+ echo try2
+
+../../d/try3.xx :
+ echo try3
+
+./xxx/..////try4.xx :
+ echo try4
+
+/cygdrive/c/temp/try5.xx :
+ echo try5
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+else
+ echo "Failure! dmake reported:"
+ echo "$output1"
+fi
+exit $result
diff --git a/dmake/tests/targets-16 b/dmake/tests/targets-16
new file mode 100755
index 000000000000..795fb7a63650
--- /dev/null
+++ b/dmake/tests/targets-16
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# 08.10.2006 Volker Quetschke
+# Check that $ in dynamic prerequisites are handled correctly.
+# (issue 70168)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we set AAA to set_AAA.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+DYNPRQS=a\$\$xx1 a\$\$xx2
+
+all : \$\$(DYNPRQS) a\$\$\$\$xx3
+ echo all
+
+a\$\$xx1 :
+ echo a1:\$@
+
+a\$\$xx2 :
+ echo a2:\$@
+
+a\$\$xx3 :
+ echo a3:\$@
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+else
+ echo "Failure! dmake reported:"
+ echo "$output1"
+fi
+exit $result
diff --git a/dmake/tests/targets-17 b/dmake/tests/targets-17
new file mode 100755
index 000000000000..cea9c633615d
--- /dev/null
+++ b/dmake/tests/targets-17
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# 08.10.2006 Volker Quetschke
+# Check that empty dynamic prerequisites are handled correctly.
+# (issue 70210)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+EMPTYPRQ=
+
+all : \$\$(EMPTYPRQ)
+ echo all
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+else
+ echo "Failure! dmake reported:"
+ echo "$output1"
+fi
+exit $result
diff --git a/dmake/tests/targets-18 b/dmake/tests/targets-18
new file mode 100755
index 000000000000..0e75ddb0f55e
--- /dev/null
+++ b/dmake/tests/targets-18
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# 21.06.2007 Volker Quetschke
+# Check that OOODMAKEMODE can switches of the ./foo to foo normalization.
+# (issue 74007)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.IMPORT : OOODMAKEMODE
+
+# See if OOODMAKEMODE works
+./all :
+ @echo X\$@Y
+
+EOT
+
+
+output1=`eval OOODMAKEMODE="" ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+if test $result1 -ne 0 -o "$output1" != "XallY"; then
+ echo "Test 1: Wrong result: $output1"
+ result1=1
+fi
+
+
+output2=`eval OOODMAKEMODE=y ${DMAKEPROG} -rf $file1 2>&1 `
+result2=$?
+if test $result2 -ne 0 -o "$output2" != "X./allY"; then
+ echo "Test 2: Wrong result: $output2"
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit 0
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-19 b/dmake/tests/targets-19
new file mode 100755
index 000000000000..3ca904f53e8d
--- /dev/null
+++ b/dmake/tests/targets-19
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# 22.06.2007 Volker Quetschke
+# Check that multiple leading slashes are normalized.
+# (issue 78061)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1 - Test if excess leading slashes get removed
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+////all :
+ @echo X\$@Y
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+if test "$output1" != "X/allY"; then
+ echo "Subtest 1: Wrong result: $output1"
+ result1=1
+else
+ echo "Subtest 1: OK"
+fi
+
+
+# Test 2 - Test if excess leading slashes in DOS paths get removed
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+"c:////all" .WINPATH :
+ @echo X\$@Y
+
+EOT
+
+if test x`uname -o 2> /dev/null` = "xCygwin"; then
+ output2=`eval ${DMAKEPROG} -r -f $file1`
+ result2=$?
+ if test "$output2" != "Xc:/allY"; then
+ echo "Subtest 2: Wrong result: $output2"
+ result2=1
+ else
+ echo "Subtest 2: OK"
+ fi
+else
+ echo "Subtest 2 ignored for non cygwin environment"
+ result2=0
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up" && rm -f ${tmpfiles}
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi \ No newline at end of file
diff --git a/dmake/tests/targets-2 b/dmake/tests/targets-2
new file mode 100644
index 000000000000..fbc1b0e39c7c
--- /dev/null
+++ b/dmake/tests/targets-2
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# 03.06.2006 Volker Quetschke
+# Percent target definitions were not handled properly before.
+# (issue 64869) - Two more testcases
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - %-target prerequisite - syntax error
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.PHONY all : %.c
+ +true all
+
+EOT
+
+# Testcase 2 - The recipe part is ignored - syntax error
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all :
+ +true all
+
+.PHONY : all ; +echo no recipe expected
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
+result2=$?
+
+if echo $output1 | grep 'Error: -- Syntax' > /dev/null 2>&1 ; then
+ result1=0
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if echo $output2 | grep 'Error: -- Unexpected recipe' > /dev/null 2>&1 ; then
+ result2=0
+else
+ echo "Test 2: Wrong result: $output2"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-20 b/dmake/tests/targets-20
new file mode 100755
index 000000000000..64a6a5b06ad0
--- /dev/null
+++ b/dmake/tests/targets-20
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# 12.07.2007 Volker Quetschke
+# Make sure that intermediate targets get created. BUG: If an intermediate
+# %-target does not exist it inherits the time stamp of it's parent and
+# doesn not get made.
+# Recipe: Create ptarget.c and then (newer) ptarget.a but ptarget.b did
+# not get made.
+# (issue 69462)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="ptarget.a"
+file3="ptarget.b"
+file4="ptarget.c"
+tmpfiles="$file1 $file2 $file3 $file4"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Create test environment
+touch ptarget.c
+touch ptarget.a
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.a : %.b
+ @cp \$< \$@
+
+%.b .PRECIOUS : %.c
+ @cp \$< \$@
+ @+printf "OK"
+
+%.c :
+ @touch \$@
+
+all : ptarget.a
+ @+echo "done"
+
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test "$output1" != "OKdone"; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-21 b/dmake/tests/targets-21
new file mode 100755
index 000000000000..2aff2285ab69
--- /dev/null
+++ b/dmake/tests/targets-21
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# 12.07.2007 Volker Quetschke
+# Another %-target testcase.
+# (issue 78837)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aaa.aaa"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Create test environment
+touch aaa.aaa
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.aaa : %.bbb
+ @sleep 1
+ @touch \$@
+
+%.bbb :
+ @echo building \$@
+
+
+all : aaa.aaa
+ @noop Done
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test "$output1" != "building aaa.bbb"; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-22 b/dmake/tests/targets-22
new file mode 100755
index 000000000000..14474f09792e
--- /dev/null
+++ b/dmake/tests/targets-22
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# 12.07.2007 Volker Quetschke
+# Check that intermediate targets are marked removable.
+# (issue 80143)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aaa.aaa"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Create test environment
+touch aaa.aaa
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.REMOVE : ; @echo remove \$<
+
+%.a : %.b
+ @noop $@
+
+%.b :
+ @noop $@
+
+all : xx.a
+ @noop all
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test "$output1" != "remove xx.b"; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-23 b/dmake/tests/targets-23
new file mode 100755
index 000000000000..ee670d496b34
--- /dev/null
+++ b/dmake/tests/targets-23
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# 03.08.2007 Volker Quetschke
+# Check that a %-target without prereq has precedence over one with
+# prerequisite.
+# (issue 80144)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aaa.aaa"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Create test environment
+touch aaa.aaa
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.REMOVE : ; @echo remove \$<
+
+%.a : %.b
+ @echo Wrong choice - $@
+
+%.a :
+ @echo Right choice
+
+all : xx.a
+ @noop all
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test "$output1" != "Right choice"; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-24 b/dmake/tests/targets-24
new file mode 100755
index 000000000000..98c7603980fa
--- /dev/null
+++ b/dmake/tests/targets-24
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# 03.08.2007 Volker Quetschke
+# Check that ambigous %-target are found.
+# prerequisite.
+# (issue 80144)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aaa.aaa"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Create test environment
+touch aaa.aaa
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.REMOVE : ; @echo remove \$<
+
+%.a : %.b
+ @echo Blah
+
+%.a : xx.b
+ @echo Blue
+
+%.b :
+ touch $@
+
+all : xx.a
+ @noop all
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep ': -- Ambiguous inference chains for target' > /dev/null 2>&1 ; then
+ echo "OK"
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=0
+fi
+
+# Errorcode in $result1 means successfull test
+if test $result1 -ne 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-25 b/dmake/tests/targets-25
new file mode 100755
index 000000000000..fa95f655bbb1
--- /dev/null
+++ b/dmake/tests/targets-25
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# 03.08.2007 Volker Quetschke
+# Check that the .PRECIOUS attribute works.
+# (issue 80352)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.REMOVE : ; @echo remove \$<
+
+%.a : %.b
+ @noop Blah
+
+%.b .PRECIOUS :
+ @noop xx.b
+
+all : xx.a
+ @echo Done
+
+EOT
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+
+if test "$output1" != "Done"; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-26 b/dmake/tests/targets-26
new file mode 100755
index 000000000000..10ac0d43f2b7
--- /dev/null
+++ b/dmake/tests/targets-26
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# 10.08.2007 Volker Quetschke
+# Check that the .PHONY attribute works with %-targets.
+# (issue 66751)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="phonyfile.a"
+file3="phonyfile.b"
+tmpfiles="$file1 $file2 $file3"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.a : %.b
+ @sleep 1
+ @touch \$@
+ @+printf " and \$@.\n"
+
+#%.b :
+%.b .PHONY :
+ @touch \$@
+ @+printf "Build \$@"
+
+EOT
+
+touch phonyfile.a phonyfile.b
+# Avoid that phonyfile.a has the same time stamp as phonyfile.b after
+# that has been rebuild.
+sleep 1
+
+output1=`eval ${DMAKEPROG} -rf $file1 phonyfile.a 2>&1 `
+result1=$?
+
+if test "$output1" != "Build phonyfile.b and phonyfile.a."; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-27 b/dmake/tests/targets-27
new file mode 100755
index 000000000000..3ad33b4c20ff
--- /dev/null
+++ b/dmake/tests/targets-27
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# 15.08.2007 Volker Quetschke
+# Another check that the .PHONY attribute works with %-targets. This test
+# was still failing after issue 66751.
+# (issue 80687)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aa.x"
+file3="aa.y"
+file4="aa.z"
+tmpfiles="$file1 $file2 $file3 $file4"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.x : %.y
+ @sleep 1
+ @+printf " and \$@.\n"
+ @touch \$@
+
+aa.y .PHONY : aa.z
+ @+printf "Build \$@"
+ @touch \$@
+
+EOT
+
+# Create test environment
+touch aa.z; sleep 1; touch aa.y ; sleep 1 ;touch aa.x
+# Avoid that aa.x has the same time stamp as aa.y after
+# that has been rebuild.
+sleep 1
+
+output1=`eval ${DMAKEPROG} -rf $file1 aa.x 2>&1 `
+result1=$?
+
+if test "$output1" != "Build aa.y and aa.x."; then
+ echo "Wrong result: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-28 b/dmake/tests/targets-28
new file mode 100755
index 000000000000..0943eb6677ff
--- /dev/null
+++ b/dmake/tests/targets-28
@@ -0,0 +1,175 @@
+#!/bin/sh
+
+# 25.08.2007 Volker Quetschke
+# Check that dmake handles dependencies correctly.
+# (issue 64572)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aa.x"
+file3="aa.y"
+file4="aa.z"
+tmpfiles="$file1 $file2 $file3 $file4"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+aa.x : aa.y
+ @echo nothing
+
+aa.y :
+ @echo \$@
+
+EOT
+
+# Create test environment
+touch aa.x
+# Avoid that aa.x has the same time stamp as aa.y after
+# that has been rebuild.
+sleep 1
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1`
+result1=$?
+
+if test $result1 = 0 && echo $output1 | grep 'Warning: -- Target \[aa.x\] was made but the time stamp has not been updated.' > /dev/null 2>&1 ; then
+ echo "Subtest 1: OK"
+ result1=0
+else
+ echo "Subtest 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 2 - Warn if virtual targets have a corresponding file.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+aa.x : aa.y
+ @echo X\$@X
+ @touch \$@
+
+# Should warn - aa.y exists.
+aa.y : aa.z
+
+aa.z :
+ @printf Z\$@Z
+
+EOT
+
+# Create test environment
+rm -f aa.x
+touch aa.y
+# Avoid the same time after build.
+sleep 1
+
+output2=`eval ${DMAKEPROG} -rf $file1 2>&1`
+result2=$?
+
+if test $result2 = 0 && echo $output2 | grep 'Warning: -- Found file corresponding to virtual target \[aa.y\].' > /dev/null 2>&1 ; then
+ echo "Subtest 2: OK"
+ result2=0
+else
+ echo "Subtest 2: Wrong result: $output2"
+ echo
+ result2=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 3
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+aa.x : aa.y
+ @echo X\$@X
+ @touch \$@
+
+aa.y : aa.z
+
+aa.z :
+ @printf Z\$@Z
+ @touch \$@
+
+EOT
+
+# Create test environment
+rm -f aa.y
+touch aa.z ; sleep 1 ; touch aa.x
+# Avoid the same time after build.
+sleep 1
+
+# This tests that aa.x is not build as the dependency chain is intact with
+# the virtual target aa.y having the same time stamp as aa.z.
+output3=`eval ${DMAKEPROG} -vm -rf $file1 2>&1`
+result3=$?
+
+if test $result3 = 0 && echo "$output3" | grep "aa.x' is up to date" > /dev/null 2>&1 ; then
+ echo "Subtest 3: OK"
+ result3=0
+else
+ echo "Subtest 3: Wrong result: :$output3:"
+ echo
+ result3=1
+fi
+
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Test 4
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+aa.x : aa.y
+ @echo Build \$@
+ @touch \$@
+
+aa.y : aa.z
+
+aa.z :
+ @printf Z\$@Z
+ @touch \$@
+
+EOT
+
+# Create test environment
+touch aa.z ; sleep 1 ; touch aa.x
+# Create a file for the virtual target that is newer than aa.x
+sleep 1 ; touch aa.y
+# Avoid the same time after build.
+sleep 1
+
+# This tests that aa.x is build.
+output4=`eval ${DMAKEPROG} -rf $file1 2>&1`
+result4=$?
+
+if test $result4 = 0 -a "$output4" = "Build aa.x" ; then
+ echo "Subtest 4: OK"
+ result4=0
+else
+ echo "Subtest 4: Wrong result: :$output4:"
+ echo
+ result4=1
+fi
+
+
+if test $result1 -eq 0 -a $result2 -eq 0 \
+ -a $result3 -eq 0 -a $result4 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-29 b/dmake/tests/targets-29
new file mode 100755
index 000000000000..004553eb93d5
--- /dev/null
+++ b/dmake/tests/targets-29
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# 24.09.2007 Volker Quetschke
+# Check that the .REMOVE target does not crash dmake in parallel builds.
+# (issue 80012)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="aaa.aaa"
+file3="aaa.bbb"
+file4="aaa.ccc"
+tmpfiles="$file1 $file2 $file3 $file4"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.REMOVE :; @echo remove intermediate target: \$<
+
+%.aaa : %.bbb
+ @echo built \$@
+
+%.bbb : %.ccc
+ @sleep 1
+ @echo built \$@
+
+%.ccc :
+ @echo built \$@
+
+all : aaa.aaa
+ @echo Done
+
+EOT
+
+output1=`eval ${DMAKEPROG} -P2 -rf $file1 2>&1`
+result1=$?
+
+if test $result1 -ne 0; then
+ echo "Failure! Remove the corefile!"
+ echo "Output: $output1"
+ result1=1
+else
+ echo "OK"
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-3 b/dmake/tests/targets-3
new file mode 100644
index 000000000000..288dd67f1e25
--- /dev/null
+++ b/dmake/tests/targets-3
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# 03.06.2006 Volker Quetschke
+# .<suffix> targets were silently ignored despite the illegal syntax.
+# (issue 65360)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - Check that warning is issued if .<suffix> targets are ignored
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.nada : something
+
+something :
+ +echo "A target."
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Warning: -- Ignoring AUGMAKE meta-target' > /dev/null 2>&1 ; then
+ result1=0
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-30 b/dmake/tests/targets-30
new file mode 100755
index 000000000000..31e2e9712504
--- /dev/null
+++ b/dmake/tests/targets-30
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# 05.02.2008 Volker Quetschke
+# Check that OOODMAKEMODE=y does not normalize ./../foo.
+# (issue 84800)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+OOODMAKEMODE:=y
+
+# See if OOODMAKEMODE keeps ./../all
+./../all :
+ @echo X\$@Y
+
+EOT
+
+
+output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result1=$?
+if test $result1 -ne 0 -o "$output1" != "X./../allY"; then
+ echo "Test 1: Wrong result: $output1"
+ result1=1
+fi
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+OOODMAKEMODE:=
+
+# See if OOODMAKEMODE= removes the leading .
+./../all :
+ @echo X\$@Y
+
+EOT
+
+
+output2=`eval ${DMAKEPROG} -rf $file1 2>&1 `
+result2=$?
+if test $result2 -ne 0 -o "$output2" != "X../allY"; then
+ echo "Test 2: Wrong result: $output2"
+ result2=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ exit 0
+else
+ echo "Failure!"
+ exit 1
+fi
diff --git a/dmake/tests/targets-4 b/dmake/tests/targets-4
new file mode 100644
index 000000000000..2bc66d9ec519
--- /dev/null
+++ b/dmake/tests/targets-4
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# 03.06.2006 Volker Quetschke
+# Check that a warning is issued for special or meta targets with
+# empty recipes.
+# (issue 65360) - Well, the issue is talking about slightly a different
+# issue but a related patch was committed with this issue reference.
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+file2="mfile2.mk"
+tmpfiles="$file1 $file2"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - AUGMAKE meta targets
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.NIX :
+
+something :
+ +echo "A target."
+
+EOT
+
+# Testcase 2 - Percent targets
+cat > $file2 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.a : %.b
+
+something :
+ +echo "A target."
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
+result2=$?
+
+if echo $output1 | grep -v 'Warning: -- Empty recipe' > /dev/null 2>&1 ; then
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if echo $output2 | grep -v 'Warning: -- Empty recipe' > /dev/null 2>&1 ; then
+ echo "Test 2: Wrong result: $output2"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 -a $result2 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-5 b/dmake/tests/targets-5
new file mode 100644
index 000000000000..0e83ca43107c
--- /dev/null
+++ b/dmake/tests/targets-5
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# 13.06.2006 Volker Quetschke
+# Error out if AUGMAKE meta and normal targets occur in the same rule
+# definition.
+# (issue 66083)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1 - Check that warning is issued if .<suffix> targets are ignored
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.NIX.NUX aaa : ; @+echo "Normal and meta target together"
+
+something :
+ @+echo "A target."
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Error: -- A non AUGMAKE meta target must' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=0
+fi
+
+# Errorcode in $result1 means successfull test
+if test $result1 -ne 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-6 b/dmake/tests/targets-6
new file mode 100644
index 000000000000..08ec6591a29a
--- /dev/null
+++ b/dmake/tests/targets-6
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# 13.06.2006 Volker Quetschke
+# Pre 4.5 dmakes didn't handle .<suffix> targets if AUGMAKE was set.
+# (issue 66365)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that .NIX is treated as meta target, making all the target
+# that gets build.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+AUGMAKE=yes
+
+.NIX : ; @+echo ".NIX Treated as a normal target"
+
+all :
+ @+echo "Fallthrough"
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Fallthrough' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-7 b/dmake/tests/targets-7
new file mode 100644
index 000000000000..7fb091bd5bdf
--- /dev/null
+++ b/dmake/tests/targets-7
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# 13.06.2006 Volker Quetschke
+# Check that `%.a %.b :| %.x %.y 'Z' ; recipe` rules are handled correctly.
+# (issues 48087 and 65122)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Expect dummy, all.pp and all.xx to be build
+# that gets build.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.xx %.rr :| %.yy %.pp 'dummy' ; @+printf "\$@"
+
+%.pp :
+ @sleep 1
+ @+printf "\$@"
+
+dummy :
+ @+printf "\$@"
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 all.xx 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'dummyall.ppall.xx' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-8 b/dmake/tests/targets-8
new file mode 100644
index 000000000000..1bb31959a4f6
--- /dev/null
+++ b/dmake/tests/targets-8
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# 13.06.2006 Volker Quetschke
+# .SETDIR used to fail for multiple percent targets.
+# (issue 64431)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Expect xxx.1 and xxx.2 to be build
+# that gets build.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+all : xxx.1 xxx.2
+
+xxx.% .SETDIR=. :
+ @+printf "OK"
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'OKOK' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tests/targets-9 b/dmake/tests/targets-9
new file mode 100644
index 000000000000..b82d3796750d
--- /dev/null
+++ b/dmake/tests/targets-9
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# 14.06.2006 Volker Quetschke
+# Prior to dmake 4.5 only one %-target per target-definition worked reliably.
+# (issue 48087)
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Check that we warn.
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+%.xx %.rr : %.yy 'a' 'b' ; touch $@
+
+dummy :
+ @+echo "A target"
+
+EOT
+
+output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
+result1=$?
+
+if echo $output1 | grep 'Warning: -- Prior to dmake 4.5 only one' > /dev/null 2>&1 ; then
+ dummy=1
+ # OK
+else
+ echo "Test 1: Wrong result: $output1"
+ echo
+ result1=1
+fi
+
+if test $result1 -eq 0 ; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result
diff --git a/dmake/tos/config.mk b/dmake/tos/config.mk
new file mode 100644
index 000000000000..65076200175a
--- /dev/null
+++ b/dmake/tos/config.mk
@@ -0,0 +1,49 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# PRINTER, PRINTFLAGS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+PRINTER = hw
+PRINTFLAGS = -P$(PRINTER)
+STARTUPFILE = $(OS)/startup.mk
+CPPFLAGS = $(CFLAGS)
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDFLAGS) -o $@ $(OBJDIR)/*$O
+LDFLAGS += -s
+LD = $(CC)
+
+# Debug flags
+DB_CFLAGS = -g -DDBUG
+DB_LDFLAGS = -g
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS = -O
+NDB_LDFLAGS =
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += -I$(OS)
+
+# Sources that must be defined for each different version
+OS_SRC += ruletab.c
+DOS_SRC = rmprq.c runargv.c dirbrk.c rmprq.c
+UNIX_SRC = arlib.c
+BSD_SRC = putenv.c tempnam.c
+
+.SETDIR=$(OS) : $(OS_SRC)
+.SETDIR=msdos : $(DOS_SRC)
+.SETDIR=unix : $(UNIX_SRC)
+.SETDIR=unix/bsd43 : $(BSD_SRC)
+
+SRC += $(OS_SRC) $(DOS_SRC) $(UNIX_SRC) $(BSD_SRC)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/tos/make.sh b/dmake/tos/make.sh
new file mode 100644
index 000000000000..8ecb7db9c8e3
--- /dev/null
+++ b/dmake/tos/make.sh
@@ -0,0 +1,57 @@
+mkdir objects
+gcc -c -I. -Itos -O infer.c
+mv infer.o objects
+gcc -c -I. -Itos -O make.c
+mv make.o objects
+gcc -c -I. -Itos -O stat.c
+mv stat.o objects
+gcc -c -I. -Itos -O expand.c
+mv expand.o objects
+gcc -c -I. -Itos -O dmstring.c
+mv dmstring.o objects
+gcc -c -I. -Itos -O hash.c
+mv hash.o objects
+gcc -c -I. -Itos -O dag.c
+mv dag.o objects
+gcc -c -I. -Itos -O dmake.c
+mv dmake.o objects
+gcc -c -I. -Itos -O path.c
+mv path.o objects
+gcc -c -I. -Itos -O imacs.c
+mv imacs.o objects
+gcc -c -I. -Itos -O sysintf.c
+mv sysintf.o objects
+gcc -c -I. -Itos -O parse.c
+mv parse.o objects
+gcc -c -I. -Itos -O getinp.c
+mv getinp.o objects
+gcc -c -I. -Itos -O quit.c
+mv quit.o objects
+gcc -c -I. -Itos -O state.c
+mv state.o objects
+gcc -c -I. -Itos -O dmdump.c
+mv dmdump.o objects
+gcc -c -I. -Itos -O macparse.c
+mv macparse.o objects
+gcc -c -I. -Itos -O rulparse.c
+mv rulparse.o objects
+gcc -c -I. -Itos -O percent.c
+mv percent.o objects
+gcc -c -I. -Itos -O function.c
+mv function.o objects
+gcc -c -I. -Itos -O tos/ruletab.c
+mv ruletab.o objects
+gcc -c -I. -Itos -O msdos/rmprq.c
+mv rmprq.o objects
+gcc -c -I. -Itos -O msdos/runargv.c
+mv runargv.o objects
+gcc -c -I. -Itos -O msdos/dirbrk.c
+mv dirbrk.o objects
+gcc -c -I. -Itos -O unix/arlib.c
+mv arlib.o objects
+gcc -c -I. -Itos -O unix/bsd43/putenv.c
+mv putenv.o objects
+gcc -c -I. -Itos -O unix/bsd43/tempnam.c
+mv tempnam.o objects
+gcc -s -o dmake objects/*.o
+cp tos/template.mk startup/config.mk
diff --git a/dmake/tos/public.h b/dmake/tos/public.h
new file mode 100644
index 000000000000..4b2f0af5e8f7
--- /dev/null
+++ b/dmake/tos/public.h
@@ -0,0 +1,166 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:52:34 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+int If_root_path ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+
+#endif
diff --git a/dmake/tos/putenv.c b/dmake/tos/putenv.c
new file mode 100644
index 000000000000..06e914d1fa0f
--- /dev/null
+++ b/dmake/tos/putenv.c
@@ -0,0 +1,78 @@
+/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- My own putenv for BSD like systems.
+--
+-- DESCRIPTION
+-- This originally came from MKS, but I rewrote it to fix a bug with
+-- replacing existing strings, probably never happened but the code
+-- was wrong nonetheless.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+int
+putenv( str )/*
+===============
+ Take a string of the form NAME=value and stick it into the environment.
+ We do this by allocating a new set of pointers if we have to add a new
+ string and by replacing an existing pointer if the value replaces the value
+ of an existing string. */
+char *str;
+{
+ extern char **environ; /* The current environment. */
+ static char **ourenv = NULL; /* A new environment */
+ register char **p;
+ register char *q;
+ int size;
+
+ /* First search the current environment and see if we can replace a
+ * string. */
+ for( p=environ; *p; p++ ) {
+ register char *s = str;
+
+ for( q = *p; *q && *s && *s == *q; q++, s++ )
+ if( *s == '=' ) {
+ *p = str;
+ return(0); /* replaced it so go away */
+ }
+ }
+
+ /* Ok, can't replace a string so need to grow the environment. */
+ size = p - environ + 2; /* size of new environment */
+ /* size of old is size-1 */
+
+ /* It's the first time, so allocate a new environment since we don't know
+ * where the old one is comming from. */
+ if( ourenv == NULL ) {
+ if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL )
+ return(1);
+
+ memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) );
+ }
+ else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL )
+ return(1);
+
+ ourenv[--size] = NULL;
+ ourenv[--size] = str;
+
+ environ = ourenv;
+ return(0);
+}
diff --git a/dmake/tos/ruletab.c b/dmake/tos/ruletab.c
new file mode 100644
index 000000000000..2631131a8d7a
--- /dev/null
+++ b/dmake/tos/ruletab.c
@@ -0,0 +1,42 @@
+/* RCS $Id: ruletab.c,v 1.2 2006-04-20 12:18:01 hr Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+static char *_rules[] = {
+ "MAXPROCESSLIMIT := 1",
+ "MAXPROCESS := 1",
+ "MAXLINELENGTH := 8190",
+ ".IMPORT .IGNORE: ROOTDIR DMAKEROOT",
+ ".MAKEFILES : makefile.mk Makefile makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ 0 };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
diff --git a/dmake/tos/startup.h b/dmake/tos/startup.h
new file mode 100644
index 000000000000..30a91342c718
--- /dev/null
+++ b/dmake/tos/startup.h
@@ -0,0 +1,28 @@
+/* RCS $Id: startup.h,v 1.2 2006-04-20 12:18:14 hr Exp $
+--
+-- SYNOPSIS
+-- Definition of MAKESTARTUP
+--
+-- DESCRIPTION
+-- Default MAKESTARTUP value defining where dmake locates the
+-- startup file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"DMAKEROOT *:= $(ROOTDIR)/etc/startup",
+"MAKESTARTUP := $(DMAKEROOT)/startup.mk",
diff --git a/dmake/tos/sysintf.h b/dmake/tos/sysintf.h
new file mode 100644
index 000000000000..da9974365c11
--- /dev/null
+++ b/dmake/tos/sysintf.h
@@ -0,0 +1,45 @@
+/* RCS $Id: sysintf.h,v 1.2 2007-01-18 09:43:39 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m) (void) void_lcache(l,m)
+#define Hook_std_writes(A)
+#define GETPID getpid()
+
+/* for directory cache */
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define getswitchar() '-'
+
+/*
+** make parameters
+*/
diff --git a/dmake/tos/template.mk b/dmake/tos/template.mk
new file mode 100644
index 000000000000..91ce656f14b0
--- /dev/null
+++ b/dmake/tos/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= tos
+ OSRELEASE *:=
+ OSENVIRONMENT *:=
diff --git a/dmake/tos/tempnam.c b/dmake/tos/tempnam.c
new file mode 100644
index 000000000000..8c0e3077d65a
--- /dev/null
+++ b/dmake/tos/tempnam.c
@@ -0,0 +1,104 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+
+static char *cpdir();
+static char *seed="AAA";
+
+/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
+#ifndef P_tmpdir
+static char *P_tmpdir = "/tmp";
+#endif
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
+ if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
+ if( access( cpdir(p, P_tmpdir), 3) != 0 )
+ if( access( cpdir(p, "/tmp"), 3) != 0 )
+ return(NULL);
+
+ (void) strcat(p, "/");
+ if(prefix)
+ {
+ *(p+strlen(p)+5) = '\0';
+ (void)strncat(p, prefix, 5);
+ }
+
+ (void)strcat(p, seed);
+ (void)strcat(p, "XXXXXX");
+
+ q = seed;
+ while(*q == 'Z') *q++ = 'A';
+ ++*q;
+
+ if(*mktemp(p) == '\0') return(NULL);
+ return(p);
+}
+
+
+
+static char *
+cpdir(buf, str)
+char *buf;
+char *str;
+{
+ char *p;
+
+ if(str != NULL)
+ {
+ (void) strcpy(buf, str);
+ p = buf - 1 + strlen(buf);
+ if(*p == '/') *p = '\0';
+ }
+
+ return(buf);
+}
diff --git a/dmake/unix/386ix/ar.h b/dmake/unix/386ix/ar.h
new file mode 100644
index 000000000000..4c38e8944e99
--- /dev/null
+++ b/dmake/unix/386ix/ar.h
@@ -0,0 +1,27 @@
+/* RCS $Id: ar.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- ar header
+--
+-- DESCRIPTION
+-- Make sure that PORTAR is defined.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define PORTAR 1
+#include "/usr/include/ar.h"
diff --git a/dmake/unix/386ix/config.mk b/dmake/unix/386ix/config.mk
new file mode 100644
index 000000000000..4c1eac92b94d
--- /dev/null
+++ b/dmake/unix/386ix/config.mk
@@ -0,0 +1,27 @@
+# This is the 386IX UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC :=
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/386ix/make.sh b/dmake/unix/386ix/make.sh
new file mode 100644
index 000000000000..68e0109bb576
--- /dev/null
+++ b/dmake/unix/386ix/make.sh
@@ -0,0 +1,60 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/386ix -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/386ix -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/386ix -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/386ix -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/386ix -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/386ix -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/386ix -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/386ix -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/386ix -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/386ix -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/386ix -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/386ix -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/386ix -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/386ix -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/386ix -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/386ix -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/386ix -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/386ix -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/386ix -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/386ix -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/386ix -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/386ix -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/386ix -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/386ix -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/386ix -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/386ix -O unix/dcache.c
+mv dcache.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o
+cp unix/386ix/template.mk startup/config.mk
diff --git a/dmake/unix/386ix/public.h b/dmake/unix/386ix/public.h
new file mode 100644
index 000000000000..25a7778312be
--- /dev/null
+++ b/dmake/unix/386ix/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:53:49 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/386ix/stdlib.h b/dmake/unix/386ix/stdlib.h
new file mode 100644
index 000000000000..1ec47228432b
--- /dev/null
+++ b/dmake/unix/386ix/stdlib.h
@@ -0,0 +1,44 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+extern free();
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/386ix/template.mk b/dmake/unix/386ix/template.mk
new file mode 100644
index 000000000000..e59d37c7ca72
--- /dev/null
+++ b/dmake/unix/386ix/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= 386ix
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/386ix/time.h b/dmake/unix/386ix/time.h
new file mode 100644
index 000000000000..aff117b02ade
--- /dev/null
+++ b/dmake/unix/386ix/time.h
@@ -0,0 +1,35 @@
+/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- time_t
+--
+-- DESCRIPTION
+-- Properly define time_t.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*
+** Berkeley get this wrong!
+*/
+#ifndef TIME_h
+#define TIME_h
+
+typedef long time_t; /* this is the thing we use */
+
+#endif TIME_h
+
diff --git a/dmake/unix/Makefile.am b/dmake/unix/Makefile.am
new file mode 100755
index 000000000000..e92c23ae9275
--- /dev/null
+++ b/dmake/unix/Makefile.am
@@ -0,0 +1,7 @@
+
+noinst_LIBRARIES = libunix.a
+
+libunix_a_SOURCES = arlib.c dcache.c dirbrk.c rmprq.c ruletab.c runargv.c tempnam.c
+
+
+INCLUDES = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/unix/@OS_VERSION@/gnu -I$(top_srcdir)/unix -I$(top_srcdir)/unix/@OS_VERSION@
diff --git a/dmake/unix/Makefile.in b/dmake/unix/Makefile.in
new file mode 100755
index 000000000000..c46390514170
--- /dev/null
+++ b/dmake/unix/Makefile.in
@@ -0,0 +1,396 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+LIBOBJDIR =
+subdir = unix
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libunix_a_AR = $(AR) $(ARFLAGS)
+libunix_a_LIBADD =
+am_libunix_a_OBJECTS = arlib.$(OBJEXT) dcache.$(OBJEXT) \
+ dirbrk.$(OBJEXT) rmprq.$(OBJEXT) ruletab.$(OBJEXT) \
+ runargv.$(OBJEXT) tempnam.$(OBJEXT)
+libunix_a_OBJECTS = $(am_libunix_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libunix_a_SOURCES)
+DIST_SOURCES = $(libunix_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUG_FALSE = @DBUG_FALSE@
+DBUG_TRUE = @DBUG_TRUE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DMAKEROOT_H_LINE1 = @DMAKEROOT_H_LINE1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OS_LIBRARY = @OS_LIBRARY@
+OS_SUBDIRS = @OS_SUBDIRS@
+OS_TYPE = @OS_TYPE@
+OS_VERSION = @OS_VERSION@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+noinst_LIBRARIES = libunix.a
+libunix_a_SOURCES = arlib.c dcache.c dirbrk.c rmprq.c ruletab.c runargv.c tempnam.c
+INCLUDES = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/unix/@OS_VERSION@/gnu -I$(top_srcdir)/unix -I$(top_srcdir)/unix/@OS_VERSION@
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign unix/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign unix/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libunix.a: $(libunix_a_OBJECTS) $(libunix_a_DEPENDENCIES)
+ -rm -f libunix.a
+ $(libunix_a_AR) libunix.a $(libunix_a_OBJECTS) $(libunix_a_LIBADD)
+ $(RANLIB) libunix.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arlib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dcache.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirbrk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmprq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ruletab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runargv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempnam.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-noinstLIBRARIES ctags distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/dmake/unix/arlib.c b/dmake/unix/arlib.c
new file mode 100644
index 000000000000..3a667f08188f
--- /dev/null
+++ b/dmake/unix/arlib.c
@@ -0,0 +1,610 @@
+/* $RCSfile: arlib.c,v $
+-- $Revision: 1.5 $
+-- last change: $Author: hr $ $Date: 2006-04-20 12:18:37 $
+--
+-- SYNOPSIS
+-- Unix archive manipulation code.
+--
+-- DESCRIPTION
+-- Originally this code was provided by Eric Gisin of MKS. I took
+-- his code and completely rewrote it adding cacheing of lib members
+-- and other various optimizations. I kept the overal functional
+-- idea of the library routines as they are similar to those in GNU
+-- make and felt it advantageous to maintain a similar interface.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* Sun unix on 386i's has a broken ar.h that does not assume PORTAR format
+ * by default, so we fix it here. */
+#if defined(i386) || defined(__DGUX__)
+#define PORTAR 1
+#endif
+
+#if !defined (COHERENT) && !defined(__COHERENT__)
+#include <ar.h>
+#else
+#include <arcoff.h>
+#endif /* COHERENT, __COHERENT__ */
+#include "extern.h"
+#include "sysintf.h"
+
+/* By defining the defines below it is possible to configure the library
+ * code for library cacheing/non-cacheing, ASCII archive headers, and a full
+ * decode of the ar_hdr fields in the scan_ar function. */
+
+#ifndef ASCARCH
+#define ASCARCH 1 /* ASCII time stored in archive */
+#endif
+
+#ifndef LC
+#define LC 1 /* Turn on library cacheing */
+#endif
+
+#ifndef CHECKELF
+#define CHECKELF 1 /* Enable Elf long member names */
+#endif
+
+#ifndef DECODE_ALL_AR_FIELDS
+#define DECODE_ALL_AR_FIELDS 0 /* decode only fields make needs*/
+#endif
+
+#ifndef AR_TRUNCATE_MEMBER_NAMES
+#define AR_TRUNCATE_MEMBER_NAMES 0 /* truncate member names for */
+#endif /* comparison. */
+
+#if LC
+# define FOUND_MEMBER FALSE
+#else
+# define FOUND_MEMBER TRUE
+# define _cache_member(a, b, c)
+# define _check_cache(a, b, c, d) FALSE
+#endif
+
+#define MAXFNAME 255 /* Max length of member name */
+#define MAXMNAME 8 /* Max module name < MAXFNAME */
+
+
+/* This struct is used to pass the library and member inrmation about the
+ * routines that perform the library seeking/cacheing */
+struct ar_args {
+ char *lib;
+ char *member;
+ time_t time;
+};
+
+
+typedef struct AR {
+ char ar_name[MAXFNAME+1]; /* File name */
+ long ar_size; /* Size in bytes */
+ time_t ar_time; /* Modification time */
+
+#ifdef DOS
+ char ar_modname[MAXMNAME+1]; /* DOS module name */
+#endif
+
+#if DECODE_ALL_AR_FIELDS
+ uint16 ar_mode; /* File mode */
+ uint16 ar_uid; /* File owner */
+ uint16 ar_gid; /* File group owner */
+#endif
+} AR, *ARPTR;
+
+
+static int ar_scan ANSI((FILE *,
+ int (*) ANSI((FILE *, struct AR *,struct ar_args *)),
+ struct ar_args *));
+static int ar_touch ANSI(( FILE *, time_t ));
+static int time_function ANSI(( FILE *, struct AR *, struct ar_args * ));
+static int touch_function ANSI(( FILE *, struct AR *, struct ar_args * ));
+static int ar_name_equal ANSI((char *, char *));
+
+#if LC
+static int _cache_member ANSI((char *, char *, time_t));
+static int _check_cache ANSI((char *, char *, time_t *, int));
+#endif
+
+/* decoded archive header */
+static AR _ar;
+static off_t arhdroffset; /* member seek offset */
+
+
+PUBLIC time_t
+seek_arch(name, lib)/*
+======================
+ Look for module 'name' inside 'lib'. If compiled with cacheing then first
+ check to see if the specified lib is cached. If so then return that time
+ stamp instead of looking into the library. */
+char *name;
+char *lib;
+{
+ FILE *f;
+ int rv;
+ time_t mtime;
+ struct ar_args args;
+
+ /* Check the cache first (if there is a cache) */
+ if( _check_cache(name, lib, &mtime, FALSE) ) return( mtime );
+
+ /* Open the lib file and perform the scan of the members, looking
+ * for our particular member. If cacheing is enabled it will be
+ * taken care of automatically during the scan. */
+
+ args.lib = lib;
+ args.member = name;
+ args.time = (time_t)0L;
+
+ if( (f = fopen(lib, "r")) == NIL(FILE) ) return( (time_t)0L );
+ rv = ar_scan(f, time_function, &args );
+ fclose( f );
+
+ if( rv < 0 ) Fatal("(%s): Invalid library format", lib);
+
+ return( args.time );
+}
+
+
+PUBLIC int
+touch_arch(name, lib)/*
+=======================
+ Look for module 'name' inside 'lib'. If compiled with cacheing then first
+ check to see if the specified lib is cached. If so then set that time
+ stamp and write it into the library. Returns 0 on success, non-zero
+ on failure. */
+char *name;
+char *lib;
+{
+ FILE *f;
+ int rv;
+ struct ar_args args;
+
+ /* Open the lib file and perform the scan of the members, looking
+ * for our particular member. If cacheing is enabled it will be
+ * taken care of automatically during the scan. */
+
+ args.lib = lib;
+ args.member = name;
+ args.time = (time_t)0L;
+
+ if( (f = fopen(lib, "r+")) == NIL(FILE) ) return( (time_t)1L );
+ rv = ar_scan(f, touch_function, &args );
+ fclose( f );
+
+ if( rv < 0 ) Fatal("(%s): Invalid library format", lib);
+
+ return( 0 );
+}
+
+
+
+static int
+time_function(f, arp, argp)/*
+=============================
+ get library member's time, if it matches than return it in argp, if
+ cacheing is enabled than cache the library members also. */
+FILE *f; /* library file */
+struct AR *arp; /* library member header */
+struct ar_args *argp;
+{
+ int rv = _cache_member( arp->ar_name, argp->lib, arp->ar_time );
+
+ if( ar_name_equal (argp->member, arp->ar_name)) {
+ argp->time = arp->ar_time;
+
+ if( arp->ar_time == 0 && !(Glob_attr & A_SILENT) )
+ Warning( "(%s): Can't extract library member timestamp; using EPOCH",
+ argp->member);
+
+ return( rv ); /* 1 => no cacheing, 0 => cacheing */
+ }
+
+ return( FALSE ); /* continue scan */
+}
+
+
+
+static int
+touch_function(f, arp, argp)/*
+==============================
+ Update library member's time stamp, and write new time value into cache
+ if required. */
+FILE *f; /* library file */
+struct AR *arp; /* library member header */
+struct ar_args *argp;
+{
+ extern time_t time ANSI(( time_t * ));
+ time_t now = time((time_t*) NULL); /* Current time. */
+
+ if( ar_name_equal(argp->member, arp->ar_name) ) {
+ _check_cache( argp->member, argp->lib, &now, TRUE );
+ ar_touch(f, now );
+
+ return( TRUE );
+ }
+
+ return( FALSE ); /* continue scan */
+}
+
+
+static int
+ar_name_equal (char * name1, char * name2)
+{
+ int equal;
+
+#if AR_TRUNCATE_MEMBER_NAMES
+ struct ar_hdr hdr;
+
+ equal = !strncmp (name1, name2, sizeof (hdr.ar_name)-1);
+#else
+ equal = !strcmp (name1, name2);
+#endif
+
+ return equal;
+}
+
+
+static int
+ar_scan(f, function, arg)/*
+===========================
+ Scan the opened archive, and call the given function for each member found.
+ The function will be called with the file positioned at the beginning of
+ the member and it can read up to arp->ar_size bytes of the archive member.
+ If the function returns 1, we stop and return 1. We return 0 at the end
+ of the archive, or -1 if the archive has invalid format. This interface
+ is more general than required by "make", but it can be used by other
+ utilities. */
+register FILE *f;
+int (*function) ANSI((FILE *, struct AR *, struct ar_args *));
+struct ar_args *arg;
+{
+ extern long atol ();
+ register char *p;
+ struct ar_hdr arhdr; /* archive member header */
+ long nsize; /* size of member name */
+ long arind=0; /* archive index offset */
+ int process;
+#if defined(_AIX)
+ struct fl_hdr flhdr; /* archive file header */
+ char magic[SAIAMAG]; /* size of magic string */
+#else
+#if ASCARCH
+ char magic[SARMAG];
+#else
+ unsigned short word;
+#endif
+#endif
+
+ fseek( f, 0L, 0 ); /* Start at the beginning of the archive file */
+
+#if ASCARCH
+#if defined(_AIX)
+ fread( (char *)&flhdr, sizeof(flhdr), 1, f );
+ if( strncmp(flhdr.fl_magic,AIAMAG, SAIAMAG) != 0 ) return(-1);
+ fseek(f, atol(flhdr.fl_fstmoff), 0 ); /* postition to first member */
+#else
+ fread( magic, sizeof(magic), 1, f );
+ if( strncmp(magic, ARMAG, SARMAG) != 0 ) return( -1 );
+#endif
+#else
+ fread( (char*)&word, sizeof(word), 1, f );
+ if( word != ARMAG ) return( -1 );
+#endif
+
+ /* scan the library, calling `function' for each member
+ */
+ while( 1 ) {
+ arhdroffset = ftell(f);
+#if defined(_AIX)
+ if( fread((char*)&arhdr,sizeof(arhdr)-sizeof(arhdr._ar_name),1,f)!=1)
+ break;
+ nsize = atoi(arhdr.ar_namlen);
+ fseek(f, arhdroffset+(unsigned long)(((struct ar_hdr *)0)->_ar_name.ar_name), 0);
+ if( fread((char*)_ar.ar_name,nsize,1,f)!=1)
+ break;
+ _ar.ar_name[nsize]='\0';
+#else
+ if( fread((char*) &arhdr, sizeof(arhdr), 1, f) != 1 ) break;
+ strncpy(_ar.ar_name, arhdr.ar_name, nsize = sizeof(arhdr.ar_name));
+#endif
+
+ for( p = &_ar.ar_name[nsize];
+ --p >= _ar.ar_name && *p == ' ';);
+
+ p[1] = '\0';
+ if( *p == '/' ) *p = 0; /* SysV has trailing '/' */
+
+ /* check to see if this is an archive index using SsysV Index scheme.
+ * see ar(4) man page for more info */
+#if CHECKELF
+ if( _ar.ar_name[0] == '/' && _ar.ar_name[1] == '\0' ) {
+ arind = arhdroffset+sizeof(arhdr);
+ process = 0;
+ }
+ else
+#endif
+ process = 1;
+
+#if !defined(_AIX)
+#if ASCARCH
+ if( strncmp(arhdr.ar_fmag, ARFMAG, sizeof(arhdr.ar_fmag)) != 0 )
+ return( -1 );
+ _ar.ar_time = atol(arhdr.ar_date);
+ _ar.ar_size = atol(arhdr.ar_size);
+#else
+ _ar.ar_time = arhdr.ar_date;
+ _ar.ar_size = arhdr.ar_size;
+#endif
+#if CHECKELF
+ /* check for names of the form /xxxx where xxxx is an offset into the
+ * name table pointed at by arind. */
+ if(arind && _ar.ar_name[0] == '/') {
+ long offset = atol(_ar.ar_name+1);
+ long here = ftell(f);
+ int c;
+
+ fseek(f, arind+offset, 0);
+ p = _ar.ar_name;
+ while((c=fgetc(f)) != EOF) {
+ *p++ = c;
+ if(c == '/') {
+ p[-1] = '\0';
+ break;
+ }
+ }
+
+ if (c==EOF) return(-1); /* 'c' should never be EOF */
+ fseek(f, here, 0);
+ }
+#endif
+#else
+#if ASCARCH
+ _ar.ar_time = atol(arhdr.ar_date);
+ _ar.ar_size = atol(arhdr.ar_nxtmem);
+#else
+ _ar.ar_time = arhdr.ar_date;
+ _ar.ar_size = arhdr.ar_nxtmem;
+#endif
+#endif
+
+
+#if DECODE_ALL_AR_FIELDS
+#if ASCARCH
+ _ar.ar_mode = atoi(arhdr.ar_mode);
+ _ar.ar_uid = atoi(arhdr.ar_uid);
+ _ar.ar_gid = atoi(arhdr.ar_gid);
+#else
+ _ar.ar_mode = arhdr.ar_mode;
+ _ar.ar_uid = arhdr.ar_uid;
+ _ar.ar_gid = arhdr.ar_gid;
+#endif
+#endif
+ if( process && (*function)(f, &_ar, arg) ) return( 1 );
+
+#if defined(_AIX)
+ if( _ar.ar_size == 0L ) break;
+ fseek( f, (long) _ar.ar_size, 0 );
+#else
+ fseek( f, arhdroffset + sizeof(arhdr) + ((_ar.ar_size+1) & ~1L), 0 );
+#endif
+ }
+
+#if !defined(_AIX)
+ if( !feof(f) ) return( -1 );
+#endif
+ return 0;
+}
+
+
+
+static int
+ar_touch( f, now )/*
+====================
+ touch module header timestamp. */
+FILE *f;
+time_t now;
+{
+
+ fseek(f, arhdroffset + (unsigned long)(((struct ar_hdr *)0)->ar_date), 0);
+
+#if ASCARCH
+ fprintf(f, "%lu", now);
+#else
+ fwrite((char *)now, sizeof(now), 1, f);
+#endif
+
+ return( ferror(f) ? 0 : 1 );
+}
+
+
+#if LC
+typedef struct mem {
+ time_t m_time; /* modify time of member*/
+ struct mem *m_next; /* next member in lib */
+ char m_valid; /* valid cache entry */
+ char m_name[1]; /* lib member name */
+} MEM, *MEMPTR;
+
+typedef struct lib {
+ struct lib *lb_next; /* next library in list */
+ struct mem *lb_members; /* list of lib members */
+ char lb_valid; /* valid cache entry */
+ char *lb_name; /* library name */
+} LIB, *LIBPTR;
+
+static LIBPTR _cache = NIL(LIB);
+static MEMPTR _find_member ANSI(( LIBPTR, char * ));
+
+static int
+_check_cache( name, lib, pmtime, touch )/*
+==========================================
+ Check to see if we have cached member in lib, if so return time in pmtime
+ and return TRUE, otherwise return FALSE, if touch is TRUE then touch
+ the archive member instead. */
+char *name;
+char *lib;
+time_t *pmtime;
+int touch;
+{
+ register MEMPTR mp;
+ register LIBPTR lp;
+
+ for( lp=_cache; lp != NIL(LIB) && lp->lb_name != lib; lp=lp->lb_next );
+ if( lp == NIL(LIB) ) return( FALSE );
+
+ mp = _find_member( lp, name );
+ if( mp == NIL(MEM) || !mp->m_valid ) return( FALSE );
+
+ if( touch == TRUE )
+ {
+ mp->m_time = *pmtime;
+ mp->m_valid = 1;
+ }
+ else
+ *pmtime = mp->m_time;
+
+ lp->lb_valid = 1;
+ lp->lb_members = mp;
+
+ return( TRUE );
+}
+
+
+
+static int
+_cache_member( name, lib, mtime )/*
+===================================
+ Cache name in lib along with it's time */
+char *name;
+char *lib;
+time_t mtime;
+{
+ register MEMPTR mp;
+ register LIBPTR lp;
+
+ for( lp=_cache;
+ lp != NIL(LIB) && lp->lb_name != NIL(char) && lp->lb_name != lib;
+ lp=lp->lb_next);
+
+ if( lp == NIL(LIB) )
+ {
+ lp = (LIBPTR) malloc(sizeof(LIB));
+ if( lp == NIL(LIB) ) No_ram();
+
+ lp->lb_name = lib;
+ lp->lb_members = NIL(MEM);
+ lp->lb_next = _cache;
+ lp->lb_valid = 0;
+ _cache = lp;
+ }
+
+ /* On UNIX ar does not allow multiple copies of the same .o file to live
+ * in the same AR file. If this is not TRUE then use the commented out
+ * version to set the value of mp. */
+
+ /*mp = _find_member(lp, name);*/
+ mp = NIL(MEM);
+
+ if( mp == NIL(MEM) )
+ {
+ mp = (MEMPTR) malloc(sizeof(char)*offsetof(MEM,m_name[strlen(name)+1]));
+ if( mp == NIL(MEM) ) No_ram();
+
+ strcpy( mp->m_name, name );
+ mp->m_time = mtime;
+
+ if( lp->lb_members == NIL(MEM) ) {
+ mp->m_next = mp;
+ lp->lb_members = mp;
+ }
+ else {
+ mp->m_next = lp->lb_members->m_next;
+ lp->lb_members->m_next = mp;
+ lp->lb_members = mp;
+ }
+ }
+ else
+ mp->m_time = mtime;
+
+ mp->m_valid = 1;
+
+ return( lp->lb_valid );
+}
+
+
+static MEMPTR
+_find_member( lp, name )
+LIBPTR lp;
+char *name;
+{
+ register MEMPTR mp = lp->lb_members;
+
+ if( mp == NIL(MEM) ) return(mp);
+
+ do {
+ if( !strcmp(mp->m_name, name ) ) return( mp );
+ mp = mp->m_next;
+ }
+ while( mp != lp->lb_members );
+
+ return( NIL(MEM) );
+}
+#endif
+
+
+
+PUBLIC void
+void_lcache( lib, member )/*
+============================
+ Void the library cache for lib. If member is NIL(char) then nuke all
+ of the members, if member is NOT NIL(char) then invalidate only that
+ member. */
+char *lib;
+char *member;
+{
+#if LC
+ register LIBPTR lp;
+ register MEMPTR mp;
+ register MEMPTR tmp;
+
+ for( lp=_cache; lp != NIL(LIB) && lp->lb_name != lib; lp=lp->lb_next );
+ if( lp == NIL(LIB) ) return;
+
+ if( member == NIL(char) ) {
+ mp = lp->lb_members;
+ do {
+ tmp = mp->m_next;
+ (void) free( mp );
+ mp = tmp;
+ } while( mp != lp->lb_members );
+
+ lp->lb_valid = 0;
+ lp->lb_members = NIL(MEM);
+ lp->lb_name = NIL(char);
+ }
+ else {
+ mp=lp->lb_members;
+ do {
+ if( strcmp( member, mp->m_name) == 0 ) {
+ lp->lb_members = mp->m_next;
+ mp->m_valid = 0;
+ }
+
+ mp=mp->m_next;
+ } while( mp != lp->lb_members );
+ }
+#endif
+}
diff --git a/dmake/unix/bsd43/config.mk b/dmake/unix/bsd43/config.mk
new file mode 100644
index 000000000000..e99937342e68
--- /dev/null
+++ b/dmake/unix/bsd43/config.mk
@@ -0,0 +1,27 @@
+# This is the BSD 4.3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following sources are required for BSD4.3
+OSDSRC := putenv.c tempnam.c utime.c setvbuf.c
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local BSD includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/bsd43/dirent.h b/dmake/unix/bsd43/dirent.h
new file mode 100644
index 000000000000..82f910ed3a7d
--- /dev/null
+++ b/dmake/unix/bsd43/dirent.h
@@ -0,0 +1,28 @@
+/* RCS $Id: dirent.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- dirent
+--
+-- DESCRIPTION
+-- Deal with sysV'ish dirent.h on BSD4.3 systems, which have the stuff
+-- in sys/dir.h
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <sys/dir.h>
+#define dirent direct
diff --git a/dmake/unix/bsd43/limits.h b/dmake/unix/bsd43/limits.h
new file mode 100644
index 000000000000..a08805d00d66
--- /dev/null
+++ b/dmake/unix/bsd43/limits.h
@@ -0,0 +1,32 @@
+/* RCS $Id: limits.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- limits
+--
+-- DESCRIPTION
+-- Compensate for systems that don't have a limits.h header file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <sys/types.h>
+#include <sys/dirent.h>
+#include <sys/param.h>
+
+#define NAME_MAX MAXNAMLEN
+#define PATH_MAX MAXPATHLEN
+#define CHILD_MAX 20
diff --git a/dmake/unix/bsd43/make.sh b/dmake/unix/bsd43/make.sh
new file mode 100644
index 000000000000..e45d01952f46
--- /dev/null
+++ b/dmake/unix/bsd43/make.sh
@@ -0,0 +1,69 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/bsd43 -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/putenv.c
+mv putenv.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/tempnam.c
+mv tempnam.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/utime.c
+mv utime.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/setvbuf.c
+mv setvbuf.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \
+objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o
+cp unix/bsd43/template.mk startup/config.mk
diff --git a/dmake/unix/bsd43/public.h b/dmake/unix/bsd43/public.h
new file mode 100644
index 000000000000..1a08478125b6
--- /dev/null
+++ b/dmake/unix/bsd43/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:54:02 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/bsd43/putenv.c b/dmake/unix/bsd43/putenv.c
new file mode 100644
index 000000000000..d0ed998158e0
--- /dev/null
+++ b/dmake/unix/bsd43/putenv.c
@@ -0,0 +1,78 @@
+/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- My own putenv for BSD like systems.
+--
+-- DESCRIPTION
+-- This originally came from MKS, but I rewrote it to fix a bug with
+-- replacing existing strings, probably never happened but the code
+-- was wrong nonetheless.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+int
+putenv( str )/*
+===============
+ Take a string of the form NAME=value and stick it into the environment.
+ We do this by allocating a new set of pointers if we have to add a new
+ string and by replacing an existing pointer if the value replaces the value
+ of an existing string. */
+char *str;
+{
+ extern char **environ; /* The current environment. */
+ static char **ourenv = NULL; /* A new environment */
+ register char **p;
+ register char *q;
+ int size;
+
+ /* First search the current environment and see if we can replace a
+ * string. */
+ for( p=environ; *p; p++ ) {
+ register char *s = str;
+
+ for( q = *p; *q && *s && *s == *q; q++, s++ )
+ if( *s == '=' ) {
+ *p = str;
+ return(0); /* replaced it so go away */
+ }
+ }
+
+ /* Ok, can't replace a string so need to grow the environment. */
+ size = p - environ + 2; /* size of new environment */
+ /* size of old is size-1 */
+
+ /* It's the first time, so allocate a new environment since we don't know
+ * where the old one is comming from. */
+ if( ourenv == NULL ) {
+ if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL )
+ return(1);
+
+ memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) );
+ }
+ else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL )
+ return(1);
+
+ ourenv[--size] = NULL;
+ ourenv[--size] = str;
+
+ environ = ourenv;
+ return(0);
+}
diff --git a/dmake/unix/bsd43/setvbuf.c b/dmake/unix/bsd43/setvbuf.c
new file mode 100644
index 000000000000..ce5d193fbe89
--- /dev/null
+++ b/dmake/unix/bsd43/setvbuf.c
@@ -0,0 +1,40 @@
+/* RCS $Id: setvbuf.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- Setvbuf for BSD
+--
+-- DESCRIPTION
+-- A sysv call, standard BSD doesn't have this.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdio.h>
+
+setvbuf(fp, bp, type, len_unused)
+FILE* fp;
+char* bp;
+int type;
+int len_unused;
+{
+ switch (type) {
+ case _IOLBF: setlinebuf(fp); return;
+ case _IONBF: setbuf(fp, NULL); return;
+ default: setbuf(fp, bp); return;
+ }
+}
+
diff --git a/dmake/unix/bsd43/stdlib.h b/dmake/unix/bsd43/stdlib.h
new file mode 100644
index 000000000000..82ab9627cd65
--- /dev/null
+++ b/dmake/unix/bsd43/stdlib.h
@@ -0,0 +1,44 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+extern free();
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/bsd43/string.h b/dmake/unix/bsd43/string.h
new file mode 100644
index 000000000000..862c17960a0b
--- /dev/null
+++ b/dmake/unix/bsd43/string.h
@@ -0,0 +1,43 @@
+/* RCS $Id: string.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- string function headers
+--
+-- DESCRIPTION
+-- Supply correct definitions for certain string functions.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#ifndef STRING_h
+#define STRING_h
+
+/*
+** BSD does this wrong
+*/
+#include <strings.h>
+
+#include "stdmacs.h"
+extern char* strpbrk ANSI((char* src, char* any));
+
+#ifndef DBUG
+#define strchr(str,c) index(str,c)
+#define strrchr(str,c) rindex(str,c)
+#else
+char *strchr ANSI((char*, char));
+char *strrchr ANSI((char*, char));
+#endif
+#endif
diff --git a/dmake/unix/bsd43/template.mk b/dmake/unix/bsd43/template.mk
new file mode 100644
index 000000000000..14a7cab8ed4b
--- /dev/null
+++ b/dmake/unix/bsd43/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsd43
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/bsd43/tempnam.c b/dmake/unix/bsd43/tempnam.c
new file mode 100644
index 000000000000..12512ec9cb8b
--- /dev/null
+++ b/dmake/unix/bsd43/tempnam.c
@@ -0,0 +1,103 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+
+static char *cpdir();
+static char seed[4]="AAA";
+
+/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
+#ifndef P_tmpdir
+static char *P_tmpdir = "/tmp";
+#endif
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
+ if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
+ if( access( cpdir(p, P_tmpdir), 3) != 0 )
+ if( access( cpdir(p, "/tmp"), 3) != 0 )
+ return(NULL);
+
+ (void) strcat(p, "/");
+ if(prefix)
+ {
+ *(p+strlen(p)+5) = '\0';
+ (void)strncat(p, prefix, 5);
+ }
+
+ (void)strcat(p, seed);
+ (void)strcat(p, "XXXXXX");
+
+ q = seed;
+ while(*q == 'Z') *q++ = 'A';
+ ++*q;
+
+ if(*mktemp(p) == '\0') return(NULL);
+ return(p);
+}
+
+
+
+static char *
+cpdir(buf, str)
+char *buf;
+char *str;
+{
+ char *p;
+
+ if(str != NULL)
+ {
+ (void) strcpy(buf, str);
+ p = buf - 1 + strlen(buf);
+ if(*p == '/') *p = '\0';
+ }
+
+ return(buf);
+}
diff --git a/dmake/unix/bsd43/utime.c b/dmake/unix/bsd43/utime.c
new file mode 100644
index 000000000000..9d26700d8006
--- /dev/null
+++ b/dmake/unix/bsd43/utime.c
@@ -0,0 +1,70 @@
+/* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- utime
+--
+-- DESCRIPTION
+-- Provide our own utime function.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+
+int
+utime(name, timep)
+char* name;
+time_t timep[2];
+{
+ struct timeval tv[2], *tvp;
+ struct stat buf;
+ int fil;
+ char data;
+
+ if (timep!=0)
+ {
+ tvp = tv, tv[0].tv_sec = timep[0], tv[1].tv_sec = timep[1];
+ if (utimes(name, tvp)==0)
+ return (0);
+ }
+
+ if (stat(name, &buf) != 0)
+ return (-1);
+ if (buf.st_size != 0) {
+ if ((fil = open(name, O_RDWR, 0666)) < 0)
+ return (-1);
+ if (read(fil, &data, 1) < 1) {
+ close(fil);
+ return (-1);
+ }
+ lseek(fil, 0L, 0);
+ if (write(fil, &data, 1) < 1) {
+ close(fil);
+ return (-1);
+ }
+ close(fil);
+ return (0);
+ } else if ((fil = creat(name, 0666)) < 0) {
+ return (-1);
+ } else {
+ close(fil);
+ return (0);
+ }
+}
diff --git a/dmake/unix/bsd43/uw/config.mk b/dmake/unix/bsd43/uw/config.mk
new file mode 100644
index 000000000000..1f94136f6d6e
--- /dev/null
+++ b/dmake/unix/bsd43/uw/config.mk
@@ -0,0 +1,17 @@
+# This is the BSD 4.3 University of Waterloo (uw) UNIX configuration file
+# for DMAKE
+# It simply modifies the values of LDLIBS to include libuw.a
+# so that vfprintf can be found.
+#
+
+LDLIBS += -luw
+osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
+CFLAGS += -I$(osredir)
+
+# install script for UW's /usr/software hierarchy...
+install:
+ mkdir ../bin; strip ./dmake; mv ./dmake ../bin
+ chmod a+rx ../bin/dmake ../bin
+ mkdir ../lib; chmod a+rx ../lib
+ cp $(STARTUPFILE) ../lib
+ chmod a+r ../lib/startup.mk
diff --git a/dmake/unix/bsd43/uw/make.sh b/dmake/unix/bsd43/uw/make.sh
new file mode 100644
index 000000000000..f23ecbb8ec44
--- /dev/null
+++ b/dmake/unix/bsd43/uw/make.sh
@@ -0,0 +1,69 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/putenv.c
+mv putenv.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/tempnam.c
+mv tempnam.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/utime.c
+mv utime.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/setvbuf.c
+mv setvbuf.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \
+objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o -luw
+cp unix/bsd43/uw/template.mk startup/config.mk
diff --git a/dmake/unix/bsd43/uw/public.h b/dmake/unix/bsd43/uw/public.h
new file mode 100644
index 000000000000..fe2709c60023
--- /dev/null
+++ b/dmake/unix/bsd43/uw/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:54:14 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/bsd43/uw/template.mk b/dmake/unix/bsd43/uw/template.mk
new file mode 100644
index 000000000000..6afe91c1fc7a
--- /dev/null
+++ b/dmake/unix/bsd43/uw/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsd43
+ OSENVIRONMENT *:= uw
diff --git a/dmake/unix/bsd43/vf/config.mk b/dmake/unix/bsd43/vf/config.mk
new file mode 100644
index 000000000000..bf4e64808d6c
--- /dev/null
+++ b/dmake/unix/bsd43/vf/config.mk
@@ -0,0 +1,11 @@
+# This config file adds vfprintf.c and memcpy.c for those systems that
+# do not have it.
+#
+
+osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
+CFLAGS += -I$(osredir)
+
+# The following sources are required for BSD4.3
+OSDESRC := memcpy.c vfprintf.c
+SRC += $(OSDESRC)
+.SETDIR=$(osredir) : $(OSDESRC)
diff --git a/dmake/unix/bsd43/vf/ctype.h b/dmake/unix/bsd43/vf/ctype.h
new file mode 100644
index 000000000000..f229a9ab3967
--- /dev/null
+++ b/dmake/unix/bsd43/vf/ctype.h
@@ -0,0 +1,51 @@
+/* RCS $Id: ctype.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- ctype
+--
+-- DESCRIPTION
+-- ctype.h 4.2 85/09/04
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define _U 01
+#define _L 02
+#define _N 04
+#define _S 010
+#define _P 020
+#define _C 040
+#define _X 0100
+#define _B 0200
+
+extern char _ctype_[];
+
+#define isalpha(c) ((_ctype_+1)[c]&(_U|_L))
+#define isupper(c) ((_ctype_+1)[c]&_U)
+#define islower(c) ((_ctype_+1)[c]&_L)
+#define isdigit(c) ((_ctype_+1)[c]&_N)
+#define isxdigit(c) ((_ctype_+1)[c]&(_N|_X))
+#define isspace(c) ((_ctype_+1)[c]&_S)
+#define ispunct(c) ((_ctype_+1)[c]&_P)
+#define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N))
+#define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
+#define isgraph(c) ((_ctype_+1)[c]&(_P|_U|_L|_N))
+#define iscntrl(c) ((_ctype_+1)[c]&_C)
+#define isascii(c) ((unsigned)(c)<=0177)
+#define toupper(c) ((c)-'a'+'A')
+#define tolower(c) ((c)-'A'+'a')
+#define toascii(c) ((c)&0177)
diff --git a/dmake/unix/bsd43/vf/make.sh b/dmake/unix/bsd43/vf/make.sh
new file mode 100644
index 000000000000..231b683a80e6
--- /dev/null
+++ b/dmake/unix/bsd43/vf/make.sh
@@ -0,0 +1,73 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/putenv.c
+mv putenv.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/tempnam.c
+mv tempnam.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/utime.c
+mv utime.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/setvbuf.c
+mv setvbuf.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/memcpy.c
+mv memcpy.o objects
+cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/vfprintf.c
+mv vfprintf.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \
+objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o objects/memcpy.o objects/vfprintf.o
+cp unix/bsd43/vf/template.mk startup/config.mk
diff --git a/dmake/unix/bsd43/vf/memcpy.c b/dmake/unix/bsd43/vf/memcpy.c
new file mode 100644
index 000000000000..4ae47722e851
--- /dev/null
+++ b/dmake/unix/bsd43/vf/memcpy.c
@@ -0,0 +1,36 @@
+/* RCS $Id: memcpy.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- memcpy
+--
+-- DESCRIPTION
+-- BSD didn't have this in the library many moons ago.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+char *
+memcpy(t, f, n)
+register char *t, *f;
+register n;
+{
+ register char *p = t;
+
+ while( --n >= 0 ) *t++ = *f++;
+
+ return (p);
+}
diff --git a/dmake/unix/bsd43/vf/public.h b/dmake/unix/bsd43/vf/public.h
new file mode 100644
index 000000000000..4483a04fe534
--- /dev/null
+++ b/dmake/unix/bsd43/vf/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:54:25 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/bsd43/vf/template.mk b/dmake/unix/bsd43/vf/template.mk
new file mode 100644
index 000000000000..395cd4718fa0
--- /dev/null
+++ b/dmake/unix/bsd43/vf/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsd43
+ OSENVIRONMENT *:= vf
diff --git a/dmake/unix/bsd43/vf/vfprintf.c b/dmake/unix/bsd43/vf/vfprintf.c
new file mode 100644
index 000000000000..675e2e83e5ab
--- /dev/null
+++ b/dmake/unix/bsd43/vf/vfprintf.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88";
+#endif /* LIBC_SCCS and not lint */
+
+#include <stdio.h>
+#include <varargs.h>
+
+int
+vfprintf(iop, fmt, ap)
+ FILE *iop;
+ char *fmt;
+ va_list ap;
+{
+ int len;
+ char localbuf[BUFSIZ];
+
+ if (iop->_flag & _IONBF) {
+ iop->_flag &= ~_IONBF;
+ iop->_ptr = iop->_base = localbuf;
+ len = _doprnt(fmt, ap, iop);
+ (void) fflush(iop);
+ iop->_flag |= _IONBF;
+ iop->_base = NULL;
+ iop->_bufsiz = 0;
+ iop->_cnt = 0;
+ } else
+ len = _doprnt(fmt, ap, iop);
+
+ return (ferror(iop) ? EOF : len);
+}
+
diff --git a/dmake/unix/bsdarm32/config.mk b/dmake/unix/bsdarm32/config.mk
new file mode 100644
index 000000000000..e99937342e68
--- /dev/null
+++ b/dmake/unix/bsdarm32/config.mk
@@ -0,0 +1,27 @@
+# This is the BSD 4.3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following sources are required for BSD4.3
+OSDSRC := putenv.c tempnam.c utime.c setvbuf.c
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local BSD includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/bsdarm32/dirent.h b/dmake/unix/bsdarm32/dirent.h
new file mode 100644
index 000000000000..b50fa18a9d9e
--- /dev/null
+++ b/dmake/unix/bsdarm32/dirent.h
@@ -0,0 +1,30 @@
+/* RCS $Id: dirent.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- dirent
+--
+-- DESCRIPTION
+-- Deal with sysV'ish dirent.h on BSD4.3 systems, which have the stuff
+-- in sys/dir.h
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <sys/dir.h>
+#include </usr/include/dirent.h>
+#define dirent direct
+
diff --git a/dmake/unix/bsdarm32/limits.h b/dmake/unix/bsdarm32/limits.h
new file mode 100644
index 000000000000..655d707bb4f6
--- /dev/null
+++ b/dmake/unix/bsdarm32/limits.h
@@ -0,0 +1,29 @@
+/* RCS $Id: limits.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- limits
+--
+-- DESCRIPTION
+-- Compensate for systems that don't have a limits.h header file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <sys/types.h>
+#include <sys/dirent.h>
+#include <sys/param.h>
+
diff --git a/dmake/unix/bsdarm32/make.sh b/dmake/unix/bsdarm32/make.sh
new file mode 100644
index 000000000000..f43dd9425774
--- /dev/null
+++ b/dmake/unix/bsdarm32/make.sh
@@ -0,0 +1,67 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/bsdarm32/putenv.c
+mv putenv.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/bsdarm32/tempnam.c
+mv tempnam.o objects
+cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/bsdarm32/utime.c
+mv utime.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \
+objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o
+cp unix/bsdarm32/template.mk startup/config.mk
diff --git a/dmake/unix/bsdarm32/public.h b/dmake/unix/bsdarm32/public.h
new file mode 100644
index 000000000000..f06831cdc264
--- /dev/null
+++ b/dmake/unix/bsdarm32/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:54:38 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/bsdarm32/putenv.c b/dmake/unix/bsdarm32/putenv.c
new file mode 100644
index 000000000000..d0ed998158e0
--- /dev/null
+++ b/dmake/unix/bsdarm32/putenv.c
@@ -0,0 +1,78 @@
+/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- My own putenv for BSD like systems.
+--
+-- DESCRIPTION
+-- This originally came from MKS, but I rewrote it to fix a bug with
+-- replacing existing strings, probably never happened but the code
+-- was wrong nonetheless.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+int
+putenv( str )/*
+===============
+ Take a string of the form NAME=value and stick it into the environment.
+ We do this by allocating a new set of pointers if we have to add a new
+ string and by replacing an existing pointer if the value replaces the value
+ of an existing string. */
+char *str;
+{
+ extern char **environ; /* The current environment. */
+ static char **ourenv = NULL; /* A new environment */
+ register char **p;
+ register char *q;
+ int size;
+
+ /* First search the current environment and see if we can replace a
+ * string. */
+ for( p=environ; *p; p++ ) {
+ register char *s = str;
+
+ for( q = *p; *q && *s && *s == *q; q++, s++ )
+ if( *s == '=' ) {
+ *p = str;
+ return(0); /* replaced it so go away */
+ }
+ }
+
+ /* Ok, can't replace a string so need to grow the environment. */
+ size = p - environ + 2; /* size of new environment */
+ /* size of old is size-1 */
+
+ /* It's the first time, so allocate a new environment since we don't know
+ * where the old one is comming from. */
+ if( ourenv == NULL ) {
+ if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL )
+ return(1);
+
+ memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) );
+ }
+ else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL )
+ return(1);
+
+ ourenv[--size] = NULL;
+ ourenv[--size] = str;
+
+ environ = ourenv;
+ return(0);
+}
diff --git a/dmake/unix/bsdarm32/stdlib.h b/dmake/unix/bsdarm32/stdlib.h
new file mode 100644
index 000000000000..82ab9627cd65
--- /dev/null
+++ b/dmake/unix/bsdarm32/stdlib.h
@@ -0,0 +1,44 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+extern free();
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/bsdarm32/string.h b/dmake/unix/bsdarm32/string.h
new file mode 100644
index 000000000000..c8abdf137696
--- /dev/null
+++ b/dmake/unix/bsdarm32/string.h
@@ -0,0 +1,42 @@
+/* RCS $Id: string.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- string function headers
+--
+-- DESCRIPTION
+-- Supply correct definitions for certain string functions.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+
+/*
+** BSD does this wrong
+*/
+#include </usr/include/string.h>
+
+#include "stdmacs.h"
+extern char* strpbrk ANSI((const char* src, const char* any));
+
+#ifndef DBUG
+#define strchr(str,c) index(str,c)
+#define strrchr(str,c) rindex(str,c)
+#else
+char *strchr ANSI((char*, char));
+char *strrchr ANSI((char*, char));
+#endif
+
diff --git a/dmake/unix/bsdarm32/template.mk b/dmake/unix/bsdarm32/template.mk
new file mode 100644
index 000000000000..830e9958394c
--- /dev/null
+++ b/dmake/unix/bsdarm32/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= bsdarm32
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/bsdarm32/tempnam.c b/dmake/unix/bsdarm32/tempnam.c
new file mode 100644
index 000000000000..a645f41abcf7
--- /dev/null
+++ b/dmake/unix/bsdarm32/tempnam.c
@@ -0,0 +1,105 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+
+static char *cpdir();
+static char seed[4]="AAA";
+
+/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
+#ifndef P_tmpdir
+static char *P_tmpdir = "/tmp";
+#endif
+
+
+char *
+tempnam(dir, prefix)
+const char *dir; /* use this directory please (if non-NULL) */
+const char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
+ if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
+ if( access( cpdir(p, P_tmpdir), 3) != 0 )
+ if( access( cpdir(p, "/tmp"), 3) != 0 )
+ return(NULL);
+
+ (void) strcat(p, "/");
+ if(prefix)
+ {
+ *(p+strlen(p)+5) = '\0';
+ (void)strncat(p, prefix, 5);
+ }
+
+ (void)strcat(p, seed);
+ (void)strcat(p, "XXXXXX");
+
+ q = seed;
+ while(*q == 'Z') *q++ = 'A';
+ ++*q;
+
+ if(*mktemp(p) == '\0') return(NULL);
+ return(p);
+}
+
+
+
+
+static char *
+cpdir(buf, str)
+char *buf;
+char *str;
+{
+ char *p;
+
+ if(str != NULL)
+ {
+ (void) strcpy(buf, str);
+ p = buf - 1 + strlen(buf);
+ if(*p == '/') *p = '\0';
+ }
+
+ return(buf);
+}
diff --git a/dmake/unix/bsdarm32/utime.c b/dmake/unix/bsdarm32/utime.c
new file mode 100644
index 000000000000..9d26700d8006
--- /dev/null
+++ b/dmake/unix/bsdarm32/utime.c
@@ -0,0 +1,70 @@
+/* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- utime
+--
+-- DESCRIPTION
+-- Provide our own utime function.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+
+int
+utime(name, timep)
+char* name;
+time_t timep[2];
+{
+ struct timeval tv[2], *tvp;
+ struct stat buf;
+ int fil;
+ char data;
+
+ if (timep!=0)
+ {
+ tvp = tv, tv[0].tv_sec = timep[0], tv[1].tv_sec = timep[1];
+ if (utimes(name, tvp)==0)
+ return (0);
+ }
+
+ if (stat(name, &buf) != 0)
+ return (-1);
+ if (buf.st_size != 0) {
+ if ((fil = open(name, O_RDWR, 0666)) < 0)
+ return (-1);
+ if (read(fil, &data, 1) < 1) {
+ close(fil);
+ return (-1);
+ }
+ lseek(fil, 0L, 0);
+ if (write(fil, &data, 1) < 1) {
+ close(fil);
+ return (-1);
+ }
+ close(fil);
+ return (0);
+ } else if ((fil = creat(name, 0666)) < 0) {
+ return (-1);
+ } else {
+ close(fil);
+ return (0);
+ }
+}
diff --git a/dmake/unix/coherent/config.mk b/dmake/unix/coherent/config.mk
new file mode 100644
index 000000000000..9c5890c8065d
--- /dev/null
+++ b/dmake/unix/coherent/config.mk
@@ -0,0 +1,26 @@
+# This is the COHERENT configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir) -Dvoid=int
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/coherent/stdlib.h b/dmake/unix/coherent/stdlib.h
new file mode 100644
index 000000000000..82ab9627cd65
--- /dev/null
+++ b/dmake/unix/coherent/stdlib.h
@@ -0,0 +1,44 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+extern free();
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/coherent/time.h b/dmake/unix/coherent/time.h
new file mode 100644
index 000000000000..e3509ed8ec8b
--- /dev/null
+++ b/dmake/unix/coherent/time.h
@@ -0,0 +1,32 @@
+/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- time_t
+--
+-- DESCRIPTION
+-- Properly define time_t.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef TIME_h
+#define TIME_h
+
+typedef long time_t; /* this is the thing we use */
+
+#endif TIME_h
+
diff --git a/dmake/unix/coherent/ver40/config.mk b/dmake/unix/coherent/ver40/config.mk
new file mode 100644
index 000000000000..df2a702ea02f
--- /dev/null
+++ b/dmake/unix/coherent/ver40/config.mk
@@ -0,0 +1,11 @@
+# This config file adds vfprintf.c and memcpy.c for those systems that
+# do not have it.
+#
+
+osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
+CFLAGS += -I$(osredir)
+
+# The following sources are required for coherent version 4.0
+OSDESRC := vfprintf.c getcwd.c
+SRC += $(OSDESRC)
+.SETDIR=$(osredir) : $(OSDESRC)
diff --git a/dmake/unix/coherent/ver40/getcwd.c b/dmake/unix/coherent/ver40/getcwd.c
new file mode 100644
index 000000000000..cc2772494611
--- /dev/null
+++ b/dmake/unix/coherent/ver40/getcwd.c
@@ -0,0 +1,49 @@
+/* RCS $Id: getcwd.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
+--
+-- SYNOPSIS
+-- getcwd
+--
+-- DESCRIPTION
+-- Wrapper for getcwd.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#if __STDC__
+char *getcwd(char *buffer, int length)
+#else
+char *getcwd (buffer, length)
+char *buffer;
+int length;
+#endif
+{
+ extern char *getwd();
+
+ char *dir;
+ dir = getwd();
+ if (dir)
+ {
+ strncpy(buffer,dir,length);
+ return buffer;
+ }
+ else
+ {
+ *buffer = 0;
+ return (char *) 0;
+ }
+}
+
diff --git a/dmake/unix/coherent/ver40/make.sh b/dmake/unix/coherent/ver40/make.sh
new file mode 100644
index 000000000000..1a0c850452f0
--- /dev/null
+++ b/dmake/unix/coherent/ver40/make.sh
@@ -0,0 +1,64 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/coherent/ver40/vfprintf.c
+mv vfprintf.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/coherent/ver40/getcwd.c
+mv getcwd.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/vfprintf.o objects/getcwd.o
+cp unix/coherent/ver40/template.mk startup/config.mk
diff --git a/dmake/unix/coherent/ver40/public.h b/dmake/unix/coherent/ver40/public.h
new file mode 100644
index 000000000000..63ae40f18087
--- /dev/null
+++ b/dmake/unix/coherent/ver40/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:54:51 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/coherent/ver40/template.mk b/dmake/unix/coherent/ver40/template.mk
new file mode 100644
index 000000000000..ef23550cf651
--- /dev/null
+++ b/dmake/unix/coherent/ver40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= coherent
+ OSENVIRONMENT *:= ver40
diff --git a/dmake/unix/coherent/ver40/vfprintf.c b/dmake/unix/coherent/ver40/vfprintf.c
new file mode 100644
index 000000000000..907230db2081
--- /dev/null
+++ b/dmake/unix/coherent/ver40/vfprintf.c
@@ -0,0 +1,190 @@
+/* Portable vfprintf and vprintf by Robert A. Larson <blarson@skat.usc.edu> */
+
+/* Copyright 1989 Robert A. Larson.
+ * Distribution in any form is allowed as long as the author
+ * retains credit, changes are noted by their author and the
+ * copyright message remains intact. This program comes as-is
+ * with no warentee of fitness for any purpouse.
+ *
+ * Thanks to Doug Gwen, Chris Torek, and others who helped clarify
+ * the ansi printf specs.
+ *
+ * Please send any bug fixes and improvments to blarson@skat.usc.edu .
+ * The use of goto is NOT a bug.
+ */
+
+/* Feb 9, 1989 blarson First usenet release */
+
+/* This code implements the vfprintf function, without relying on
+ * the existance of _doprint or other system specific code.
+ *
+ * Define NOVOID if void * is not a supported type.
+ *
+ * Two compile options are available for efficency:
+ * INTSPRINTF should be defined if sprintf is int and returns
+ * the number of chacters formated.
+ * LONGINT should be defined if sizeof(long) == sizeof(int)
+ *
+ * They only make the code smaller and faster, they need not be
+ * defined.
+ *
+ * UNSIGNEDSPECIAL should be defined if unsigned is treated differently
+ * than int in argument passing. If this is definded, and LONGINT is not,
+ * the compiler must support the type unsingned long.
+ *
+ * Most quirks and bugs of the available fprintf fuction are duplicated,
+ * however * in the width and precision fields will work correctly
+ * even if fprintf does not support this. The %n format and the return
+ * count will only work if fprintf returns the number of characters
+ * formatted.
+ *
+ * Bad format strings, or those with very long width and precision
+ * fields (including expanded * fields) will cause undesired results.
+ */
+
+#ifdef OSK /* os9/68k can take advantage of both */
+#define INTSPRINTF
+#define LONGINT
+#endif
+#define NOVOID 1
+
+/* This must be a typedef not a #define! */
+#ifdef NOVOID
+typedef char *pointer;
+#else
+typedef void *pointer;
+#endif
+
+#include <stdio.h>
+
+#ifdef INTSPRINTF
+#define Sprintf(string,format,arg) (sprintf((string),(format),(arg)))
+#else
+#define Sprintf(string,format,arg) (\
+ sprintf((string),(format),(arg)),\
+ strlen(string)\
+)
+#endif
+
+#include <stdarg.h>
+
+typedef int *intp;
+
+int vfprintf(dest, format, args)
+FILE *dest;
+register char *format;
+va_list args;
+{
+ register char c;
+ register char *tp;
+ register int count = 0;
+ char tempfmt[64];
+#ifndef LONGINT
+ int longflag;
+#endif
+
+ tempfmt[0] = '%';
+ while(c = *format++) {
+ if(c=='%') {
+ tp = &tempfmt[1];
+#ifndef LONGINT
+ longflag = 0;
+#endif
+continue_format:
+ switch(c = *format++) {
+ case 's':
+ *tp++ = c;
+ *tp = '\0';
+ count += fprintf(dest, tempfmt, va_arg(args, char *));
+ break;
+ case 'u':
+ case 'x':
+ case 'o':
+ case 'X':
+#ifdef UNSIGNEDSPECIAL
+ *tp++ = c;
+ *tp = '\0';
+#ifndef LONGINT
+ if(longflag)
+ count += fprintf(dest, tempfmt, va_arg(args, unsigned long));
+ else
+#endif
+ count += fprintf(dest, tempfmt, va_arg(args, unsigned));
+ break;
+#endif
+ case 'd':
+ case 'c':
+ case 'i':
+ *tp++ = c;
+ *tp = '\0';
+#ifndef LONGINT
+ if(longflag)
+ count += fprintf(dest, tempfmt, va_arg(args, long));
+ else
+#endif
+ count += fprintf(dest, tempfmt, va_arg(args, int));
+ break;
+ case 'f':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ *tp++ = c;
+ *tp = '\0';
+ count += fprintf(dest, tempfmt, va_arg(args, double));
+ break;
+ case 'p':
+ *tp++ = c;
+ *tp = '\0';
+ count += fprintf(dest, tempfmt, va_arg(args, pointer));
+ break;
+ case '-':
+ case '+':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '.':
+ case ' ':
+ case '#':
+ case 'h':
+ *tp++ = c;
+ goto continue_format;
+ case 'l':
+#ifndef LONGINT
+ longflag = 1;
+ *tp++ = c;
+#endif
+ goto continue_format;
+ case '*':
+ tp += Sprintf(tp, "%d", va_arg(args, int));
+ goto continue_format;
+ case 'n':
+ *va_arg(args, intp) = count;
+ break;
+ case '%':
+ default:
+ putc(c, dest);
+ count++;
+ break;
+ }
+ } else {
+ putc(c, dest);
+ count++;
+ }
+ }
+ return count;
+}
+
+vprintf(format, args)
+char *format;
+va_list args;
+{
+ return vfprintf(stdout, format, args);
+}
diff --git a/dmake/unix/coherent/ver42/config.mk b/dmake/unix/coherent/ver42/config.mk
new file mode 100644
index 000000000000..2ff06b6b7917
--- /dev/null
+++ b/dmake/unix/coherent/ver42/config.mk
@@ -0,0 +1,11 @@
+# This config file adds vfprintf.c and memcpy.c for those systems that
+# do not have it.
+#
+
+osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
+CFLAGS += -I$(osredir)
+
+# The following sources are required for Coherent version 4.2
+#OSDESRC :=
+#SRC += $(OSDESRC)
+#.SETDIR=$(osredir) : $(OSDESRC)
diff --git a/dmake/unix/coherent/ver42/make.sh b/dmake/unix/coherent/ver42/make.sh
new file mode 100644
index 000000000000..bfc7f8252a5d
--- /dev/null
+++ b/dmake/unix/coherent/ver42/make.sh
@@ -0,0 +1,60 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/dcache.c
+mv dcache.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o
+cp unix/coherent/ver42/template.mk startup/config.mk
diff --git a/dmake/unix/coherent/ver42/public.h b/dmake/unix/coherent/ver42/public.h
new file mode 100644
index 000000000000..3921d7ccda29
--- /dev/null
+++ b/dmake/unix/coherent/ver42/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:55:03 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/coherent/ver42/template.mk b/dmake/unix/coherent/ver42/template.mk
new file mode 100644
index 000000000000..e5dd9f99ffac
--- /dev/null
+++ b/dmake/unix/coherent/ver42/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= coherent
+ OSENVIRONMENT *:= ver42
diff --git a/dmake/unix/config.mk b/dmake/unix/config.mk
new file mode 100644
index 000000000000..a6859ceb3c50
--- /dev/null
+++ b/dmake/unix/config.mk
@@ -0,0 +1,39 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# PRINTER, PRINTFLAGS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+PRINTER = hw
+PRINTFLAGS = -P$(PRINTER)
+STARTUPFILE = $(OS)/startup.mk
+CPPFLAGS = $(CFLAGS)
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDFLAGS) -o $@ $(LDOBJS) $(LDLIBS)
+
+# Debug flags
+DB_CFLAGS = -g -DDBUG
+DB_LDFLAGS = -g
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS = -O
+NDB_LDFLAGS = -O
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += -I$(OS)
+
+# Sources that must be defined for each different version
+OSSRC := arlib.c dirbrk.c rmprq.c ruletab.c runargv.c dcache.c
+SRC += $(OSSRC)
+.SETDIR=$(OS) : $(OSSRC)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/cygwin/public.h b/dmake/unix/cygwin/public.h
new file mode 100644
index 000000000000..02129e2b3d3a
--- /dev/null
+++ b/dmake/unix/cygwin/public.h
@@ -0,0 +1,172 @@
+/* $RCSfile: public.h,v $
+-- $Revision: 1.9 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:55:15 $
+--
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+const int in_quit ANSI((void));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+
+#endif
diff --git a/dmake/unix/dcache.c b/dmake/unix/dcache.c
new file mode 100644
index 000000000000..e0ebf59da553
--- /dev/null
+++ b/dmake/unix/dcache.c
@@ -0,0 +1,223 @@
+/* $RCSfile: dcache.c,v $
+-- $Revision: 1.9 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:52:47 $
+--
+-- SYNOPSIS
+-- Directory cache management routines.
+--
+-- DESCRIPTION
+-- This is the code that maintains a directory cache for each directory
+-- that dmake visits. The entire directory is thus only read once and
+-- the need for performing costly 'stat' calls when performing target
+-- inference is much reduced. The improvement in performance should be
+-- significant for NFS or remote mounted file systems.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* For Borland 5.00 compile, for some reason they seem to insist on pulling
+ * in the winnt.h if __WIN32__ is defined and you include <dirent.h>. This
+ * is, in my opinion, a BUG! on Borland's part.
+ */
+#if defined(__BORLANDC__) && defined(__WIN32__)
+#undef __WIN32__
+#endif
+
+#ifdef __APPLE__
+#include <sys/types.h>
+#endif
+#include <dirent.h>
+#include "extern.h"
+#include "sysintf.h"
+
+
+typedef struct ent {
+ char *name;
+ uint32 hkey;
+ time_t mtime;
+ int isdir;
+ struct ent *next;
+} Entry, *EntryPtr;
+
+
+typedef struct mydir {
+ char *path;
+ uint32 hkey;
+ EntryPtr entries;
+ struct mydir *next;
+} DirEntry, *DirEntryPtr;
+
+static DirEntryPtr dtab[HASH_TABLE_SIZE];
+
+
+/* Stat a path using the directory cache.
+ *
+ * We build a cannonical representation of the path using either an absolute
+ * path name if that is what 'path' is or the relative path name constructed
+ * from 'path' and the present value of Pwd.
+ *
+ * The present value of Pwd then gives a directory path that we search for
+ * in our cache using a hash lookup. If the directory component is located
+ * then we search the basename component of the path and return the result of
+ * the search: 0L if the component is not in the cache and it's time stamp
+ * otherwise.
+ *
+ * If the directory is not in our cache we insert it into the cache by
+ * openning the directory and reading all of the files within. Once read
+ * then we return the result of the above search.
+ *
+ * Optionally, if force is TRUE, and we did NOT read the directory to provide
+ * the result then stat the file anyway and update the internal cache.
+ */
+
+PUBLIC time_t
+CacheStat(path, force)
+char *path;
+int force;
+{
+ struct stat stbuf;
+ DirEntryPtr dp;
+ EntryPtr ep;
+ uint32 hkey;
+ uint16 hv;
+ char *fpath;
+ char *spath;
+ char *comp;
+ char *dir;
+ char *udir; /* Hold the unchanged (DcacheRespCase) directory. */
+ int loaded=FALSE;
+
+ if (If_root_path(path))
+ spath = path;
+ else
+ spath = Build_path(Pwd,path);
+
+ fpath = DmStrDup(spath);
+
+ comp = Basename(fpath); /* Use before the Filedir() call. */
+ dir = Filedir(fpath);
+
+ /* do caching and comparing lower case if told so. */
+ if( !STOBOOL(DcacheRespCase) ) {
+ udir = DmStrDup(dir);
+ strlwr(comp);
+ strlwr(dir);
+ } else
+ udir = dir;
+
+ hv = Hash(dir,&hkey);
+
+ for(dp=dtab[hv]; dp; dp=dp->next)
+ if (hkey == dp->hkey && strcmp(dp->path,dir) == 0)
+ break;
+
+ if (!dp) {
+ /* Not cached yet, doing it now. */
+ DIR *dirp;
+ struct dirent *direntp;
+
+ if( Verbose & V_DIR_CACHE )
+ printf( "%s: Caching directory [%s]\n", Pname, dir );
+
+ /* Load the directory, we have the right hash position already */
+ loaded = TRUE;
+
+ TALLOC(dp,1,DirEntry);
+ dp->next = dtab[hv];
+ dtab[hv] = dp;
+ dp->path = DmStrDup(dir);
+ dp->hkey = hkey;
+
+ /* We use the unchanged (not potentially lowercased because of
+ * DcacheRespCase) directory as this would fail on a case sensitive
+ * file system.
+ * Note: Using case insensitive directory caching on case sensitive
+ * file systems is a *BAD* idea. If in doubt use case sensitive
+ * directory caching even on case insensitive file systems as the
+ * worst case in this szenario is that /foo/bar/ and /foo/BAR/ are
+ * cached separately (with the same content) even though they are
+ * the same directory. This would only happen if different targets
+ * using different upper/lower case spellings for the same directory
+ * and is *never* a good idea. */
+ if (Set_dir(udir) == 0) {
+ if((dirp=opendir(".")) != NIL(DIR)) {
+ while((direntp=readdir(dirp)) != NULL) {
+ TALLOC(ep,1,Entry);
+ ep->name = DmStrDup(direntp->d_name); /* basename only */
+ if( !STOBOOL(DcacheRespCase) )
+ strlwr(ep->name);
+
+ Hash(ep->name, &ep->hkey); /* This sets ep->hkey. */
+
+ ep->next = dp->entries;
+ dp->entries = ep;
+ DMSTAT(direntp->d_name,&stbuf);
+ ep->isdir = (stbuf.st_mode & S_IFDIR);
+ ep->mtime = stbuf.st_mtime;
+ }
+ closedir(dirp);
+ }
+ Set_dir(Pwd);
+ }
+ }
+
+ Hash(comp, &hkey); /* Calculate hkey. */
+
+ /* search in dp->entries for comp. */
+ if (dp) {
+ for(ep=dp->entries; ep; ep=ep->next)
+ if(hkey == ep->hkey && strcmp(ep->name,comp) == 0)
+ break;
+ }
+ else
+ ep = NULL;
+
+ if( force && !loaded) {
+ if (strlen(comp) > NameMax || DMSTAT(spath,&stbuf) != 0) {
+ /* Either file to long or the stat failed. */
+ if (strlen(comp) > NameMax)
+ Warning( "File [%s] longer than value of NAMEMAX [%d].\n\
+ Assume unix time 0.\n", comp, NameMax );
+ if(ep)
+ ep->mtime = 0L;
+ }
+ else {
+ if (!ep) {
+ TALLOC(ep,1,Entry);
+ ep->name = DmStrDup(comp);
+ if( !STOBOOL(DcacheRespCase) )
+ strlwr(ep->name);
+ Hash(ep->name, &ep->hkey);
+ ep->next = dp->entries;
+ ep->isdir = (stbuf.st_mode & S_IFDIR);
+ dp->entries = ep;
+ }
+
+ ep->mtime = stbuf.st_mtime;
+ }
+
+ if( Verbose & V_DIR_CACHE )
+ printf("%s: Updating dir cache entry for [%s], new time is %ld\n",
+ Pname, spath, ep ? ep->mtime : 0L);
+ }
+
+ if( udir != dir )
+ FREE(udir); /* Keep this before the free of fpath. */
+
+ FREE(fpath);
+ return(!ep ? (time_t)0L : ((STOBOOL(Augmake) && ep->isdir)?0L:ep->mtime));
+}
diff --git a/dmake/unix/dirbrk.c b/dmake/unix/dirbrk.c
new file mode 100644
index 000000000000..3032a58d4e96
--- /dev/null
+++ b/dmake/unix/dirbrk.c
@@ -0,0 +1,53 @@
+/* RCS $Id: dirbrk.c,v 1.4 2007-10-15 15:52:59 ihi Exp $
+--
+-- SYNOPSIS
+-- Define the directory separator string.
+--
+-- DESCRIPTION
+-- Define this string for any character that may appear in a path name
+-- and can be used as a directory separator. Also provide a function
+-- to indicate if a given path begins at the root of the file system.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+#ifdef __EMX__
+/* os2 uses /, \, and : */
+/* FIXME: The OS/2 port most probably wants to use the HAVE_DRIVE_LETTERS
+ * macro, see extern.h. */
+char* DirBrkStr = "/\\:";
+#else
+/* Unix only uses / */
+char* DirBrkStr = "/";
+#endif
+
+/*
+** Return TRUE if the name is the full specification of a path name to a file
+** starting at the root of the file system, otherwise return FALSE
+*/
+PUBLIC int
+If_root_path(name)
+char *name;
+{
+ return( strchr(DirBrkStr, *name) != NIL(char)
+#ifdef HAVE_DRIVE_LETTERS
+ || (*name && name[1] == ':' && isalpha(*name))
+#endif
+ );
+}
diff --git a/dmake/unix/linux/config.mk b/dmake/unix/linux/config.mk
new file mode 100644
index 000000000000..75bcf3c2a211
--- /dev/null
+++ b/dmake/unix/linux/config.mk
@@ -0,0 +1,27 @@
+# This is the SysV R3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC :=
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/linux/gnu/config.mk b/dmake/unix/linux/gnu/config.mk
new file mode 100644
index 000000000000..e351490a6b3d
--- /dev/null
+++ b/dmake/unix/linux/gnu/config.mk
@@ -0,0 +1,4 @@
+# This is the Linux gnu configuration file for DMAKE
+# It makes sure we include from the right place.
+#
+CFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
diff --git a/dmake/unix/linux/gnu/make.sh b/dmake/unix/linux/gnu/make.sh
new file mode 100644
index 000000000000..8e0aa400a80b
--- /dev/null
+++ b/dmake/unix/linux/gnu/make.sh
@@ -0,0 +1,193 @@
+platform=`uname -m`; export platform;
+
+mkdir objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O infer.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O infer.c
+fi
+mv infer.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O make.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O make.c
+fi
+mv make.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O stat.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O stat.c
+fi
+mv stat.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O expand.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O expand.c
+fi
+mv expand.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmstring.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmstring.c
+fi
+mv dmstring.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O hash.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O hash.c
+fi
+mv hash.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dag.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dag.c
+fi
+mv dag.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmake.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmake.c
+fi
+mv dmake.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O path.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O path.c
+fi
+mv path.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O imacs.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O imacs.c
+fi
+mv imacs.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O sysintf.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O sysintf.c
+fi
+mv sysintf.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O parse.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O parse.c
+fi
+mv parse.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O getinp.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O getinp.c
+fi
+mv getinp.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O quit.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O quit.c
+fi
+mv quit.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O state.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O state.c
+fi
+mv state.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmdump.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmdump.c
+fi
+mv dmdump.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O macparse.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O macparse.c
+fi
+mv macparse.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O rulparse.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O rulparse.c
+fi
+mv rulparse.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O percent.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O percent.c
+fi
+mv percent.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O function.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O function.c
+fi
+mv function.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/arlib.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/arlib.c
+fi
+mv arlib.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dirbrk.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dirbrk.c
+fi
+mv dirbrk.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/rmprq.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/rmprq.c
+fi
+mv rmprq.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/ruletab.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/ruletab.c
+fi
+mv ruletab.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/runargv.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/runargv.c
+fi
+mv runargv.o objects
+
+if test $platform = sparc -o $platform = sparc64; then
+gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dcache.c
+else
+gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dcache.c
+fi
+mv dcache.o objects
+
+gcc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o
+cp unix/linux/gnu/template.mk startup/config.mk
diff --git a/dmake/unix/linux/gnu/public.h b/dmake/unix/linux/gnu/public.h
new file mode 100644
index 000000000000..8de24957f763
--- /dev/null
+++ b/dmake/unix/linux/gnu/public.h
@@ -0,0 +1,172 @@
+/* $RCSfile: public.h,v $
+-- $Revision: 1.9 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:55:29 $
+--
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+const int in_quit ANSI((void));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+
+#endif
diff --git a/dmake/unix/linux/gnu/template.mk b/dmake/unix/linux/gnu/template.mk
new file mode 100644
index 000000000000..a0bcef64097b
--- /dev/null
+++ b/dmake/unix/linux/gnu/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= linux
+ OSENVIRONMENT *:= gnu
diff --git a/dmake/unix/macosx/config.mk b/dmake/unix/macosx/config.mk
new file mode 100644
index 000000000000..75bcf3c2a211
--- /dev/null
+++ b/dmake/unix/macosx/config.mk
@@ -0,0 +1,27 @@
+# This is the SysV R3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC :=
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/macosx/gnu/config.mk b/dmake/unix/macosx/gnu/config.mk
new file mode 100644
index 000000000000..e351490a6b3d
--- /dev/null
+++ b/dmake/unix/macosx/gnu/config.mk
@@ -0,0 +1,4 @@
+# This is the Linux gnu configuration file for DMAKE
+# It makes sure we include from the right place.
+#
+CFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
diff --git a/dmake/unix/macosx/gnu/make.sh b/dmake/unix/macosx/gnu/make.sh
new file mode 100644
index 000000000000..65929e93026a
--- /dev/null
+++ b/dmake/unix/macosx/gnu/make.sh
@@ -0,0 +1,63 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/macosx/tempnam.c
+mv tempnam.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \
+objects/dcache.o objects/tempnam.o
+cp unix/macosx/gnu/template.mk startup/config.mk
diff --git a/dmake/unix/macosx/gnu/public.h b/dmake/unix/macosx/gnu/public.h
new file mode 100644
index 000000000000..e96dbb9dd34a
--- /dev/null
+++ b/dmake/unix/macosx/gnu/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.8 2007-10-15 15:55:41 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+PUBLIC int main ANSI((int argc, char **argv));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/macosx/gnu/template.mk b/dmake/unix/macosx/gnu/template.mk
new file mode 100644
index 000000000000..672878dfa095
--- /dev/null
+++ b/dmake/unix/macosx/gnu/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= macosx
+ OSENVIRONMENT *:= gnu
diff --git a/dmake/unix/macosx/tempnam.c b/dmake/unix/macosx/tempnam.c
new file mode 100644
index 000000000000..fc9eec04fb52
--- /dev/null
+++ b/dmake/unix/macosx/tempnam.c
@@ -0,0 +1,102 @@
+/* RCS $Id: tempnam.c,v 1.1 2001-02-23 03:44:30 pluby Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+char *
+dtempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", getpid() );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/unix/os2/public.h b/dmake/unix/os2/public.h
new file mode 100644
index 000000000000..845a16a2c80f
--- /dev/null
+++ b/dmake/unix/os2/public.h
@@ -0,0 +1,172 @@
+/* $RCSfile: public.h,v $
+-- $Revision: 1.2 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:55:51 $
+--
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+const int in_quit ANSI((void));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+
+#endif
diff --git a/dmake/unix/rmprq.c b/dmake/unix/rmprq.c
new file mode 100644
index 000000000000..0144e18c2427
--- /dev/null
+++ b/dmake/unix/rmprq.c
@@ -0,0 +1,121 @@
+/* $RCSfile: rmprq.c,v $
+-- $Revision: 1.5 $
+-- last change: $Author: obo $ $Date: 2007-06-12 06:09:05 $
+--
+-- SYNOPSIS
+-- Remove prerequisites code.
+--
+-- DESCRIPTION
+-- This code is different for DOS and for UNIX and parallel make
+-- architectures since the parallel case requires the rm's to be
+-- run in parallel, whereas DOS guarantees to run them sequentially.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include "extern.h"
+
+PUBLIC void
+Remove_prq( tcp )/*
+===================
+ Removable targets (ie. an inferred intermediate node) are removed
+ by this function by running Make() on the special target .REMOVE
+ (pointed to by tcp).
+ As this function can be called from within another Make() (for example
+ like this:
+ Make()->Exec_commands()->Do_cmnd()->runargv()->..->_finished_child()
+ ->Update_time_stamp()->Remove_prq() )
+ it is necessary to store and restore the dynamic macros when Make()
+ is finished.
+
+ FIXME: Another potential problem is that while building .REMOVE another
+ previously started target finishes and from _finished_child() calls
+ Remove_prq() again. This will delete the dynamic macros and possibly
+ clear/reset the prerequisites of the previous .REMOVE target.
+*/
+CELLPTR tcp;
+{
+ static LINKPTR rlp = NIL(LINK);
+ static int flag = 0;
+ static HASHPTR m_at, m_q, m_b, m_g, m_l, m_bb, m_up;
+ char *m_at_s, *m_g_s, *m_q_s, *m_b_s, *m_l_s, *m_bb_s, *m_up_s;
+ LINKPTR tlp;
+
+ /* Unset F_MADE and F_VISITED. */
+ tcp->ce_flag &= ~(F_MADE|F_VISITED);
+ tcp->ce_time = 0L;
+
+ /* The idea seems to be to create a target that is used to remove
+ * intermediate prerequisites. Why add something to the "CeMeToo(tlp)"
+ * list? I don't understand this yet.
+ * FIXME! Either comment on what is going on or fix the code. */
+ for( tlp=rlp; tlp !=NIL(LINK); tlp=tlp->cl_next )
+ /* Find first target that has F_VISITED not set or F_MADE set,
+ * i.e. it is not currently made or already done. */
+ if( (tlp->cl_prq->ce_flag & (F_VISITED|F_MADE)) != F_VISITED )
+ break;
+
+ if( tlp == NIL(LINK) ) {
+ TALLOC(tlp, 1, LINK);
+ TALLOC(tlp->cl_prq, 1, CELL);
+ tlp->cl_next = rlp;
+ rlp = tlp;
+ }
+
+ *tlp->cl_prq = *tcp;
+
+ /* We save the dynamic macro values here, as it is possible that the
+ * .REMOVE recipe is getting executed for a target while some other target
+ * is in the middle of executing it's list of recipe lines, in this case
+ * the values of $@ etc, must be preserved so that when we return to
+ * complete the other recipe we must make certain that the values of it's
+ * dynamic macros are unmodified. */
+
+ if( !flag ) {
+ /* Do the getting of the macros only once. */
+ flag = 1;
+ m_at = Get_name("@", Macs, TRUE);
+ m_g = Get_name(">", Macs, TRUE);
+ m_q = Get_name("?", Macs, TRUE);
+ m_b = Get_name("<", Macs, TRUE);
+ m_l = Get_name("&", Macs, TRUE);
+ m_bb = Get_name("*", Macs, TRUE);
+ m_up = Get_name("^", Macs, TRUE);
+ }
+
+ m_at_s = m_at->ht_value; m_at->ht_value = NIL(char);
+ m_g_s = m_g->ht_value; m_g->ht_value = NIL(char);
+ m_q_s = m_q->ht_value; m_q->ht_value = NIL(char);
+ m_b_s = m_b->ht_value; m_b->ht_value = NIL(char);
+ m_l_s = m_l->ht_value; m_l->ht_value = NIL(char);
+ m_bb_s = m_bb->ht_value; m_bb->ht_value = NIL(char);
+ m_up_s = m_up->ht_value; m_up->ht_value = NIL(char);
+
+ Make( tlp->cl_prq, tcp );
+ if( tlp->cl_prq->ce_dir ){
+ FREE(tlp->cl_prq->ce_dir);
+ tlp->cl_prq->ce_dir=NIL(char);
+ }
+
+ m_at->ht_value = m_at_s;
+ m_g->ht_value = m_g_s;
+ m_q->ht_value = m_q_s;
+ m_b->ht_value = m_b_s;
+ m_l->ht_value = m_l_s;
+ m_bb->ht_value = m_bb_s;
+ m_up->ht_value = m_up_s;
+}
diff --git a/dmake/unix/ruletab.c b/dmake/unix/ruletab.c
new file mode 100644
index 000000000000..d815a4f15d18
--- /dev/null
+++ b/dmake/unix/ruletab.c
@@ -0,0 +1,44 @@
+/* $RCSfile: ruletab.c,v $
+-- $Revision: 1.9 $
+-- last change: $Author: ihi $ $Date: 2007-10-15 15:53:13 $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+static char *_rules[] = {
+ "MAXPROCESSLIMIT := 64",
+ "MAXLINELENGTH := 32766",
+#include "dmakeroot.h"
+ ".IMPORT .IGNORE: DMAKEROOT",
+ ".MAKEFILES : makefile.mk Makefile makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ 0 };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
diff --git a/dmake/unix/runargv.c b/dmake/unix/runargv.c
new file mode 100644
index 000000000000..4be342bbb273
--- /dev/null
+++ b/dmake/unix/runargv.c
@@ -0,0 +1,1101 @@
+/* $RCSfile: runargv.c,v $
+-- $Revision: 1.14 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:39:41 $
+--
+-- SYNOPSIS
+-- Invoke a sub process.
+--
+-- DESCRIPTION
+-- Use the standard methods of executing a sub process.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+/*
+This file (runargv.c) provides all the parallel process handling routines
+for dmake on unix like operating systems. The following text briefly
+describes the process flow.
+
+Exec_commands() [make.c] builds the recipes associated to the given target.
+ They are build sequentially in a loop that calls Do_cmnd() for each of them.
+
+Do_cmnd() [sysintf.c] feeds the given command or command group to runargv().
+
+The following flowchart decripes the process flow starting with runargv,
+descriptions for each of the functions are following.
+
+ +--------------------------------+
+ | runargv | <+
+ +--------------------------------+ |
+ | ^ |
+ | | returns if |
+ | calls | wfc is false |
+ v | |
+ +--------------------------------+ |
+ | _add_child | |
+ +--------------------------------+ |
+ | ^ |
+ | calls if | | if another process
+ | wfc is true | returns | is queued:
+ v | | recursive call
+ +--------------------------------+ |
+ | Wait_for_Child | |
+ +--------------------------------+ |
+ | ^ |
+ | | process queue |
+ | calls | is empty |
+ v | |
+ +--------------------------------+ |
+ | _finished_child | -+
+ +--------------------------------+
+
+
+
+runargv() [unix/runargv] The runargv function manages up to MAXPROCESS
+ process queues (_procs[i]) for parallel process execution and hands
+ the actual commands down to the operating system.
+ Each of the process queues handles the sequential execution of commands
+ that belong to that process queue. Usually this means the sequential
+ execution of the recipe lines that belong to one target.
+ Even in non parallel builds (MAXPROCESS==1) child processes are
+ created and handled.
+ If recipes for a target are currently running attach them to the
+ corresponding process queue (_procs[i]) of that target and return.
+ If the maximum number (MAXPROCESS) of concurrently running queues is
+ reached use Wait_for_child(?, -1) to wait for a process queue to become
+ available.
+ New child processes are started using:
+ spawn: posix_spawnp (POSIX) or spawnvp (cygwin).
+ fork/execvp: Create a client process with fork and run the command
+ with execvp.
+ The parent calls _add_child() to track the child.
+
+_add_child(..., wfc) [unix/runargv] creates (or reuses) a process queue
+ and enters the child's parameters.
+ If wfc (wait for completion) is TRUE the function calls
+ Wait_for_child to wait for the whole process queue to be finished.
+
+Wait_for_child(abort_flg, pqid) [unix/runargv] waits either for the current
+ process from process queue pqid to finish or if the W_WFC attribute is
+ set for all entries of that process queue (recursively) to finish.
+ All finished processes are handled by calling _finished_child() for each
+ of them.
+ If pqid == -1 wait for the next process to finish but honor the A_WFC
+ attribute of that process (queue) and wait for the whole queue if needed.
+ If abort_flg is TRUE no further processes will be added to any process
+ queue.
+ If a pqid is given but a process from another process queue finishes
+ first that process is handled and A_WFC is also honored.
+ All finished processes are processed until the process from the given pqid
+ is reached or gone (might have been handled while finishing another process
+ queue).
+
+_finished_child(pid, status) [unix/runargv] handles the finished child. If
+ there are more commands in the corresponding process queue start the next
+ with runargv().
+*/
+
+#include <signal.h>
+
+#include "extern.h"
+
+#ifdef HAVE_WAIT_H
+# include <wait.h>
+#else
+# ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+# endif
+#endif
+
+#if HAVE_SPAWN_H && ENABLE_SPAWN
+# include <spawn.h>
+#endif
+
+#if __CYGWIN__ && ENABLE_SPAWN
+# include <process.h>
+#endif
+
+#ifdef __EMX__
+# include <process.h>
+#define _P_NOWAIT P_NOWAIT
+#endif
+
+#include "sysintf.h"
+#if HAVE_ERRNO_H
+# include <errno.h>
+#else
+ extern int errno;
+#endif
+
+typedef struct prp {
+ char *prp_cmd;
+ int prp_group;
+ t_attr prp_attr;
+ int prp_last;
+ struct prp *prp_next;
+} RCP, *RCPPTR;
+
+#if defined(USE_CREATEPROCESS)
+ /* MS's HANDLE is basically a (void *) (winnt.h). */
+typedef HANDLE DMHANDLE;
+#else
+typedef int DMHANDLE;
+#endif
+
+typedef struct pr {
+ int pr_valid;
+ DMHANDLE pr_pid;
+ DMHANDLE pr_tid;
+ CELLPTR pr_target;
+ int pr_ignore;
+ int pr_last;
+ int pr_wfc;
+ RCPPTR pr_recipe;
+ RCPPTR pr_recipe_end;
+ char *pr_dir;
+} PR;
+
+typedef struct tpid {
+ DMHANDLE pid;
+ DMHANDLE tid;
+} TPID;
+
+const TPID DMNOPID = { (DMHANDLE)-1, (DMHANDLE)0 };
+
+static PR *_procs = NIL(PR); /* Array to hold concurrent processes. */
+static int _procs_size = 0; /* Savegard to find MAXPROCESS changes. */
+static int _proc_cnt = 0; /* Number of running processes. */
+static int _abort_flg= FALSE;
+static int _use_i = -1;
+#if defined(USE_CREATEPROCESS)
+static HANDLE *_wpList = NIL(HANDLE); /* Array to hold pids to wait for. */
+#endif
+
+static int _add_child ANSI((TPID, CELLPTR, int, int, int));
+static void _attach_cmd ANSI((char *, int, CELLPTR, t_attr, int));
+static void _finished_child ANSI((DMHANDLE, int));
+static int _running ANSI((CELLPTR));
+
+/* Machine/OS dependent helpers. */
+static int dmwaitnext ANSI((DMHANDLE *, int *));
+static int dmwaitpid ANSI((int, DMHANDLE *, int *));
+
+#if defined( USE_SPAWN )
+
+int terrno; /* Temporarily store errno. */
+
+static TPID dmspawn ANSI((char **));
+
+static TPID
+dmspawn( argv )
+ char **argv;
+{
+ TPID pid;
+
+ /* No error output is done here as stdout/stderr might be redirected. */
+#if defined( __CYGWIN__) || defined( __EMX__)
+ pid.pid = spawnvp(_P_NOWAIT, argv[0], (const char**) argv);
+ pid.tid = 0;
+#elif defined(USE_CREATEPROCESS)
+ static STARTUPINFO si;
+ static int initSTARTUPINFO = FALSE;
+ PROCESS_INFORMATION pi;
+
+ /* si can be reused. */
+ if( initSTARTUPINFO == FALSE ) {
+ initSTARTUPINFO = TRUE;
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ }
+ ZeroMemory( &pi, sizeof(pi) );
+
+ /* Start the child process. CreateProcess() parameters:
+ * No module name (use command line).
+ * Command line. This fails if the path to the program contains spaces.
+ * Process handle not inheritable.
+ * Thread handle not inheritable.
+ * Set handle inheritance (stdout, stderr, etc.) to TRUE.
+ * No creation flags.
+ * Use parent's environment block.
+ * Use parent's starting directory.
+ * Pointer to STARTUPINFO structure.
+ * Pointer to PROCESS_INFORMATION structure. */
+ if( CreateProcess(NULL, argv[0], NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi) ) {
+ pid.pid = pi.hProcess;
+ pid.tid = pi.hThread;
+ } else {
+ fprintf(stderr, "CreateProcess failed (%d).\n", GetLastError() );
+ pid.pid = (DMHANDLE)-1;
+ }
+#else /* Non cygwin, OS/2, MinGW and MSC */
+ int tpid;
+ if (posix_spawnp (&tpid, argv[0], NULL, NULL, argv, (char *)NULL))
+ tpid = -1; /* posix_spawn failed */
+
+ pid.pid = tpid;
+ pid.tid = 0;
+#endif /* __CYGWIN__ */
+ return pid;
+}
+
+#endif /* USE_SPAWN */
+
+static int
+dmwaitnext( wid, status )
+ DMHANDLE *wid; /* Id we waited for. */
+ int *status; /* status of the finished process. */
+ /* return 1 if a process finished, -1 if there
+ * was nothing to wait for (ECHILD) and -2 for other errors. */
+{
+
+#if !defined(USE_CREATEPROCESS)
+ /* Here might be the culprit for the famous OOo build hang. If
+ * cygwin manages to "loose" a process and none else is left the
+ * wait() will wait forever. */
+ *wid = wait(status);
+
+ /* If ECHILD is set from waitpid/wait then no child was left. */
+ if( *wid == -1 ) {
+ fprintf(stderr, "%s: Internal Error: wait() failed: %d - %s\n",
+ Pname, errno, strerror(errno) );
+ if(errno != ECHILD) {
+ /* Wait was interrupted or a child was terminated (SIGCHLD) */
+ return -2;
+ } else {
+ return -1;
+ }
+ }
+#else
+ DWORD pEvent;
+ DWORD dwExitCode;
+ int i;
+ int numProc = 0;
+
+ *status = 0;
+
+ /* Create a list of possible objects to wait for. */
+ for( i=0; i<Max_proc; i++ ) {
+ if(_procs[i].pr_valid) {
+ _wpList[numProc++] = _procs[i].pr_pid;
+ }
+ }
+ if( numProc == 0 ) {
+ fprintf(stderr, "%s: Internal Error: dmwaitnext() failed: "
+ "Nothing to wait for.\n", Pname );
+ return -1;
+ }
+
+ /* Wait ... */
+ /* number of objects in array, array of objects,
+ * wait for any object, wait for the next child to finish */
+ pEvent = WaitForMultipleObjects( numProc, _wpList, FALSE, INFINITE);
+
+ if( pEvent >= 0 && pEvent < WAIT_OBJECT_0 + numProc ) {
+ *wid = _wpList[pEvent - WAIT_OBJECT_0];
+ for( i=0; i<Max_proc && _procs[i].pr_pid != *wid; i++ )
+ ;
+ if( i == Max_proc )
+ Fatal("Internal Error: Process not in pq !");
+
+ GetExitCodeProcess(*wid, &dwExitCode);
+ if(dwExitCode == STILL_ACTIVE) {
+ /* Process did not terminate -> force it, with exit code 1. */
+ TerminateProcess(*wid, 1);
+ dwExitCode = 1;
+ fprintf(stderr, "%s: Internal Error: Process still running - "
+ "terminate it!\n", Pname );
+ }
+
+ /* Close process and thread handles. */
+ CloseHandle( *wid );
+ CloseHandle( _procs[i].pr_tid );
+ *status = dwExitCode;
+ }
+ else {
+ int err = GetLastError();
+ LPVOID lpMsgBuf;
+
+ FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL );
+
+ fprintf(stderr, "%s: Internal Error: WaitForMultipleObjects() (%d) failed:"
+ " %d - %s\n", Pname, numProc, err, lpMsgBuf);
+ LocalFree(lpMsgBuf);
+
+ /* No way to identify something comparable to ECHILD, always return -2.*/
+ return -2;
+ }
+
+#endif
+ return 1;
+}
+
+
+static int
+dmwaitpid( pqid, wid, status )
+ int pqid; /* Process queue to wait for. */
+ DMHANDLE *wid; /* Id we waited for. */
+ int *status; /* status of the finished process. */
+ /* return 1 if the process finished, 0 if it didn't finish yet, -1 if there
+ * was nothing to wait for (ECHILD) and -2 for other errors. */
+{
+
+#if !defined(USE_CREATEPROCESS)
+ *wid = waitpid(_procs[pqid].pr_pid, status, WNOHANG);
+
+ /* Process still running. */
+ if( *wid == 0 ) {
+ *status = 0;
+ return 0;
+ }
+ /* If ECHILD is set from waitpid/wait then no child was left. */
+ if( *wid == -1 ) {
+ fprintf(stderr, "%s: Internal Error: waitpid() failed: %d - %s\n",
+ Pname, errno, strerror(errno) );
+ if(errno != ECHILD) {
+ /* Wait was interrupted or a child was terminated (SIGCHLD) */
+ return -2;
+ } else {
+ return -1;
+ }
+ }
+#else
+ DWORD pEvent;
+ DWORD dwExitCode;
+
+ *wid = _procs[pqid].pr_pid;
+ *status = 0;
+
+ /* Wait ... (Check status and return) */
+ pEvent = WaitForSingleObject(*wid, 0);
+
+ if( pEvent == WAIT_OBJECT_0 ) {
+ GetExitCodeProcess(*wid, &dwExitCode);
+ if(dwExitCode == STILL_ACTIVE) {
+ /* Process did not terminate -> force it, with exit code 1. */
+ TerminateProcess(*wid, 1);
+ dwExitCode = 1;
+ fprintf(stderr, "%s: Internal Error: Process still running - "
+ "terminate it!\n", Pname );
+ }
+
+ /* Close process and thread handles. */
+ CloseHandle( *wid );
+ CloseHandle( _procs[pqid].pr_tid );
+ *status = dwExitCode;
+ }
+ else if( pEvent == WAIT_TIMEOUT ) {
+ return 0;
+ }
+ else {
+ int err = GetLastError();
+ LPVOID lpMsgBuf;
+
+ FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL );
+
+ fprintf(stderr, "%s: Internal Error: WaitForSingleObject() failed:"
+ " %d - %s\n", Pname, err, lpMsgBuf);
+ LocalFree(lpMsgBuf);
+
+ /* No way to identify something comparable to ECHILD, always return -2.*/
+ return -2;
+ }
+#endif
+
+ return 1;
+}
+
+
+#if ! HAVE_STRERROR
+static char *
+private_strerror (errnum)
+ int errnum;
+{
+#ifndef __APPLE__
+# if defined(arm32) || defined(linux) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ extern const char * const sys_errlist[];
+# else
+ extern char *sys_errlist[];
+# endif
+#endif
+ extern int sys_nerr;
+
+ if (errnum > 0 && errnum <= sys_nerr)
+ return sys_errlist[errnum];
+ return "Unknown system error";
+}
+#define strerror private_strerror
+#endif /* HAVE_STRERROR */
+
+PUBLIC int
+runargv(target, group, last, cmnd_attr, cmd)/*
+==============================================
+ Execute the command given by cmd.
+
+ Return 0 if the command executed and finished or
+ 1 if the command started and is running.
+ */
+CELLPTR target;
+int group;
+int last;
+t_attr cmnd_attr; /* Attributes for current cmnd. */
+char **cmd; /* Simulate a reference to *cmd. */
+{
+ int ignore = (cmnd_attr & A_IGNORE)!= 0; /* Ignore errors ('-'). */
+ int shell = (cmnd_attr & A_SHELL) != 0; /* Use shell ('+'). */
+ int mute = (cmnd_attr & A_MUTE) != 0; /* Mute output ('@@'). */
+ int wfc = (cmnd_attr & A_WFC) != 0; /* Wait for completion. */
+
+ TPID pid;
+ int st_pq = 0; /* Current _exec_shell target process index */
+ char *tcmd = *cmd; /* For saver/easier string arithmetic on *cmd. */
+ char **argv;
+
+ int old_stdout = -1; /* For shell escapes and */
+ int old_stderr = -1; /* @@-recipe silencing. */
+ int internal = 0; /* Used to indicate internal command. */
+
+ DB_ENTER( "runargv" );
+
+ /* Special handling for the shell function macro is required. If the
+ * currend command is called as part of a shell escape in a recipe make
+ * sure that all previous recipe lines of this target have finished. */
+ if( Is_exec_shell ) {
+ if( (st_pq = _running(Shell_exec_target)) != -1 ) {
+ RCPPTR rp;
+ /* Add WFC to _procs[st_pq]. */
+ _procs[st_pq].pr_wfc = TRUE;
+ /* Set also the A_WFC flag in the recipe attributes. */
+ for( rp = _procs[st_pq].pr_recipe ; rp != NIL(RCP); rp = rp->prp_next )
+ rp->prp_attr |= A_WFC;
+
+ Wait_for_child(FALSE, st_pq);
+ }
+ } else {
+ if( _running(target) != -1 /*&& Max_proc != 1*/ ) {
+ /* The command will be executed when the previous recipe
+ * line completes. */
+ _attach_cmd( *cmd, group, target, cmnd_attr, last );
+ DB_RETURN( 1 );
+ }
+ }
+
+ /* If all process array entries are used wait until we get a free
+ * slot. For Max_proc == 1 this forces sequential execution. */
+ while( _proc_cnt == Max_proc ) {
+ Wait_for_child(FALSE, -1);
+ }
+
+ /* Return immediately for empty line or noop command. */
+ if ( !*tcmd || /* empty line */
+ ( strncmp(tcmd, "noop", 4) == 0 && /* noop command */
+ (iswhite(tcmd[4]) || tcmd[4] == '\0')) ) {
+ internal = 1;
+ }
+ else if( !shell && /* internal echo only if not in shell */
+ strncmp(tcmd, "echo", 4) == 0 &&
+ (iswhite(tcmd[4]) || tcmd[4] == '\0') ) {
+ int nl = 1;
+
+ tcmd = tcmd+4;
+ while( iswhite(*tcmd) ) ++tcmd;
+ if ( strncmp(tcmd,"-n",2 ) == 0) {
+ nl = 0;
+ tcmd = tcmd+2;
+ while( iswhite(*tcmd) ) ++tcmd;
+ }
+
+ /* redirect output for _exec_shell / @@-recipes. */
+ if( Is_exec_shell ) {
+ /* Add error checking? */
+ old_stdout = dup(1);
+ dup2( fileno(stdout_redir), 1 );
+ }
+ if( mute ) {
+ old_stderr = dup(2);
+ dup2( zerofd, 2 );
+
+ if( !Is_exec_shell ) {
+ old_stdout = dup(1);
+ dup2( zerofd, 1 );
+ }
+ }
+
+ printf("%s%s", tcmd, nl ? "\n" : "");
+ fflush(stdout);
+
+ /* Restore stdout/stderr if needed. */
+ if( old_stdout != -1 ) {
+ dup2(old_stdout, 1);
+ close(old_stdout);
+ if( old_stderr != -1 ) {
+ dup2(old_stderr, 2);
+ close(old_stderr);
+ }
+ }
+
+ internal = 1;
+ }
+ if ( internal ) {
+ /* Use _add_child() / _finished_child() with internal command. */
+ int cur_proc = _add_child(DMNOPID, target, ignore, last, FALSE);
+ _finished_child( (DMHANDLE)-cur_proc, 0 );
+ DB_RETURN( 0 );
+ }
+
+ /* Pack cmd in argument vector. */
+ argv = Pack_argv( group, shell, cmd );
+
+ /* Really spawn or fork a child. */
+#if defined( USE_SPAWN )
+ /* As no other childs are started while the output is redirected this
+ * is save. */
+ if( Is_exec_shell ) {
+ /* Add error checking? */
+ old_stdout = dup(1);
+ dup2( fileno(stdout_redir), 1 );
+ }
+ if( mute ) {
+ old_stderr = dup(2);
+ dup2( zerofd, 2 );
+
+ if( !Is_exec_shell ) {
+ old_stdout = dup(1);
+ dup2( zerofd, 1 );
+ }
+ }
+
+ pid = dmspawn( argv );
+ terrno = errno;
+
+ if( old_stdout != -1 ) {
+ dup2(old_stdout, 1);
+ close(old_stdout);
+ if( old_stderr != -1 ) {
+ dup2(old_stderr, 2);
+ close(old_stderr);
+ }
+ }
+ if(pid.pid == (DMHANDLE)-1) {
+ /* spawn failed */
+ int cur_proc;
+
+ fprintf(stderr, "%s: Error executing '%s': %s",
+ Pname, argv[0], strerror(terrno) );
+ if( ignore||Continue ) {
+ fprintf(stderr, " (Ignored)" );
+ }
+ fprintf(stderr, "\n");
+
+ /* Use _add_child() / _finished_child() to treat the failure
+ * gracefully, if so requested. */
+ cur_proc = _add_child(DMNOPID, target, ignore, last, FALSE);
+ _finished_child((DMHANDLE)cur_proc, SIGTERM);
+
+ /* _finished_child() aborts dmake if we are not told to
+ * ignore errors. If we reach the this point return 0 as
+ * errors are obviously ignored and indicate that the process
+ * finished. */
+ DB_RETURN( 0 );
+ } else {
+ _add_child(pid, target, ignore, last, wfc);
+ }
+#else /* USE_SPAWN */
+
+ fflush(stdout);
+ switch( pid.pid = fork() ){
+
+ case -1: /* fork failed */
+ Fatal("fork failed: %s: %s", argv[0], strerror( errno ));
+
+ case 0: /* child */
+ /* redirect output for _exec_shell / @@-recipes. */
+ if( Is_exec_shell ) {
+ /* Add error checking? */
+ old_stdout = dup(1);
+ dup2( fileno(stdout_redir), 1 );
+ }
+ if( mute ) {
+ old_stderr = dup(2);
+ dup2( zerofd, 2 );
+
+ if( !Is_exec_shell ) {
+ old_stdout = dup(1);
+ dup2( zerofd, 1 );
+ }
+ }
+ execvp(argv[0], argv);
+ /* restoring output to catch potential error output if execvp()
+ * failed. */
+ if( old_stdout != -1 ) {
+ dup2(old_stdout, 1);
+ close(old_stdout);
+ if( old_stderr != -1 ) {
+ dup2(old_stderr, 2);
+ close(old_stderr);
+ }
+ }
+ fprintf(stderr, "%s: Error executing '%s': %s",
+ Pname, argv[0], strerror(errno) );
+ if( ignore||Continue ) {
+ fprintf(stderr, " (Ignored)" );
+ }
+ fprintf(stderr, "\n");
+
+ kill(getpid(), SIGTERM);
+ /*NOTREACHED*/
+ Fatal("\nInternal Error - kill could't kill child %d.\n", getpid());
+
+ default: /* parent */
+ _add_child(pid, target, ignore, last, wfc);
+ }
+
+#endif /* USE_SPAWN */
+
+ /* If wfc is set this command must have been finished. */
+ if( wfc ) {
+ DB_RETURN( 0 );
+ } else {
+ DB_RETURN( 1 );
+ }
+}
+
+
+PUBLIC int
+Wait_for_child( abort_flg, pqid )/*
+===================================
+ Wait for the next processes from process queue pqid to finish. All finished
+ processes are handled by calling _finished_child() for each of them.
+ If pqid == -1 wait for the next process to finish.
+ If abort_flg is TRUE no further processes will be added to any process
+ queue. The A_WFC attribute is honored, see the documentation at the top
+ of this file.
+ Return 0 if we successfully waited for a process and -1 if there was nothing
+ to wait for.
+*/
+int abort_flg;
+int pqid;
+{
+ DMHANDLE pid;
+ DMHANDLE wid;
+ int status;
+ int waitret; /* return value of the dmwait functions. */
+ /* Never wait for internal commands. */
+ int waitchild;
+ int is_exec_shell_status = Is_exec_shell;
+
+ if( !_procs ) {
+ /* No process was ever created, i.e. _procs is not yet initialized.
+ * Nothing to wait for. */
+ return -1;
+ }
+
+ if( pqid > Max_proc ) Fatal("Internal Error: pqid > Max_proc !");
+
+ if( pqid == -1 ) {
+ /* Check if there is something to wait for. */
+ int i;
+ for( i=0; i<Max_proc && !_procs[i].pr_valid; i++ )
+ ;
+ if( i == Max_proc )
+ return(-1);
+
+ pid = (DMHANDLE)-1;
+ waitchild = FALSE;
+ }
+ else {
+ /* Check if pqid is active. */
+ if( !_procs[pqid].pr_valid ) {
+ /* Make this an error? */
+ Warning("Internal Warning: pqid is not active!?");
+ return(-1);
+ }
+
+ pid = _procs[pqid].pr_pid;
+ waitchild = _procs[pqid].pr_wfc;
+ }
+
+
+ /* It is impossible that processes that were started from _exec_shell
+ * have follow-up commands in its process entry. Unset Is_exec_shell
+ * to prevent piping of child processes that are started from the
+ * _finished_child subroutine and reset to its original value when
+ * leaving this function. */
+ Is_exec_shell = FALSE;
+
+ do {
+ /* Wait for the next process to finish. */
+ if( (pid != (DMHANDLE)-1) && (waitret = dmwaitpid(pqid, &wid, &status)) != 0 ) {
+ /* if dmwaitpid returns 0 this means that pid didn't finish yet.
+ * In this case just handle the next finished process in the
+ * following "else". If an error is returned (waitret < 0) the else
+ * clause is not evaluated and the error is handled in the following
+ * lines. If a process was waited for (waitret == 0) also proceed to
+ * the following lines. */
+ ;
+ }
+ else {
+ waitret = dmwaitnext(&wid, &status);
+ /* If we get an error tell the error handling routine below that we
+ * were not waiting for a specific pid. */
+ if( waitret < 0 ) {
+ pid = (DMHANDLE)-1;
+ }
+ }
+
+ /* If ECHILD is set from waitpid/wait then no child was left. */
+ if( waitret < 0 ) {
+ if(waitret == -2) {
+ /* Wait was interrupted or a child was terminated (SIGCHLD) */
+ if ( in_quit() ) {
+ /* We're already terminating, just continue. */
+ return 0;
+ } else {
+ Fatal( "dmake was interrupted or a child terminated. "
+ "Stopping all childs ..." );
+ }
+ } else {
+ /* The child we were waiting for is missing or no child is
+ * left to wait for. */
+ if( pid != (DMHANDLE)-1 ) {
+ /* If we know the pid disable the pq entry. */
+ if( _procs[pqid].pr_valid ) {
+ _procs[pqid].pr_valid = 0;
+ _procs[pqid].pr_recipe = NIL(RCP);
+ _proc_cnt--;
+ }
+ } else {
+ /* otherwise disable all remaining pq's. As we don't know
+ * which pid failed there is no gracefull way to terminate. */
+ int i;
+ for( i=0; i<Max_proc; i++ ) {
+ _procs[i].pr_valid = 0;
+ _procs[i].pr_recipe = NIL(RCP);
+ }
+ _proc_cnt = 0;
+ }
+ /* The pid we were waiting for or any of the remaining childs
+ * (pid == -1) is missing. This should not happen and means
+ * that the process got lost or was treated elsewhere. */
+ Fatal( "Internal Error: Child is missing but still listed in _procs[x] %d: %s\n"
+ "\nTemporary or .ERRREMOVE targets might not have been removed!\n",
+ errno, strerror( errno ) );
+ }
+ }
+
+ _abort_flg = abort_flg;
+ _finished_child(wid, status);
+ _abort_flg = FALSE;
+ if( waitchild ) {
+ /* If pid != wid the process we're waiting for might have been
+ * finished from a "Wait_for_child(FALSE, -1)" call from
+ * _finished_child() -> runargv(). */
+ if( pid != wid ) {
+ if( !_procs[pqid].pr_valid || _procs[pqid].pr_pid != pid ) {
+ /* Someone finished pid, no need to wait further. */
+ waitchild = FALSE;
+ }
+ }
+ else
+ /* We finished pid, no need to wait further. */
+ waitchild = FALSE;
+ }
+ }
+ while( waitchild );
+
+ Is_exec_shell = is_exec_shell_status;
+ return(0);
+}
+
+
+PUBLIC void
+Clean_up_processes()
+{
+ register int i;
+ int ret;
+
+ if( _procs != NIL(PR) ) {
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid ) {
+#if !defined(USE_CREATEPROCESS)
+ if( (ret = kill(_procs[i].pr_pid, SIGTERM)) ) {
+ fprintf(stderr, "Killing of pid %d from pq[%d] failed with: %s - %d ret: %d\n",
+ _procs[i].pr_pid, i,
+ strerror(errno), SIGTERM, ret );
+ }
+#else
+ TerminateProcess(_procs[i].pr_pid, 1);
+#endif
+ }
+ }
+}
+
+
+static int
+_add_child( pid, target, ignore, last, wfc )/*
+==============================================
+ Creates/amend a process queue entry and enters the child parameters.
+ The pid == -1 represents an internal command and the function returns
+ the used process array index. For non-internal commands the function
+ returns -1.
+ If wfc (wait for completion) is TRUE the function calls
+ Wait_for_child to wait for the whole process queue to be finished.
+*/
+TPID pid;
+CELLPTR target;
+int ignore;
+int last;
+int wfc;
+{
+ register int i;
+ register PR *pp;
+
+ /* Never change MAXPROCESS after _procs is allocated. */
+ if( _procs_size != Max_proc ) {
+ /* If procs was never initialize this is OK, do it now. */
+ if( _procs == NIL(PR) ) {
+ _procs_size = Max_proc;
+ TALLOC( _procs, Max_proc, PR );
+#if defined(USE_CREATEPROCESS)
+ TALLOC( _wpList, Max_proc, HANDLE );
+
+ /* Signed int values are cast to DMHANDLE in various places, use this
+ * sanity check to verify that DMHANDLE is large enough. */
+ if( sizeof(int) > sizeof(DMHANDLE) )
+ Fatal( "Internal Error: Check type of DMHANDLE!" );
+#endif
+ }
+ else {
+ Fatal( "MAXPROCESS changed from `%d' to `%d' after a command was executed!", _procs_size, Max_proc );
+ }
+ }
+
+ if( Measure & M_RECIPE )
+ Do_profile_output( "s", M_RECIPE, target );
+
+ /* If _use_i!=-1 then this function is called by _finished_child()
+ * ( through runargv() ). */
+ if( (i = _use_i) == -1 ) {
+ for( i=0; i<Max_proc; i++ )
+ if( !_procs[i].pr_valid )
+ break;
+ }
+ else {
+ /* Re-use the process queue number given by _use_i.
+ * Free the pointer before using it again below. */
+ FREE( _procs[i].pr_dir );
+ }
+
+ pp = _procs+i;
+
+ pp->pr_valid = 1;
+ pp->pr_pid = pid.pid;
+ pp->pr_tid = pid.tid;
+ pp->pr_target = target;
+ pp->pr_ignore = ignore;
+ pp->pr_last = last;
+ pp->pr_wfc = wfc;
+ /* Freed above and after the last recipe in _finished child(). */
+ pp->pr_dir = DmStrDup(Get_current_dir());
+
+ Current_target = NIL(CELL);
+
+ _proc_cnt++;
+
+ if( pid.pid != (DMHANDLE)-1 ) {
+ /* Wait for each recipe to finish if wfc is TRUE. This
+ * basically forces sequential execution. */
+ if( wfc ) {
+ Wait_for_child( FALSE, i );
+ }
+
+ return -1;
+ } else
+ return i;
+}
+
+
+static void
+_finished_child(cid, status)/*
+==============================
+ Handle process array entry for finished child. This can be a finished
+ process or a finished internal command depending on the content of cid.
+ For cid >= 1 the value of cid is used as the pid to of the finished
+ process and for cid < 1 -cid is used as the process array index of the
+ internal command.
+*/
+DMHANDLE cid;
+int status;
+{
+ register int i;
+ char *dir;
+
+ if((int)cid < 1) { /* Force int. */
+ /* internal command */
+ i = -((int)cid);
+ }
+ else {
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid && _procs[i].pr_pid == cid )
+ break;
+
+ /* Some children we didn't make esp true if using /bin/sh to execute a
+ * a pipe and feed the output as a makefile into dmake. */
+ if( i == Max_proc ) {
+ Warning("Internal Warning: finished pid %d is not in pq!?", cid);
+ return;
+ }
+ }
+
+ /* Not a running process anymore, the next runargv() will not use
+ * _attach_cmd(). */
+ _procs[i].pr_valid = 0;
+
+ if( Measure & M_RECIPE )
+ Do_profile_output( "e", M_RECIPE, _procs[i].pr_target );
+
+ _proc_cnt--;
+ dir = DmStrDup(Get_current_dir());
+ Set_dir( _procs[i].pr_dir );
+
+ if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
+ RCPPTR rp = _procs[i].pr_recipe;
+
+
+ Current_target = _procs[i].pr_target;
+ Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
+ Current_target = NIL(CELL);
+
+ if ( _procs[i].pr_target->ce_attr & A_ERROR ) {
+ _procs[i].pr_last = TRUE;
+ goto ABORT_REMAINDER_OF_RECIPE;
+ }
+
+ _procs[i].pr_recipe = rp->prp_next;
+
+ _use_i = i;
+ /* Run next recipe line. The rp->prp_attr propagates a possible
+ * wfc condition. */
+ runargv( _procs[i].pr_target, rp->prp_group,
+ rp->prp_last, rp->prp_attr, &rp->prp_cmd );
+ _use_i = -1;
+
+ FREE( rp->prp_cmd );
+ FREE( rp );
+
+ /* If all process queues are used wait for the next process to
+ * finish. Is this really needed here? */
+ if( _proc_cnt == Max_proc ) {
+ Wait_for_child( FALSE, -1 );
+ }
+ }
+ else {
+ /* empty the queue on abort. */
+ if( _abort_flg )
+ _procs[i].pr_recipe = NIL(RCP);
+
+ Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
+
+ ABORT_REMAINDER_OF_RECIPE:
+ if( _procs[i].pr_last ) {
+ FREE(_procs[i].pr_dir ); /* Set in _add_child() */
+
+ if( !Doing_bang ) {
+ /* Update_time_stamp() triggers the deletion of intermediate
+ * targets. This starts a new process queue, so we have to
+ * clear the _use_i variable. */
+ int my_use_i = _use_i;
+
+ _use_i = -1;
+ Update_time_stamp( _procs[i].pr_target );
+ _use_i = my_use_i;
+ }
+ }
+ }
+
+ Set_dir(dir);
+ FREE(dir);
+}
+
+
+static int
+_running( cp )/*
+================
+ Check if target exists in process array AND is running. Return its
+ process array index if it is running, return -1 otherwise.
+*/
+CELLPTR cp;
+{
+ register int i;
+
+ if( !_procs ) return( -1 );
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ return( i == Max_proc ? -1 : i );
+}
+
+
+static void
+_attach_cmd( cmd, group, cp, cmnd_attr, last )/*
+================================================
+ Attach to an active process queue. Inherit wfc setting. */
+char *cmd;
+int group;
+CELLPTR cp;
+t_attr cmnd_attr;
+int last;
+{
+ register int i;
+ RCPPTR rp;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ TALLOC( rp, 1, RCP );
+ rp->prp_cmd = DmStrDup(cmd);
+ rp->prp_attr = cmnd_attr;
+ /* Inherit wfc from process queue. */
+ if( _procs[i].pr_wfc )
+ rp->prp_attr |= A_WFC;
+ rp->prp_group = group;
+ rp->prp_last = last;
+
+ if( _procs[i].pr_recipe == NIL(RCP) )
+ _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
+ else {
+ _procs[i].pr_recipe_end->prp_next = rp;
+ _procs[i].pr_recipe_end = rp;
+ }
+}
diff --git a/dmake/unix/solaris/config.mk b/dmake/unix/solaris/config.mk
new file mode 100644
index 000000000000..bc2364a33260
--- /dev/null
+++ b/dmake/unix/solaris/config.mk
@@ -0,0 +1,27 @@
+# This is the BSD 4.3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following sources are required for Solaris 2.1 or greater
+OSDSRC := tempnam.c getcwd.c
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local BSD includes
+# too.
+CFLAGS += -I$(osrdir) -DSolaris
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/solaris/getcwd.c b/dmake/unix/solaris/getcwd.c
new file mode 100644
index 000000000000..f2359bcc795b
--- /dev/null
+++ b/dmake/unix/solaris/getcwd.c
@@ -0,0 +1,231 @@
+/*
+ getcwd -- get pathname of current working directory
+
+ public-domain implementation
+
+ last edit: 03-Nov-1990 Gwyn@BRL.MIL
+
+ complies with the following standards:
+ IEEE Std 1003.1-1988
+ SVID Issue 3
+ X/Open Portability Guide Issue 2 (when "XPG2" is defined)
+ X/Open Portability Guide Issue 3
+
+ This implementation of getcwd() can be used to replace the UNIX
+ System V library routine (which uses popen() to capture the output of
+ the "pwd" command). Once that is done, "pwd" can be reimplemented as
+ just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below.
+
+ This implementation depends on every directory having entries for
+ "." and "..". It also depends on the internals of the <dirent.h>
+ data structures to some degree.
+
+ I considered using chdir() to ascend the hierarchy, followed by a
+ final chdir() to the path being returned by getcwd() to restore the
+ location, but decided that error recovery was too difficult that way.
+ The algorithm I settled on was inspired by my rewrite of the "pwd"
+ utility, combined with the dotdots[] array trick from the SVR2 shell.
+*/
+#define XPG2 /* define to support obsolete XPG2-mandated feature */
+
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef M_XENIX
+# include <sys/ndir.h>
+# define dirent direct
+#else
+# include <dirent.h>
+#endif
+
+#include <errno.h>
+#include <string.h>
+
+typedef char *pointer; /* (void *) if you have it */
+
+extern void free();
+extern pointer malloc();
+extern int fstat(), stat();
+
+extern int errno; /* normally done by <errno.h> */
+
+#ifndef NULL
+#define NULL 0 /* amorphous null pointer constant */
+#endif
+
+#ifndef NAME_MAX
+#define NAME_MAX 255 /* maximum directory entry size */
+#endif
+
+
+char *
+getcwd( buf, size ) /* returns pointer to CWD pathname */
+ char *buf; /* where to put name (NULL to malloc) */
+ int size; /* size of buf[] or malloc()ed memory */
+ {
+ static char dotdots[] =
+"../../../../../../../../../../../../../../../../../../../../../../../../../..";
+ char *dotdot; /* -> dotdots[.], right to left */
+ DIR *dirp; /* -> parent directory stream */
+ struct dirent *dir; /* -> directory entry */
+ struct stat stat1,
+ stat2; /* info from stat() */
+ struct stat *d = &stat1; /* -> info about "." */
+ struct stat *dd = &stat2; /* -> info about ".." */
+ register char *buffer; /* local copy of buf, or malloc()ed */
+ char *bufend; /* -> buffer[size] */
+ register char *endp; /* -> end of reversed string */
+ register char *dname; /* entry name ("" for root) */
+ int serrno = errno; /* save entry errno */
+
+ if ( buf != NULL && size <= 0
+#ifndef XPG2
+ || buf == NULL
+#endif
+ ) {
+ errno = EINVAL; /* invalid argument */
+ return NULL;
+ }
+
+ buffer = buf;
+#ifdef XPG2
+ if ( buf == NULL /* wants us to malloc() the string */
+ && (buffer = (char *) malloc( (unsigned) size )) == NULL
+ /* XXX -- actually should probably not pay attention to "size" arg */
+ ) {
+ errno = ENOMEM; /* cannot malloc() specified size */
+ return NULL;
+ }
+#endif
+
+ if ( stat( ".", dd ) != 0 ) /* prime the pump */
+ goto error; /* errno already set */
+
+ endp = buffer; /* initially, empty string */
+ bufend = &buffer[size];
+
+ for ( dotdot = &dotdots[sizeof dotdots]; dotdot != dotdots; )
+ {
+ dotdot -= 3; /* include one more "/.." section */
+ /* (first time is actually "..") */
+
+ /* swap stat() info buffers */
+ {
+ register struct stat *temp = d;
+
+ d = dd; /* new current dir is old parent dir */
+ dd = temp;
+ }
+
+ if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */
+ goto error; /* errno already set */
+
+ if ( fstat( dirp->dd_fd, dd ) != 0 )
+ {
+ serrno = errno; /* set by fstat() */
+ (void)closedir( dirp );
+ errno = serrno; /* in case closedir() clobbered it */
+ goto error;
+ }
+
+ if ( d->st_dev == dd->st_dev )
+ { /* not crossing a mount point */
+ if ( d->st_ino == dd->st_ino )
+ { /* root directory */
+ dname = "";
+ goto append;
+ }
+
+ do
+ if ( (dir = readdir( dirp )) == NULL )
+ {
+ (void)closedir( dirp );
+ errno = ENOENT; /* missing entry */
+ goto error;
+ }
+ while ( dir->d_ino != d->st_ino );
+ }
+ else { /* crossing a mount point */
+ struct stat t; /* info re. test entry */
+ char name[sizeof dotdots + 1 + NAME_MAX];
+
+ (void)strcpy( name, dotdot );
+ dname = &name[strlen( name )];
+ *dname++ = '/';
+
+ do {
+ if ( (dir = readdir( dirp )) == NULL )
+ {
+ (void)closedir( dirp );
+ errno = ENOENT; /* missing entry */
+ goto error;
+ }
+
+ (void)strcpy( dname, dir->d_name );
+ /* must fit if NAME_MAX is not a lie */
+ }
+ while ( stat( name, &t ) != 0
+ || t.st_ino != d->st_ino
+ || t.st_dev != d->st_dev
+ );
+ }
+
+ dname = dir->d_name;
+
+ /* append "/" and reversed dname string onto buffer */
+ append:
+ if ( endp != buffer /* avoid trailing / in final name */
+ || dname[0] == '\0' /* but allow "/" when CWD is root */
+ )
+ *endp++ = '/';
+
+ {
+ register char *app; /* traverses dname string */
+
+ for ( app = dname; *app != '\0'; ++app )
+ ;
+
+ if ( app - dname >= bufend - endp )
+ {
+ (void)closedir( dirp );
+ errno = ERANGE; /* won't fit allotted space */
+ goto error;
+ }
+
+ while ( app != dname )
+ *endp++ = *--app;
+ }
+
+ (void)closedir( dirp );
+
+ if ( dname[0] == '\0' ) /* reached root; wrap it up */
+ {
+ register char *startp; /* -> buffer[.] */
+
+ *endp = '\0'; /* plant null terminator */
+
+ /* straighten out reversed pathname string */
+ for ( startp = buffer; --endp > startp; ++startp )
+ {
+ char temp = *endp;
+
+ *endp = *startp;
+ *startp = temp;
+ }
+
+ errno = serrno; /* restore entry errno */
+ /* XXX -- if buf==NULL, realloc here? */
+ return buffer;
+ }
+ }
+
+ errno = ENOMEM; /* actually, algorithm failure */
+
+ error:
+ if ( buf == NULL )
+ free( (pointer)buffer );
+
+ return NULL;
+ }
+
diff --git a/dmake/unix/solaris/gnu/config.mk b/dmake/unix/solaris/gnu/config.mk
new file mode 100644
index 000000000000..f6f4f2c68cbc
--- /dev/null
+++ b/dmake/unix/solaris/gnu/config.mk
@@ -0,0 +1,8 @@
+# This is the Solaris gcc configuration file for DMAKE
+# It modifies the value of CC to be gcc
+#
+
+CC = gcc
+
+# disable a gcc bug when compiling runargv.c
+runargv.o ?= CFLAGS += -g
diff --git a/dmake/unix/solaris/gnu/make.sh b/dmake/unix/solaris/gnu/make.sh
new file mode 100644
index 000000000000..10a50a837dfa
--- /dev/null
+++ b/dmake/unix/solaris/gnu/make.sh
@@ -0,0 +1,64 @@
+mkdir objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O infer.c
+mv infer.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O make.c
+mv make.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O stat.c
+mv stat.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O expand.c
+mv expand.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmstring.c
+mv dmstring.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O hash.c
+mv hash.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dag.c
+mv dag.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmake.c
+mv dmake.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O path.c
+mv path.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O imacs.c
+mv imacs.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O sysintf.c
+mv sysintf.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O parse.c
+mv parse.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O getinp.c
+mv getinp.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O quit.c
+mv quit.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O state.c
+mv state.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmdump.c
+mv dmdump.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O macparse.c
+mv macparse.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O rulparse.c
+mv rulparse.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O percent.c
+mv percent.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O function.c
+mv function.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/arlib.c
+mv arlib.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dirbrk.c
+mv dirbrk.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/rmprq.c
+mv rmprq.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/ruletab.c
+mv ruletab.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O -g unix/runargv.c
+mv runargv.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dcache.c
+mv dcache.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/tempnam.c
+mv tempnam.o objects
+gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/getcwd.c
+mv getcwd.o objects
+gcc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/tempnam.o objects/getcwd.o
+cp unix/solaris/gnu/template.mk startup/config.mk
diff --git a/dmake/unix/solaris/gnu/public.h b/dmake/unix/solaris/gnu/public.h
new file mode 100644
index 000000000000..e9236422a5e0
--- /dev/null
+++ b/dmake/unix/solaris/gnu/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:56:16 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/solaris/gnu/template.mk b/dmake/unix/solaris/gnu/template.mk
new file mode 100644
index 000000000000..3f9282027c5c
--- /dev/null
+++ b/dmake/unix/solaris/gnu/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= solaris
+ OSENVIRONMENT *:= gnu
diff --git a/dmake/unix/solaris/make.sh b/dmake/unix/solaris/make.sh
new file mode 100644
index 000000000000..21894778a642
--- /dev/null
+++ b/dmake/unix/solaris/make.sh
@@ -0,0 +1,64 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/tempnam.c
+mv tempnam.o objects
+cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/getcwd.c
+mv getcwd.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/tempnam.o objects/getcwd.o
+cp unix/solaris/template.mk startup/config.mk
diff --git a/dmake/unix/solaris/public.h b/dmake/unix/solaris/public.h
new file mode 100644
index 000000000000..16f322b6a94c
--- /dev/null
+++ b/dmake/unix/solaris/public.h
@@ -0,0 +1,166 @@
+/* RCS $Id: public.h,v 1.7 2007-10-15 15:56:04 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/solaris/template.mk b/dmake/unix/solaris/template.mk
new file mode 100644
index 000000000000..233917a6ba92
--- /dev/null
+++ b/dmake/unix/solaris/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= solaris
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/solaris/tempnam.c b/dmake/unix/solaris/tempnam.c
new file mode 100644
index 000000000000..56f23fbe21d4
--- /dev/null
+++ b/dmake/unix/solaris/tempnam.c
@@ -0,0 +1,103 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+
+static char *cpdir();
+static char seed[4]="AAA";
+
+/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
+#ifndef P_tmpdir
+static char *P_tmpdir = "/tmp";
+#endif
+
+char *
+tempnam(dir, prefix)
+const char *dir; /* use this directory please (if non-NULL) */
+const char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
+ if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
+ if( access( cpdir(p, P_tmpdir), 3) != 0 )
+ if( access( cpdir(p, "/tmp"), 3) != 0 )
+ return(NULL);
+
+ (void) strcat(p, "/");
+ if(prefix)
+ {
+ *(p+strlen(p)+5) = '\0';
+ (void)strncat(p, prefix, 5);
+ }
+
+ (void)strcat(p, seed);
+ (void)strcat(p, "XXXXXX");
+
+ q = seed;
+ while(*q == 'Z') *q++ = 'A';
+ ++*q;
+
+ if(*mktemp(p) == '\0') return(NULL);
+ return(p);
+}
+
+
+
+static char *
+cpdir(buf, str)
+char *buf;
+char *str;
+{
+ char *p;
+
+ if(str != NULL)
+ {
+ (void) strcpy(buf, str);
+ p = buf - 1 + strlen(buf);
+ if(*p == '/') *p = '\0';
+ }
+
+ return(buf);
+}
diff --git a/dmake/unix/startup.h b/dmake/unix/startup.h
new file mode 100644
index 000000000000..b445a86cecef
--- /dev/null
+++ b/dmake/unix/startup.h
@@ -0,0 +1,27 @@
+/* RCS $Id: startup.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $
+--
+-- SYNOPSIS
+-- Definition of MAKESTARTUP
+--
+-- DESCRIPTION
+-- Default MAKESTARTUP value defining where dmake locates the
+-- startup file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"MAKESTARTUP := $(DMAKEROOT)/startup.mk",
diff --git a/dmake/unix/sysintf.h b/dmake/unix/sysintf.h
new file mode 100644
index 000000000000..85bd198529e8
--- /dev/null
+++ b/dmake/unix/sysintf.h
@@ -0,0 +1,50 @@
+/* RCS $Id: sysintf.h,v 1.4 2007-10-15 15:53:38 ihi Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m) (void) void_lcache(l,m)
+#define Hook_std_writes(A)
+#define GETPID getpid()
+
+#ifndef S_IFDIR
+#define S_IFDIR 0040000
+#endif
+
+#ifndef S_IFMT
+#define S_IFMT 0170000
+#endif
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define getswitchar() '-'
+
+/*
+** Make parameters
+*/
diff --git a/dmake/unix/sysvr1/config.mk b/dmake/unix/sysvr1/config.mk
new file mode 100644
index 000000000000..d1cd2d8810f5
--- /dev/null
+++ b/dmake/unix/sysvr1/config.mk
@@ -0,0 +1,28 @@
+# This is the SysV R3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC := vfprintf.c
+
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/sysvr1/make.sh b/dmake/unix/sysvr1/make.sh
new file mode 100644
index 000000000000..1db251f3361e
--- /dev/null
+++ b/dmake/unix/sysvr1/make.sh
@@ -0,0 +1,62 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/sysvr1 -O unix/sysvr1/vfprintf.c
+mv vfprintf.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/vfprintf.o
+cp unix/sysvr1/template.mk startup/config.mk
diff --git a/dmake/unix/sysvr1/public.h b/dmake/unix/sysvr1/public.h
new file mode 100644
index 000000000000..f61f0f42595f
--- /dev/null
+++ b/dmake/unix/sysvr1/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:56:28 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/sysvr1/putenv.c b/dmake/unix/sysvr1/putenv.c
new file mode 100644
index 000000000000..1453852710c2
--- /dev/null
+++ b/dmake/unix/sysvr1/putenv.c
@@ -0,0 +1,78 @@
+/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $
+--
+-- SYNOPSIS
+-- My own putenv for BSD like systems.
+--
+-- DESCRIPTION
+-- This originally came from MKS, but I rewrote it to fix a bug with
+-- replacing existing strings, probably never happened but the code
+-- was wrong nonetheless.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+int
+putenv( str )/*
+===============
+ Take a string of the form NAME=value and stick it into the environment.
+ We do this by allocating a new set of pointers if we have to add a new
+ string and by replacing an existing pointer if the value replaces the value
+ of an existing string. */
+char *str;
+{
+ extern char **environ; /* The current environment. */
+ static char **ourenv = NULL; /* A new environment */
+ register char **p;
+ register char *q;
+ int size;
+
+ /* First search the current environment and see if we can replace a
+ * string. */
+ for( p=environ; *p; p++ ) {
+ register char *s = str;
+
+ for( q = *p; *q && *s && *s == *q; q++, s++ )
+ if( *s == '=' ) {
+ *p = str;
+ return(0); /* replaced it so go away */
+ }
+ }
+
+ /* Ok, can't replace a string so need to grow the environment. */
+ size = p - environ + 2; /* size of new environment */
+ /* size of old is size-1 */
+
+ /* It's the first time, so allocate a new environment since we don't know
+ * where the old one is comming from. */
+ if( ourenv == NULL ) {
+ if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL )
+ return(1);
+
+ memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) );
+ }
+ else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL )
+ return(1);
+
+ ourenv[--size] = NULL;
+ ourenv[--size] = str;
+
+ environ = ourenv;
+ return(0);
+}
diff --git a/dmake/unix/sysvr1/stdlib.h b/dmake/unix/sysvr1/stdlib.h
new file mode 100644
index 000000000000..3b612c2fd601
--- /dev/null
+++ b/dmake/unix/sysvr1/stdlib.h
@@ -0,0 +1,44 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+extern free();
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/sysvr1/template.mk b/dmake/unix/sysvr1/template.mk
new file mode 100644
index 000000000000..4eb40febb3a1
--- /dev/null
+++ b/dmake/unix/sysvr1/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr1
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/sysvr1/time.h b/dmake/unix/sysvr1/time.h
new file mode 100644
index 000000000000..3b3dfac5684f
--- /dev/null
+++ b/dmake/unix/sysvr1/time.h
@@ -0,0 +1,32 @@
+/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $
+--
+-- SYNOPSIS
+-- time_t
+--
+-- DESCRIPTION
+-- Properly define time_t.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef TIME_h
+#define TIME_h
+
+typedef long time_t; /* this is the thing we use */
+
+#endif TIME_h
+
diff --git a/dmake/unix/sysvr1/vfprintf.c b/dmake/unix/sysvr1/vfprintf.c
new file mode 100644
index 000000000000..1d24a1c19b08
--- /dev/null
+++ b/dmake/unix/sysvr1/vfprintf.c
@@ -0,0 +1,58 @@
+/* From:
+ * John Limpert johnl@gronk.UUCP uunet!n3dmc!gronk!johnl
+ */
+
+#include <stdio.h>
+#include <varargs.h>
+
+#ifndef BUFSIZ
+#include <stdio.h>
+#endif
+
+#ifndef va_dcl
+#include <varargs.h>
+#endif
+
+int
+vsprintf(str, fmt, ap)
+ char *str, *fmt;
+ va_list ap;
+{
+ FILE f;
+ int len;
+
+ f._flag = _IOWRT+_IOMYBUF;
+ f._ptr = (char *)str; /* My copy of BSD stdio.h has this as (char *)
+ * with a comment that it should be
+ * (unsigned char *). Since this code is
+ * intended for use on a vanilla BSD system,
+ * we'll stick with (char *) for now.
+ */
+ f._cnt = 32767;
+ len = _doprnt(fmt, ap, &f);
+ *f._ptr = 0;
+ return (len);
+}
+
+int
+vfprintf(iop, fmt, ap)
+ FILE *iop;
+ char *fmt;
+ va_list ap;
+{
+ int len;
+
+ len = _doprnt(fmt, ap, iop);
+ return (ferror(iop) ? EOF : len);
+}
+
+int
+vprintf(fmt, ap)
+ char *fmt;
+ va_list ap;
+{
+ int len;
+
+ len = _doprnt(fmt, ap, stdout);
+ return (ferror(stdout) ? EOF : len);
+}
diff --git a/dmake/unix/sysvr3/config.mk b/dmake/unix/sysvr3/config.mk
new file mode 100644
index 000000000000..75bcf3c2a211
--- /dev/null
+++ b/dmake/unix/sysvr3/config.mk
@@ -0,0 +1,27 @@
+# This is the SysV R3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC :=
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/sysvr3/gnu/public.h b/dmake/unix/sysvr3/gnu/public.h
new file mode 100644
index 000000000000..829293cce720
--- /dev/null
+++ b/dmake/unix/sysvr3/gnu/public.h
@@ -0,0 +1,165 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:56:54 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+int Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+int Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/sysvr3/make.sh b/dmake/unix/sysvr3/make.sh
new file mode 100644
index 000000000000..505670f8b708
--- /dev/null
+++ b/dmake/unix/sysvr3/make.sh
@@ -0,0 +1,60 @@
+mkdir objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O infer.c
+mv infer.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O make.c
+mv make.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O stat.c
+mv stat.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O expand.c
+mv expand.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O dmstring.c
+mv dmstring.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O hash.c
+mv hash.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O dag.c
+mv dag.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O dmake.c
+mv dmake.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O path.c
+mv path.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O imacs.c
+mv imacs.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O sysintf.c
+mv sysintf.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O parse.c
+mv parse.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O getinp.c
+mv getinp.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O quit.c
+mv quit.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O state.c
+mv state.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O dmdump.c
+mv dmdump.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O macparse.c
+mv macparse.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O rulparse.c
+mv rulparse.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O percent.c
+mv percent.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O function.c
+mv function.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/arlib.c
+mv arlib.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/dirbrk.c
+mv dirbrk.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/rmprq.c
+mv rmprq.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/ruletab.c
+mv ruletab.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/runargv.c
+mv runargv.o objects
+gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/dcache.c
+mv dcache.o objects
+gcc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o
+cp unix/sysvr3/template.mk startup/config.mk
diff --git a/dmake/unix/sysvr3/public.h b/dmake/unix/sysvr3/public.h
new file mode 100644
index 000000000000..ec7a7c1ba5f6
--- /dev/null
+++ b/dmake/unix/sysvr3/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:56:41 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/sysvr3/pwd/config.mk b/dmake/unix/sysvr3/pwd/config.mk
new file mode 100644
index 000000000000..86c535a64c1d
--- /dev/null
+++ b/dmake/unix/sysvr3/pwd/config.mk
@@ -0,0 +1,20 @@
+# This is the Sys VR3 PWD configuration file. It configures SysvR3 unix
+# versions of dmake to use a provided version of getcwd rather than the
+# standard library version that uses popen to capture the output of pwd.
+#
+
+osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+# The following are required sources
+OSRESRC := getcwd.c
+
+.IF $(OSRESRC)
+ SRC += $(OSRESRC)
+ .SETDIR=$(osredir) : $(OSRESRC)
+.END
+
+.SOURCE.h : $(osredir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osredir)
diff --git a/dmake/unix/sysvr3/pwd/getcwd.c b/dmake/unix/sysvr3/pwd/getcwd.c
new file mode 100644
index 000000000000..f2359bcc795b
--- /dev/null
+++ b/dmake/unix/sysvr3/pwd/getcwd.c
@@ -0,0 +1,231 @@
+/*
+ getcwd -- get pathname of current working directory
+
+ public-domain implementation
+
+ last edit: 03-Nov-1990 Gwyn@BRL.MIL
+
+ complies with the following standards:
+ IEEE Std 1003.1-1988
+ SVID Issue 3
+ X/Open Portability Guide Issue 2 (when "XPG2" is defined)
+ X/Open Portability Guide Issue 3
+
+ This implementation of getcwd() can be used to replace the UNIX
+ System V library routine (which uses popen() to capture the output of
+ the "pwd" command). Once that is done, "pwd" can be reimplemented as
+ just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below.
+
+ This implementation depends on every directory having entries for
+ "." and "..". It also depends on the internals of the <dirent.h>
+ data structures to some degree.
+
+ I considered using chdir() to ascend the hierarchy, followed by a
+ final chdir() to the path being returned by getcwd() to restore the
+ location, but decided that error recovery was too difficult that way.
+ The algorithm I settled on was inspired by my rewrite of the "pwd"
+ utility, combined with the dotdots[] array trick from the SVR2 shell.
+*/
+#define XPG2 /* define to support obsolete XPG2-mandated feature */
+
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef M_XENIX
+# include <sys/ndir.h>
+# define dirent direct
+#else
+# include <dirent.h>
+#endif
+
+#include <errno.h>
+#include <string.h>
+
+typedef char *pointer; /* (void *) if you have it */
+
+extern void free();
+extern pointer malloc();
+extern int fstat(), stat();
+
+extern int errno; /* normally done by <errno.h> */
+
+#ifndef NULL
+#define NULL 0 /* amorphous null pointer constant */
+#endif
+
+#ifndef NAME_MAX
+#define NAME_MAX 255 /* maximum directory entry size */
+#endif
+
+
+char *
+getcwd( buf, size ) /* returns pointer to CWD pathname */
+ char *buf; /* where to put name (NULL to malloc) */
+ int size; /* size of buf[] or malloc()ed memory */
+ {
+ static char dotdots[] =
+"../../../../../../../../../../../../../../../../../../../../../../../../../..";
+ char *dotdot; /* -> dotdots[.], right to left */
+ DIR *dirp; /* -> parent directory stream */
+ struct dirent *dir; /* -> directory entry */
+ struct stat stat1,
+ stat2; /* info from stat() */
+ struct stat *d = &stat1; /* -> info about "." */
+ struct stat *dd = &stat2; /* -> info about ".." */
+ register char *buffer; /* local copy of buf, or malloc()ed */
+ char *bufend; /* -> buffer[size] */
+ register char *endp; /* -> end of reversed string */
+ register char *dname; /* entry name ("" for root) */
+ int serrno = errno; /* save entry errno */
+
+ if ( buf != NULL && size <= 0
+#ifndef XPG2
+ || buf == NULL
+#endif
+ ) {
+ errno = EINVAL; /* invalid argument */
+ return NULL;
+ }
+
+ buffer = buf;
+#ifdef XPG2
+ if ( buf == NULL /* wants us to malloc() the string */
+ && (buffer = (char *) malloc( (unsigned) size )) == NULL
+ /* XXX -- actually should probably not pay attention to "size" arg */
+ ) {
+ errno = ENOMEM; /* cannot malloc() specified size */
+ return NULL;
+ }
+#endif
+
+ if ( stat( ".", dd ) != 0 ) /* prime the pump */
+ goto error; /* errno already set */
+
+ endp = buffer; /* initially, empty string */
+ bufend = &buffer[size];
+
+ for ( dotdot = &dotdots[sizeof dotdots]; dotdot != dotdots; )
+ {
+ dotdot -= 3; /* include one more "/.." section */
+ /* (first time is actually "..") */
+
+ /* swap stat() info buffers */
+ {
+ register struct stat *temp = d;
+
+ d = dd; /* new current dir is old parent dir */
+ dd = temp;
+ }
+
+ if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */
+ goto error; /* errno already set */
+
+ if ( fstat( dirp->dd_fd, dd ) != 0 )
+ {
+ serrno = errno; /* set by fstat() */
+ (void)closedir( dirp );
+ errno = serrno; /* in case closedir() clobbered it */
+ goto error;
+ }
+
+ if ( d->st_dev == dd->st_dev )
+ { /* not crossing a mount point */
+ if ( d->st_ino == dd->st_ino )
+ { /* root directory */
+ dname = "";
+ goto append;
+ }
+
+ do
+ if ( (dir = readdir( dirp )) == NULL )
+ {
+ (void)closedir( dirp );
+ errno = ENOENT; /* missing entry */
+ goto error;
+ }
+ while ( dir->d_ino != d->st_ino );
+ }
+ else { /* crossing a mount point */
+ struct stat t; /* info re. test entry */
+ char name[sizeof dotdots + 1 + NAME_MAX];
+
+ (void)strcpy( name, dotdot );
+ dname = &name[strlen( name )];
+ *dname++ = '/';
+
+ do {
+ if ( (dir = readdir( dirp )) == NULL )
+ {
+ (void)closedir( dirp );
+ errno = ENOENT; /* missing entry */
+ goto error;
+ }
+
+ (void)strcpy( dname, dir->d_name );
+ /* must fit if NAME_MAX is not a lie */
+ }
+ while ( stat( name, &t ) != 0
+ || t.st_ino != d->st_ino
+ || t.st_dev != d->st_dev
+ );
+ }
+
+ dname = dir->d_name;
+
+ /* append "/" and reversed dname string onto buffer */
+ append:
+ if ( endp != buffer /* avoid trailing / in final name */
+ || dname[0] == '\0' /* but allow "/" when CWD is root */
+ )
+ *endp++ = '/';
+
+ {
+ register char *app; /* traverses dname string */
+
+ for ( app = dname; *app != '\0'; ++app )
+ ;
+
+ if ( app - dname >= bufend - endp )
+ {
+ (void)closedir( dirp );
+ errno = ERANGE; /* won't fit allotted space */
+ goto error;
+ }
+
+ while ( app != dname )
+ *endp++ = *--app;
+ }
+
+ (void)closedir( dirp );
+
+ if ( dname[0] == '\0' ) /* reached root; wrap it up */
+ {
+ register char *startp; /* -> buffer[.] */
+
+ *endp = '\0'; /* plant null terminator */
+
+ /* straighten out reversed pathname string */
+ for ( startp = buffer; --endp > startp; ++startp )
+ {
+ char temp = *endp;
+
+ *endp = *startp;
+ *startp = temp;
+ }
+
+ errno = serrno; /* restore entry errno */
+ /* XXX -- if buf==NULL, realloc here? */
+ return buffer;
+ }
+ }
+
+ errno = ENOMEM; /* actually, algorithm failure */
+
+ error:
+ if ( buf == NULL )
+ free( (pointer)buffer );
+
+ return NULL;
+ }
+
diff --git a/dmake/unix/sysvr3/pwd/make.sh b/dmake/unix/sysvr3/pwd/make.sh
new file mode 100644
index 000000000000..1f57569f61df
--- /dev/null
+++ b/dmake/unix/sysvr3/pwd/make.sh
@@ -0,0 +1,62 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/sysvr3/pwd/getcwd.c
+mv getcwd.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/getcwd.o
+cp unix/sysvr3/pwd/template.mk startup/config.mk
diff --git a/dmake/unix/sysvr3/pwd/public.h b/dmake/unix/sysvr3/pwd/public.h
new file mode 100644
index 000000000000..78ce5609988e
--- /dev/null
+++ b/dmake/unix/sysvr3/pwd/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:57:06 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/sysvr3/pwd/template.mk b/dmake/unix/sysvr3/pwd/template.mk
new file mode 100644
index 000000000000..fa6b4aa6bd1b
--- /dev/null
+++ b/dmake/unix/sysvr3/pwd/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr3
+ OSENVIRONMENT *:= pwd
diff --git a/dmake/unix/sysvr3/stdlib.h b/dmake/unix/sysvr3/stdlib.h
new file mode 100644
index 000000000000..077123d5494f
--- /dev/null
+++ b/dmake/unix/sysvr3/stdlib.h
@@ -0,0 +1,55 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+#ifndef _AIX
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+
+/* The AIX compiler dies on illegal redefinition of free */
+extern free();
+#endif
+
+/* AIX doesn't use NAME_MAX anylonger... */
+#ifdef _AIX
+#include <unistd.h>
+#define NAME_MAX pathconf("/dev/null",_PC_NAME_MAX)
+#endif
+
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/sysvr3/template.mk b/dmake/unix/sysvr3/template.mk
new file mode 100644
index 000000000000..3cb518671142
--- /dev/null
+++ b/dmake/unix/sysvr3/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr3
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/sysvr3/time.h b/dmake/unix/sysvr3/time.h
new file mode 100644
index 000000000000..3b3dfac5684f
--- /dev/null
+++ b/dmake/unix/sysvr3/time.h
@@ -0,0 +1,32 @@
+/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $
+--
+-- SYNOPSIS
+-- time_t
+--
+-- DESCRIPTION
+-- Properly define time_t.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef TIME_h
+#define TIME_h
+
+typedef long time_t; /* this is the thing we use */
+
+#endif TIME_h
+
diff --git a/dmake/unix/sysvr4/config.mk b/dmake/unix/sysvr4/config.mk
new file mode 100644
index 000000000000..6443ff6a91c9
--- /dev/null
+++ b/dmake/unix/sysvr4/config.mk
@@ -0,0 +1,27 @@
+# This is the SysV R4 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC :=
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/sysvr4/make.sh b/dmake/unix/sysvr4/make.sh
new file mode 100644
index 000000000000..9ab5904422f0
--- /dev/null
+++ b/dmake/unix/sysvr4/make.sh
@@ -0,0 +1,60 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/sysvr4 -O unix/dcache.c
+mv dcache.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o
+cp unix/sysvr4/template.mk startup/config.mk
diff --git a/dmake/unix/sysvr4/public.h b/dmake/unix/sysvr4/public.h
new file mode 100644
index 000000000000..d8929a0ea7e5
--- /dev/null
+++ b/dmake/unix/sysvr4/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:57:19 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/sysvr4/template.mk b/dmake/unix/sysvr4/template.mk
new file mode 100644
index 000000000000..553878268e59
--- /dev/null
+++ b/dmake/unix/sysvr4/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= sysvr4
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/tempnam.c b/dmake/unix/tempnam.c
new file mode 100644
index 000000000000..4b143ed8d0d7
--- /dev/null
+++ b/dmake/unix/tempnam.c
@@ -0,0 +1,106 @@
+/* RCS $Id: tempnam.c,v 1.2 2002-07-11 08:53:35 mh Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifdef __APPLE__
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+char *
+dtempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", getpid() );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
+
+#endif
diff --git a/dmake/unix/xenix/config.mk b/dmake/unix/xenix/config.mk
new file mode 100644
index 000000000000..a4f8f78f3ee1
--- /dev/null
+++ b/dmake/unix/xenix/config.mk
@@ -0,0 +1,27 @@
+# This is the SysV R3 UNIX configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# The following are required sources
+OSDSRC :=
+.IF $(OSDSRC)
+ SRC += $(OSDSRC)
+ .SETDIR=$(osrdir) : $(OSDSRC)
+.END
+
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osrdir) -DM_XENIX
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
diff --git a/dmake/unix/xenix/make.sh b/dmake/unix/xenix/make.sh
new file mode 100644
index 000000000000..597936f38061
--- /dev/null
+++ b/dmake/unix/xenix/make.sh
@@ -0,0 +1,60 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/dcache.c
+mv dcache.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o
+cp unix/xenix/template.mk startup/config.mk
diff --git a/dmake/unix/xenix/public.h b/dmake/unix/xenix/public.h
new file mode 100644
index 000000000000..7c24a76b9a0b
--- /dev/null
+++ b/dmake/unix/xenix/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:57:31 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/xenix/pwd/config.mk b/dmake/unix/xenix/pwd/config.mk
new file mode 100644
index 000000000000..095ff3587a68
--- /dev/null
+++ b/dmake/unix/xenix/pwd/config.mk
@@ -0,0 +1,23 @@
+# This is the Sys VR3 PWD configuration file. It configures SysvR3 unix
+# versions of dmake to use a provided version of getcwd rather than the
+# standard library version that uses popen to capture the output of pwd.
+#
+
+osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+# The following are required sources
+OSRESRC := getcwd.c
+
+.IF $(OSRESRC)
+ SRC += $(OSRESRC)
+ .SETDIR=$(osredir) : $(OSRESRC)
+.END
+
+.SOURCE.h : $(osredir)
+
+# Local configuration modifications for CFLAGS, there's local SysV includes
+# too.
+CFLAGS += -I$(osredir)
+
+# Xenix needs -lx in order to link successfully.
+LDLIBS += -lx
diff --git a/dmake/unix/xenix/pwd/getcwd.c b/dmake/unix/xenix/pwd/getcwd.c
new file mode 100644
index 000000000000..f2359bcc795b
--- /dev/null
+++ b/dmake/unix/xenix/pwd/getcwd.c
@@ -0,0 +1,231 @@
+/*
+ getcwd -- get pathname of current working directory
+
+ public-domain implementation
+
+ last edit: 03-Nov-1990 Gwyn@BRL.MIL
+
+ complies with the following standards:
+ IEEE Std 1003.1-1988
+ SVID Issue 3
+ X/Open Portability Guide Issue 2 (when "XPG2" is defined)
+ X/Open Portability Guide Issue 3
+
+ This implementation of getcwd() can be used to replace the UNIX
+ System V library routine (which uses popen() to capture the output of
+ the "pwd" command). Once that is done, "pwd" can be reimplemented as
+ just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below.
+
+ This implementation depends on every directory having entries for
+ "." and "..". It also depends on the internals of the <dirent.h>
+ data structures to some degree.
+
+ I considered using chdir() to ascend the hierarchy, followed by a
+ final chdir() to the path being returned by getcwd() to restore the
+ location, but decided that error recovery was too difficult that way.
+ The algorithm I settled on was inspired by my rewrite of the "pwd"
+ utility, combined with the dotdots[] array trick from the SVR2 shell.
+*/
+#define XPG2 /* define to support obsolete XPG2-mandated feature */
+
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef M_XENIX
+# include <sys/ndir.h>
+# define dirent direct
+#else
+# include <dirent.h>
+#endif
+
+#include <errno.h>
+#include <string.h>
+
+typedef char *pointer; /* (void *) if you have it */
+
+extern void free();
+extern pointer malloc();
+extern int fstat(), stat();
+
+extern int errno; /* normally done by <errno.h> */
+
+#ifndef NULL
+#define NULL 0 /* amorphous null pointer constant */
+#endif
+
+#ifndef NAME_MAX
+#define NAME_MAX 255 /* maximum directory entry size */
+#endif
+
+
+char *
+getcwd( buf, size ) /* returns pointer to CWD pathname */
+ char *buf; /* where to put name (NULL to malloc) */
+ int size; /* size of buf[] or malloc()ed memory */
+ {
+ static char dotdots[] =
+"../../../../../../../../../../../../../../../../../../../../../../../../../..";
+ char *dotdot; /* -> dotdots[.], right to left */
+ DIR *dirp; /* -> parent directory stream */
+ struct dirent *dir; /* -> directory entry */
+ struct stat stat1,
+ stat2; /* info from stat() */
+ struct stat *d = &stat1; /* -> info about "." */
+ struct stat *dd = &stat2; /* -> info about ".." */
+ register char *buffer; /* local copy of buf, or malloc()ed */
+ char *bufend; /* -> buffer[size] */
+ register char *endp; /* -> end of reversed string */
+ register char *dname; /* entry name ("" for root) */
+ int serrno = errno; /* save entry errno */
+
+ if ( buf != NULL && size <= 0
+#ifndef XPG2
+ || buf == NULL
+#endif
+ ) {
+ errno = EINVAL; /* invalid argument */
+ return NULL;
+ }
+
+ buffer = buf;
+#ifdef XPG2
+ if ( buf == NULL /* wants us to malloc() the string */
+ && (buffer = (char *) malloc( (unsigned) size )) == NULL
+ /* XXX -- actually should probably not pay attention to "size" arg */
+ ) {
+ errno = ENOMEM; /* cannot malloc() specified size */
+ return NULL;
+ }
+#endif
+
+ if ( stat( ".", dd ) != 0 ) /* prime the pump */
+ goto error; /* errno already set */
+
+ endp = buffer; /* initially, empty string */
+ bufend = &buffer[size];
+
+ for ( dotdot = &dotdots[sizeof dotdots]; dotdot != dotdots; )
+ {
+ dotdot -= 3; /* include one more "/.." section */
+ /* (first time is actually "..") */
+
+ /* swap stat() info buffers */
+ {
+ register struct stat *temp = d;
+
+ d = dd; /* new current dir is old parent dir */
+ dd = temp;
+ }
+
+ if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */
+ goto error; /* errno already set */
+
+ if ( fstat( dirp->dd_fd, dd ) != 0 )
+ {
+ serrno = errno; /* set by fstat() */
+ (void)closedir( dirp );
+ errno = serrno; /* in case closedir() clobbered it */
+ goto error;
+ }
+
+ if ( d->st_dev == dd->st_dev )
+ { /* not crossing a mount point */
+ if ( d->st_ino == dd->st_ino )
+ { /* root directory */
+ dname = "";
+ goto append;
+ }
+
+ do
+ if ( (dir = readdir( dirp )) == NULL )
+ {
+ (void)closedir( dirp );
+ errno = ENOENT; /* missing entry */
+ goto error;
+ }
+ while ( dir->d_ino != d->st_ino );
+ }
+ else { /* crossing a mount point */
+ struct stat t; /* info re. test entry */
+ char name[sizeof dotdots + 1 + NAME_MAX];
+
+ (void)strcpy( name, dotdot );
+ dname = &name[strlen( name )];
+ *dname++ = '/';
+
+ do {
+ if ( (dir = readdir( dirp )) == NULL )
+ {
+ (void)closedir( dirp );
+ errno = ENOENT; /* missing entry */
+ goto error;
+ }
+
+ (void)strcpy( dname, dir->d_name );
+ /* must fit if NAME_MAX is not a lie */
+ }
+ while ( stat( name, &t ) != 0
+ || t.st_ino != d->st_ino
+ || t.st_dev != d->st_dev
+ );
+ }
+
+ dname = dir->d_name;
+
+ /* append "/" and reversed dname string onto buffer */
+ append:
+ if ( endp != buffer /* avoid trailing / in final name */
+ || dname[0] == '\0' /* but allow "/" when CWD is root */
+ )
+ *endp++ = '/';
+
+ {
+ register char *app; /* traverses dname string */
+
+ for ( app = dname; *app != '\0'; ++app )
+ ;
+
+ if ( app - dname >= bufend - endp )
+ {
+ (void)closedir( dirp );
+ errno = ERANGE; /* won't fit allotted space */
+ goto error;
+ }
+
+ while ( app != dname )
+ *endp++ = *--app;
+ }
+
+ (void)closedir( dirp );
+
+ if ( dname[0] == '\0' ) /* reached root; wrap it up */
+ {
+ register char *startp; /* -> buffer[.] */
+
+ *endp = '\0'; /* plant null terminator */
+
+ /* straighten out reversed pathname string */
+ for ( startp = buffer; --endp > startp; ++startp )
+ {
+ char temp = *endp;
+
+ *endp = *startp;
+ *startp = temp;
+ }
+
+ errno = serrno; /* restore entry errno */
+ /* XXX -- if buf==NULL, realloc here? */
+ return buffer;
+ }
+ }
+
+ errno = ENOMEM; /* actually, algorithm failure */
+
+ error:
+ if ( buf == NULL )
+ free( (pointer)buffer );
+
+ return NULL;
+ }
+
diff --git a/dmake/unix/xenix/pwd/make.sh b/dmake/unix/xenix/pwd/make.sh
new file mode 100644
index 000000000000..e7c02e53ace6
--- /dev/null
+++ b/dmake/unix/xenix/pwd/make.sh
@@ -0,0 +1,62 @@
+mkdir objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O infer.c
+mv infer.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O make.c
+mv make.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O stat.c
+mv stat.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O expand.c
+mv expand.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dmstring.c
+mv dmstring.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O hash.c
+mv hash.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dag.c
+mv dag.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dmake.c
+mv dmake.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O path.c
+mv path.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O imacs.c
+mv imacs.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O sysintf.c
+mv sysintf.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O parse.c
+mv parse.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O getinp.c
+mv getinp.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O quit.c
+mv quit.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O state.c
+mv state.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dmdump.c
+mv dmdump.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O macparse.c
+mv macparse.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O rulparse.c
+mv rulparse.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O percent.c
+mv percent.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O function.c
+mv function.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/arlib.c
+mv arlib.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/dirbrk.c
+mv dirbrk.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/rmprq.c
+mv rmprq.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/ruletab.c
+mv ruletab.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/runargv.c
+mv runargv.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/dcache.c
+mv dcache.o objects
+cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/xenix/pwd/getcwd.c
+mv getcwd.o objects
+cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \
+objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \
+objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \
+objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \
+objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \
+objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/getcwd.o -lx
+cp unix/xenix/pwd/template.mk startup/config.mk
diff --git a/dmake/unix/xenix/pwd/public.h b/dmake/unix/xenix/pwd/public.h
new file mode 100644
index 000000000000..593e2956b3e1
--- /dev/null
+++ b/dmake/unix/xenix/pwd/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:57:43 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+time_t seek_arch ANSI((char *, char *));
+int touch_arch ANSI(( char *, char *));
+void void_lcache ANSI(( char *, char *));
+int If_root_path ANSI((char *));
+void Remove_prq ANSI((CELLPTR));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+
+#endif
diff --git a/dmake/unix/xenix/pwd/template.mk b/dmake/unix/xenix/pwd/template.mk
new file mode 100644
index 000000000000..abd4066c347b
--- /dev/null
+++ b/dmake/unix/xenix/pwd/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= xenix
+ OSENVIRONMENT *:= pwd
diff --git a/dmake/unix/xenix/stdlib.h b/dmake/unix/xenix/stdlib.h
new file mode 100644
index 000000000000..fe814c798a0b
--- /dev/null
+++ b/dmake/unix/xenix/stdlib.h
@@ -0,0 +1,50 @@
+/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
+--
+-- SYNOPSIS
+-- stdlib interface
+--
+-- DESCRIPTION
+-- Specially needed pieces of interface to the standard C lib.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+
+#ifndef _STDLIB_INCLUDED_
+#define _STDLIB_INCLUDED_
+
+extern /*GOTO*/ _exit();
+extern /*GOTO*/ exit();
+extern /*GOTO*/ abort();
+extern int system();
+extern char *getenv();
+extern char *calloc();
+extern char *malloc();
+extern char *realloc();
+
+#ifndef _AIX
+/* The AIX compiler dies on illegal redefinition of free */
+extern free();
+#endif
+
+extern int errno;
+
+#ifndef EIO
+# include <errno.h>
+#endif
+
+#endif /* _STDLIB_INCLUDED_ */
diff --git a/dmake/unix/xenix/template.mk b/dmake/unix/xenix/template.mk
new file mode 100644
index 000000000000..7ab223fbdb9f
--- /dev/null
+++ b/dmake/unix/xenix/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= unix
+ OSRELEASE *:= xenix
+ OSENVIRONMENT *:=
diff --git a/dmake/unix/xenix/time.h b/dmake/unix/xenix/time.h
new file mode 100644
index 000000000000..c7102cfc18cb
--- /dev/null
+++ b/dmake/unix/xenix/time.h
@@ -0,0 +1,32 @@
+/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
+--
+-- SYNOPSIS
+-- time_t
+--
+-- DESCRIPTION
+-- Properly define time_t.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef TIME_h
+#define TIME_h
+
+typedef long time_t; /* this is the thing we use */
+
+#endif TIME_h
+
diff --git a/dmake/vextern.h b/dmake/vextern.h
new file mode 100644
index 000000000000..ab9b8b9c1278
--- /dev/null
+++ b/dmake/vextern.h
@@ -0,0 +1,129 @@
+/* RCS $Id: vextern.h,v 1.7 2007-10-15 15:42:04 ihi Exp $
+--
+-- SYNOPSIS
+-- Global variable declarations.
+--
+-- DESCRIPTION
+-- Leave _DEFINE_GLOBALS_ undefined and the following declarations
+-- will be defined as global variables, otherwise you get the
+-- external declarations to the same global variables.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These two are defined in dir/ruletab.c and dir/dirbrk.c, and are always
+ * imported as externals by the other code. Their defining modules do not
+ * #include this file. */
+extern char* DirBrkStr; /* pointer to value of macro DIRBRKSTR */
+extern char** Rule_tab; /* Builtin rules */
+
+#ifndef _DEFINE_GLOBALS_
+#define EXTERN extern
+#else
+#define EXTERN
+#endif
+
+EXTERN int Line_number; /* Current line number in make file parse */
+EXTERN t_attr Glob_attr; /* Global attrs to control global ops */
+EXTERN char* Makedir; /* pointer to macro value for MAKEDIR */
+EXTERN char* Makedir_macval; /* value of MAKEDIR (for .WINPATH) */
+EXTERN char* Shell; /* pointer to macro value for SHELL */
+EXTERN char* Shell_flags; /* pointer to macro value for SHELLFLAGS */
+EXTERN char* Shell_quote; /* pointer to macro value for SHELLCMDQUOTE */
+EXTERN char* GShell; /* pointer to macro value for GROUPSHELL */
+EXTERN char* GShell_flags; /* pointer to macro value for GROUPFLAGS */
+EXTERN char* Shell_metas; /* pointer to macro value for SHELLMETAS */
+EXTERN char* Grp_suff; /* pointer to macro value for GROUPSUFFIX */
+EXTERN char* DirSepStr; /* pointer to macro value for DIRSEPSTR */
+EXTERN char* AbsPname; /* pointer to macro value for ABSMAKECMD */
+EXTERN char* Pname; /* dmake process invoke name */
+EXTERN char* Pwd; /* current working dir */
+EXTERN char* Pwd_macval; /* value of PWD (for .WINPATH) */
+EXTERN char* Tmd; /* path to directory where dmake started */
+EXTERN char* Tmd_macval; /* value of TMD (for .WINPATH) */
+EXTERN char* Spacechar; /* pointer to macro value for SPACECHAR */
+EXTERN char* Keep_state; /* current .KEEP_STATE file */
+EXTERN char* Escape_char; /* Current escape character */
+EXTERN char* LastMacName; /* Last macro successfully parsed */
+EXTERN char* UseDirCache; /* The value of .DIRCACHE */
+EXTERN char* DcacheRespCase; /* TRUE if we are to respect dcache case */
+EXTERN char* OOoDmMode; /* Enable special behavior for OOo build. */
+EXTERN int Target; /* TRUE if a default target was found in *
+ * a makefile or on the commandline */
+EXTERN int If_expand; /* TRUE if calling Expand from getinp.c */
+EXTERN int Suppress_temp_file;/* TRUE if doing a test in _exec_recipe*/
+EXTERN int Readenv; /* TRUE if defining macro from environment*/
+EXTERN int Makemkf; /* TRUE if making makefile(s) */
+EXTERN int Nest_level; /* Nesting level for .IF .ELSE .END ... */
+EXTERN int Prep; /* Value of macro PREP */
+EXTERN int Def_targets; /* TRUE if defining targets - Only used *
+ * in Def_cell(). */
+EXTERN int Skip_to_eof; /* TRUE if asked to skip to eof on input */
+EXTERN int NameMax; /* The value of NAMEMAX */
+EXTERN int UseWinpath; /* True if .WINPATH is set for currently *
+ * made target. */
+#if __CYGWIN__
+EXTERN char* CygDrvPre; /* Drive prefix used by cygwin */
+EXTERN int CygDrvPreLen; /* Drive prefix length used by cygwin */
+#endif
+
+
+EXTERN CELLPTR Root; /* Root of the make graph (.ROOT) */
+EXTERN CELLPTR Targets; /* Targets in makefile (.TARGETS) */
+
+EXTERN CELLPTR Current_target; /* cell of current target being made */
+EXTERN int Wait_for_completion; /* Wait for subprocess to finish */
+EXTERN int Is_exec_shell; /* Indicate shell escape */
+EXTERN CELLPTR Shell_exec_target; /* Keep Current_target for _exec__shell */
+EXTERN FILE* stdout_redir; /* For _exec_shell client redirects */
+EXTERN int zerofd; /* File descriptor for /dev/null */
+EXTERN int Doing_bang; /* TRUE if target timestamp needs not to be
+ * updated immediately. */
+EXTERN int Packed_shell; /* TRUE if packed args to use a shell */
+#if defined(MSDOS)
+EXTERN int Swap_on_exec; /* TRUE if going to swap on exec call */
+#endif
+EXTERN int State; /* parser state */
+EXTERN int Group; /* parsing a group recipe ==> TRUE */
+
+/* Command line option flags are defined here. They correspond one-for one
+ * with the flags defined in dmake.c */
+
+EXTERN char *Augmake; /* -A */
+EXTERN char Comment; /* -c */
+EXTERN char Get_env; /* -e or -E */
+EXTERN char* Notabs; /* -B */
+EXTERN int Continue; /* -k */
+EXTERN int Force; /* -u */
+EXTERN int Listing; /* -p */
+EXTERN int Rules; /* -r */
+EXTERN int Trace; /* -n */
+EXTERN int Touch; /* -t */
+EXTERN int Check; /* -q */
+EXTERN uint16 Verbose; /* -v */
+EXTERN uint16 Measure; /* -m */
+EXTERN int Microsoft; /* -M */
+EXTERN int Transitive; /* -T */
+EXTERN int No_exec; /* -X */
+
+EXTERN HASHPTR Defs[HASH_TABLE_SIZE];
+EXTERN HASHPTR Macs[HASH_TABLE_SIZE];
+
+EXTERN char *Buffer; /* a general purpose buffer */
+EXTERN int Buffer_size;
+EXTERN int Max_proclmt; /* limit of max # of conc procs */
+EXTERN int Max_proc; /* max # of conc procs */
diff --git a/dmake/win95/borland/bcc50/config.h b/dmake/win95/borland/bcc50/config.h
new file mode 100644
index 000000000000..709aad379ea1
--- /dev/null
+++ b/dmake/win95/borland/bcc50/config.h
@@ -0,0 +1,44 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:39:58 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGBREAK /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Borland redefined the environment variable, sigh */
+#define environ _environ
diff --git a/dmake/win95/borland/bcc50/config.mk b/dmake/win95/borland/bcc50/config.mk
new file mode 100644
index 000000000000..b63cae1c1977
--- /dev/null
+++ b/dmake/win95/borland/bcc50/config.mk
@@ -0,0 +1,14 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+# Change the CCROOT variable to reflect the installation directory of your
+# C++ compiler.
+.IMPORT .IGNORE : CCVER
+
+CCVER *:= c:/cc/borland/$(OSENVIRONMENT)
+
+# Definitions for compiles and links
+CSTARTUP = $(CCVER)/lib/c0x32.obj
+LDLIBS = $(CCVER)/lib/cw32 $(CCVER)/lib/import32
+
+CFLAGS += -A- -w-pro -I$(osedir)
diff --git a/dmake/win95/borland/bcc50/lib.rsp b/dmake/win95/borland/bcc50/lib.rsp
new file mode 100644
index 000000000000..6b6ffb39dc4e
--- /dev/null
+++ b/dmake/win95/borland/bcc50/lib.rsp
@@ -0,0 +1,2 @@
+c:\cc\borland\bcc50\lib\cw32+
+c:\cc\borland\bcc50\lib\import32
diff --git a/dmake/win95/borland/bcc50/mk.bat b/dmake/win95/borland/bcc50/mk.bat
new file mode 100755
index 000000000000..1c77b3799df5
--- /dev/null
+++ b/dmake/win95/borland/bcc50/mk.bat
@@ -0,0 +1,96 @@
+md objects
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 infer.c
+copy infer.obj objects
+del infer.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 make.c
+copy make.obj objects
+del make.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 stat.c
+copy stat.obj objects
+del stat.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 expand.c
+copy expand.obj objects
+del expand.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 hash.c
+copy hash.obj objects
+del hash.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dag.c
+copy dag.obj objects
+del dag.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 path.c
+copy path.obj objects
+del path.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 parse.c
+copy parse.obj objects
+del parse.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 quit.c
+copy quit.obj objects
+del quit.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 state.c
+copy state.obj objects
+del state.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 percent.c
+copy percent.obj objects
+del percent.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 function.c
+copy function.obj objects
+del function.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\switchar.c
+copy switchar.obj objects
+del switchar.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\utime.c
+copy utime.obj objects
+del utime.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 unix\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+tlink32 @win95\borland\bcc50\obj.rsp,dmake.exe,NUL.MAP,@win95\borland\bcc50\lib.rsp
+copy win95\borland\bcc50\template.mk startup\config.mk
diff --git a/dmake/win95/borland/bcc50/obj.rsp b/dmake/win95/borland/bcc50/obj.rsp
new file mode 100644
index 000000000000..0301270860f0
--- /dev/null
+++ b/dmake/win95/borland/bcc50/obj.rsp
@@ -0,0 +1,32 @@
+c:\cc\borland\bcc50\lib\c0x32.obj+
+objects\infer.obj+
+objects\make.obj+
+objects\stat.obj+
+objects\expand.obj+
+objects\dmstring.obj+
+objects\hash.obj+
+objects\dag.obj+
+objects\dmake.obj+
+objects\path.obj+
+objects\imacs.obj+
+objects\sysintf.obj+
+objects\parse.obj+
+objects\getinp.obj+
+objects\quit.obj+
+objects\state.obj+
+objects\dmdump.obj+
+objects\macparse.obj+
+objects\rulparse.obj+
+objects\percent.obj+
+objects\function.obj+
+objects\dchdir.obj+
+objects\switchar.obj+
+objects\dstrlwr.obj+
+objects\arlib.obj+
+objects\dirbrk.obj+
+objects\tempnam.obj+
+objects\ruletab.obj+
+objects\utime.obj+
+objects\runargv.obj+
+objects\dcache.obj+
+objects\rmprq.obj
diff --git a/dmake/win95/borland/bcc50/public.h b/dmake/win95/borland/bcc50/public.h
new file mode 100644
index 000000000000..bca3bc332b31
--- /dev/null
+++ b/dmake/win95/borland/bcc50/public.h
@@ -0,0 +1,168 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:58:03 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int dchdir ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+void Remove_prq ANSI((CELLPTR));
+
+#endif
diff --git a/dmake/win95/borland/bcc50/template.mk b/dmake/win95/borland/bcc50/template.mk
new file mode 100644
index 000000000000..b5095c40ce2a
--- /dev/null
+++ b/dmake/win95/borland/bcc50/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= win95
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc50
diff --git a/dmake/win95/borland/config.mk b/dmake/win95/borland/config.mk
new file mode 100644
index 000000000000..8d5d69df5bd7
--- /dev/null
+++ b/dmake/win95/borland/config.mk
@@ -0,0 +1,51 @@
+# This is the Turbo C++ 2.0 DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# OS specific sources
+OSR_SRC += tempnam.c ruletab.c
+DOS_SRC += runargv.c rmprq.c
+
+SRC += $(OSR_SRC) $(DOS_SRC)
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS. Make sure your turboc.cfg
+# file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line
+# below!
+#CFLAGS += -DM_I86=1 -D__STDC__=1
+
+# You can get a smaller executable still, buy adding a -1 to the list of
+# flags below, but then you can't run this on an 8086/88 cpu.
+#CFLAGS += -1
+CFLAGS += -I$(osrdir) -d -O -N- -w-nod
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDHEAD) @$(LDTMPOBJ),$(TARGET),NUL.MAP$(LDTAIL)
+LDTAIL = $(_libs)$(LDFLAGS:s/ //)
+_libs = $(!null,$(LDLIBS) ,@$(LDTMPLIB))
+LDTMPOBJ = $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"+\n")\n)
+LDTMPLIB = $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\\,:t"+\n")\n)
+
+# Debugging information for Turbo-C
+DB_CFLAGS += -v
+DB_LDFLAGS += /v
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+.SETDIR=$(osrdir) : $(OSR_SRC)
+.SETDIR=msdos : $(DOS_SRC)
+
+S_s = -dmsmall
+S_m = -dmmedium
+S_c = -dmcompact
+S_l = -dmlarge
diff --git a/dmake/win95/borland/ruletab.c b/dmake/win95/borland/ruletab.c
new file mode 100644
index 000000000000..78aa04d04301
--- /dev/null
+++ b/dmake/win95/borland/ruletab.c
@@ -0,0 +1,44 @@
+/* RCS $Id: ruletab.c,v 1.3 2006-06-29 11:32:01 ihi Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+#include <stdio.h>
+
+static char *_rules[] = {
+ "MAXLINELENGTH := 32766",
+ "MAXPROCESSLIMIT := 4",
+ ".IMPORT .IGNORE: DMAKEROOT",
+ ".MAKEFILES : makefile.mk makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ (char *)NULL };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
+
diff --git a/dmake/win95/borland/sysintf.h b/dmake/win95/borland/sysintf.h
new file mode 100644
index 000000000000..d3d92cf68d34
--- /dev/null
+++ b/dmake/win95/borland/sysintf.h
@@ -0,0 +1,55 @@
+/* RCS $Id: sysintf.h,v 1.3 2007-01-18 09:49:31 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+#define Hook_std_writes(A)
+
+extern char * tempnam();
+extern char * getcwd();
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX _MAX_FNAME
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX _MAX_PATH
diff --git a/dmake/win95/borland/tempnam.c b/dmake/win95/borland/tempnam.c
new file mode 100644
index 000000000000..cb1bd9f5eb53
--- /dev/null
+++ b/dmake/win95/borland/tempnam.c
@@ -0,0 +1,114 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* Turbo C stdio.h doesn't define P_tmpdir, so let's do it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifndef P_tmpdir
+static char *P_tmpdir = "";
+#endif
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+#if defined(__WIN32__)
+ unsigned int _psp = rand();
+#endif
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/win95/config.mk b/dmake/win95/config.mk
new file mode 100644
index 000000000000..721be05b00f4
--- /dev/null
+++ b/dmake/win95/config.mk
@@ -0,0 +1,53 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+
+# Memory model to compile for
+# set to s - small, m - medium, c - compact, l - large
+# Need large model now, dmake has grown up :-)
+MODEL = l
+
+STARTUPFILE = startup/startup.mk
+
+CPPFLAGS = $(CFLAGS)
+
+# Debug flags
+DB_CFLAGS = -DDBUG
+DB_LDFLAGS =
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS =
+NDB_LDFLAGS =
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += -I$(OS)
+
+# Common Win32 source files.
+OS_SRC += dchdir.c switchar.c
+
+# Imported MSDOS Files.
+DOSSRC += dstrlwr.c arlib.c dirbrk.c
+
+SRC += $(OS_SRC) $(UNIXSRC) $(DOSSRC)
+
+# Provide our own %$O : %$S rule.
+%$O : %$S
+ +$(AS) $(ASFLAGS) \
+ $(<:s,\,${__.DIVSEP-sh-${USESHELL}},:s,/,${__.DIVSEP-sh-${USESHELL}},);
+ mv $(@:f) $(OBJDIR)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
+
+.SETDIR=msdos : $(DOSSRC)
+.SETDIR=$(OS) : $(ASRC) $(OS_SRC)
diff --git a/dmake/win95/dchdir.c b/dmake/win95/dchdir.c
new file mode 100644
index 000000000000..6a77d45b69fe
--- /dev/null
+++ b/dmake/win95/dchdir.c
@@ -0,0 +1,46 @@
+/* RCS $Id: dchdir.c,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
+--
+-- SYNOPSIS
+-- Change directory.
+--
+-- DESCRIPTION
+-- Under DOS change the current drive as well as the current directory.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <direct.h>
+#include "extern.h"
+
+PUBLIC int
+dchdir(path)
+char *path;
+{
+ int res;
+
+ res = chdir(path);
+
+ if (res != -1 && path[1] == ':') {
+ unsigned new_drive;
+
+ /* for WIN32 just use the _chdrive library call */
+ new_drive = (*path & ~0x20) - 'A' + 1;
+ _chdrive(new_drive);
+ }
+
+ return (res);
+}
diff --git a/dmake/win95/microsft/config.h b/dmake/win95/microsft/config.h
new file mode 100644
index 000000000000..e04d1bd72669
--- /dev/null
+++ b/dmake/win95/microsft/config.h
@@ -0,0 +1,122 @@
+/* $RCSfile: config.h,v $
+-- $Revision: 1.14 $
+-- last change: $Author: kz $ $Date: 2008-03-05 18:40:17 $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* Attention! In the UNIX like builds with the ./configure ; make
+ procedure a config.h is generated. The autogenerated config.h
+ must not be there to compile dmake with MSC and the
+ "dmake\make.bat win95-vpp40" command. This file sets (among other
+ things) the needed HAS_... and HAVE_... macros.
+
+ Don't forget to update the PACKAGE and VERSION macros!
+*/
+
+/* Name and version number of this package */
+#define PACKAGE "dmake"
+#define VERSION "4.12"
+#define BUILDINFO "Windows / MS Visual C++"
+
+#if defined (_MSC_VER)
+# if _MSC_VER < 500
+ Force a compile-time blowup.
+ Do not define "#define _MSC_VER" for MSC compilers earlier than 5.0.
+# endif
+#endif
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+#define coreleft() 0L
+
+/* MSC Version 4.0 doesn't understand SIGTERM, later versions do. */
+/* config.h is included before signal.h therefore test MSC version */
+#if _MSC_VER < 500
+# define SIGTERM SIGINT
+#endif
+
+/* Fixes unimplemented line buffering for MSC 5.x and 6.0.
+ * MSC _IOLBF is the same as _IOFBF
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# undef _IOLBF
+# define _IOLBF _IONBF
+#endif
+
+/* in alloc.h: size_t is redefined
+ * defined in stdio.h which is included by alloc.h
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# define _TYPES_
+#endif
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in MSC */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/* MSC didn't seem to care about CONST in the past */
+#ifndef CONST
+# define CONST
+#endif
+
+/* Assume case insensitive file system. */
+#define CASE_INSENSITIVE_FS 1
+
+/* MSC has sys/types.h and sys/stat.h (this is tested only with MSVC++ 6.0) */
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+
+/* These functions are available! (this is tested only with MSVC++ 6.0) */
+#define HAVE_GETCWD 1
+#define HAVE_UTIME_NULL 1
+#define HAVE_TZSET 1
+#define HAVE_STRLWR 1
+
+#define HAVE_ERRNO_H 1
+#define HAVE_STRERROR 1
+#define HAVE_TEMPNAM 1
+#define HAVE_FCNTL_H 1
+
+/* These defines are needed for itypes.h! (this is tested only with MSVC++ 6.0) */
+#define SIZEOF_INT 4
+#define SIZEOF_LONG 4
+#define SIZEOF_SHORT 2
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Use my own tempnam for MSC Version less than 6.0 */
+#if _MSC_VER < 600
+# define tempnam dtempnam
+#endif
+
diff --git a/dmake/win95/microsft/config.mk b/dmake/win95/microsft/config.mk
new file mode 100644
index 000000000000..acc43fd3160c
--- /dev/null
+++ b/dmake/win95/microsft/config.mk
@@ -0,0 +1,62 @@
+# This is the MSC 4.0 and higher DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+TMPDIR :=
+.EXPORT : TMPDIR
+
+# Definition of macros for library, and C startup code.
+
+# The following sources are required for MSC
+OSR_SRC += ruletab.c
+UNX_SRC += runargv.c rmprq.c
+
+.SETDIR=$(osrdir) : $(OSR_SRC)
+.SETDIR=unix : $(UNX_SRC)
+
+SRC += $(OSR_SRC) $(UNX_SRC)
+.SOURCE.h : $(osrdir)
+
+SET_STACK = /stack:4096
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+# Microsoft C doesn't need tail but needs head
+LDOBJS != $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDTAIL !=
+LDHEAD != $(LDFLAGS)
+LDARGS != $(LDHEAD) -out:$(TARGET) @$(LDTMPOBJ) $(LDTAIL)
+LDTAIL != $(_libs)
+_libs != $(!null,$(LDLIBS) ,@$(LDTMPLIB))
+LDTMPOBJ != $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\,:t"\n"))
+LDTMPLIB != $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\,:t"\n"))
+
+# Debugging libraries and flags
+DB_LDFLAGS += /nologo /co /li /map
+DB_LDLIBS +=
+DB_CFLAGS += -Zi
+
+# NO Debug MSC flags:
+# Set the environment variable MSC_VER to be one of 5.1, 6.0, 8.0 (for VC++4.0)
+# to get these by default when you make dmake using 'dmake'.
+#
+
+NDB_LDFLAGS += /nologo
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+CFLAGS += /nologo
+
+S_s = -Dmsmall
+S_m = -Dmmedium
+S_c = -Dmcompact
+S_l = -Dmlarge
diff --git a/dmake/win95/microsft/optoff.h b/dmake/win95/microsft/optoff.h
new file mode 100644
index 000000000000..019605931851
--- /dev/null
+++ b/dmake/win95/microsft/optoff.h
@@ -0,0 +1,27 @@
+/* RCS $Id: optoff.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
+--
+-- SYNOPSIS
+-- Turn off microsoft loop optimization.
+--
+-- DESCRIPTION
+-- This is broken in some pre 600 compilers so just turn it off.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#if _MSC_VER < 600
+# pragma loop_opt(off)
+#endif
diff --git a/dmake/win95/microsft/ruletab.c b/dmake/win95/microsft/ruletab.c
new file mode 100644
index 000000000000..12edbeb84de7
--- /dev/null
+++ b/dmake/win95/microsft/ruletab.c
@@ -0,0 +1,56 @@
+/* RCS $Id: ruletab.c,v 1.5 2008-03-05 18:40:54 kz Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+#include "extern.h"
+
+#if !defined(MAXIMUM_WAIT_OBJECTS)
+#define MAXIMUM_WAIT_OBJECTS 1
+#endif
+
+/* To stringify the result of the expansion of a macro argument
+ * use two levels of macros. */
+#define dmstr2(s) dmstr1(s)
+#define dmstr1(s) #s
+
+static char *_rules[] = {
+ "MAXLINELENGTH := 32766",
+ "MAXPROCESSLIMIT := " dmstr2(MAXIMUM_WAIT_OBJECTS) ,
+ ".IMPORT .IGNORE: DMAKEROOT",
+ ".MAKEFILES : makefile.mk makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+#if __MINGW32__
+# include "dmakeroot.h"
+#endif
+ (char *)NULL };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
+
diff --git a/dmake/win95/microsft/sysintf.h b/dmake/win95/microsft/sysintf.h
new file mode 100644
index 000000000000..3434847f3327
--- /dev/null
+++ b/dmake/win95/microsft/sysintf.h
@@ -0,0 +1,57 @@
+/* RCS $Id: sysintf.h,v 1.3 2007-01-18 09:50:52 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+#define Hook_std_writes(A)
+
+extern char * tempnam();
+extern char * getcwd();
+
+/* for directory cache */
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX _MAX_FNAME
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX _MAX_PATH
diff --git a/dmake/win95/microsft/tempnam.c b/dmake/win95/microsft/tempnam.c
new file mode 100644
index 000000000000..c3a8fa140f29
--- /dev/null
+++ b/dmake/win95/microsft/tempnam.c
@@ -0,0 +1,110 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <process.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* MSC stdio.h defines P_tmpdir, so let's undo it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifdef P_tmpdir
+#undef P_tmpdir
+#endif
+static char *P_tmpdir = "";
+
+char *
+dtempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", getpid() );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/win95/microsft/vpp40/config.mk b/dmake/win95/microsft/vpp40/config.mk
new file mode 100644
index 000000000000..14fe952eac00
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/config.mk
@@ -0,0 +1,14 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+.IMPORT .IGNORE : MSC_VER
+MSC_VER *= 8.0
+
+CFLAGS += -I$(osedir)
+
+NDB_CFLAGS += -Od -GF -Ge
+NDB_LDFLAGS +=
+NDB_LDLIBS +=
+
+# Redefine rule for making our objects, we don't need mv
+%$O : %.c ;% $(CC) -c $(CFLAGS) -Fo$@ $<
diff --git a/dmake/win95/microsft/vpp40/lib.rsp b/dmake/win95/microsft/vpp40/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/win95/microsft/vpp40/mk.bat b/dmake/win95/microsft/vpp40/mk.bat
new file mode 100755
index 000000000000..1f1cee1d0d34
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/mk.bat
@@ -0,0 +1,41 @@
+if not "%1" == "" goto link
+if exist objects rd /S /Q objects
+if exist config.h del config.h
+if exist dmake.exe del dmake.exe
+md objects
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\infer.obj infer.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\make.obj make.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\stat.obj stat.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\expand.obj expand.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmstring.obj dmstring.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\hash.obj hash.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dag.obj dag.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmake.obj dmake.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\path.obj path.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\imacs.obj imacs.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\sysintf.obj sysintf.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\parse.obj parse.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\getinp.obj getinp.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\quit.obj quit.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\state.obj state.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmdump.obj dmdump.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\macparse.obj macparse.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\rulparse.obj rulparse.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\percent.obj percent.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\function.obj function.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dchdir.obj win95\dchdir.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\switchar.obj win95\switchar.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dstrlwr.obj msdos\dstrlwr.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\arlib.obj msdos\arlib.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dirbrk.obj msdos\dirbrk.c
+rem Not needed for MSVC 6 and up. Lesser versions not supported
+rem cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\tempnam.obj tempnam.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\ruletab.obj win95\microsft\ruletab.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\runargv.obj unix\runargv.c
+cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\rmprq.obj unix\rmprq.c
+
+:link
+rem link /nologo /out:dmake.exe @fix95nt\win95\microsft\vpp40\obj.rsp
+if "%c_flg%" == "" link /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp
+if not "%c_flg%" == "" link /DEBUG:notmapped,full /DEBUGTYPE:cv /PDB:NONE /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp
+copy win95\microsft\vpp40\template.mk startup\config.mk
diff --git a/dmake/win95/microsft/vpp40/obj.rsp b/dmake/win95/microsft/vpp40/obj.rsp
new file mode 100644
index 000000000000..ae89a27c3940
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/obj.rsp
@@ -0,0 +1,28 @@
+objects\infer.obj
+objects\make.obj
+objects\stat.obj
+objects\expand.obj
+objects\dmstring.obj
+objects\hash.obj
+objects\dag.obj
+objects\dmake.obj
+objects\path.obj
+objects\imacs.obj
+objects\sysintf.obj
+objects\parse.obj
+objects\getinp.obj
+objects\quit.obj
+objects\state.obj
+objects\dmdump.obj
+objects\macparse.obj
+objects\rulparse.obj
+objects\percent.obj
+objects\function.obj
+objects\dchdir.obj
+objects\switchar.obj
+objects\dstrlwr.obj
+objects\arlib.obj
+objects\dirbrk.obj
+objects\ruletab.obj
+objects\runargv.obj
+objects\rmprq.obj
diff --git a/dmake/win95/microsft/vpp40/public.h b/dmake/win95/microsft/vpp40/public.h
new file mode 100644
index 000000000000..94b50d22c214
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.8 2007-10-15 15:58:42 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int dchdir ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+void Remove_prq ANSI((CELLPTR));
+
+#endif
diff --git a/dmake/win95/microsft/vpp40/runargv.c b/dmake/win95/microsft/vpp40/runargv.c
new file mode 100644
index 000000000000..fab9258d6d61
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/runargv.c
@@ -0,0 +1,288 @@
+Blake sent me the wrong one.
+
+/* RCS $Id: runargv.c,v 1.2 2007-10-15 15:58:54 ihi Exp $
+--
+-- SYNOPSIS
+-- Invoke a sub process.
+--
+-- DESCRIPTION
+-- Use the standard methods of executing a sub process.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <process.h>
+#include <errno.h>
+#include <signal.h>
+#include "extern.h"
+#include "sysintf.h"
+
+extern char **environ;
+
+typedef struct prp {
+ char *prp_cmd;
+ int prp_group;
+ int prp_ignore;
+ int prp_last;
+ int prp_shell;
+ struct prp *prp_next;
+} RCP, *RCPPTR;
+
+typedef struct pr {
+ int pr_valid;
+ int pr_pid;
+ CELLPTR pr_target;
+ int pr_ignore;
+ int pr_last;
+ RCPPTR pr_recipe;
+ RCPPTR pr_recipe_end;
+ char *pr_dir;
+} PR;
+
+static PR *_procs = NIL(PR);
+static int _proc_cnt = 0;
+static int _abort_flg= FALSE;
+static int _use_i = -1;
+static int _do_upd = 0;
+
+static void _add_child ANSI((int, CELLPTR, int, int));
+static void _attach_cmd ANSI((char *, int, int, CELLPTR, int, int));
+static void _finished_child ANSI((int, int));
+static int _running ANSI((CELLPTR));
+
+PUBLIC int
+runargv(target, ignore, group, last, shell, cmd)
+CELLPTR target;
+int ignore;
+int group;
+int last;
+int shell;
+char *cmd;
+{
+ extern int errno;
+ extern char *sys_errlist[];
+ int pid;
+ char **argv;
+
+ if( _running(target) /*&& Max_proc != 1*/ ) {
+ /* The command will be executed when the previous recipe
+ * line completes. */
+ _attach_cmd( cmd, group, ignore, target, last, shell );
+ return(1);
+ }
+
+ while( _proc_cnt == Max_proc )
+ if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child %d", errno );
+
+ argv = Pack_argv( group, shell, cmd );
+
+ pid = _spawnvpe(_P_NOWAIT, argv[0], argv, environ);
+ if (pid == -1) { /* failed */
+ Error("%s: %s", argv[0], sys_errlist[errno]);
+ Handle_result(-1, ignore, _abort_flg, target);
+ return(-1);
+ } else
+ _add_child(pid, target, ignore, last);
+
+ return(1);
+}
+
+
+PUBLIC int
+Wait_for_child( abort_flg, pid )
+int abort_flg;
+int pid;
+{
+ int wid;
+ int status;
+ int waitchild;
+
+ waitchild = (pid == -1)? FALSE : Wait_for_completion;
+
+ do {
+ if( (wid = wait(&status)) == -1 ) return(-1);
+
+ _abort_flg = abort_flg;
+ _finished_child(wid, status);
+ _abort_flg = FALSE;
+ } while( waitchild && pid != wid );
+
+ return(0);
+}
+
+
+PUBLIC void
+Clean_up_processes()
+{
+ register int i;
+
+ if( _procs != NIL(PR) ) {
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid )
+ kill(_procs[i].pr_pid, SIGTERM);
+
+ while( Wait_for_child(TRUE, -1) != -1 );
+ }
+}
+
+
+static void
+_add_child( pid, target, ignore, last )
+int pid;
+CELLPTR target;
+int ignore;
+int last;
+{
+ register int i;
+ register PR *pp;
+
+ if( _procs == NIL(PR) ) {
+ TALLOC( _procs, Max_proc, PR );
+ }
+
+ if( (i = _use_i) == -1 )
+ for( i=0; i<Max_proc; i++ )
+ if( !_procs[i].pr_valid )
+ break;
+
+ pp = _procs+i;
+
+ pp->pr_valid = 1;
+ pp->pr_pid = pid;
+ pp->pr_target = target;
+ pp->pr_ignore = ignore;
+ pp->pr_last = last;
+ pp->pr_dir = DmStrDup(Get_current_dir());
+
+ Current_target = NIL(CELL);
+
+ _proc_cnt++;
+
+ if( Wait_for_completion ) Wait_for_child( FALSE, pid );
+}
+
+
+static void
+_finished_child(pid, status)
+int pid;
+int status;
+{
+ register int i;
+ register PR *pp;
+ char *dir;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
+ break;
+
+ /* Some children we didn't make esp true if using /bin/sh to execute a
+ * a pipe and feed the output as a makefile into dmake. */
+ if( i == Max_proc ) return;
+ _procs[i].pr_valid = 0;
+ _proc_cnt--;
+ dir = DmStrDup(Get_current_dir());
+ Set_dir( _procs[i].pr_dir );
+
+ if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
+ RCPPTR rp = _procs[i].pr_recipe;
+
+
+ Current_target = _procs[i].pr_target;
+ Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
+ Current_target = NIL(CELL);
+
+ if ( _procs[i].pr_target->ce_attr & A_ERROR ) {
+ _procs[i].pr_last = TRUE;
+ goto ABORT_REMAINDER_OF_RECIPE;
+ }
+
+ _procs[i].pr_recipe = rp->prp_next;
+
+ _use_i = i;
+ runargv( _procs[i].pr_target, rp->prp_ignore, rp->prp_group,
+ rp->prp_last, rp->prp_shell, rp->prp_cmd );
+ _use_i = -1;
+
+ FREE( rp->prp_cmd );
+ FREE( rp );
+
+ if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
+ }
+ else {
+ Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
+
+ ABORT_REMAINDER_OF_RECIPE:
+ if( _procs[i].pr_last ) {
+ FREE(_procs[i].pr_dir );
+
+ if( !Doing_bang ) Update_time_stamp( _procs[i].pr_target );
+ }
+ }
+
+ Set_dir(dir);
+ FREE(dir);
+}
+
+
+static int
+_running( cp )
+CELLPTR cp;
+{
+ register int i;
+
+ if( !_procs ) return(FALSE);
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ return( i != Max_proc );
+}
+
+
+static void
+_attach_cmd( cmd, group, ignore, cp, last, shell )
+char *cmd;
+int group;
+int ignore;
+CELLPTR cp;
+int last;
+int shell;
+{
+ register int i;
+ RCPPTR rp;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ TALLOC( rp, 1, RCP );
+ rp->prp_cmd = DmStrDup(cmd);
+ rp->prp_group = group;
+ rp->prp_ignore= ignore;
+ rp->prp_last = last;
+ rp->prp_shell = shell;
+
+ if( _procs[i].pr_recipe == NIL(RCP) )
+ _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
+ else {
+ _procs[i].pr_recipe_end->prp_next = rp;
+ _procs[i].pr_recipe_end = rp;
+ }
+}
diff --git a/dmake/win95/microsft/vpp40/template.mk b/dmake/win95/microsft/vpp40/template.mk
new file mode 100644
index 000000000000..d4e6c9eb9f40
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= win95
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= vpp40
diff --git a/dmake/win95/microsft/vpp40/tempnam.c b/dmake/win95/microsft/vpp40/tempnam.c
new file mode 100644
index 000000000000..c27da47c7602
--- /dev/null
+++ b/dmake/win95/microsft/vpp40/tempnam.c
@@ -0,0 +1,110 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* MSC stdio.h defines P_tmpdir, so let's undo it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifdef P_tmpdir
+#undef P_tmpdir
+#endif
+static char *P_tmpdir = "";
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/win95/startup.h b/dmake/win95/startup.h
new file mode 100644
index 000000000000..af0f88c1e6d3
--- /dev/null
+++ b/dmake/win95/startup.h
@@ -0,0 +1,28 @@
+/* RCS $Id: startup.h,v 1.2 2006-04-20 12:23:16 hr Exp $
+--
+-- SYNOPSIS
+-- Definition of MAKESTARTUP
+--
+-- DESCRIPTION
+-- Default MAKESTARTUP value defining where dmake locates the
+-- startup file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"DMAKEROOT *= $(ABSMAKECMD:d)startup",
+"MAKESTARTUP := $(DMAKEROOT)\\startup.mk",
diff --git a/dmake/win95/switchar.c b/dmake/win95/switchar.c
new file mode 100644
index 000000000000..783d02cefe77
--- /dev/null
+++ b/dmake/win95/switchar.c
@@ -0,0 +1,43 @@
+/* RCS $Id: switchar.c,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $
+--
+-- SYNOPSIS
+-- switchar settings
+--
+-- DESCRIPTION
+-- Figure out the value of switchar.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "stdmacs.h"
+
+getswitchar()/*
+===============
+ Try the environment first. If you don't find SWITCHAR there, then use
+ the DOS call. The call is undocumented, and doesn't work for DOS versions
+ 4.0 and up, so the check of the environment will fix that. */
+{
+ static char *_env_switchar = NIL(char);
+
+ if( _env_switchar != NIL(char) ||
+ (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
+ return(*_env_switchar);
+
+ return ('/');
+}
diff --git a/dmake/winnt/borland/bcc50/config.h b/dmake/winnt/borland/bcc50/config.h
new file mode 100644
index 000000000000..77c577995664
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/config.h
@@ -0,0 +1,44 @@
+/* RCS $Id: config.h,v 1.2 2008-03-05 18:41:34 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+/*#define coreleft() 0L*/
+extern unsigned int coreleft();
+
+#define SIGQUIT SIGBREAK /* turbo C doesn't understand SIGQUIT */
+
+/* Turbo-C understands const declarations. */
+#define CONST const
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Borland redefined the environment variable, sigh */
+#define environ _environ
diff --git a/dmake/winnt/borland/bcc50/config.mk b/dmake/winnt/borland/bcc50/config.mk
new file mode 100644
index 000000000000..6e4fbd89e368
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/config.mk
@@ -0,0 +1,12 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+# Change the CCROOT variable to reflect the installation directory of your
+# C++ compiler.
+CCVER *:= c:/cc/borland/$(OSENVIRONMENT)
+
+# Definitions for compiles and links
+CSTARTUP = $(CCVER)/lib/c0x32.obj
+LDLIBS = $(CCVER)/lib/cw32 $(CCVER)/lib/import32
+
+CFLAGS += -A- -w-pro -I$(osedir)
diff --git a/dmake/winnt/borland/bcc50/lib.rsp b/dmake/winnt/borland/bcc50/lib.rsp
new file mode 100644
index 000000000000..0bad32e7128d
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/lib.rsp
@@ -0,0 +1,2 @@
+c:\cc\borland\bcc50\lib\cw32
+c:\cc\borland\bcc50\lib\import32
diff --git a/dmake/winnt/borland/bcc50/mk.bat b/dmake/winnt/borland/bcc50/mk.bat
new file mode 100755
index 000000000000..f6e3c75fce78
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/mk.bat
@@ -0,0 +1,95 @@
+md objects
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 infer.c
+copy infer.obj objects
+del infer.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 make.c
+copy make.obj objects
+del make.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 stat.c
+copy stat.obj objects
+del stat.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 expand.c
+copy expand.obj objects
+del expand.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 hash.c
+copy hash.obj objects
+del hash.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dag.c
+copy dag.obj objects
+del dag.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 path.c
+copy path.obj objects
+del path.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 parse.c
+copy parse.obj objects
+del parse.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 quit.c
+copy quit.obj objects
+del quit.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 state.c
+copy state.obj objects
+del state.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 percent.c
+copy percent.obj objects
+del percent.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 function.c
+copy function.obj objects
+del function.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\switchar.c
+copy switchar.obj objects
+del switchar.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\utime.c
+copy utime.obj objects
+del utime.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 win95\borland\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc32 -c -I. -Iwin95 -Iwin95\borland -d -O -N- -w-nod -A- -w-pro -Iwin95\borland\bcc50 unix\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+tlink32 @win95\borland\bcc50\obj.rsp,dmake.exe,NUL.MAP,@win95\borland\bcc50\lib.rsp
diff --git a/dmake/winnt/borland/bcc50/mk.cmd b/dmake/winnt/borland/bcc50/mk.cmd
new file mode 100755
index 000000000000..7f212e9c4f09
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/mk.cmd
@@ -0,0 +1,93 @@
+md objects
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 infer.c
+copy infer.obj objects
+del infer.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 make.c
+copy make.obj objects
+del make.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 stat.c
+copy stat.obj objects
+del stat.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 expand.c
+copy expand.obj objects
+del expand.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 dmstring.c
+copy dmstring.obj objects
+del dmstring.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 hash.c
+copy hash.obj objects
+del hash.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 dag.c
+copy dag.obj objects
+del dag.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 dmake.c
+copy dmake.obj objects
+del dmake.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 path.c
+copy path.obj objects
+del path.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 imacs.c
+copy imacs.obj objects
+del imacs.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 sysintf.c
+copy sysintf.obj objects
+del sysintf.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 parse.c
+copy parse.obj objects
+del parse.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 getinp.c
+copy getinp.obj objects
+del getinp.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 quit.c
+copy quit.obj objects
+del quit.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 state.c
+copy state.obj objects
+del state.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 dmdump.c
+copy dmdump.obj objects
+del dmdump.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 macparse.c
+copy macparse.obj objects
+del macparse.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 rulparse.c
+copy rulparse.obj objects
+del rulparse.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 percent.c
+copy percent.obj objects
+del percent.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 function.c
+copy function.obj objects
+del function.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 winnt\dchdir.c
+copy dchdir.obj objects
+del dchdir.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 msdos\dstrlwr.c
+copy dstrlwr.obj objects
+del dstrlwr.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 msdos\arlib.c
+copy arlib.obj objects
+del arlib.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 msdos\dirbrk.c
+copy dirbrk.obj objects
+del dirbrk.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 winnt\borland\tempnam.c
+copy tempnam.obj objects
+del tempnam.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 winnt\borland\ruletab.c
+copy ruletab.obj objects
+del ruletab.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 winnt\borland\utime.c
+copy utime.obj objects
+del utime.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 winnt\borland\runargv.c
+copy runargv.obj objects
+del runargv.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 unix\dcache.c
+copy dcache.obj objects
+del dcache.obj
+bcc32 -c -I. -Iwinnt -Iwinnt\borland -d -O -N- -w-nod -A- -w-pro -Iwinnt\borland\bcc50 unix\rmprq.c
+copy rmprq.obj objects
+del rmprq.obj
+tlink32 @fix95nt\winnt\borland\bcc50\obj.rsp,dmake.exe,NUL.MAP,@fix95nt\winnt\borland\bcc50\lib.rsp
+copy winnt\borland\bcc50\template.mk startup\config.mk
diff --git a/dmake/winnt/borland/bcc50/obj.rsp b/dmake/winnt/borland/bcc50/obj.rsp
new file mode 100644
index 000000000000..9cf59afdedd2
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/obj.rsp
@@ -0,0 +1,31 @@
+c:\cc\borland\bcc50\lib\c0x32.obj
+objects\infer.obj
+objects\make.obj
+objects\stat.obj
+objects\expand.obj
+objects\dmstring.obj
+objects\hash.obj
+objects\dag.obj
+objects\dmake.obj
+objects\path.obj
+objects\imacs.obj
+objects\sysintf.obj
+objects\parse.obj
+objects\getinp.obj
+objects\quit.obj
+objects\state.obj
+objects\dmdump.obj
+objects\macparse.obj
+objects\rulparse.obj
+objects\percent.obj
+objects\function.obj
+objects\dchdir.obj
+objects\dstrlwr.obj
+objects\arlib.obj
+objects\dirbrk.obj
+objects\tempnam.obj
+objects\ruletab.obj
+objects\utime.obj
+objects\runargv.obj
+objects\dcache.obj
+objects\rmprq.obj
diff --git a/dmake/winnt/borland/bcc50/public.h b/dmake/winnt/borland/bcc50/public.h
new file mode 100644
index 000000000000..1965c0210483
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/public.h
@@ -0,0 +1,168 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:59:14 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int dchdir ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+int Wait_for_child ANSI((int, int));
+void Clean_up_processes ANSI(());
+time_t CacheStat ANSI((char *, int));
+void Remove_prq ANSI((CELLPTR));
+
+#endif
diff --git a/dmake/winnt/borland/bcc50/template.mk b/dmake/winnt/borland/bcc50/template.mk
new file mode 100644
index 000000000000..b94ac034e0a1
--- /dev/null
+++ b/dmake/winnt/borland/bcc50/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= winnt
+ OSRELEASE *:= borland
+ OSENVIRONMENT *:= bcc50
diff --git a/dmake/winnt/borland/config.mk b/dmake/winnt/borland/config.mk
new file mode 100644
index 000000000000..85c929b4163e
--- /dev/null
+++ b/dmake/winnt/borland/config.mk
@@ -0,0 +1,51 @@
+# This is the Turbo C++ 2.0 DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+# OS specific sources
+OSR_SRC += tempnam.c ruletab.c
+DOS_SRC += runargv.c rmprq.c
+
+SRC += $(OSR_SRC) $(DOS_SRC)
+.SOURCE.h : $(osrdir)
+
+# Local configuration modifications for CFLAGS. Make sure your turboc.cfg
+# file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line
+# below!
+#CFLAGS += -DM_I86=1 -D__STDC__=1
+
+# You can get a smaller executable still, buy adding a -1 to the list of
+# flags below, but then you can't run this on an 8086/88 cpu.
+#CFLAGS += -1
+CFLAGS += -I$(osrdir) -d -O -N- -w-nod
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
+LDARGS = $(LDHEAD) @$(LDTMPOBJ),$(TARGET),NUL.MAP$(LDTAIL)
+LDTAIL = $(_libs)$(LDFLAGS:s/ //)
+_libs = $(!null,$(LDLIBS) ,@$(LDTMPLIB))
+LDTMPOBJ = $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"+\n")\n)
+LDTMPLIB = $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\\,:t"+\n")\n)
+
+# Debugging information for Turbo-C
+DB_CFLAGS += -v
+DB_LDFLAGS += /v
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+.SETDIR=$(osrdir) : $(OSR_SRC)
+.SETDIR=msdos : $(DOS_SRC)
+
+S_s = -dmsmall
+S_m = -dmmedium
+S_c = -dmcompact
+S_l = -dmlarge
diff --git a/dmake/winnt/borland/ruletab.c b/dmake/winnt/borland/ruletab.c
new file mode 100644
index 000000000000..855f05515e5c
--- /dev/null
+++ b/dmake/winnt/borland/ruletab.c
@@ -0,0 +1,44 @@
+/* RCS $Id: ruletab.c,v 1.3 2006-06-29 11:32:41 ihi Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+#include <stdio.h>
+
+static char *_rules[] = {
+ "MAXLINELENGTH := 32766",
+ "MAXPROCESSLIMIT := 4",
+ ".IMPORT .IGNORE: DMAKEROOT",
+ ".MAKEFILES : makefile.mk makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ (char *)NULL };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
+
diff --git a/dmake/winnt/borland/sysintf.h b/dmake/winnt/borland/sysintf.h
new file mode 100644
index 000000000000..23b6a6c247d3
--- /dev/null
+++ b/dmake/winnt/borland/sysintf.h
@@ -0,0 +1,55 @@
+/* RCS $Id: sysintf.h,v 1.3 2007-01-18 09:51:20 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+#define Hook_std_writes(A)
+
+extern char * tempnam();
+extern char * getcwd();
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX _MAX_FNAME
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX _MAX_PATH
diff --git a/dmake/winnt/borland/tempnam.c b/dmake/winnt/borland/tempnam.c
new file mode 100644
index 000000000000..a7d0df8d962b
--- /dev/null
+++ b/dmake/winnt/borland/tempnam.c
@@ -0,0 +1,114 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* Turbo C stdio.h doesn't define P_tmpdir, so let's do it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifndef P_tmpdir
+static char *P_tmpdir = "";
+#endif
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+#if defined(__WIN32__)
+ unsigned int _psp = rand();
+#endif
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/winnt/config.mk b/dmake/winnt/config.mk
new file mode 100644
index 000000000000..2abcb8ad66c6
--- /dev/null
+++ b/dmake/winnt/config.mk
@@ -0,0 +1,57 @@
+# This is an OS specific configuration file
+# It assumes that OBJDIR, TARGET and DEBUG are previously defined.
+# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
+# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
+#
+
+# Memory model to compile for
+# set to s - small, m - medium, c - compact, l - large
+# Need large model now, dmake has grown up :-)
+MODEL = l
+
+STARTUPFILE = startup/startup.mk
+
+CPPFLAGS = $(CFLAGS)
+
+# Debug flags
+DB_CFLAGS = -DDBUG
+DB_LDFLAGS =
+DB_LDLIBS =
+
+# NO Debug flags
+NDB_CFLAGS =
+NDB_LDFLAGS =
+NDB_LDLIBS =
+
+# Local configuration modifications for CFLAGS.
+CFLAGS += -I$(OS)
+
+# Common Win32 source files.
+OS_SRC += dchdir.c
+
+# Imported Win95 files.
+WIN95SRC += switchar.c
+
+# Imported MSDOS Files.
+DOSSRC += dstrlwr.c arlib.c dirbrk.c
+
+SRC += $(OS_SRC) $(UNIXSRC) $(DOSSRC)
+
+# Provide our own %$O : %$S rule.
+%$O : %$S
+ +$(AS) $(ASFLAGS) \
+ $(<:s,\,${__.DIVSEP-sh-${USESHELL}},:s,/,${__.DIVSEP-sh-${USESHELL}},);
+ mv $(@:f) $(OBJDIR)
+
+# Set source dirs so that we can find files named in this
+# config file.
+.SOURCE.h : $(OS)
+
+# See if we modify anything in the lower levels.
+.IF $(OSRELEASE) != $(NULL)
+ .INCLUDE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
+.END
+
+.SETDIR=msdos : $(DOSSRC)
+.SETDIR=win95 : $(WIN95SRC)
+.SETDIR=$(OS) : $(ASRC) $(OS_SRC)
diff --git a/dmake/winnt/dchdir.c b/dmake/winnt/dchdir.c
new file mode 100644
index 000000000000..de2cf18041a8
--- /dev/null
+++ b/dmake/winnt/dchdir.c
@@ -0,0 +1,47 @@
+/* RCS $Id: dchdir.c,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- Change directory.
+--
+-- DESCRIPTION
+-- Under DOS change the current drive as well as the current directory.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <dir.h>
+#include <direct.h>
+#include "extern.h"
+
+PUBLIC int
+dchdir(path)
+char *path;
+{
+ int res;
+
+ res = chdir(path);
+
+ if (res != -1 && path[1] == ':') {
+ unsigned new_drive;
+
+ /* for WIN32 just use the _chdrive library call */
+ new_drive = (*path & ~0x20) - 'A' + 1;
+ _chdrive(new_drive);
+ }
+
+ return (res);
+}
diff --git a/dmake/winnt/microsft/config.h b/dmake/winnt/microsft/config.h
new file mode 100644
index 000000000000..32d59716185a
--- /dev/null
+++ b/dmake/winnt/microsft/config.h
@@ -0,0 +1,85 @@
+/* RCS $Id: config.h,v 1.9 2008-03-05 18:41:51 kz Exp $
+--
+-- SYNOPSIS
+-- Configurarion include file.
+--
+-- DESCRIPTION
+-- There is one of these for each specific machine configuration.
+-- It can be used to further tweek the machine specific sources
+-- so that they compile.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* Name and version number of this package */
+#define PACKAGE "dmake"
+#define VERSION "4.12"
+#define BUILDINFO "Windows / MS Visual C++"
+
+#if defined (_MSC_VER)
+# if _MSC_VER < 500
+ Force a compile-time blowup.
+ Do not define "#define _MSC_VER" for MSC compilers earlier than 5.0.
+# endif
+#endif
+
+/* define this for configurations that don't have the coreleft function
+ * so that the code compiles. To my knowledge coreleft exists only on
+ * Turbo C, but it is needed here since the function is used in many debug
+ * macros. */
+#define coreleft() 0L
+
+/* MSC Version 4.0 doesn't understand SIGTERM, later versions do. */
+#ifndef SIGTERM
+# define SIGTERM SIGINT
+#endif
+
+/* Fixes unimplemented line buffering for MSC 5.x and 6.0.
+ * MSC _IOLBF is the same as _IOFBF
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# undef _IOLBF
+# define _IOLBF _IONBF
+#endif
+
+/* in alloc.h: size_t is redefined
+ * defined in stdio.h which is included by alloc.h
+ */
+#if defined(MSDOS) && defined (_MSC_VER)
+# define _TYPES_
+#endif
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in MSC */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/* MSC didn't seem to care about CONST in the past */
+#ifndef CONST
+# define CONST
+#endif
+
+#ifndef MSDOS
+# define MSDOS 1
+#endif
+
+/* a small problem with pointer to voids on some unix machines needs this */
+#define DMPVOID void *
+
+/* Use my own tempnam */
+#define tempnam dtempnam
+
diff --git a/dmake/winnt/microsft/config.mk b/dmake/winnt/microsft/config.mk
new file mode 100644
index 000000000000..352eed716d2f
--- /dev/null
+++ b/dmake/winnt/microsft/config.mk
@@ -0,0 +1,61 @@
+# This is the MSC 4.0 and higher DOS configuration file for DMAKE
+# It simply modifies the values of SRC, and checks to see if
+# OSENVIRONMENT is defined. If so it includes the appropriate
+# config.mk file.
+#
+# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
+# directory.
+#
+osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
+
+TMPDIR :=
+.EXPORT : TMPDIR
+
+# Definition of macros for library, and C startup code.
+
+# The following sources are required for MSC
+OSR_SRC += tempnam.c ruletab.c
+DOS_SRC += runargv.c rmprq.c
+
+.SETDIR=$(osrdir) : $(OSR_SRC)
+.SETDIR=msdos : $(DOS_SRC)
+
+SRC += $(OSR_SRC) $(DOS_SRC)
+.SOURCE.h : $(osrdir)
+
+SET_STACK = /stack:4096
+ASFLAGS += -t -mx $(S_$(MODEL))
+
+# Microsoft C doesn't need tail but needs head
+LDTAIL !=
+LDHEAD != $(LDFLAGS)
+LDARGS != $(LDHEAD) -out:$(TARGET) @$(LDTMPOBJ) $(LDTAIL)
+LDTAIL != $(_libs)
+_libs != $(!null,$(LDLIBS) ,@$(LDTMPLIB))
+LDTMPOBJ != $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"\n")\n)
+LDTMPLIB != $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\\,:t"\n")\n)
+
+# Debugging libraries and flags
+DB_LDFLAGS += /nologo /co /li /map
+DB_LDLIBS +=
+DB_CFLAGS += -Zi
+
+# NO Debug MSC flags:
+# Set the environment variable MSC_VER to be one of 5.1, 6.0, 8.0 (for VC++4.0)
+# to get these by default when you make dmake using 'dmake'.
+#
+
+NDB_LDFLAGS += /nologo
+CFLAGS += -I$(osrdir)
+
+# See if we modify anything in the lower levels.
+.IF $(OSENVIRONMENT) != $(NULL)
+ .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
+.END
+
+CFLAGS += /nologo
+
+S_s = -Dmsmall
+S_m = -Dmmedium
+S_c = -Dmcompact
+S_l = -Dmlarge
diff --git a/dmake/winnt/microsft/optoff.h b/dmake/winnt/microsft/optoff.h
new file mode 100644
index 000000000000..7dd3cb839572
--- /dev/null
+++ b/dmake/winnt/microsft/optoff.h
@@ -0,0 +1,27 @@
+/* RCS $Id: optoff.h,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- Turn off microsoft loop optimization.
+--
+-- DESCRIPTION
+-- This is broken in some pre 600 compilers so just turn it off.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+#if _MSC_VER < 600
+# pragma loop_opt(off)
+#endif
diff --git a/dmake/winnt/microsft/ruletab.c b/dmake/winnt/microsft/ruletab.c
new file mode 100644
index 000000000000..ed7686f7b5e0
--- /dev/null
+++ b/dmake/winnt/microsft/ruletab.c
@@ -0,0 +1,45 @@
+/* RCS $Id: ruletab.c,v 1.3 2006-06-29 11:33:07 ihi Exp $
+--
+-- SYNOPSIS
+-- Default initial configuration of dmake.
+--
+-- DESCRIPTION
+-- Define here the initial set of rules that are defined before
+-- dmake performs any processing.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/* These are control macros for dmake that MUST be defined at some point
+ * if they are NOT dmake will not work! These are default definitions. They
+ * may be overridden inside the .STARTUP makefile, they are here
+ * strictly so that dmake can parse the STARTUP makefile */
+
+#include <stdio.h>
+
+static char *_rules[] = {
+ "MAXLINELENGTH := 32766",
+ "MAXPROCESSLIMIT := 4",
+ "MAXPROCESS := 1",
+ ".IMPORT .IGNORE: DMAKEROOT"
+ ".MAKEFILES : makefile.mk makefile",
+ ".SOURCE : .NULL",
+#include "startup.h"
+ (char *)NULL };
+
+char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
+
diff --git a/dmake/winnt/microsft/sysintf.h b/dmake/winnt/microsft/sysintf.h
new file mode 100644
index 000000000000..010280bb802b
--- /dev/null
+++ b/dmake/winnt/microsft/sysintf.h
@@ -0,0 +1,57 @@
+/* RCS $Id: sysintf.h,v 1.3 2007-01-18 09:52:02 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+#define Hook_std_writes(A)
+
+extern char * tempnam();
+extern char * getcwd();
+
+/* for directory cache */
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX _MAX_FNAME
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX _MAX_PATH
diff --git a/dmake/winnt/microsft/tempnam.c b/dmake/winnt/microsft/tempnam.c
new file mode 100644
index 000000000000..c3a8fa140f29
--- /dev/null
+++ b/dmake/winnt/microsft/tempnam.c
@@ -0,0 +1,110 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <process.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* MSC stdio.h defines P_tmpdir, so let's undo it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifdef P_tmpdir
+#undef P_tmpdir
+#endif
+static char *P_tmpdir = "";
+
+char *
+dtempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", getpid() );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/winnt/microsft/vpp40/config.mk b/dmake/winnt/microsft/vpp40/config.mk
new file mode 100644
index 000000000000..14fe952eac00
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/config.mk
@@ -0,0 +1,14 @@
+# Definition of macros for library, and C startup code.
+osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
+
+.IMPORT .IGNORE : MSC_VER
+MSC_VER *= 8.0
+
+CFLAGS += -I$(osedir)
+
+NDB_CFLAGS += -Od -GF -Ge
+NDB_LDFLAGS +=
+NDB_LDLIBS +=
+
+# Redefine rule for making our objects, we don't need mv
+%$O : %.c ;% $(CC) -c $(CFLAGS) -Fo$@ $<
diff --git a/dmake/winnt/microsft/vpp40/lib.rsp b/dmake/winnt/microsft/vpp40/lib.rsp
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/lib.rsp
@@ -0,0 +1 @@
+
diff --git a/dmake/winnt/microsft/vpp40/mk.bat b/dmake/winnt/microsft/vpp40/mk.bat
new file mode 100755
index 000000000000..22917df5eaee
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/mk.bat
@@ -0,0 +1,32 @@
+md objects
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\infer.obj infer.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\make.obj make.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\stat.obj stat.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\expand.obj expand.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dmstring.obj dmstring.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\hash.obj hash.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dag.obj dag.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dmake.obj dmake.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\path.obj path.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\imacs.obj imacs.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\sysintf.obj sysintf.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\parse.obj parse.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\getinp.obj getinp.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\quit.obj quit.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\state.obj state.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dmdump.obj dmdump.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\macparse.obj macparse.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\rulparse.obj rulparse.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\percent.obj percent.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\function.obj function.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dchdir.obj win95\dchdir.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\switchar.obj win95\switchar.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dstrlwr.obj msdos\dstrlwr.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\arlib.obj msdos\arlib.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\dirbrk.obj msdos\dirbrk.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\tempnam.obj tempnam.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\ruletab.obj win95\microsft\ruletab.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\runargv.obj msdos\runargv.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 \nologo -Od -GF -Ge -Foobjects\rmprq.obj msdos\rmprq.c
+rem link /nologo @win95\microsft\vpp40\obj.rsp,dmake.exe,NUL.MAP;
+link /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp
diff --git a/dmake/winnt/microsft/vpp40/mk.cmd b/dmake/winnt/microsft/vpp40/mk.cmd
new file mode 100755
index 000000000000..5fcc801fae91
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/mk.cmd
@@ -0,0 +1,31 @@
+md objects
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\infer.obj infer.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\make.obj make.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\stat.obj stat.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\expand.obj expand.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmstring.obj dmstring.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\hash.obj hash.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dag.obj dag.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmake.obj dmake.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\path.obj path.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\imacs.obj imacs.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\sysintf.obj sysintf.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\parse.obj parse.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\getinp.obj getinp.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\quit.obj quit.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\state.obj state.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmdump.obj dmdump.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\macparse.obj macparse.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\rulparse.obj rulparse.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\percent.obj percent.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\function.obj function.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dchdir.obj winnt\dchdir.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dstrlwr.obj msdos\dstrlwr.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\arlib.obj msdos\arlib.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dirbrk.obj msdos\dirbrk.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\tempnam.obj winnt\microsft\tempnam.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\ruletab.obj winnt\microsft\ruletab.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\runargv.obj msdos\runargv.c
+cl -c -I. -Iwinnt -Iwinnt\microsft -Iwinnt\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\rmprq.obj msdos\rmprq.c
+link /nologo /out:dmake.exe @fix95nt\winnt\microsft\vpp40\obj.rsp
+copy winnt\microsft\vpp40\template.mk startup\config.mk
diff --git a/dmake/winnt/microsft/vpp40/obj.rsp b/dmake/winnt/microsft/vpp40/obj.rsp
new file mode 100644
index 000000000000..5c00dab6c29c
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/obj.rsp
@@ -0,0 +1,28 @@
+objects\infer.obj
+objects\make.obj
+objects\stat.obj
+objects\expand.obj
+objects\dmstring.obj
+objects\hash.obj
+objects\dag.obj
+objects\dmake.obj
+objects\path.obj
+objects\imacs.obj
+objects\sysintf.obj
+objects\parse.obj
+objects\getinp.obj
+objects\quit.obj
+objects\state.obj
+objects\dmdump.obj
+objects\macparse.obj
+objects\rulparse.obj
+objects\percent.obj
+objects\function.obj
+objects\dchdir.obj
+objects\dstrlwr.obj
+objects\arlib.obj
+objects\dirbrk.obj
+objects\tempnam.obj
+objects\ruletab.obj
+objects\runargv.obj
+objects\rmprq.obj
diff --git a/dmake/winnt/microsft/vpp40/public.h b/dmake/winnt/microsft/vpp40/public.h
new file mode 100644
index 000000000000..ffbe4e463560
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.9 2007-10-15 15:59:48 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int dchdir ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+void Remove_prq ANSI((CELLPTR));
+
+#endif
diff --git a/dmake/winnt/microsft/vpp40/runargv.c b/dmake/winnt/microsft/vpp40/runargv.c
new file mode 100644
index 000000000000..9042dfc80a47
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/runargv.c
@@ -0,0 +1,288 @@
+Blake sent me the wrong one.
+
+/* RCS $Id: runargv.c,v 1.2 2007-10-15 16:00:01 ihi Exp $
+--
+-- SYNOPSIS
+-- Invoke a sub process.
+--
+-- DESCRIPTION
+-- Use the standard methods of executing a sub process.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#include <process.h>
+#include <errno.h>
+#include <signal.h>
+#include "extern.h"
+#include "sysintf.h"
+
+extern char **environ;
+
+typedef struct prp {
+ char *prp_cmd;
+ int prp_group;
+ int prp_ignore;
+ int prp_last;
+ int prp_shell;
+ struct prp *prp_next;
+} RCP, *RCPPTR;
+
+typedef struct pr {
+ int pr_valid;
+ int pr_pid;
+ CELLPTR pr_target;
+ int pr_ignore;
+ int pr_last;
+ RCPPTR pr_recipe;
+ RCPPTR pr_recipe_end;
+ char *pr_dir;
+} PR;
+
+static PR *_procs = NIL(PR);
+static int _proc_cnt = 0;
+static int _abort_flg= FALSE;
+static int _use_i = -1;
+static int _do_upd = 0;
+
+static void _add_child ANSI((int, CELLPTR, int, int));
+static void _attach_cmd ANSI((char *, int, int, CELLPTR, int, int));
+static void _finished_child ANSI((int, int));
+static int _running ANSI((CELLPTR));
+
+PUBLIC int
+runargv(target, ignore, group, last, shell, cmd)
+CELLPTR target;
+int ignore;
+int group;
+int last;
+int shell;
+char *cmd;
+{
+ extern int errno;
+ extern char *sys_errlist[];
+ int pid;
+ char **argv;
+
+ if( _running(target) /*&& Max_proc != 1*/ ) {
+ /* The command will be executed when the previous recipe
+ * line completes. */
+ _attach_cmd( cmd, group, ignore, target, last, shell );
+ return(1);
+ }
+
+ while( _proc_cnt == Max_proc )
+ if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child %d", errno );
+
+ argv = Pack_argv( group, shell, cmd );
+
+ pid = _spawnvpe(_P_NOWAIT, argv[0], argv, environ);
+ if (pid == -1) { /* failed */
+ Error("%s: %s", argv[0], sys_errlist[errno]);
+ Handle_result(-1, ignore, _abort_flg, target);
+ return(-1);
+ } else
+ _add_child(pid, target, ignore, last);
+
+ return(1);
+}
+
+
+PUBLIC int
+Wait_for_child( abort_flg, pid )
+int abort_flg;
+int pid;
+{
+ int wid;
+ int status;
+ int waitchild;
+
+ waitchild = (pid == -1)? FALSE : Wait_for_completion;
+
+ do {
+ if( (wid = wait(&status)) == -1 ) return(-1);
+
+ _abort_flg = abort_flg;
+ _finished_child(wid, status);
+ _abort_flg = FALSE;
+ } while( waitchild && pid != wid );
+
+ return(0);
+}
+
+
+PUBLIC void
+Clean_up_processes()
+{
+ register int i;
+
+ if( _procs != NIL(PR) ) {
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid )
+ kill(_procs[i].pr_pid, SIGTERM);
+
+ while( Wait_for_child(TRUE, -1) != -1 );
+ }
+}
+
+
+static void
+_add_child( pid, target, ignore, last )
+int pid;
+CELLPTR target;
+int ignore;
+int last;
+{
+ register int i;
+ register PR *pp;
+
+ if( _procs == NIL(PR) ) {
+ TALLOC( _procs, Max_proc, PR );
+ }
+
+ if( (i = _use_i) == -1 )
+ for( i=0; i<Max_proc; i++ )
+ if( !_procs[i].pr_valid )
+ break;
+
+ pp = _procs+i;
+
+ pp->pr_valid = 1;
+ pp->pr_pid = pid;
+ pp->pr_target = target;
+ pp->pr_ignore = ignore;
+ pp->pr_last = last;
+ pp->pr_dir = DmStrDup(Get_current_dir());
+
+ Current_target = NIL(CELL);
+
+ _proc_cnt++;
+
+ if( Wait_for_completion ) Wait_for_child( FALSE, pid );
+}
+
+
+static void
+_finished_child(pid, status)
+int pid;
+int status;
+{
+ register int i;
+ register PR *pp;
+ char *dir;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
+ break;
+
+ /* Some children we didn't make esp true if using /bin/sh to execute a
+ * a pipe and feed the output as a makefile into dmake. */
+ if( i == Max_proc ) return;
+ _procs[i].pr_valid = 0;
+ _proc_cnt--;
+ dir = DmStrDup(Get_current_dir());
+ Set_dir( _procs[i].pr_dir );
+
+ if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
+ RCPPTR rp = _procs[i].pr_recipe;
+
+
+ Current_target = _procs[i].pr_target;
+ Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
+ Current_target = NIL(CELL);
+
+ if ( _procs[i].pr_target->ce_attr & A_ERROR ) {
+ _procs[i].pr_last = TRUE;
+ goto ABORT_REMAINDER_OF_RECIPE;
+ }
+
+ _procs[i].pr_recipe = rp->prp_next;
+
+ _use_i = i;
+ runargv( _procs[i].pr_target, rp->prp_ignore, rp->prp_group,
+ rp->prp_last, rp->prp_shell, rp->prp_cmd );
+ _use_i = -1;
+
+ FREE( rp->prp_cmd );
+ FREE( rp );
+
+ if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
+ }
+ else {
+ Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
+
+ ABORT_REMAINDER_OF_RECIPE:
+ if( _procs[i].pr_last ) {
+ FREE(_procs[i].pr_dir );
+
+ if( !Doing_bang ) Update_time_stamp( _procs[i].pr_target );
+ }
+ }
+
+ Set_dir(dir);
+ FREE(dir);
+}
+
+
+static int
+_running( cp )
+CELLPTR cp;
+{
+ register int i;
+
+ if( !_procs ) return(FALSE);
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ return( i != Max_proc );
+}
+
+
+static void
+_attach_cmd( cmd, group, ignore, cp, last, shell )
+char *cmd;
+int group;
+int ignore;
+CELLPTR cp;
+int last;
+int shell;
+{
+ register int i;
+ RCPPTR rp;
+
+ for( i=0; i<Max_proc; i++ )
+ if( _procs[i].pr_valid &&
+ _procs[i].pr_target == cp )
+ break;
+
+ TALLOC( rp, 1, RCP );
+ rp->prp_cmd = DmStrDup(cmd);
+ rp->prp_group = group;
+ rp->prp_ignore= ignore;
+ rp->prp_last = last;
+ rp->prp_shell = shell;
+
+ if( _procs[i].pr_recipe == NIL(RCP) )
+ _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
+ else {
+ _procs[i].pr_recipe_end->prp_next = rp;
+ _procs[i].pr_recipe_end = rp;
+ }
+}
diff --git a/dmake/winnt/microsft/vpp40/template.mk b/dmake/winnt/microsft/vpp40/template.mk
new file mode 100644
index 000000000000..e53922df68c3
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/template.mk
@@ -0,0 +1,7 @@
+# ** Default build configuration for dmake.
+# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED
+# ** USE "startup/local.mk" for those.
+
+ OS *:= winnt
+ OSRELEASE *:= microsft
+ OSENVIRONMENT *:= vpp40
diff --git a/dmake/winnt/microsft/vpp40/tempnam.c b/dmake/winnt/microsft/vpp40/tempnam.c
new file mode 100644
index 000000000000..c27da47c7602
--- /dev/null
+++ b/dmake/winnt/microsft/vpp40/tempnam.c
@@ -0,0 +1,110 @@
+/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:37 hr Exp $
+--
+-- SYNOPSIS
+-- tempnam
+--
+-- DESCRIPTION
+-- temp file name generation routines.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+/*LINTLIBRARY*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dos.h>
+
+#if defined(max)
+# undef max
+#endif
+#define max(A,B) (((A)<(B))?(B):(A))
+
+extern char *mktemp();
+extern int access();
+int d_access();
+
+/* MSC stdio.h defines P_tmpdir, so let's undo it here */
+/* Under DOS leave the default tmpdir pointing here! */
+#ifdef P_tmpdir
+#undef P_tmpdir
+#endif
+static char *P_tmpdir = "";
+
+char *
+tempnam(dir, prefix)
+char *dir; /* use this directory please (if non-NULL) */
+char *prefix; /* use this (if non-NULL) as filename prefix */
+{
+ static int count = 0;
+ register char *p, *q, *tmpdir;
+ int tl=0, dl=0, pl;
+ char buf[30];
+
+ pl = strlen(P_tmpdir);
+
+ if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
+ else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir);
+ if( dir != NULL ) dl = strlen(dir);
+
+ if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
+ return(NULL);
+
+ *p = '\0';
+
+ if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) )
+ if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) )
+ if( d_access( strcpy(p, P_tmpdir), 0) != 0 )
+ if( !prefix )
+ prefix = "tp";
+
+ if(prefix)
+ {
+ *(p+strlen(p)+2) = '\0';
+ (void)strncat(p, prefix, 2);
+ }
+
+ sprintf( buf, "%08x", _psp );
+ buf[6]='\0';
+ (void)strcat(p, buf );
+ sprintf( buf, "%04d", count++ );
+ q=p+strlen(p)-6;
+ *q++ = buf[0]; *q++ = buf[1];
+ *q++ = buf[2]; *q++ = buf[3];
+
+ if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
+
+ return(p);
+}
+
+
+
+d_access( name, flag )
+char *name;
+int flag;
+{
+ extern char *DirSepStr;
+ char *p;
+ int r;
+
+ if( name == NULL || !*name ) return(1); /* NULL dir means current dir */
+ r = access( name, flag );
+ p = name+strlen(name)-1;
+ if(*p != '/' && *p != '\\') strcat( p, DirSepStr );
+
+ return( r );
+}
diff --git a/dmake/winnt/mingw/public.h b/dmake/winnt/mingw/public.h
new file mode 100644
index 000000000000..303b1ff65a96
--- /dev/null
+++ b/dmake/winnt/mingw/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.7 2007-10-15 16:00:18 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int dchdir ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+void Remove_prq ANSI((CELLPTR));
+
+#endif
diff --git a/dmake/winnt/mingw/sysintf.h b/dmake/winnt/mingw/sysintf.h
new file mode 100644
index 000000000000..06aec476fe90
--- /dev/null
+++ b/dmake/winnt/mingw/sysintf.h
@@ -0,0 +1,62 @@
+/* RCS $Id: sysintf.h,v 1.4 2007-01-18 09:53:01 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+#define Hook_std_writes(A)
+
+extern char * tempnam();
+extern char * getcwd();
+
+/* for directory cache */
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in MinGW */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX _MAX_FNAME
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX _MAX_PATH
diff --git a/dmake/winnt/msvc6/public.h b/dmake/winnt/msvc6/public.h
new file mode 100644
index 000000000000..c10f7a23468e
--- /dev/null
+++ b/dmake/winnt/msvc6/public.h
@@ -0,0 +1,167 @@
+/* RCS $Id: public.h,v 1.7 2007-10-15 16:00:31 ihi Exp $
+-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
+--
+--
+-- SYNOPSIS
+-- Local functions exported to be visible by others.
+--
+-- DESCRIPTION
+-- This file is generated by 'genpub'. Function declarations
+-- that appear in this file are extracted by 'genpub' from
+-- source files. Any function in the source file whose definition
+-- appears like:
+--
+-- PUBLIC return_type
+-- function( arg_list );
+-- type_expr1 arg1;
+-- ...
+--
+-- has its definition extracted and a line of the form:
+--
+-- return_type function ANSI((type_expr1,type_expr2,...));
+--
+-- entered into the output file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#ifndef _DMAKE_PUBLIC_h
+#define _DMAKE_PUBLIC_h
+
+#ifdef EXTERN
+#undef EXTERN
+#endif
+#if defined(DEFINE_DMAKE_VARIABLES)
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+/***** genpub: Begin list of generated function headers */
+void Infer_recipe ANSI((CELLPTR, CELLPTR));
+int Make_targets ANSI(());
+int Make ANSI((CELLPTR, CELLPTR));
+int Exec_commands ANSI((CELLPTR));
+void Print_cmnd ANSI((char *, int, int));
+int Push_dir ANSI((char *, char *, int));
+void Pop_dir ANSI((int));
+void Append_line ANSI((char *, int, FILE *, char *, int, int));
+void Stat_target ANSI((CELLPTR, int, int));
+char *Expand ANSI((char *));
+char *Apply_edit ANSI((char *, char *, char *, int, int));
+void Map_esc ANSI((char *));
+char* Apply_modifiers ANSI((int, char *));
+char* Tokenize ANSI((char *, char *, char, int));
+char* ScanToken ANSI((char *, char **, int));
+char *DmStrJoin ANSI((char *, char *, int, int));
+char *DmStrAdd ANSI((char *, char *, int));
+char *DmStrApp ANSI((char *, char *));
+char *DmStrDup ANSI((char *));
+char *DmStrDup2 ANSI((char *));
+char *DmStrPbrk ANSI((char *, char *));
+char *DmStrSpn ANSI((char *, char *));
+char *DmStrStr ANSI((char *, char *));
+char *DmSubStr ANSI((char *, char *));
+uint16 Hash ANSI((char *, uint32 *));
+HASHPTR Get_name ANSI((char *, HASHPTR *, int));
+HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
+HASHPTR Push_macro ANSI((HASHPTR));
+HASHPTR Pop_macro ANSI((HASHPTR));
+HASHPTR Def_macro ANSI((char *, char *, int));
+CELLPTR Def_cell ANSI((char *));
+LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
+void Clear_prerequisites ANSI((CELLPTR));
+int Test_circle ANSI((CELLPTR, int));
+STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
+t_attr Rcp_attribute ANSI((char *));
+int main ANSI((int, char **));
+FILE *Openfile ANSI((char *, int, int));
+FILE *Closefile ANSI(());
+FILE *Search_file ANSI((char *, char **));
+char *Filename ANSI(());
+int Nestlevel ANSI(());
+FILE *TryFiles ANSI((LINKPTR));
+void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist)));
+void No_ram ANSI(());
+void Usage ANSI((int));
+void Version ANSI(());
+char *Get_suffix ANSI((char *));
+char *Basename ANSI((char *));
+char *Filedir ANSI((char *));
+char *Build_path ANSI((char *, char *));
+void Make_rules ANSI(());
+void Create_macro_vars ANSI(());
+time_t Do_stat ANSI((char *, char *, char **, int));
+int Do_touch ANSI((char *, char *, char **));
+void Void_lib_cache ANSI((char *, char *));
+time_t Do_time ANSI(());
+void Do_profile_output ANSI((char *, uint16, CELLPTR));
+int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int));
+char ** Pack_argv ANSI((int, int, char **));
+char *Read_env_string ANSI((char *));
+int Write_env_string ANSI((char *, char *));
+void ReadEnvironment ANSI(());
+void Catch_signals ANSI((void (*)(int)));
+void Clear_signals ANSI(());
+void Prolog ANSI((int, char* []));
+void Epilog ANSI((int));
+char *Get_current_dir ANSI(());
+int Set_dir ANSI((char*));
+char Get_switch_char ANSI(());
+FILE* Get_temp ANSI((char **, char *));
+FILE *Start_temp ANSI((char *, CELLPTR, char **));
+void Open_temp_error ANSI((char *, char *));
+void Link_temp ANSI((CELLPTR, FILE *, char *));
+void Close_temp ANSI((CELLPTR, FILE *));
+void Unlink_temp_files ANSI((CELLPTR));
+void Handle_result ANSI((int, int, int, CELLPTR));
+void Update_time_stamp ANSI((CELLPTR));
+int Remove_file ANSI((char *));
+void Parse ANSI((FILE *));
+int Get_line ANSI((char *, FILE *));
+char *Do_comment ANSI((char *, char **, int));
+char *Get_token ANSI((TKSTRPTR, char *, int));
+void Quit ANSI((int));
+void Read_state ANSI(());
+void Write_state ANSI(());
+int Check_state ANSI((CELLPTR, STRINGPTR *, int));
+void Dump ANSI(());
+void Dump_recipe ANSI((STRINGPTR));
+int Parse_macro ANSI((char *, int));
+int Macro_op ANSI((char *));
+int Parse_rule_def ANSI((int *));
+int Rule_op ANSI((char *));
+void Add_recipe_to_list ANSI((char *, int, int));
+void Bind_rules_to_targets ANSI((int));
+int Set_group_attributes ANSI((char *));
+DFALINKPTR Match_dfa ANSI((char *));
+void Check_circle_dfa ANSI(());
+void Add_nfa ANSI((char *));
+char *Exec_function ANSI((char *));
+int dchdir ANSI((char *));
+void dstrlwr ANSI((char *, char *));
+time_t seek_arch ANSI((char*, char*));
+int touch_arch ANSI((char*, char*));
+int If_root_path ANSI((char *));
+int runargv ANSI((CELLPTR, int, int, t_attr, char **));
+void Clean_up_processes ANSI(());
+int Wait_for_child ANSI((int, int));
+void Remove_prq ANSI((CELLPTR));
+
+#endif
diff --git a/dmake/winnt/msvc6/sysintf.h b/dmake/winnt/msvc6/sysintf.h
new file mode 100644
index 000000000000..631e0fc2d80a
--- /dev/null
+++ b/dmake/winnt/msvc6/sysintf.h
@@ -0,0 +1,62 @@
+/* RCS $Id: sysintf.h,v 1.3 2007-01-18 09:53:49 vg Exp $
+--
+-- SYNOPSIS
+-- Interfaces for sysintf.c
+--
+-- DESCRIPTION
+-- Abstractions of functions in sysintf.c
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+#define DMSTAT stat
+#define VOID_LCACHE(l,m)
+#define GETPID _psp
+#define Hook_std_writes(A)
+
+extern char * tempnam();
+extern char * getcwd();
+
+/* for directory cache */
+#define CacheStat(A,B) really_dostat(A,&buf)
+
+/*
+** standard C items
+*/
+
+/*
+** DOS interface standard items
+*/
+#define chdir(p) dchdir(p)
+
+/* in sysintf.c: SIGQUIT is used, this is not defined in MinGW */
+#ifndef SIGQUIT
+# define SIGQUIT SIGTERM
+#endif
+
+/*
+** make parameters
+*/
+#ifdef _POSIX_NAME_MAX
+#undef _POSIX_NAME_MAX
+#endif
+#define _POSIX_NAME_MAX 12
+
+#ifdef _POSIX_PATH_MAX
+#undef _POSIX_PATH_MAX
+#endif
+#define _POSIX_PATH_MAX _MAX_PATH
diff --git a/dmake/winnt/startup.h b/dmake/winnt/startup.h
new file mode 100644
index 000000000000..18f48cfd9bde
--- /dev/null
+++ b/dmake/winnt/startup.h
@@ -0,0 +1,29 @@
+/* RCS $Id: startup.h,v 1.2 2006-04-20 12:25:19 hr Exp $
+--
+-- SYNOPSIS
+-- Definition of MAKESTARTUP
+--
+-- DESCRIPTION
+-- Default MAKESTARTUP value defining where dmake locates the
+-- startup file.
+--
+-- AUTHOR
+-- Dennis Vadura, dvadura@dmake.wticorp.com
+--
+-- WWW
+-- http://dmake.wticorp.com/
+--
+-- COPYRIGHT
+-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
+--
+-- This program is NOT free software; you can redistribute it and/or
+-- modify it under the terms of the Software License Agreement Provided
+-- in the file <distribution-root>/readme/license.txt.
+--
+-- LOG
+-- Use cvs log to obtain detailed change logs.
+*/
+
+"DMAKEROOT *= $(ABSMAKECMD:d)startup",
+"MAKESTARTUP := $(DMAKEROOT)\\startup.mk",
+