summaryrefslogtreecommitdiff
path: root/dmake/qssl
diff options
context:
space:
mode:
Diffstat (limited to 'dmake/qssl')
-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
12 files changed, 909 insertions, 0 deletions
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
+