home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume19 / dmake / part35 < prev    next >
Encoding:
Text File  |  1991-05-13  |  40.2 KB  |  1,353 lines

  1. Newsgroups: comp.sources.misc
  2. From: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  3. Subject:  v19i056:  dmake - dmake version 3.7, Part35/37
  4. Message-ID: <1991May13.145435.9882@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: eb903818eb59c7a3d08a6fade332f2b9
  6. Date: Mon, 13 May 1991 14:54:35 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  10. Posting-number: Volume 19, Issue 56
  11. Archive-name: dmake/part35
  12. Supersedes: dmake-3.6: Volume 15, Issue 52-77
  13.  
  14. ---- Cut Here and feed the following to sh ----
  15. #!/bin/sh
  16. # this is dmake.shar.35 (part 35 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file dmake/unix/ruletab.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 35; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test -f _shar_wnt_.tmp; then
  33. sed 's/^X//' << 'SHAR_EOF' >> 'dmake/unix/ruletab.c' &&
  34. -- SYNOPSIS -- Default initial configuration of dmake.
  35. -- 
  36. -- DESCRIPTION
  37. --     Define here the initial set of rules that are defined before
  38. --    dmake performs any processing.
  39. --
  40. -- AUTHOR
  41. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  42. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  43. --
  44. -- COPYRIGHT
  45. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  46. -- 
  47. --      This program is free software; you can redistribute it and/or
  48. --      modify it under the terms of the GNU General Public License
  49. --      (version 1), as published by the Free Software Foundation, and
  50. --      found in the file 'LICENSE' included with this distribution.
  51. -- 
  52. --      This program is distributed in the hope that it will be useful,
  53. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  54. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  55. --      GNU General Public License for more details.
  56. -- 
  57. --      You should have received a copy of the GNU General Public License
  58. --      along with this program;  if not, write to the Free Software
  59. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  60. --
  61. -- LOG
  62. --     $Log:    ruletab.c,v $
  63. X * Revision 1.1  91/05/06  15:27:29  dvadura
  64. X * dmake Release Version 3.7
  65. X * 
  66. */
  67. X
  68. /* These are control macros for dmake that MUST be defined at some point
  69. X * if they are NOT dmake will not work!  These are default definitions.  They
  70. X * may be overridden inside the .STARTUP makefile, they are here
  71. X * strictly so that dmake can parse the STARTUP makefile */
  72. X
  73. static char *_rules[] = {
  74. X    "MAXPROCESSLIMIT := 10",
  75. X    "MAXLINELENGTH := 8190",
  76. X    ".IMPORT .IGNORE: ROOTDIR",
  77. X    ".MAKEFILES : makefile.mk Makefile makefile",
  78. X    ".SOURCE    : .NULL",
  79. #include "startup.h"
  80. X    0 };
  81. X
  82. char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
  83. SHAR_EOF
  84. chmod 0640 dmake/unix/ruletab.c ||
  85. echo 'restore of dmake/unix/ruletab.c failed'
  86. Wc_c="`wc -c < 'dmake/unix/ruletab.c'`"
  87. test 1939 -eq "$Wc_c" ||
  88.     echo 'dmake/unix/ruletab.c: original size 1939, current size' "$Wc_c"
  89. rm -f _shar_wnt_.tmp
  90. fi
  91. # ============= dmake/unix/runargv.c ==============
  92. if test -f 'dmake/unix/runargv.c' -a X"$1" != X"-c"; then
  93.     echo 'x - skipping dmake/unix/runargv.c (File already exists)'
  94.     rm -f _shar_wnt_.tmp
  95. else
  96. > _shar_wnt_.tmp
  97. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/runargv.c' &&
  98. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/runargv.c,v 1.1 91/05/06 15:27:29 dvadura Exp $
  99. -- SYNOPSIS -- invoke a sub process.
  100. -- 
  101. -- DESCRIPTION
  102. --     Use the standard methods of executing a sub process.
  103. --
  104. -- AUTHOR
  105. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  106. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  107. --
  108. -- COPYRIGHT
  109. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  110. -- 
  111. --      This program is free software; you can redistribute it and/or
  112. --      modify it under the terms of the GNU General Public License
  113. --      (version 1), as published by the Free Software Foundation, and
  114. --      found in the file 'LICENSE' included with this distribution.
  115. -- 
  116. --      This program is distributed in the hope that it will be useful,
  117. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  118. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  119. --      GNU General Public License for more details.
  120. -- 
  121. --      You should have received a copy of the GNU General Public License
  122. --      along with this program;  if not, write to the Free Software
  123. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  124. --
  125. -- LOG
  126. --     $Log:    runargv.c,v $
  127. X * Revision 1.1  91/05/06  15:27:29  dvadura
  128. X * dmake Release Version 3.7
  129. X * 
  130. */
  131. X
  132. #include <signal.h>
  133. #include "extern.h"
  134. #include "sysintf.h"
  135. X
  136. typedef struct prp {
  137. X   char *prp_cmd;
  138. X   int   prp_group;
  139. X   int   prp_ignore;
  140. X   int   prp_last;
  141. X   int     prp_shell;
  142. X   struct prp *prp_next;
  143. } RCP, *RCPPTR;
  144. X
  145. typedef struct pr {
  146. X   int        pr_valid;
  147. X   int        pr_pid;
  148. X   CELLPTR    pr_target;
  149. X   int        pr_ignore;
  150. X   int        pr_last;
  151. X   RCPPTR      pr_recipe;
  152. X   RCPPTR      pr_recipe_end;
  153. X   char        *pr_dir;
  154. } PR;
  155. X
  156. static PR  *_procs    = NIL(PR);
  157. static int  _proc_cnt = 0;
  158. static int  _abort_flg= FALSE;
  159. static int  _use_i    = -1;
  160. static int  _do_upd   = 0;
  161. X
  162. static  void    _add_child ANSI((int, CELLPTR, int, int));
  163. static  void    _attach_cmd ANSI((char *, int, int, CELLPTR, int, int));
  164. static  void    _finished_child ANSI((int, int));
  165. static  int     _running ANSI((CELLPTR));
  166. X
  167. PUBLIC int
  168. runargv(target, ignore, group, last, shell, cmd)
  169. CELLPTR target;
  170. int     ignore;
  171. int    group;
  172. int    last;
  173. int     shell;
  174. char    *cmd;
  175. {
  176. X   extern  int  errno;
  177. X   extern  char *sys_errlist[];
  178. X   int          pid;
  179. X   char         **argv;
  180. X
  181. X   if( _running(target) /*&& Max_proc != 1*/ ) {
  182. X      /* The command will be executed when the previous recipe
  183. X       * line completes. */
  184. X      _attach_cmd( cmd, group, ignore, target, last, shell );
  185. X      return(1);
  186. X   }
  187. X
  188. X   while( _proc_cnt == Max_proc )
  189. X      if( Wait_for_child(FALSE, -1) == -1 )  Fatal( "Lost a child" );
  190. X
  191. X   argv = Pack_argv( group, shell, cmd );
  192. X
  193. X   switch( pid=fork() ){
  194. X      int   wid;
  195. X      int   status;
  196. X
  197. X   case -1: /* fork failed */
  198. X      Error("%s: %s", argv[0], sys_errlist[errno]);
  199. X      Handle_result(-1, ignore, _abort_flg, target);
  200. X      return(-1);
  201. X
  202. X   case 0:  /* child */
  203. X      execvp(argv[0], argv);
  204. X      Continue = TRUE;   /* survive error message */
  205. X      Error("%s: %s", argv[0], sys_errlist[errno]);
  206. X      kill(getpid(), SIGTERM);
  207. X      /*NOTREACHED*/
  208. X
  209. X   default: /* parent */
  210. X      _add_child(pid, target, ignore, last);
  211. X   }
  212. X
  213. X   return(1);
  214. }
  215. X
  216. X
  217. PUBLIC int
  218. Wait_for_child( abort_flg, pid )
  219. int abort_flg;
  220. int pid;
  221. {
  222. X   int wid;
  223. X   int status;
  224. X   int waitchild;
  225. X
  226. X   waitchild = (pid == -1)? FALSE : Wait_for_completion;
  227. X
  228. X   do {
  229. X      if( (wid = wait(&status)) == -1 ) return(-1);
  230. X
  231. X      _abort_flg = abort_flg;
  232. X      _finished_child(wid, status);
  233. X      _abort_flg = FALSE;
  234. X   }
  235. X   while( waitchild && pid != wid );
  236. X
  237. X   return(0);
  238. }
  239. X
  240. X
  241. PUBLIC void
  242. Clean_up_processes()
  243. {
  244. X   register int i;
  245. X
  246. X   if( _procs != NIL(PR) ) {
  247. X      for( i=0; i<Max_proc; i++ )
  248. X     if( _procs[i].pr_valid )
  249. X        kill(_procs[i].pr_pid, SIGTERM);
  250. X
  251. X      while( Wait_for_child(TRUE, -1) != -1 );
  252. X   }
  253. }
  254. X
  255. X
  256. static void
  257. _add_child( pid, target, ignore, last )
  258. int    pid;
  259. CELLPTR target;
  260. int    ignore;
  261. int     last;
  262. {
  263. X   register int i;
  264. X   register PR *pp;
  265. X
  266. X   if( _procs == NIL(PR) ) {
  267. X      TALLOC( _procs, Max_proc, PR );
  268. X   }
  269. X
  270. X   if( (i = _use_i) == -1 )
  271. X      for( i=0; i<Max_proc; i++ )
  272. X     if( !_procs[i].pr_valid )
  273. X        break;
  274. X
  275. X   pp = _procs+i;
  276. X
  277. X   pp->pr_valid  = 1;
  278. X   pp->pr_pid    = pid;
  279. X   pp->pr_target = target;
  280. X   pp->pr_ignore = ignore;
  281. X   pp->pr_last   = last;
  282. X   pp->pr_dir    = _strdup(Get_current_dir());
  283. X
  284. X   Current_target = NIL(CELL);
  285. X
  286. X   _proc_cnt++;
  287. X
  288. X   if( Wait_for_completion ) Wait_for_child( FALSE, pid );
  289. }
  290. X
  291. X
  292. static void
  293. _finished_child(pid, status)
  294. int    pid;
  295. int    status;
  296. {
  297. X   register int i;
  298. X   register PR *pp;
  299. X   char     *dir;
  300. X
  301. X   for( i=0; i<Max_proc; i++ )
  302. X      if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
  303. X     break;
  304. X
  305. X   /* Some children we didn't make esp true if using /bin/sh to execute a
  306. X    * a pipe and feed the output as a makefile into dmake. */
  307. X   if( i == Max_proc ) return;
  308. X   _procs[i].pr_valid = 0;
  309. X   _proc_cnt--;
  310. X   dir = _strdup(Get_current_dir());
  311. X   Set_dir( _procs[i].pr_dir );
  312. X
  313. X   if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
  314. X      RCPPTR rp = _procs[i].pr_recipe;
  315. X
  316. X
  317. X      Current_target = _procs[i].pr_target;
  318. X      Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
  319. X      Current_target = NIL(CELL);
  320. X
  321. X      _procs[i].pr_recipe = rp->prp_next;
  322. X
  323. X      _use_i = i;
  324. X      runargv( _procs[i].pr_target, rp->prp_ignore, rp->prp_group,
  325. X           rp->prp_last, rp->prp_shell, rp->prp_cmd );
  326. X      _use_i = -1;
  327. X
  328. X      FREE( rp->prp_cmd );
  329. X      FREE( rp );
  330. X
  331. X      if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
  332. X   }
  333. X   else {
  334. X      Unlink_temp_files( _procs[i].pr_target );
  335. X      Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
  336. X
  337. X      if( _procs[i].pr_last ) {
  338. X     FREE(_procs[i].pr_dir );
  339. X
  340. X     if( !Doing_bang ) Update_time_stamp( _procs[i].pr_target );
  341. X      }
  342. X   }
  343. X
  344. X   Set_dir(dir);
  345. X   FREE(dir);
  346. }
  347. X
  348. X
  349. static int
  350. _running( cp )
  351. CELLPTR cp;
  352. {
  353. X   register int i;
  354. X
  355. X   if( !_procs ) return(FALSE);
  356. X
  357. X   for( i=0; i<Max_proc; i++ )
  358. X      if( _procs[i].pr_valid &&
  359. X      _procs[i].pr_target == cp  )
  360. X     break;
  361. X     
  362. X   return( i != Max_proc );
  363. }
  364. X
  365. X
  366. static void
  367. _attach_cmd( cmd, group, ignore, cp, last, shell )
  368. char    *cmd;
  369. int    group;
  370. int     ignore;
  371. CELLPTR cp;
  372. int     last;
  373. int     shell;
  374. {
  375. X   register int i;
  376. X   RCPPTR rp;
  377. X
  378. X   for( i=0; i<Max_proc; i++ )
  379. X      if( _procs[i].pr_valid &&
  380. X      _procs[i].pr_target == cp  )
  381. X     break;
  382. X
  383. X   TALLOC( rp, 1, RCP );
  384. X   rp->prp_cmd   = _strdup(cmd);
  385. X   rp->prp_group = group;
  386. X   rp->prp_ignore= ignore;
  387. X   rp->prp_last  = last;
  388. X   rp->prp_shell = shell;
  389. X
  390. X   if( _procs[i].pr_recipe == NIL(RCP) )
  391. X      _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
  392. X   else {
  393. X      _procs[i].pr_recipe_end->prp_next = rp;
  394. X      _procs[i].pr_recipe_end = rp;
  395. X   }
  396. }
  397. SHAR_EOF
  398. chmod 0640 dmake/unix/runargv.c ||
  399. echo 'restore of dmake/unix/runargv.c failed'
  400. Wc_c="`wc -c < 'dmake/unix/runargv.c'`"
  401. test 6758 -eq "$Wc_c" ||
  402.     echo 'dmake/unix/runargv.c: original size 6758, current size' "$Wc_c"
  403. rm -f _shar_wnt_.tmp
  404. fi
  405. # ============= dmake/unix/startup.h ==============
  406. if test -f 'dmake/unix/startup.h' -a X"$1" != X"-c"; then
  407.     echo 'x - skipping dmake/unix/startup.h (File already exists)'
  408.     rm -f _shar_wnt_.tmp
  409. else
  410. > _shar_wnt_.tmp
  411. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/startup.h' &&
  412. /* This file contains the default value of the MAKESTARTUP variable.
  413. X * You must set the quoted string below to the default path to the startup
  414. X * variable, so that it gets compiled in.  LEAVE ROOTDIR at the front of
  415. X * the path.  This allows the user to customize his environment for dmake
  416. X * by setting up a new ROOTDIR environment variable. */
  417. X
  418. "MAKESTARTUP := $(ROOTDIR)/usr/software/dmake/data/startup.mk",
  419. SHAR_EOF
  420. chmod 0640 dmake/unix/startup.h ||
  421. echo 'restore of dmake/unix/startup.h failed'
  422. Wc_c="`wc -c < 'dmake/unix/startup.h'`"
  423. test 412 -eq "$Wc_c" ||
  424.     echo 'dmake/unix/startup.h: original size 412, current size' "$Wc_c"
  425. rm -f _shar_wnt_.tmp
  426. fi
  427. # ============= dmake/unix/sysintf.h ==============
  428. if test -f 'dmake/unix/sysintf.h' -a X"$1" != X"-c"; then
  429.     echo 'x - skipping dmake/unix/sysintf.h (File already exists)'
  430.     rm -f _shar_wnt_.tmp
  431. else
  432. > _shar_wnt_.tmp
  433. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysintf.h' &&
  434. /*
  435. ** assorted bits of system interface, for common routines inside dmake.
  436. ** System specific code can be found in the config.h files for each
  437. ** of the system specifications.
  438. */
  439. #define STAT stat
  440. #define VOID_LCACHE(l,m) (void) void_lcache(l,m)
  441. #define Hook_std_writes(A)
  442. #define GETPID getpid()
  443. X
  444. /*
  445. ** standard C items
  446. */
  447. X
  448. /*
  449. ** DOS interface standard items
  450. */
  451. #define    getswitchar()    '-'
  452. X
  453. /*
  454. ** make parameters
  455. */
  456. #define    MAX_PATH_LEN    1024
  457. SHAR_EOF
  458. chmod 0640 dmake/unix/sysintf.h ||
  459. echo 'restore of dmake/unix/sysintf.h failed'
  460. Wc_c="`wc -c < 'dmake/unix/sysintf.h'`"
  461. test 441 -eq "$Wc_c" ||
  462.     echo 'dmake/unix/sysintf.h: original size 441, current size' "$Wc_c"
  463. rm -f _shar_wnt_.tmp
  464. fi
  465. # ============= dmake/unix/sysvr1/config.h ==============
  466. if test ! -d 'dmake/unix/sysvr1'; then
  467.     mkdir 'dmake/unix/sysvr1'
  468. fi
  469. if test -f 'dmake/unix/sysvr1/config.h' -a X"$1" != X"-c"; then
  470.     echo 'x - skipping dmake/unix/sysvr1/config.h (File already exists)'
  471.     rm -f _shar_wnt_.tmp
  472. else
  473. > _shar_wnt_.tmp
  474. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/config.h' &&
  475. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr1/RCS/config.h,v 1.1 91/05/06 15:28:02 dvadura Exp $
  476. -- SYNOPSIS -- Configurarion include file.
  477. -- 
  478. -- DESCRIPTION
  479. --     There is one of these for each specific machine configuration.
  480. --    It can be used to further tweek the machine specific sources
  481. --    so that they compile.
  482. --
  483. -- AUTHOR
  484. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  485. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  486. --
  487. -- COPYRIGHT
  488. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  489. -- 
  490. --      This program is free software; you can redistribute it and/or
  491. --      modify it under the terms of the GNU General Public License
  492. --      (version 1), as published by the Free Software Foundation, and
  493. --      found in the file 'LICENSE' included with this distribution.
  494. -- 
  495. --      This program is distributed in the hope that it will be useful,
  496. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  497. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  498. --      GNU General Public License for more details.
  499. -- 
  500. --      You should have received a copy of the GNU General Public License
  501. --      along with this program;  if not, write to the Free Software
  502. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  503. --
  504. -- LOG
  505. --     $Log:    config.h,v $
  506. X * Revision 1.1  91/05/06  15:28:02  dvadura
  507. X * dmake Release Version 3.7
  508. X * 
  509. */
  510. X
  511. /* define this for configurations that don't have the coreleft function
  512. X * so that the code compiles.  To my knowledge coreleft exists only on
  513. X * Turbo C, but it is needed here since the function is used in many debug
  514. X * macros. */
  515. #define coreleft() 0L
  516. X
  517. /* Define the getcwd function that is used in the code, since BSD does
  518. X * not have getcwd, but call it getwd instead. */
  519. extern char *getcwd ANSI((char *, int));
  520. X
  521. /* Define setvbuf, SysV doesn't have one */
  522. #define setvbuf(fp, bp, type, len) setbuf( fp, NULL );
  523. X
  524. /* We don't care about CONST */
  525. #define CONST
  526. SHAR_EOF
  527. chmod 0640 dmake/unix/sysvr1/config.h ||
  528. echo 'restore of dmake/unix/sysvr1/config.h failed'
  529. Wc_c="`wc -c < 'dmake/unix/sysvr1/config.h'`"
  530. test 1999 -eq "$Wc_c" ||
  531.     echo 'dmake/unix/sysvr1/config.h: original size 1999, current size' "$Wc_c"
  532. rm -f _shar_wnt_.tmp
  533. fi
  534. # ============= dmake/unix/sysvr1/config.mk ==============
  535. if test -f 'dmake/unix/sysvr1/config.mk' -a X"$1" != X"-c"; then
  536.     echo 'x - skipping dmake/unix/sysvr1/config.mk (File already exists)'
  537.     rm -f _shar_wnt_.tmp
  538. else
  539. > _shar_wnt_.tmp
  540. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/config.mk' &&
  541. # This is the SysV R3 UNIX configuration file for DMAKE
  542. #    It simply modifies the values of SRC, and checks to see if
  543. #    OSENVIRONMENT is defined.  If so it includes the appropriate
  544. #    config.mk file.
  545. #
  546. # It also sets the values of .SOURCE.c and .SOURCE.h to include the local
  547. # directory.
  548. #
  549. osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
  550. X
  551. # The following are required sources
  552. OSDSRC := vfprintf.c
  553. X
  554. .IF $(OSDSRC)
  555. X   SRC    += $(OSDSRC)
  556. X   .SETDIR=$(osrdir) : $(OSDSRC)
  557. .END
  558. X
  559. .SOURCE.h : $(osrdir)
  560. X
  561. # Local configuration modifications for CFLAGS, there's local SysV includes
  562. # too.
  563. CFLAGS += -I$(osrdir)
  564. X
  565. # See if we modify anything in the lower levels.
  566. .IF $(OSENVIRONMENT) != $(NULL)
  567. X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
  568. .END
  569. SHAR_EOF
  570. chmod 0640 dmake/unix/sysvr1/config.mk ||
  571. echo 'restore of dmake/unix/sysvr1/config.mk failed'
  572. Wc_c="`wc -c < 'dmake/unix/sysvr1/config.mk'`"
  573. test 761 -eq "$Wc_c" ||
  574.     echo 'dmake/unix/sysvr1/config.mk: original size 761, current size' "$Wc_c"
  575. rm -f _shar_wnt_.tmp
  576. fi
  577. # ============= dmake/unix/sysvr1/make.sh ==============
  578. if test -f 'dmake/unix/sysvr1/make.sh' -a X"$1" != X"-c"; then
  579.     echo 'x - skipping dmake/unix/sysvr1/make.sh (File already exists)'
  580.     rm -f _shar_wnt_.tmp
  581. else
  582. > _shar_wnt_.tmp
  583. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/make.sh' &&
  584. mkdir objects
  585. cc -c -I. -Iunix -Iunix/sysvr1 -O infer.c
  586. mv infer.o objects
  587. cc -c -I. -Iunix -Iunix/sysvr1 -O make.c
  588. mv make.o objects
  589. cc -c -I. -Iunix -Iunix/sysvr1 -O stat.c
  590. mv stat.o objects
  591. cc -c -I. -Iunix -Iunix/sysvr1 -O expand.c
  592. mv expand.o objects
  593. cc -c -I. -Iunix -Iunix/sysvr1 -O dmstring.c
  594. mv dmstring.o objects
  595. cc -c -I. -Iunix -Iunix/sysvr1 -O hash.c
  596. mv hash.o objects
  597. cc -c -I. -Iunix -Iunix/sysvr1 -O dag.c
  598. mv dag.o objects
  599. cc -c -I. -Iunix -Iunix/sysvr1 -O dmake.c
  600. mv dmake.o objects
  601. cc -c -I. -Iunix -Iunix/sysvr1 -O path.c
  602. mv path.o objects
  603. cc -c -I. -Iunix -Iunix/sysvr1 -O imacs.c
  604. mv imacs.o objects
  605. cc -c -I. -Iunix -Iunix/sysvr1 -O sysintf.c
  606. mv sysintf.o objects
  607. cc -c -I. -Iunix -Iunix/sysvr1 -O parse.c
  608. mv parse.o objects
  609. cc -c -I. -Iunix -Iunix/sysvr1 -O getinp.c
  610. mv getinp.o objects
  611. cc -c -I. -Iunix -Iunix/sysvr1 -O quit.c
  612. mv quit.o objects
  613. cc -c -I. -Iunix -Iunix/sysvr1 -O state.c
  614. mv state.o objects
  615. cc -c -I. -Iunix -Iunix/sysvr1 -O basename.c
  616. mv basename.o objects
  617. cc -c -I. -Iunix -Iunix/sysvr1 -O dmdump.c
  618. mv dmdump.o objects
  619. cc -c -I. -Iunix -Iunix/sysvr1 -O macparse.c
  620. mv macparse.o objects
  621. cc -c -I. -Iunix -Iunix/sysvr1 -O rulparse.c
  622. mv rulparse.o objects
  623. cc -c -I. -Iunix -Iunix/sysvr1 -O percent.c
  624. mv percent.o objects
  625. cc -c -I. -Iunix -Iunix/sysvr1 -O function.c
  626. mv function.o objects
  627. cc -c -I. -Iunix -Iunix/sysvr1 -O unix/arlib.c
  628. mv arlib.o objects
  629. cc -c -I. -Iunix -Iunix/sysvr1 -O unix/dirbrk.c
  630. mv dirbrk.o objects
  631. cc -c -I. -Iunix -Iunix/sysvr1 -O unix/rmprq.c
  632. mv rmprq.o objects
  633. cc -c -I. -Iunix -Iunix/sysvr1 -O unix/ruletab.c
  634. mv ruletab.o objects
  635. cc -c -I. -Iunix -Iunix/sysvr1 -O unix/runargv.c
  636. mv runargv.o objects
  637. cc -c -I. -Iunix -Iunix/sysvr1 -O unix/sysvr1/vfprintf.c
  638. mv vfprintf.o objects
  639. cc  -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/basename.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/vfprintf.o 
  640. cp unix/sysvr1/startup.mk startup.mk
  641. SHAR_EOF
  642. chmod 0640 dmake/unix/sysvr1/make.sh ||
  643. echo 'restore of dmake/unix/sysvr1/make.sh failed'
  644. Wc_c="`wc -c < 'dmake/unix/sysvr1/make.sh'`"
  645. test 2251 -eq "$Wc_c" ||
  646.     echo 'dmake/unix/sysvr1/make.sh: original size 2251, current size' "$Wc_c"
  647. rm -f _shar_wnt_.tmp
  648. fi
  649. # ============= dmake/unix/sysvr1/public.h ==============
  650. if test -f 'dmake/unix/sysvr1/public.h' -a X"$1" != X"-c"; then
  651.     echo 'x - skipping dmake/unix/sysvr1/public.h (File already exists)'
  652.     rm -f _shar_wnt_.tmp
  653. else
  654. > _shar_wnt_.tmp
  655. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/public.h' &&
  656. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr1/RCS/public.h,v 1.1 91/05/06 15:28:03 dvadura Exp Locker: dvadura $
  657. -- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
  658. --
  659. -- SYNOPSIS -- Local functions exported to be visible by others.
  660. --
  661. -- DESCRIPTION
  662. --      This file is generated by 'genpub'.  Function declarations
  663. --      that appear in this file are extracted by 'genpub' from
  664. --      source files.  Any function in the source file whose definition
  665. --      appears like:
  666. --
  667. --          PUBLIC return_type
  668. --          function( arg_list );
  669. --          type_expr1 arg1;
  670. --          ...
  671. --
  672. --      has its definition extracted and a line of the form:
  673. --
  674. --          return_type function ANSI((type_expr1,type_expr2,...));
  675. --
  676. --      entered into the output file.
  677. --
  678. -- AUTHOR
  679. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  680. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  681. --
  682. -- COPYRIGHT
  683. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  684. -- 
  685. --      This program is free software; you can redistribute it and/or
  686. --      modify it under the terms of the GNU General Public License
  687. --      (version 1), as published by the Free Software Foundation, and
  688. --      found in the file 'LICENSE' included with this distribution.
  689. -- 
  690. --      This program is distributed in the hope that it will be useful,
  691. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  692. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  693. --      GNU General Public License for more details.
  694. -- 
  695. --      You should have received a copy of the GNU General Public License
  696. --      along with this program;  if not, write to the Free Software
  697. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  698. --
  699. -- LOG
  700. --     $Log:    public.h,v $
  701. X * Revision 1.1  91/05/06  15:28:03  dvadura
  702. X * dmake Release Version 3.7
  703. X * 
  704. */
  705. X
  706. #ifndef _DMAKE_PUBLIC_h
  707. #define _DMAKE_PUBLIC_h
  708. X
  709. void Infer_recipe ANSI((CELLPTR, CELLPTR));
  710. int Make_targets ANSI(());
  711. int Exec_commands ANSI((CELLPTR));
  712. void Pop_dir ANSI((int));
  713. void Append_line ANSI((char *, int, FILE *, char *, int, int));
  714. void Stat_target ANSI((CELLPTR, int));
  715. char * Expand ANSI((char *));
  716. char * Apply_edit ANSI((char *, char *, char *, int, int));
  717. void Map_esc ANSI((char *));
  718. char* Apply_modifiers ANSI((int, char *));
  719. char* Tokenize ANSI((char *, char *));
  720. char * _strjoin ANSI((char *, char *, int, int));
  721. char * _stradd ANSI((char *, char *, int));
  722. char * _strapp ANSI((char *, char *));
  723. char * _strdup ANSI((char *));
  724. char * _strpbrk ANSI((char *, char *));
  725. char * _strspn ANSI((char *, char *));
  726. char * _strstr ANSI((char *, char *));
  727. char * _substr ANSI((char *, char *));
  728. uint16 Hash ANSI((char *, uint32 *));
  729. HASHPTR Get_name ANSI((char *, HASHPTR *, int));
  730. HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
  731. HASHPTR Def_macro ANSI((char *, char *, int));
  732. CELLPTR Def_cell ANSI((char *));
  733. LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
  734. void Clear_prerequisites ANSI((CELLPTR));
  735. int Test_circle ANSI((CELLPTR, int));
  736. STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
  737. t_attr Rcp_attribute ANSI((char *));
  738. int main ANSI((int, char **));
  739. FILE * Openfile ANSI((char *, int, int));
  740. FILE * Closefile ANSI(());
  741. FILE * Search_file ANSI((char *, char **));
  742. char * Filename ANSI(());
  743. void No_ram ANSI(());
  744. int Usage ANSI((int));
  745. int Version ANSI(());
  746. char * Get_suffix ANSI((char *));
  747. char * Build_path ANSI((char *, char *));
  748. void Make_rules ANSI(());
  749. void Create_macro_vars ANSI(());
  750. time_t Do_stat ANSI((char *, char *, char **));
  751. int Do_touch ANSI((char *, char *, char **));
  752. void Void_lib_cache ANSI((char *, char *));
  753. time_t Do_time ANSI(());
  754. int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
  755. char ** Pack_argv ANSI((int, int, char *));
  756. char * Read_env_string ANSI((char *));
  757. int Write_env_string ANSI((char *, char *));
  758. void ReadEnvironment ANSI(());
  759. void Catch_signals ANSI((void (*)()));
  760. void Clear_signals ANSI(());
  761. void Prolog ANSI((int, char* []));
  762. void Epilog ANSI((int));
  763. char * Get_current_dir ANSI(());
  764. int Set_dir ANSI((char*));
  765. char Get_switch_char ANSI(());
  766. FILE* Get_temp ANSI((char **, char *, int));
  767. FILE * Start_temp ANSI((char *, CELLPTR, char **));
  768. void Open_temp_error ANSI((char *, char *));
  769. void Link_temp ANSI((CELLPTR, FILE *, char *));
  770. void Close_temp ANSI((CELLPTR, FILE *));
  771. void Unlink_temp_files ANSI((CELLPTR));
  772. void Handle_result ANSI((int, int, int, CELLPTR));
  773. void Update_time_stamp ANSI((CELLPTR));
  774. void Parse ANSI((FILE *));
  775. int Get_line ANSI((char *, FILE *));
  776. char * Do_comment ANSI((char *, char **, int));
  777. char * Get_token ANSI((TKSTRPTR, char *, int));
  778. void Quit ANSI(());
  779. void Read_state ANSI(());
  780. void Write_state ANSI(());
  781. int Check_state ANSI((CELLPTR, STRINGPTR *, int));
  782. char* basename ANSI((char *));
  783. void Dump ANSI(());
  784. void Dump_recipe ANSI((STRINGPTR));
  785. int Parse_macro ANSI((char *, int));
  786. int Macro_op ANSI((char *));
  787. int Parse_rule_def ANSI((int *));
  788. int Rule_op ANSI((char *));
  789. void Add_recipe_to_list ANSI((char *, int, int));
  790. void Bind_rules_to_targets ANSI((int));
  791. int Set_group_attributes ANSI((char *));
  792. DFALINKPTR Match_dfa ANSI((char *));
  793. void Check_circle_dfa ANSI(());
  794. void Add_nfa ANSI((char *));
  795. char * Exec_function ANSI((char *));
  796. time_t seek_arch ANSI((char *, char *));
  797. int If_root_path ANSI((char *));
  798. void Remove_prq ANSI((CELLPTR));
  799. int runargv ANSI((CELLPTR, int, int, int, int, char *));
  800. int Wait_for_child ANSI((int, int));
  801. void Clean_up_processes ANSI(());
  802. X
  803. #endif
  804. SHAR_EOF
  805. chmod 0640 dmake/unix/sysvr1/public.h ||
  806. echo 'restore of dmake/unix/sysvr1/public.h failed'
  807. Wc_c="`wc -c < 'dmake/unix/sysvr1/public.h'`"
  808. test 5522 -eq "$Wc_c" ||
  809.     echo 'dmake/unix/sysvr1/public.h: original size 5522, current size' "$Wc_c"
  810. rm -f _shar_wnt_.tmp
  811. fi
  812. # ============= dmake/unix/sysvr1/putenv.c ==============
  813. if test -f 'dmake/unix/sysvr1/putenv.c' -a X"$1" != X"-c"; then
  814.     echo 'x - skipping dmake/unix/sysvr1/putenv.c (File already exists)'
  815.     rm -f _shar_wnt_.tmp
  816. else
  817. > _shar_wnt_.tmp
  818. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/putenv.c' &&
  819. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr1/RCS/putenv.c,v 1.1 91/05/06 15:28:04 dvadura Exp $
  820. -- SYNOPSIS -- my own putenv for BSD like systems.
  821. -- 
  822. -- DESCRIPTION
  823. --     This originally came from MKS, but I rewrote it to fix a bug with
  824. --    replacing existing strings, probably never happened but the code
  825. --    was wrong nonetheless.
  826. --
  827. -- AUTHOR
  828. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  829. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  830. --
  831. -- COPYRIGHT
  832. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  833. -- 
  834. --      This program is free software; you can redistribute it and/or
  835. --      modify it under the terms of the GNU General Public License
  836. --      (version 1), as published by the Free Software Foundation, and
  837. --      found in the file 'LICENSE' included with this distribution.
  838. -- 
  839. --      This program is distributed in the hope that it will be useful,
  840. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  841. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  842. --      GNU General Public License for more details.
  843. -- 
  844. --      You should have received a copy of the GNU General Public License
  845. --      along with this program;  if not, write to the Free Software
  846. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  847. --
  848. -- LOG
  849. --     $Log:    putenv.c,v $
  850. X * Revision 1.1  91/05/06  15:28:04  dvadura
  851. X * dmake Release Version 3.7
  852. X * 
  853. */
  854. X
  855. #include <stdio.h>
  856. #include <string.h>
  857. X
  858. int
  859. putenv( str )/*
  860. ===============
  861. X   Take a string of the form NAME=value and stick it into the environment.
  862. X   We do this by allocating a new set of pointers if we have to add a new
  863. X   string and by replacing an existing pointer if the value replaces the value
  864. X   of an existing string. */
  865. char *str;
  866. {
  867. X   extern char **environ;        /* The current environment. */
  868. X   static char **ourenv = NULL;        /* A new environment        */
  869. X   register char **p;
  870. X   register char *q;
  871. X   int      size;
  872. X
  873. X   /* First search the current environment and see if we can replace a
  874. X    * string. */
  875. X   for( p=environ; *p; p++ ) {
  876. X      register char *s = str;
  877. X
  878. X      for( q = *p; *q && *s && *s == *q; q++, s++ )
  879. X     if( *s == '=' ) {
  880. X        *p = str;
  881. X        return(0);            /* replaced it so go away */
  882. X     }
  883. X   }
  884. X
  885. X   /* Ok, can't replace a string so need to grow the environment. */
  886. X   size = p - environ + 2;    /* size of new environment */
  887. X                /* size of old is size-1   */
  888. X
  889. X   /* It's the first time, so allocate a new environment since we don't know
  890. X    * where the old one is comming from. */
  891. X   if( ourenv == NULL ) {
  892. X      if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL )
  893. X     return(1);
  894. X
  895. X      memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) );
  896. X   }
  897. X   else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL )
  898. X      return(1);
  899. X
  900. X   ourenv[--size] = NULL;
  901. X   ourenv[--size] = str;
  902. X
  903. X   environ = ourenv;
  904. X   return(0);
  905. }
  906. SHAR_EOF
  907. chmod 0640 dmake/unix/sysvr1/putenv.c ||
  908. echo 'restore of dmake/unix/sysvr1/putenv.c failed'
  909. Wc_c="`wc -c < 'dmake/unix/sysvr1/putenv.c'`"
  910. test 2931 -eq "$Wc_c" ||
  911.     echo 'dmake/unix/sysvr1/putenv.c: original size 2931, current size' "$Wc_c"
  912. rm -f _shar_wnt_.tmp
  913. fi
  914. # ============= dmake/unix/sysvr1/startup.mk ==============
  915. if test -f 'dmake/unix/sysvr1/startup.mk' -a X"$1" != X"-c"; then
  916.     echo 'x - skipping dmake/unix/sysvr1/startup.mk (File already exists)'
  917.     rm -f _shar_wnt_.tmp
  918. else
  919. > _shar_wnt_.tmp
  920. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/startup.mk' &&
  921. # Generic UNIX DMAKE startup file.  Customize to suit your needs.
  922. # Should work for both SYSV, and BSD 4.3
  923. # See the documentation for a description of internally defined macros.
  924. #
  925. # Disable warnings for macros redefined here that were given
  926. # on the command line.
  927. __.SILENT := $(.SILENT)
  928. .SILENT   := yes
  929. X
  930. # Configuration parameters for DMAKE startup.mk file
  931. # Set these to NON-NULL if you wish to turn the parameter on.
  932. _HAVE_RCS    := yes        # yes => RCS  is installed.
  933. _HAVE_SCCS    := yes        # yes => SCCS is installed.
  934. X
  935. # Applicable suffix definitions
  936. A := .a        # Libraries
  937. E :=        # Executables
  938. F := .f        # Fortran
  939. O := .o        # Objects
  940. P := .p        # Pascal
  941. S := .s        # Assembler sources
  942. V := ,v        # RCS suffix
  943. X
  944. # Recipe execution configurations
  945. SHELL        := /bin/sh
  946. SHELLFLAGS    := -ce
  947. GROUPSHELL    := $(SHELL)
  948. GROUPFLAGS    := 
  949. SHELLMETAS    := |();&<>?*][$$:\\#`'"
  950. GROUPSUFFIX    :=
  951. DIVFILE         = $(TMPFILE)
  952. X
  953. # Standard C-language command names and flags
  954. X   CPP       := /lib/cpp        # C-preprocessor
  955. X   CC      := cc        # C-compiler and flags
  956. X   CFLAGS  +=
  957. X
  958. X   AS      := as        # Assembler and flags
  959. X   ASFLAGS += 
  960. X
  961. X   LD       = $(CC)        # Loader and flags
  962. X   LDFLAGS +=
  963. X   LDLIBS   =
  964. X
  965. # Definition of $(MAKE) macro for recursive makes.
  966. X   MAKE = $(MAKECMD) $(MFLAGS)
  967. X
  968. # Definition of Print command for this system.
  969. X   PRINT = lpr
  970. X
  971. # Language and Parser generation Tools and their flags
  972. X   YACC      := yacc        # standard yacc
  973. X   YFLAGS +=
  974. X   YTAB      := y.tab        # yacc output files name stem.
  975. X
  976. X   LEX      := lex        # standard lex
  977. X   LFLAGS +=
  978. X   LEXYY  := lex.yy        # lex output file
  979. X
  980. # Other Compilers, Tools and their flags
  981. X   PC    := pc            # pascal compiler
  982. X   RC    := f77            # ratfor compiler
  983. X   FC    := f77            # fortran compiler
  984. X
  985. X   CO       := co        # check out for RCS
  986. X   COFLAGS += -q
  987. X
  988. X   AR     := ar            # archiver
  989. X   ARFLAGS+= ruv
  990. X
  991. X   RM       := /bin/rm        # remove a file command
  992. X   RMFLAGS +=
  993. X
  994. # Implicit generation rules for making inferences.
  995. # We don't provide .yr or .ye rules here.  They're obsolete.
  996. # Rules for making *$O
  997. X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  998. X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  999. X   %$O : %$S ; $(AS) $(ASFLAGS) $<
  1000. X   %$O : %.cl ; class -c $<
  1001. X   %$O : %.e %.r %.F %$F
  1002. X    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  1003. X
  1004. # Executables
  1005. X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  1006. X
  1007. # lex and yacc rules
  1008. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  1009. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  1010. X
  1011. # This rule tells how to make *.out from it's immediate list of prerequisites
  1012. # UNIX only.
  1013. X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  1014. X
  1015. # RCS support
  1016. .IF $(_HAVE_RCS)
  1017. X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  1018. X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  1019. .END
  1020. X
  1021. # SCCS support
  1022. .IF $(_HAVE_SCCS)
  1023. X   % : s.% ; get $@
  1024. X   .NOINFER : s.%
  1025. .END
  1026. X
  1027. # Recipe to make archive files.
  1028. %$A :
  1029. [
  1030. X   $(AR) $(ARFLAGS) $@ $?
  1031. X   $(RM) $(RMFLAGS) $?
  1032. X   ranlib $@
  1033. ]
  1034. X
  1035. # DMAKE uses this recipe to remove intermediate targets
  1036. .REMOVE :; $(RM) -f $<
  1037. X
  1038. # AUGMAKE extensions for SYSV compatibility
  1039. @B = $(@:b)
  1040. @D = $(@:d)
  1041. @F = $(@:f)
  1042. *B = $(*:b)
  1043. *D = $(*:d)
  1044. *F = $(*:f)
  1045. <B = $(<:b)
  1046. <D = $(<:d)
  1047. <F = $(<:f)
  1048. ?B = $(?:b)
  1049. ?F = $(?:f)
  1050. ?D = $(?:d)
  1051. X
  1052. # Turn warnings back to previous setting.
  1053. .SILENT := $(__.SILENT)
  1054. X
  1055. # Local startup file if any
  1056. .INCLUDE .IGNORE: "_startup.mk"
  1057. SHAR_EOF
  1058. chmod 0640 dmake/unix/sysvr1/startup.mk ||
  1059. echo 'restore of dmake/unix/sysvr1/startup.mk failed'
  1060. Wc_c="`wc -c < 'dmake/unix/sysvr1/startup.mk'`"
  1061. test 3221 -eq "$Wc_c" ||
  1062.     echo 'dmake/unix/sysvr1/startup.mk: original size 3221, current size' "$Wc_c"
  1063. rm -f _shar_wnt_.tmp
  1064. fi
  1065. # ============= dmake/unix/sysvr1/stdarg.h ==============
  1066. if test -f 'dmake/unix/sysvr1/stdarg.h' -a X"$1" != X"-c"; then
  1067.     echo 'x - skipping dmake/unix/sysvr1/stdarg.h (File already exists)'
  1068.     rm -f _shar_wnt_.tmp
  1069. else
  1070. > _shar_wnt_.tmp
  1071. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/stdarg.h' &&
  1072. /*
  1073. X * stdarg.h
  1074. X *
  1075. X * defines ANSI style macros for accessing arguments of a function which takes
  1076. X * a variable number of arguments
  1077. X *
  1078. X */
  1079. X
  1080. #if !defined(__STDARG_H__)
  1081. #define __STDARG_H__
  1082. X
  1083. #if !defined(_VA_LIST_)
  1084. #define _VA_LIST_
  1085. typedef char *va_list;
  1086. #endif
  1087. X
  1088. #define va_dcl int va_alist
  1089. #define va_start(ap,v)  ap = (va_list)&va_alist
  1090. #define va_arg(ap,t)    ((t*)(ap += sizeof(t)))[-1]
  1091. #define va_end(ap)      ap = NULL
  1092. #endif
  1093. SHAR_EOF
  1094. chmod 0640 dmake/unix/sysvr1/stdarg.h ||
  1095. echo 'restore of dmake/unix/sysvr1/stdarg.h failed'
  1096. Wc_c="`wc -c < 'dmake/unix/sysvr1/stdarg.h'`"
  1097. test 430 -eq "$Wc_c" ||
  1098.     echo 'dmake/unix/sysvr1/stdarg.h: original size 430, current size' "$Wc_c"
  1099. rm -f _shar_wnt_.tmp
  1100. fi
  1101. # ============= dmake/unix/sysvr1/stdlib.h ==============
  1102. if test -f 'dmake/unix/sysvr1/stdlib.h' -a X"$1" != X"-c"; then
  1103.     echo 'x - skipping dmake/unix/sysvr1/stdlib.h (File already exists)'
  1104.     rm -f _shar_wnt_.tmp
  1105. else
  1106. > _shar_wnt_.tmp
  1107. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/stdlib.h' &&
  1108. #ifndef _STDLIB_INCLUDED_
  1109. #define _STDLIB_INCLUDED_
  1110. X
  1111. extern /*GOTO*/ _exit();
  1112. extern /*GOTO*/ exit();
  1113. extern /*GOTO*/ abort();
  1114. extern int system();
  1115. extern char *getenv();
  1116. extern char *calloc();
  1117. extern char *malloc();
  1118. extern char *realloc();
  1119. extern free();
  1120. extern int errno;
  1121. X
  1122. #ifndef EIO
  1123. #    include <errno.h>
  1124. #endif
  1125. X
  1126. #endif /* _STDLIB_INCLUDED_ */
  1127. SHAR_EOF
  1128. chmod 0640 dmake/unix/sysvr1/stdlib.h ||
  1129. echo 'restore of dmake/unix/sysvr1/stdlib.h failed'
  1130. Wc_c="`wc -c < 'dmake/unix/sysvr1/stdlib.h'`"
  1131. test 346 -eq "$Wc_c" ||
  1132.     echo 'dmake/unix/sysvr1/stdlib.h: original size 346, current size' "$Wc_c"
  1133. rm -f _shar_wnt_.tmp
  1134. fi
  1135. # ============= dmake/unix/sysvr1/time.h ==============
  1136. if test -f 'dmake/unix/sysvr1/time.h' -a X"$1" != X"-c"; then
  1137.     echo 'x - skipping dmake/unix/sysvr1/time.h (File already exists)'
  1138.     rm -f _shar_wnt_.tmp
  1139. else
  1140. > _shar_wnt_.tmp
  1141. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/time.h' &&
  1142. /*
  1143. ** Berkeley get this wrong!
  1144. */
  1145. #ifndef    TIME_h
  1146. #define    TIME_h
  1147. X
  1148. typedef    long    time_t;    /* this is the thing we use */
  1149. X
  1150. #endif    TIME_h
  1151. X
  1152. SHAR_EOF
  1153. chmod 0640 dmake/unix/sysvr1/time.h ||
  1154. echo 'restore of dmake/unix/sysvr1/time.h failed'
  1155. Wc_c="`wc -c < 'dmake/unix/sysvr1/time.h'`"
  1156. test 133 -eq "$Wc_c" ||
  1157.     echo 'dmake/unix/sysvr1/time.h: original size 133, current size' "$Wc_c"
  1158. rm -f _shar_wnt_.tmp
  1159. fi
  1160. # ============= dmake/unix/sysvr1/vfprintf.c ==============
  1161. if test -f 'dmake/unix/sysvr1/vfprintf.c' -a X"$1" != X"-c"; then
  1162.     echo 'x - skipping dmake/unix/sysvr1/vfprintf.c (File already exists)'
  1163.     rm -f _shar_wnt_.tmp
  1164. else
  1165. > _shar_wnt_.tmp
  1166. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr1/vfprintf.c' &&
  1167. /* From:
  1168. X * John Limpert            johnl@gronk.UUCP        uunet!n3dmc!gronk!johnl
  1169. X */
  1170. X
  1171. #include <stdio.h>
  1172. #include <varargs.h>
  1173. X
  1174. #ifndef BUFSIZ
  1175. #include <stdio.h>
  1176. #endif
  1177. X
  1178. #ifndef va_dcl
  1179. #include <varargs.h>
  1180. #endif
  1181. X
  1182. int
  1183. vsprintf(str, fmt, ap)
  1184. X    char *str, *fmt;
  1185. X    va_list ap;
  1186. {
  1187. X    FILE f;
  1188. X    int len;
  1189. X
  1190. X    f._flag = _IOWRT+_IOMYBUF;
  1191. X    f._ptr = (char *)str;    /* My copy of BSD stdio.h has this as (char *)
  1192. X                 * with a comment that it should be
  1193. X                 * (unsigned char *).  Since this code is
  1194. X                 * intended for use on a vanilla BSD system,
  1195. X                 * we'll stick with (char *) for now.
  1196. X                 */
  1197. X    f._cnt = 32767;
  1198. X    len = _doprnt(fmt, ap, &f);
  1199. X    *f._ptr = 0;
  1200. X    return (len);
  1201. }
  1202. X
  1203. int
  1204. vfprintf(iop, fmt, ap)
  1205. X    FILE *iop;
  1206. X    char *fmt;
  1207. X    va_list ap;
  1208. {
  1209. X    int len;
  1210. X
  1211. X    len = _doprnt(fmt, ap, iop);
  1212. X    return (ferror(iop) ? EOF : len);
  1213. }
  1214. X
  1215. int
  1216. vprintf(fmt, ap)
  1217. X    char *fmt;
  1218. X    va_list ap;
  1219. {
  1220. X    int len;
  1221. X
  1222. X    len = _doprnt(fmt, ap, stdout);
  1223. X    return (ferror(stdout) ? EOF : len);
  1224. }
  1225. SHAR_EOF
  1226. chmod 0640 dmake/unix/sysvr1/vfprintf.c ||
  1227. echo 'restore of dmake/unix/sysvr1/vfprintf.c failed'
  1228. Wc_c="`wc -c < 'dmake/unix/sysvr1/vfprintf.c'`"
  1229. test 934 -eq "$Wc_c" ||
  1230.     echo 'dmake/unix/sysvr1/vfprintf.c: original size 934, current size' "$Wc_c"
  1231. rm -f _shar_wnt_.tmp
  1232. fi
  1233. # ============= dmake/unix/sysvr3/config.h ==============
  1234. if test ! -d 'dmake/unix/sysvr3'; then
  1235.     mkdir 'dmake/unix/sysvr3'
  1236. fi
  1237. if test -f 'dmake/unix/sysvr3/config.h' -a X"$1" != X"-c"; then
  1238.     echo 'x - skipping dmake/unix/sysvr3/config.h (File already exists)'
  1239.     rm -f _shar_wnt_.tmp
  1240. else
  1241. > _shar_wnt_.tmp
  1242. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr3/config.h' &&
  1243. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr3/RCS/config.h,v 1.1 91/05/06 15:28:20 dvadura Exp $
  1244. -- SYNOPSIS -- Configurarion include file.
  1245. -- 
  1246. -- DESCRIPTION
  1247. --     There is one of these for each specific machine configuration.
  1248. --    It can be used to further tweek the machine specific sources
  1249. --    so that they compile.
  1250. --
  1251. -- AUTHOR
  1252. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  1253. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  1254. --
  1255. -- COPYRIGHT
  1256. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  1257. -- 
  1258. --      This program is free software; you can redistribute it and/or
  1259. --      modify it under the terms of the GNU General Public License
  1260. --      (version 1), as published by the Free Software Foundation, and
  1261. --      found in the file 'LICENSE' included with this distribution.
  1262. -- 
  1263. --      This program is distributed in the hope that it will be useful,
  1264. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  1265. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1266. --      GNU General Public License for more details.
  1267. -- 
  1268. --      You should have received a copy of the GNU General Public License
  1269. --      along with this program;  if not, write to the Free Software
  1270. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1271. --
  1272. -- LOG
  1273. --     $Log:    config.h,v $
  1274. X * Revision 1.1  91/05/06  15:28:20  dvadura
  1275. X * dmake Release Version 3.7
  1276. X * 
  1277. */
  1278. X
  1279. /* define this for configurations that don't have the coreleft function
  1280. X * so that the code compiles.  To my knowledge coreleft exists only on
  1281. X * Turbo C, but it is needed here since the function is used in many debug
  1282. X * macros. */
  1283. #define coreleft() 0L
  1284. X
  1285. /* Define the getcwd function that is used in the code, since BSD does
  1286. X * not have getcwd, but call it getwd instead. */
  1287. extern char *getcwd ANSI((char *, int));
  1288. X
  1289. #ifndef M_XENIX
  1290. /* Define setvbuf, SysV doesn't have one */
  1291. #define setvbuf(fp, bp, type, len) setbuf( fp, NULL );
  1292. #endif
  1293. X
  1294. #ifdef M_XENIX
  1295. #define ASCARCH        0    /* Use binary archive headers if Xenix */
  1296. #endif
  1297. X
  1298. /* We don't care about CONST */
  1299. #define CONST
  1300. SHAR_EOF
  1301. chmod 0640 dmake/unix/sysvr3/config.h ||
  1302. echo 'restore of dmake/unix/sysvr3/config.h failed'
  1303. Wc_c="`wc -c < 'dmake/unix/sysvr3/config.h'`"
  1304. test 2106 -eq "$Wc_c" ||
  1305.     echo 'dmake/unix/sysvr3/config.h: original size 2106, current size' "$Wc_c"
  1306. rm -f _shar_wnt_.tmp
  1307. fi
  1308. # ============= dmake/unix/sysvr3/config.mk ==============
  1309. if test -f 'dmake/unix/sysvr3/config.mk' -a X"$1" != X"-c"; then
  1310.     echo 'x - skipping dmake/unix/sysvr3/config.mk (File already exists)'
  1311.     rm -f _shar_wnt_.tmp
  1312. else
  1313. > _shar_wnt_.tmp
  1314. sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/sysvr3/config.mk' &&
  1315. # This is the SysV R3 UNIX configuration file for DMAKE
  1316. #    It simply modifies the values of SRC, and checks to see if
  1317. #    OSENVIRONMENT is defined.  If so it includes the appropriate
  1318. #    config.mk file.
  1319. #
  1320. # It also sets the values of .SOURCE.c and .SOURCE.h to include the local
  1321. # directory.
  1322. #
  1323. osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
  1324. X
  1325. # The following are required sources
  1326. OSDSRC := 
  1327. .IF $(OSDSRC)
  1328. X   SRC    += $(OSDSRC)
  1329. X   .SETDIR=$(osrdir) : $(OSDSRC)
  1330. .END
  1331. X
  1332. .SOURCE.h : $(osrdir)
  1333. X
  1334. # Local configuration modifications for CFLAGS, there's local SysV includes
  1335. # too.
  1336. CFLAGS += -I$(osrdir)
  1337. X
  1338. # See if we modify anything in the lower levels.
  1339. .IF $(OSENVIRONMENT) != $(NULL)
  1340. SHAR_EOF
  1341. true || echo 'restore of dmake/unix/sysvr3/config.mk failed'
  1342. fi
  1343. echo 'End of part 35, continue with part 36'
  1344. echo 36 > _shar_seq_.tmp
  1345. exit 0
  1346.  
  1347. exit 0 # Just in case...
  1348. -- 
  1349. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1350. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1351. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1352. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1353.