home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume27 / dmake / part34 < prev    next >
Encoding:
Text File  |  1992-01-29  |  40.4 KB  |  1,353 lines

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