dvadura@watdragon.waterloo.edu (Dennis Vadura) (12/01/90)
#!/bin/sh # this is part 2 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # file dmake-3.6-patch2 continued # CurArch=2 if test ! -r s2_seq_.tmp then echo "Please unpack part 1 first!" exit 1; fi ( read Scheck if test "$Scheck" != $CurArch then echo "Please unpack part $Scheck next!" exit 1; else exit 0; fi ) < s2_seq_.tmp || exit 1 sed 's/^X//' << 'SHAR_EOF' >> dmake-3.6-patch2 XSHAR_EOF Xchmod 0640 os2/mscdos/mk60.cmd || echo "restore of os2/mscdos/mk60.cmd fails" Xset `wc -c os2/mscdos/mk60.cmd`;Sum=$1 Xif test "$Sum" != "3840" Xthen echo original size 3840, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/mscdos/obj.rsp && XXobjects\infer.obj+ XXobjects\make.obj+ XXobjects\stat.obj+ XXobjects\expand.obj+ XXobjects\string.obj+ XXobjects\hash.obj+ XXobjects\dag.obj+ XXobjects\dmake.obj+ XXobjects\path.obj+ XXobjects\imacs.obj+ XXobjects\sysintf.obj+ XXobjects\parse.obj+ XXobjects\getinp.obj+ XXobjects\quit.obj+ XXobjects\basename.obj+ XXobjects\dump.obj+ XXobjects\macparse.obj+ XXobjects\rulparse.obj+ XXobjects\percent.obj+ XXobjects\function.obj+ XXobjects\ruletab.obj+ XXobjects\runargv.obj+ XXobjects\_chdir.obj+ XXobjects\switchar.obj+ XXobjects\dirbrk.obj+ XXobjects\arlib.obj+ XXobjects\rmprq.obj+ XXobjects\explode.obj+ XXobjects\tempnam.obj XSHAR_EOF Xchmod 0640 os2/mscdos/obj.rsp || echo "restore of os2/mscdos/obj.rsp fails" Xset `wc -c os2/mscdos/obj.rsp`;Sum=$1 Xif test "$Sum" != "574" Xthen echo original size 574, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/mscdos/optoff.h && XX#if _MSC_VER < 600 XX# pragma loop_opt(off) XX#endif XSHAR_EOF Xchmod 0440 os2/mscdos/optoff.h || echo "restore of os2/mscdos/optoff.h fails" Xset `wc -c os2/mscdos/optoff.h`;Sum=$1 Xif test "$Sum" != "49" Xthen echo original size 49, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/mscdos/startup.mk && XX#NOTE: startup.mk file is called dmake.ini for OS/2 XX# and is found in os2/mscdos/dmake.ini XX.INCLUDE : "os2/mscdos/dmake.ini" XSHAR_EOF Xchmod 0640 os2/mscdos/startup.mk || echo "restore of os2/mscdos/startup.mk fails" Xset `wc -c os2/mscdos/startup.mk`;Sum=$1 Xif test "$Sum" != "132" Xthen echo original size 132, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/mscdos/tempnam.c && XX/*LINTLIBRARY*/ XX#include <stdio.h> XX#include <string.h> XX#include <stdlib.h> XX#include <dos.h> XX XX#if defined(max) XX# undef max XX#endif XX#define max(A,B) (((A)<(B))?(B):(A)) XX XXextern int access(); XXint _access(); XX XX/* MSC stdio.h defines P_tmpdir, so let's undo it here */ XX/* Under DOS leave the default tmpdir pointing here! */ XX#ifdef P_tmpdir XX#undef P_tmpdir XX#endif XXstatic char *P_tmpdir = ""; XX XXchar * XXtempnam(dir, prefix) XXchar *dir; /* use this directory please (if non-NULL) */ XXchar *prefix; /* use this (if non-NULL) as filename prefix */ XX{ XX static int count = 0; XX register char *p, *q, *tmpdir; XX int tl=0, dl=0, pl; XX char buf[30]; XX XX pl = strlen(P_tmpdir); XX XX if( (tmpdir = getenv("TMPDIR")) != NULL ) XX tl = strlen(tmpdir); XX else if( (tmpdir = getenv("TMP")) != NULL ) XX tl = strlen(tmpdir); XX if( dir != NULL ) dl = strlen(dir); XX XX if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL ) XX return(NULL); XX XX *p = '\0'; XX XX if( (tl == 0) || (_access( strcpy(p, tmpdir), 0) != 0) ) XX if( (dl == 0) || (_access( strcpy(p, dir), 0) != 0) ) XX if( _access( strcpy(p, P_tmpdir), 0) != 0 ) XX if( !prefix ) XX prefix = "tp"; XX XX if(prefix) XX { XX *(p+strlen(p)+2) = '\0'; XX (void)strncat(p, prefix, 2); XX } XX XX#ifdef OS2 XX sprintf( buf, "%08x", getpid() ); XX#else XX sprintf( buf, "%08x", _psp ); XX#endif XX buf[6]='\0'; XX (void)strcat(p, buf ); XX sprintf( buf, "%04d", count++ ); XX q=p+strlen(p)-6; XX *q++ = buf[0]; *q++ = buf[1]; XX *q++ = buf[2]; *q++ = buf[3]; XX XX if( (q = strrchr(p,'.')) != NULL ) *q = '\0'; XX XX return strlwr(p); XX} XX XX XX XX_access( name, flag ) XXchar *name; XXint flag; XX{ XX char *p; XX int r; XX XX if( name == NULL || !*name ) return(1); /* NULL dir means current dir */ XX p = name+strlen(name)-1; XX if(*p == ':' ) strcat( p++, "\\" ); XX r = access( name, flag ); XX if(*p != '/' && *p != '\\') strcat( p, "\\" ); XX XX return( r ); XX} XSHAR_EOF Xchmod 0440 os2/mscdos/tempnam.c || echo "restore of os2/mscdos/tempnam.c fails" Xset `wc -c os2/mscdos/tempnam.c`;Sum=$1 Xif test "$Sum" != "1919" Xthen echo original size 1919, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/ruletab.c && XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/os2/RCS/ruletab.c,v 1.1 90/11/14 08:46:27 dvadura Exp $ XX-- SYNOPSIS -- Default initial configuration of dmake. XX-- XX-- DESCRIPTION XX-- Define here the initial set of rules that are defined before XX-- dmake performs any processing. XX-- XX-- AUTHOR XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada XX-- XX-- COPYRIGHT XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved. XX-- XX-- This program is free software; you can redistribute it and/or XX-- modify it under the terms of the GNU General Public License XX-- (version 1), as published by the Free Software Foundation, and XX-- found in the file 'LICENSE' included with this distribution. XX-- XX-- This program is distributed in the hope that it will be useful, XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XX-- GNU General Public License for more details. XX-- XX-- You should have received a copy of the GNU General Public License XX-- along with this program; if not, write to the Free Software XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. XX-- XX-- LOG XX-- $Log: ruletab.c,v $ XX * Revision 1.1 90/11/14 08:46:27 dvadura XX * dmake Release, Version 3.6 XX * XX*/ XX XX/* These are control macros for dmake that MUST be defined at some point XX * if they are NOT dmake will not work! These are default definitions. They XX * may be overridden inside the .STARTUP makefile, they are here XX * strictly so that dmake can parse the STARTUP makefile */ XX/* XX * For OS/2 these are close to the Unix definitions in terms of limits. XX * We dont need the two different cases of Makefile, so only keep the XX * pretty one. XX */ XXstatic char *_rules[] = { XX "MAXLINELENGTH := 2046", XX "MAXPROCESSLIMIT := 16", XX "MAXPROCESS := 1" XX ".IMPORT .IGNORE: ROOTDIR INIT", XX ".MAKEFILES : makefile.mk Makefile", XX ".SOURCE : .NULL", XX#include "startup.h" XX 0 }; XX XXchar **Rule_tab = _rules; /* for sundry reasons in Get_environment() */ XX XSHAR_EOF Xchmod 0440 os2/ruletab.c || echo "restore of os2/ruletab.c fails" Xset `wc -c os2/ruletab.c`;Sum=$1 Xif test "$Sum" != "2118" Xthen echo original size 2118, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/runargv.c && XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/os2/RCS/runargv.c,v 1.1 90/11/14 08:48:15 dvadura Exp $ XX-- SYNOPSIS -- invoke a sub process, modified unix/runargv.c for OS/2. XX-- XX-- DESCRIPTION XX-- Use the standard methods of executing a sub process. XX-- XX-- AUTHOR XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada XX-- XX-- COPYRIGHT XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved. XX-- XX-- This program is free software; you can redistribute it and/or XX-- modify it under the terms of the GNU General Public License XX-- (version 1), as published by the Free Software Foundation, and XX-- found in the file 'LICENSE' included with this distribution. XX-- XX-- This program is distributed in the hope that it will be useful, XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XX-- GNU General Public License for more details. XX-- XX-- You should have received a copy of the GNU General Public License XX-- along with this program; if not, write to the Free Software XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. XX-- XX-- LOG XX-- $Log: runargv.c,v $ XX * Revision 1.1 90/11/14 08:48:15 dvadura XX * dmake Release, Version 3.6 XX * XX*/ XX XX#define INCL_DOSPROCESS XX#include <os2.h> XX XX#include <process.h> XX#include <stdlib.h> XX#include <signal.h> XX#include "extern.h" XX#include "sysintf.h" XX#include "alloc.h" XX XXtypedef struct prp { XX char *prp_cmd; XX int prp_group; XX int prp_ignore; XX int prp_last; XX int prp_shell; XX struct prp *prp_next; XX char *prp_dir; XX} RCP, *RCPPTR; XX XXtypedef struct pr { XX int pr_valid; XX int pr_pid; XX CELLPTR pr_target; XX HOWPTR pr_how; XX int pr_ignore; XX int pr_last; XX RCPPTR pr_recipe; XX RCPPTR pr_recipe_end; XX} PR; XX XXstatic PR *_procs = NIL(PR); XXstatic int _proc_cnt = 0; XXstatic int _abort_flg= FALSE; XXstatic int _use_i = -1; XXstatic int _do_upd = 0; XX XXextern unsigned int _far _pascal DosSmSetTitle(char _far *s); XXstatic void SetSessionTitle (char *s); XXstatic void _add_child ANSI((int, CELLPTR, HOWPTR, int, int)); XXstatic void _attach_cmd ANSI((char *, int, int, CELLPTR, HOWPTR, int, int)); XXstatic void _finished_child ANSI((int, int)); XXstatic int _running ANSI((CELLPTR, HOWPTR)); XX XXint XXrunargv(target, how, ignore, group, last, shell, cmd) XXCELLPTR target; XXHOWPTR how; XXint ignore; XXint group; XXint last; XXint shell; XXchar *cmd; XX{ XX int pid; XX char **argv; XX XX if( _running(target, how) /*&& Max_proc != 1*/ ) { XX /* The command will be executed when the previous recipe XX * line completes. */ XX _attach_cmd( cmd, group, ignore, target, how, last, shell ); XX return(1); XX } XX XX while( _proc_cnt == Max_proc ) XX if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child" ); XX XX SetSessionTitle(target->CE_NAME); XX argv = Pack_argv( group, shell, cmd ); XX XX if((pid=spawnvp((_osmode == DOS_MODE)?P_WAIT:P_NOWAIT,argv[0],argv)) == -1){ XX Error("%s: %s", argv[0], sys_errlist[errno]); XX Handle_result(-1, ignore, _abort_flg, target); XX return(-1); XX } XX else if( _osmode == DOS_MODE ) { XX _add_child(4711, target, how, ignore, last); XX _finished_child(4711, pid); XX } XX else XX _add_child(pid, target, how, ignore, last); XX XX return(1); XX} XX XX XX/* N.B. The system call used below is undocumented and therefore possibly XX * subject to change. It sets the session title even from a full screen XX * session, so you can see which target is being built. XX * If dubious about undocumented calls simply remove it. XX */ XXvoid XXSetSessionTitle(char *s) XX{ XX char buff[128]; XX strncpy(buff, Pname, sizeof(buff)); XX buff[sizeof(buff)-1] = 0; XX strncat(buff, " - ", sizeof(buff)); XX strncat(buff, s, sizeof(buff)); XX buff[sizeof(buff)-1] = 0; XX DosSmSetTitle(buff); XX} XX XX XXint XXWait_for_child( abort_flg, pid ) XXint abort_flg; XXint pid; XX{ XX int wid; XX int status; XX int waitchild; XX XX if( _osmode == DOS_MODE ) return(1); XX XX waitchild = (pid == -1)? FALSE : Wait_for_completion; XX XX do { XX if( (wid = wait(&status)) == -1 ) return(-1); XX XX _abort_flg = abort_flg; XX _finished_child(wid, status); XX _abort_flg = FALSE; XX } XX while( waitchild && pid != wid ); XX XX return(0); XX} XX XX XXvoid XXClean_up_processes() XX{ XX register int i; XX XX if( _osmode == DOS_MODE ) { XX _abort_flg = TRUE; XX _finished_child(4711, -1); XX return; XX } XX XX if( _procs != NIL(PR) ) { XX for( i=0; i<Max_proc; i++ ) XX if( _procs[i].pr_valid ) XX DosKillProcess(DKP_PROCESSTREE, _procs[i].pr_pid); XX XX while( Wait_for_child(TRUE, -1) != -1 ); XX } XX} XX XX XXstatic void XX_add_child( pid, target, how, ignore, last ) XXint pid; XXCELLPTR target; XXHOWPTR how; XXint ignore; XXint last; XX{ XX register int i; XX register PR *pp; XX XX if( _procs == NIL(PR) ) { XX TALLOC( _procs, Max_proc, PR ); XX } XX XX if( (i = _use_i) == -1 ) XX for( i=0; i<Max_proc; i++ ) XX if( !_procs[i].pr_valid ) XX break; XX XX pp = _procs+i; XX XX pp->pr_valid = 1; XX pp->pr_pid = pid; XX pp->pr_target = target; XX pp->pr_how = how; XX pp->pr_ignore = ignore; XX pp->pr_last = last; XX XX Current_target = NIL(HOW); XX XX _proc_cnt++; XX XX if( Wait_for_completion ) Wait_for_child( FALSE, pid ); XX} XX XX XXstatic void XX_finished_child(pid, status) XXint pid; XXint status; XX{ XX register int i; XX register PR *pp; XX XX if( _procs == NIL(PR) ) XX return; XX XX for( i=0; i<Max_proc; i++ ) XX if( _procs[i].pr_valid && _procs[i].pr_pid == pid ) XX break; XX XX _procs[i].pr_valid = 0; XX _proc_cnt--; XX XX if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) { XX RCPPTR rp = _procs[i].pr_recipe; XX char *dir; XX XX Current_target = _procs[i].pr_how; XX Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target ); XX Current_target = NIL(HOW); XX XX _procs[i].pr_recipe = rp->prp_next; XX XX _use_i = i; XX dir = _strdup(Get_current_dir()); XX Set_dir( rp->prp_dir ); XX runargv( _procs[i].pr_target, _procs[i].pr_how, rp->prp_ignore, XX rp->prp_group, rp->prp_last, rp->prp_shell, rp->prp_cmd ); XX Set_dir(dir); XX FREE(dir); XX FREE(rp->prp_dir); XX _use_i = -1; XX XX FREE( rp->prp_cmd ); XX FREE( rp ); XX XX if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 ); XX } XX else { XX Unlink_temp_files( _procs[i].pr_how ); XX Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target); XX XX if( _procs[i].pr_last && !Doing_bang ) XX Update_time_stamp( _procs[i].pr_target, _procs[i].pr_how ); XX } XX} XX XX XXstatic int XX_running( cp, how ) XXCELLPTR cp; XXHOWPTR how; XX{ XX register int i; XX XX if( !_procs ) return(FALSE); XX XX for( i=0; i<Max_proc; i++ ) XX if( _procs[i].pr_valid && XX _procs[i].pr_how == how && XX _procs[i].pr_target == cp ) XX break; XX XX return( i != Max_proc ); XX} XX XX XXstatic void XX_attach_cmd( cmd, group, ignore, cp, how, last, shell ) XXchar *cmd; XXint group; XXint ignore; XXCELLPTR cp; XXHOWPTR how; XXint last; XXint shell; XX{ XX register int i; XX RCPPTR rp; XX XX for( i=0; i<Max_proc; i++ ) XX if( _procs[i].pr_valid && XX _procs[i].pr_how == how && XX _procs[i].pr_target == cp ) XX break; XX XX TALLOC( rp, 1, RCP ); XX rp->prp_cmd = _strdup(cmd); XX rp->prp_group = group; XX rp->prp_ignore= ignore; XX rp->prp_last = last; XX rp->prp_shell = shell; XX rp->prp_dir = _strdup(Get_current_dir()); XX XX if( _procs[i].pr_recipe == NIL(RCP) ) XX _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp; XX else { XX _procs[i].pr_recipe_end->prp_next = rp; XX _procs[i].pr_recipe_end = rp; XX } XX} XSHAR_EOF Xchmod 0440 os2/runargv.c || echo "restore of os2/runargv.c fails" Xset `wc -c os2/runargv.c`;Sum=$1 Xif test "$Sum" != "7625" Xthen echo original size 7625, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/startup.h && XX/* This file contains the default value of the MAKESTARTUP variable. XX * You must set the quoted string below to the default path to the startup XX * variable, so that it gets compiled in. LEAVE ROOTDIR at the front of XX * the path. This allows the user to customize his environment for dmake XX * by setting up a new ROOTDIR environment variable. */ XX XX"MAKESTARTUP := $(INIT)dmake.ini", XSHAR_EOF Xchmod 0440 os2/startup.h || echo "restore of os2/startup.h fails" Xset `wc -c os2/startup.h`;Sum=$1 Xif test "$Sum" != "383" Xthen echo original size 383, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/stdarg.h && XX/* XX * stdarg.h XX * XX * defines ANSI style macros for accessing arguments of a function which takes XX * a variable number of arguments XX * XX */ XX XX#if !defined(__STDARG) XX#define __STDARG XX XXtypedef char *va_list; XX XX#define va_dcl int va_alist XX#define va_start(ap,v) ap = (va_list)&va_alist XX#define va_arg(ap,t) ((t*)(ap += sizeof(t)))[-1] XX#define va_end(ap) ap = NULL XX#endif XSHAR_EOF Xchmod 0440 os2/stdarg.h || echo "restore of os2/stdarg.h fails" Xset `wc -c os2/stdarg.h`;Sum=$1 Xif test "$Sum" != "373" Xthen echo original size 373, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/switchar.c && XX/* XX** return switch char XX*/ XX#if defined(OS2) || defined(_MSC_VER) XX#include <stdlib.h> XX#endif XX#if !defined(OS2) XX#include <dos.h> XX#endif /* !OS2 */ XX#include <stdio.h> XX#include "stdmacs.h" XX XXgetswitchar()/* XX=============== XX Try the environment first. If you don't find SWITCHAR there, then use XX the DOS call. The call is undocumented, and doesn't work for DOS versions XX 4.0 and up, so the check of the environment will fix that. */ XX{ XX#if defined(M_I86) XX#if !defined(OS2) XX union REGS rg; XX#endif /* ! OS2 */ XX static char *_env_switchar = NIL(char); XX XX if( _env_switchar != NIL(char) || XX (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) ) XX return(*_env_switchar); XX XX#if !defined(OS2) XX rg.h.ah = 0x37; /* switch char request */ XX rg.h.al = 0; /* get (not set) */ XX XX intdos(&rg, &rg); XX return (rg.h.dl); XX#endif /* ! OS2 */ XX#endif /* M_I86 */ XX XX return ('/'); XX} XSHAR_EOF Xchmod 0440 os2/switchar.c || echo "restore of os2/switchar.c fails" Xset `wc -c os2/switchar.c`;Sum=$1 Xif test "$Sum" != "904" Xthen echo original size 904, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > os2/sysintf.h && XX/* XX** assorted bits of system interface XX*/ XX#include <sys/types.h> XX#include <sys/stat.h> XX#include <signal.h> XX XX#define STAT stat XX#define VOID_LCACHE(l,m) XXextern char * tempnam(); XXextern char * getcwd(); XX XX/* XX** standard C items XX*/ XX XX/* XX** DOS interface standard items XX*/ XX#define chdir(p) _chdir(p) XX XX/* XX** make parameters XX*/ XX#define MAX_PATH_LEN 256 XX XSHAR_EOF Xchmod 0440 os2/sysintf.h || echo "restore of os2/sysintf.h fails" Xset `wc -c os2/sysintf.h`;Sum=$1 Xif test "$Sum" != "346" Xthen echo original size 346, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > readme/patch2 && XXDMAKE Version 3.6, patch #2 XX--------------------------- XX XXSeverity: Medium XX XXNature: Minor teething problems with UNIX, added support for OS/2 protected XX mode, and a couple of persistent bugs fixed. XX XXFormat: Shar containing new versions of affected files. With appropriate XX patches. (run the patch file through sh in the source distribution XX directory and it will do the rest) XX XX Also available as pub/src/dmake-3.6-patch2 on watmsg.uwaterloo.edu XX (129.97.129.9) XX XX Archived source incorporating all patches is available XX for anonymous ftp from watmsg.uwaterloo.ca address is XX 129.97.129.9. It is in the pub/src directory, set your XX mode to binary, and copy either: XX XX dmake-3.6.tar.Z - compressed tar format XX dmake-3.6.zoo - zoo archive XX XX NOTE: watmsg may not be available from Dec 5 to Dec 8, 1990 due XX to reconfigurartion of a machine room here. watdragon will XX be down during this time and hence I will be unreachable XX via email. XX XXPrerequisites: dmake version 3.6, patchlevel 2 source distribution XX XX XXDescription of Fixes: XX--------------------- XXFixes to patch level 2, after applying patch 1 to dmake V3.6. XX XX1. Include putenv.c and tempnam.c with the Atari-ST tos directory. I XX incorreclty thought they were not needed the first time around. XX XX2. Added check in structs.h and unix/sysintf.h to prevent xenix 386 boxes XX from trying to include types.h more than once. Fix supplied by: XX holos0!lbr@gatech.edu (Len Reed) XX XX3. Fixed possible bug in make.c to make sure we pop any pushed directories XX when making .MAKEFILES prerequisites, these things can also have a .SETDIR XX attribute. XX XX4. Fix bug with NULL recipe targets. dmake now infers a NULL recipe for any XX target that does not have a recipe after inference and does have a XX list of prerequisites. Further, if you set AUGMAKE:=yes then it will not XX complain about prerequisites that appear as targets in the makefile with XX no recipe at all. Makes it a bit more compatible with Augmake. XX Reported by krohn%SW.MCC.COM@MCC.COM (Eric Krohn). XX XX5. Added _VA_LIST_ #define to unix/sysvr[13]/stdarg.h, so that it is defined XX only once. Some syvr3 implementations require this (eg. Silicon Graphics XX IRIX). XX XX6. Fixed getinp.c and parse.c to treat \r as white space as well. XX Fixes DOS bug that crept up from time to time and caused dmake to stop XX parsing a makefile. XX XX7. Blush, embarasing bug when constructing DFA for %-meta rule. If target XX ended in a '%', it went one state too far and used a garbage value from XX the name string. Sometimes this was a '%' and it would complain that XX %-meta target contained more than one '%'. XX XX8. Minor tweaks to the man page, changed the version number to 3.6 :-) too. XX XX9. Minor tweaks to makefile.mk (moved %.o ... target) and to some various XX config.mk files in order to accomodate os/2 version. XX XX10. Support for OS/2 in the OS/2 directory, see (readme/os2). Files for this XX were provided by Kai Uwe Rommel (rommel@lan.informatik.tu-muenchen.dbp.de), XX and by Duncan Booth (duncanb@ibmpcug.co.uk, Bix:jrichards), many thanks to XX both and to Jeremy Wohl (wohl@max.physics.sunysb.edu). XX XX11. Added fix for sun 386i's broken ar.h in unix/bsd43/config.h. XSHAR_EOF Xchmod 0640 readme/patch2 || echo "restore of readme/patch2 fails" Xset `wc -c readme/patch2`;Sum=$1 Xif test "$Sum" != "3274" Xthen echo original size 3274, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > tos/putenv.c && XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/putenv.c,v 1.1 90/10/30 23:33:22 dvadura Exp $ XX-- SYNOPSIS -- my own putenv for BSD like systems. XX-- XX-- DESCRIPTION XX-- This originally came from MKS, but I rewrote it to fix a bug with XX-- replacing existing strings, probably never happened but the code XX-- was wrong nonetheless. XX-- XX-- AUTHOR XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada XX-- XX-- COPYRIGHT XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved. XX-- XX-- This program is free software; you can redistribute it and/or XX-- modify it under the terms of the GNU General Public License XX-- (version 1), as published by the Free Software Foundation, and XX-- found in the file 'LICENSE' included with this distribution. XX-- XX-- This program is distributed in the hope that it will be useful, XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XX-- GNU General Public License for more details. XX-- XX-- You should have received a copy of the GNU General Public License XX-- along with this program; if not, write to the Free Software XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. XX-- XX-- LOG XX-- $Log: putenv.c,v $ XX * Revision 1.1 90/10/30 23:33:22 dvadura XX * dmake Release, Version 3.6 XX * XX*/ XX XX#include <stdio.h> XX#include <string.h> XX XXint XXputenv( str )/* XX=============== XX Take a string of the form NAME=value and stick it into the environment. XX We do this by allocating a new set of pointers if we have to add a new XX string and by replacing an existing pointer if the value replaces the value XX of an existing string. */ XXchar *str; XX{ XX extern char **environ; /* The current environment. */ XX static char **ourenv = NULL; /* A new environment */ XX register char **p; XX register char *q; XX int size; XX XX /* First search the current environment and see if we can replace a XX * string. */ XX for( p=environ; *p; p++ ) { XX register char *s = str; XX XX for( q = *p; *q && *s && *s == *q; q++, s++ ) XX if( *s == '=' ) { XX *p = str; XX return(0); /* replaced it so go away */ XX } XX } XX XX /* Ok, can't replace a string so need to grow the environment. */ XX size = p - environ + 2; /* size of new environment */ XX /* size of old is size-1 */ XX XX /* It's the first time, so allocate a new environment since we don't know XX * where the old one is comming from. */ XX if( ourenv == NULL ) { XX if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL ) XX return(1); XX XX memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) ); XX } XX else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL ) XX return(1); XX XX ourenv[--size] = NULL; XX ourenv[--size] = str; XX XX environ = ourenv; XX return(0); XX} XSHAR_EOF Xchmod 0400 tos/putenv.c || echo "restore of tos/putenv.c fails" Xset `wc -c tos/putenv.c`;Sum=$1 Xif test "$Sum" != "2924" Xthen echo original size 2924, current size $Sum;fi Xsed 's/^X//' << 'SHAR_EOF' > tos/tempnam.c && XX/*LINTLIBRARY*/ XX#include <stdio.h> XX#include <string.h> XX#include <stdlib.h> XX XX#define max(A,B) (((A)<(B))?(B):(A)) XX XXextern char *mktemp(); XXextern int access(); XX XXstatic char *cpdir(); XXstatic char *seed="AAA"; XX XX/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */ XX#ifndef P_tmpdir XXstatic char *P_tmpdir = "/tmp"; XX#endif XX XXchar * XXtempnam(dir, prefix) XXchar *dir; /* use this directory please (if non-NULL) */ XXchar *prefix; /* use this (if non-NULL) as filename prefix */ XX{ XX register char *p, *q, *tmpdir; XX int tl=0, dl=0, pl; XX XX pl = strlen(P_tmpdir); XX XX if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); XX if( dir != NULL ) dl = strlen(dir); XX XX if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL ) XX return(NULL); XX XX *p = '\0'; XX XX if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) ) XX if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) ) XX if( access( cpdir(p, P_tmpdir), 3) != 0 ) XX if( access( cpdir(p, "/tmp"), 3) != 0 ) XX return(NULL); XX XX (void) strcat(p, "/"); XX if(prefix) XX { XX *(p+strlen(p)+5) = '\0'; XX (void)strncat(p, prefix, 5); XX } XX XX (void)strcat(p, seed); XX (void)strcat(p, "XXXXXX"); XX XX q = seed; XX while(*q == 'Z') *q++ = 'A'; XX ++*q; XX XX if(*mktemp(p) == '\0') return(NULL); XX return(p); XX} XX XX XX XXstatic char * XXcpdir(buf, str) XXchar *buf; XXchar *str; XX{ XX char *p; XX XX if(str != NULL) XX { XX (void) strcpy(buf, str); XX p = buf - 1 + strlen(buf); XX if(*p == '/') *p = '\0'; XX } XX XX return(buf); XX} XSHAR_EOF Xchmod 0400 tos/tempnam.c || echo "restore of tos/tempnam.c fails" Xset `wc -c tos/tempnam.c`;Sum=$1 Xif test "$Sum" != "1506" Xthen echo original size 1506, current size $Sum;fi X X X# Now create the file of patches and apply patch appropriately X# shar: Shell Archiver (v1.22) X# X# Run the following text with /bin/sh to create: X# _patches X# Xsed 's/^X//' << 'SHAR_EOF' > _patches && XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/unix/sysvr3/stdarg.h Sat Oct 6 12:06:44 1990 XX--- unix/sysvr3/stdarg.h Tue Nov 6 13:12:39 1990 XX*************** XX*** 6,15 **** XX * XX */ XX XX! #if !defined(__STDARG) XX! #define __STDARG XX XX typedef char *va_list; XX XX #define va_dcl int va_alist XX #define va_start(ap,v) ap = (va_list)&va_alist XX--- 6,18 ---- XX * XX */ XX XX! #if !defined(__STDARG_H__) XX! #define __STDARG_H__ XX XX+ #if !defined(_VA_LIST_) XX+ #define _VA_LIST_ XX typedef char *va_list; XX+ #endif XX XX #define va_dcl int va_alist XX #define va_start(ap,v) ap = (va_list)&va_alist XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/unix/sysvr3/config.h Mon Oct 22 18:01:12 1990 XX--- unix/sysvr3/config.h Tue Oct 30 23:27:51 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr3/RCS/config.h,v 1.1 90/10/06 12:06:39 dvadura Exp $ XX -- SYNOPSIS -- Configurarion include file. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr3/RCS/config.h,v 1.2 90/10/30 23:27:41 dvadura Exp $ XX -- SYNOPSIS -- Configurarion include file. XX -- XX -- DESCRIPTION XX*************** XX*** 29,34 **** XX--- 29,37 ---- XX -- XX -- LOG XX -- $Log: config.h,v $ XX+ * Revision 1.2 90/10/30 23:27:41 dvadura XX+ * Added M_XENIX #ifdef. XX+ * XX * Revision 1.1 90/10/06 12:06:39 dvadura XX * dmake Release, Version 3.6 XX * XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/unix/sysvr1/stdarg.h Sat Oct 6 12:06:34 1990 XX--- unix/sysvr1/stdarg.h Tue Nov 6 13:12:58 1990 XX*************** XX*** 6,15 **** XX * XX */ XX XX! #if !defined(__STDARG) XX! #define __STDARG XX XX typedef char *va_list; XX XX #define va_dcl int va_alist XX #define va_start(ap,v) ap = (va_list)&va_alist XX--- 6,18 ---- XX * XX */ XX XX! #if !defined(__STDARG_H__) XX! #define __STDARG_H__ XX XX+ #if !defined(_VA_LIST_) XX+ #define _VA_LIST_ XX typedef char *va_list; XX+ #endif XX XX #define va_dcl int va_alist XX #define va_start(ap,v) ap = (va_list)&va_alist XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/unix/sysintf.h Mon Oct 22 17:08:18 1990 XX--- unix/sysintf.h Wed Oct 31 22:19:23 1990 XX*************** XX*** 3,9 **** XX--- 3,12 ---- XX ** System specific code can be found in the config.h files for each XX ** of the system specifications. XX */ XX+ #ifndef _SYS_TYPES_INCLUDED XX+ #define _SYS_TYPES_INCLUDED XX #include <sys/types.h> XX+ #endif XX #include <sys/stat.h> XX #include <signal.h> XX XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/unix/bsd43/config.h Sat Oct 6 12:06:06 1990 XX--- unix/bsd43/config.h Thu Nov 29 21:41:41 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/bsd43/RCS/config.h,v 1.1 90/10/06 12:06:05 dvadura Exp $ XX -- SYNOPSIS -- Configurarion include file. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/bsd43/RCS/config.h,v 1.2 90/11/29 21:41:18 dvadura Exp $ XX -- SYNOPSIS -- Configurarion include file. XX -- XX -- DESCRIPTION XX*************** XX*** 29,34 **** XX--- 29,37 ---- XX -- XX -- LOG XX -- $Log: config.h,v $ XX+ * Revision 1.2 90/11/29 21:41:18 dvadura XX+ * Added fix for define to PORTAR for sun 386i's. XX+ * XX * Revision 1.1 90/10/06 12:06:05 dvadura XX * dmake Release, Version 3.6 XX * XX*************** XX*** 44,46 **** XX--- 47,55 ---- XX * not have getcwd, but call it getwd instead. */ XX extern char* getwd ANSI((char*)); XX #define getcwd(buf,siz) getwd(buf) XX+ XX+ /* Sun unix on 386i's has a broken ar.h that does not assume PORTAR format XX+ * by default, so we fix it here. */ XX+ #ifdef i386 XX+ #define PORTAR 1 XX+ #endif XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/runargv.c Tue Oct 30 11:36:24 1990 XX--- tos/runargv.c Tue Oct 30 23:33:24 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/RCS/runargv.c,v 1.1 90/10/06 12:05:30 dvadura Exp $ XX -- SYNOPSIS -- run a sub process. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/runargv.c,v 1.1 90/10/30 23:33:24 dvadura Exp $ XX -- SYNOPSIS -- run a sub process. XX -- XX -- DESCRIPTION XX*************** XX*** 27,33 **** XX -- XX -- LOG XX -- $Log: runargv.c,v $ XX! * Revision 1.1 90/10/06 12:05:30 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX--- 27,33 ---- XX -- XX -- LOG XX -- $Log: runargv.c,v $ XX! * Revision 1.1 90/10/30 23:33:24 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/ruletab.c Tue Oct 30 11:36:22 1990 XX--- tos/ruletab.c Tue Oct 30 23:33:23 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/ruletab.c,v 1.1 90/10/06 12:07:08 dvadura Exp $ XX -- SYNOPSIS -- Default initial configuration of dmake. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/ruletab.c,v 1.1 90/10/30 23:33:23 dvadura Exp $ XX -- SYNOPSIS -- Default initial configuration of dmake. XX -- XX -- DESCRIPTION XX*************** XX*** 28,34 **** XX -- XX -- LOG XX -- $Log: ruletab.c,v $ XX! * Revision 1.1 90/10/06 12:07:08 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX--- 28,34 ---- XX -- XX -- LOG XX -- $Log: ruletab.c,v $ XX! * Revision 1.1 90/10/30 23:33:23 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/rmprq.c Tue Oct 30 11:36:22 1990 XX--- tos/rmprq.c Tue Oct 30 23:33:23 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/rmprq.c,v 1.1 90/10/06 12:07:06 dvadura Exp $ XX -- SYNOPSIS -- remove prerequisites code. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/rmprq.c,v 1.1 90/10/30 23:33:23 dvadura Exp $ XX -- SYNOPSIS -- remove prerequisites code. XX -- XX -- DESCRIPTION XX*************** XX*** 29,35 **** XX -- XX -- LOG XX -- $Log: rmprq.c,v $ XX! * Revision 1.1 90/10/06 12:07:06 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX--- 29,35 ---- XX -- XX -- LOG XX -- $Log: rmprq.c,v $ XX! * Revision 1.1 90/10/30 23:33:23 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/make.sh Tue Oct 30 15:27:24 1990 XX--- tos/make.sh Thu Nov 29 21:57:51 1990 XX*************** XX*** 43,48 **** XX--- 43,50 ---- XX mv arlib.o objects XX gcc -c -DHELP -I. -Icommon -Itos -O tos/dirbrk.c XX mv dirbrk.o objects XX+ gcc -c -DHELP -I. -Icommon -Itos -O tos/putenv.c XX+ mv putenv.o objects XX gcc -c -DHELP -I. -Icommon -Itos -O tos/rmprq.c XX mv rmprq.o objects XX gcc -c -DHELP -I. -Icommon -Itos -O tos/ruletab.c XX*************** XX*** 49,52 **** XX--- 51,56 ---- XX mv ruletab.o objects XX gcc -c -DHELP -I. -Icommon -Itos -O tos/runargv.c XX mv runargv.o objects XX+ gcc -c -DHELP -I. -Icommon -Itos -O tos/tempnam.c XX+ mv tempnam.o objects XX gcc -s -o dmake objects/*.o XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/dirbrk.c Tue Oct 30 11:36:16 1990 XX--- tos/dirbrk.c Tue Oct 30 23:33:22 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/dirbrk.c,v 1.1 90/10/06 12:07:00 dvadura Exp $ XX -- SYNOPSIS -- define the directory separator string. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/dirbrk.c,v 1.1 90/10/30 23:33:22 dvadura Exp $ XX -- SYNOPSIS -- define the directory separator string. XX -- XX -- DESCRIPTION XX*************** XX*** 29,35 **** XX -- XX -- LOG XX -- $Log: dirbrk.c,v $ XX! * Revision 1.1 90/10/06 12:07:00 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX--- 29,35 ---- XX -- XX -- LOG XX -- $Log: dirbrk.c,v $ XX! * Revision 1.1 90/10/30 23:33:22 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/config.mk Tue Oct 30 12:02:38 1990 XX--- tos/config.mk Tue Oct 30 23:32:01 1990 XX*************** XX*** 27,33 **** XX CFLAGS += -I$(OS) XX XX # Sources that must be defined for each different version XX! OSSRC := arlib.c dirbrk.c rmprq.c ruletab.c runargv.c XX SRC += $(OSSRC) XX .SETDIR=$(OS) : $(OSSRC) XX XX--- 27,33 ---- XX CFLAGS += -I$(OS) XX XX # Sources that must be defined for each different version XX! OSSRC := arlib.c dirbrk.c putenv.c rmprq.c ruletab.c runargv.c tempnam.c XX SRC += $(OSSRC) XX .SETDIR=$(OS) : $(OSSRC) XX XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/config.h Tue Oct 30 11:49:16 1990 XX--- tos/config.h Tue Oct 30 23:33:21 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr3/RCS/config.h,v 1.1 90/10/06 12:06:39 dvadura Exp $ XX -- SYNOPSIS -- Configurarion include file. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/config.h,v 1.1 90/10/30 23:33:21 dvadura Exp $ XX -- SYNOPSIS -- Configurarion include file. XX -- XX -- DESCRIPTION XX*************** XX*** 29,35 **** XX -- XX -- LOG XX -- $Log: config.h,v $ XX! * Revision 1.1 90/10/06 12:06:39 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX--- 29,35 ---- XX -- XX -- LOG XX -- $Log: config.h,v $ XX! * Revision 1.1 90/10/30 23:33:21 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/tos/arlib.c Tue Oct 30 11:36:14 1990 XX--- tos/arlib.c Tue Oct 30 23:33:21 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/arlib.c,v 1.1 90/10/06 12:06:53 dvadura Exp $ XX -- SYNOPSIS -- Unix archive manipulation code. XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/tos/RCS/arlib.c,v 1.1 90/10/30 23:33:20 dvadura Exp $ XX -- SYNOPSIS -- Unix archive manipulation code. XX -- XX -- DESCRIPTION XX*************** XX*** 31,37 **** XX -- XX -- LOG XX -- $Log: arlib.c,v $ XX! * Revision 1.1 90/10/06 12:06:53 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX--- 31,37 ---- XX -- XX -- LOG XX -- $Log: arlib.c,v $ XX! * Revision 1.1 90/10/30 23:33:20 dvadura XX * dmake Release, Version 3.6 XX * XX */ XX*** /u2/dvadura/src/generic/dmake/dmake36-pl2/sysintf.c Sun Oct 28 22:16:20 1990 XX--- sysintf.c Tue Oct 30 23:08:02 1990 XX*************** XX*** 1,4 **** XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/sysintf.c,v 1.1 90/10/06 12:04:17 dvadura Exp Locker: dvadura $ XX -- SYNOPSIS -- system independent interface XX -- XX -- DESCRIPTION XX--- 1,4 ---- XX! /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/sysintf.c,v 1.2 90/10/30 23:07:05 dvadura Exp $ XX -- SYNOPSIS -- system independent interface XX -- XX -- DESCRIPTION SHAR_EOF echo "End of part 2, continue with part 3" echo "3" > s2_seq_.tmp exit 0 -- -------------------------------------------------------------------------------- "This is almost worth the HIGH blood pressure!" he |Dennis Vadura thought as yet another mosquito exploded.-R.Patching|dvadura@dragon.uwaterloo.ca ================================================================================