diff options
Diffstat (limited to 'dmake/unix')
118 files changed, 8663 insertions, 0 deletions
diff --git a/dmake/unix/386ix/ar.h b/dmake/unix/386ix/ar.h new file mode 100644 index 000000000000..4c38e8944e99 --- /dev/null +++ b/dmake/unix/386ix/ar.h @@ -0,0 +1,27 @@ +/* RCS $Id: ar.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- ar header +-- +-- DESCRIPTION +-- Make sure that PORTAR is defined. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#define PORTAR 1 +#include "/usr/include/ar.h" diff --git a/dmake/unix/386ix/config.mk b/dmake/unix/386ix/config.mk new file mode 100644 index 000000000000..4c1eac92b94d --- /dev/null +++ b/dmake/unix/386ix/config.mk @@ -0,0 +1,27 @@ +# This is the 386IX UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/386ix/make.sh b/dmake/unix/386ix/make.sh new file mode 100644 index 000000000000..68e0109bb576 --- /dev/null +++ b/dmake/unix/386ix/make.sh @@ -0,0 +1,60 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/386ix -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/386ix -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/386ix -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/386ix -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/386ix -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/386ix -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/386ix -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/386ix -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/386ix -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/386ix -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/386ix -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/386ix -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/386ix -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/386ix -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/386ix -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/386ix -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/386ix -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/386ix -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/386ix -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/386ix -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/386ix -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/386ix -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/386ix -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/386ix -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/386ix -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/386ix -O unix/dcache.c +mv dcache.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/386ix/template.mk startup/config.mk diff --git a/dmake/unix/386ix/public.h b/dmake/unix/386ix/public.h new file mode 100644 index 000000000000..eced883f353d --- /dev/null +++ b/dmake/unix/386ix/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/386ix/stdlib.h b/dmake/unix/386ix/stdlib.h new file mode 100644 index 000000000000..1ec47228432b --- /dev/null +++ b/dmake/unix/386ix/stdlib.h @@ -0,0 +1,44 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); +extern free(); +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/386ix/template.mk b/dmake/unix/386ix/template.mk new file mode 100644 index 000000000000..e59d37c7ca72 --- /dev/null +++ b/dmake/unix/386ix/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= 386ix + OSENVIRONMENT *:= diff --git a/dmake/unix/386ix/time.h b/dmake/unix/386ix/time.h new file mode 100644 index 000000000000..aff117b02ade --- /dev/null +++ b/dmake/unix/386ix/time.h @@ -0,0 +1,35 @@ +/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- time_t +-- +-- DESCRIPTION +-- Properly define time_t. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* +** Berkeley get this wrong! +*/ +#ifndef TIME_h +#define TIME_h + +typedef long time_t; /* this is the thing we use */ + +#endif TIME_h + diff --git a/dmake/unix/arlib.c b/dmake/unix/arlib.c new file mode 100644 index 000000000000..22a2168cfed1 --- /dev/null +++ b/dmake/unix/arlib.c @@ -0,0 +1,609 @@ +/* RCS $Id: arlib.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Unix archive manipulation code. +-- +-- DESCRIPTION +-- Originally this code was provided by Eric Gisin of MKS. I took +-- his code and completely rewrote it adding cacheing of lib members +-- and other various optimizations. I kept the overal functional +-- idea of the library routines as they are similar to those in GNU +-- make and felt it advantageous to maintain a similar interface. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* Sun unix on 386i's has a broken ar.h that does not assume PORTAR format + * by default, so we fix it here. */ +#if defined(i386) || defined(__DGUX__) +#define PORTAR 1 +#endif + +#if !defined (COHERENT) && !defined(__COHERENT__) +#include <ar.h> +#else +#include <arcoff.h> +#endif /* COHERENT, __COHERENT__ */ +#include "extern.h" +#include "sysintf.h" + +/* By defining the defines below it is possible to configure the library + * code for library cacheing/non-cacheing, ASCII archive headers, and a full + * decode of the ar_hdr fields in the scan_ar function. */ + +#ifndef ASCARCH +#define ASCARCH 1 /* ASCII time stored in archive */ +#endif + +#ifndef LC +#define LC 1 /* Turn on library cacheing */ +#endif + +#ifndef CHECKELF +#define CHECKELF 1 /* Enable Elf long member names */ +#endif + +#ifndef DECODE_ALL_AR_FIELDS +#define DECODE_ALL_AR_FIELDS 0 /* decode only fields make needs*/ +#endif + +#ifndef AR_TRUNCATE_MEMBER_NAMES +#define AR_TRUNCATE_MEMBER_NAMES 0 /* truncate member names for */ +#endif /* comparison. */ + +#if LC +# define FOUND_MEMBER FALSE +#else +# define FOUND_MEMBER TRUE +# define _cache_member(a, b, c) +# define _check_cache(a, b, c, d) FALSE +#endif + +#define MAXFNAME 255 /* Max length of member name */ +#define MAXMNAME 8 /* Max module name < MAXFNAME */ + + +/* This struct is used to pass the library and member inrmation about the + * routines that perform the library seeking/cacheing */ +struct ar_args { + char *lib; + char *member; + time_t time; +}; + + +typedef struct AR { + char ar_name[MAXFNAME+1]; /* File name */ + long ar_size; /* Size in bytes */ + time_t ar_time; /* Modification time */ + +#ifdef DOS + char ar_modname[MAXMNAME+1]; /* DOS module name */ +#endif + +#if DECODE_ALL_AR_FIELDS + uint16 ar_mode; /* File mode */ + uint16 ar_uid; /* File owner */ + uint16 ar_gid; /* File group owner */ +#endif +} AR, *ARPTR; + + +static int ar_scan ANSI((FILE *, + int (*) ANSI((FILE *, struct AR *,struct ar_args *)), + struct ar_args *)); +static int ar_touch ANSI(( FILE *, time_t )); +static int time_function ANSI(( FILE *, struct AR *, struct ar_args * )); +static int touch_function ANSI(( FILE *, struct AR *, struct ar_args * )); +static int ar_name_equal ANSI((char *, char *)); + +#if LC +static int _cache_member ANSI((char *, char *, time_t)); +static int _check_cache ANSI((char *, char *, time_t *, int)); +#endif + +/* decoded archive header */ +static AR _ar; +static off_t arhdroffset; /* member seek offset */ + + +PUBLIC time_t +seek_arch(name, lib)/* +====================== + Look for module 'name' inside 'lib'. If compiled with cacheing then first + check to see if the specified lib is cached. If so then return that time + stamp instead of looking into the library. */ +char *name; +char *lib; +{ + FILE *f; + int rv; + time_t mtime; + struct ar_args args; + + /* Check the cache first (if there is a cache) */ + if( _check_cache(name, lib, &mtime, FALSE) ) return( mtime ); + + /* Open the lib file and perform the scan of the members, looking + * for our particular member. If cacheing is enabled it will be + * taken care of automatically during the scan. */ + + args.lib = lib; + args.member = name; + args.time = (time_t)0L; + + if( (f = fopen(lib, "r")) == NIL(FILE) ) return( (time_t)0L ); + rv = ar_scan(f, time_function, &args ); + fclose( f ); + + if( rv < 0 ) Fatal("(%s): Invalid library format", lib); + + return( args.time ); +} + + +int +touch_arch(name, lib)/* +======================= + Look for module 'name' inside 'lib'. If compiled with cacheing then first + check to see if the specified lib is cached. If so then set that time + stamp and write it into the library. Returns 0 on success, non-zero + on failure. */ +char *name; +char *lib; +{ + FILE *f; + int rv; + struct ar_args args; + + /* Open the lib file and perform the scan of the members, looking + * for our particular member. If cacheing is enabled it will be + * taken care of automatically during the scan. */ + + args.lib = lib; + args.member = name; + args.time = (time_t)0L; + + if( (f = fopen(lib, "r+")) == NIL(FILE) ) return( (time_t)1L ); + rv = ar_scan(f, touch_function, &args ); + fclose( f ); + + if( rv < 0 ) Fatal("(%s): Invalid library format", lib); + + return( 0 ); +} + + + +static int +time_function(f, arp, argp)/* +============================= + get library member's time, if it matches than return it in argp, if + cacheing is enabled than cache the library members also. */ +FILE *f; /* library file */ +struct AR *arp; /* library member header */ +struct ar_args *argp; +{ + int rv = _cache_member( arp->ar_name, argp->lib, arp->ar_time ); + + if( ar_name_equal (argp->member, arp->ar_name)) { + argp->time = arp->ar_time; + + if( arp->ar_time == 0 && !(Glob_attr & A_SILENT) ) + Warning( "(%s): Can't extract library member timestamp; using EPOCH", + argp->member); + + return( rv ); /* 1 => no cacheing, 0 => cacheing */ + } + + return( FALSE ); /* continue scan */ +} + + + +static int +touch_function(f, arp, argp)/* +============================== + Update library member's time stamp, and write new time value into cache + if required. */ +FILE *f; /* library file */ +struct AR *arp; /* library member header */ +struct ar_args *argp; +{ + extern time_t time ANSI(( time_t * )); + time_t now = time((time_t*) NULL); /* Current time. */ + + if( ar_name_equal(argp->member, arp->ar_name) ) { + _check_cache( argp->member, argp->lib, &now, TRUE ); + ar_touch(f, now ); + + return( TRUE ); + } + + return( FALSE ); /* continue scan */ +} + + +static int +ar_name_equal (char * name1, char * name2) +{ + int equal; + +#if AR_TRUNCATE_MEMBER_NAMES + struct ar_hdr hdr; + + equal = !strncmp (name1, name2, sizeof (hdr.ar_name)-1); +#else + equal = !strcmp (name1, name2); +#endif + + return equal; +} + + +static int +ar_scan(f, function, arg)/* +=========================== + Scan the opened archive, and call the given function for each member found. + The function will be called with the file positioned at the beginning of + the member and it can read up to arp->ar_size bytes of the archive member. + If the function returns 1, we stop and return 1. We return 0 at the end + of the archive, or -1 if the archive has invalid format. This interface + is more general than required by "make", but it can be used by other + utilities. */ +register FILE *f; +int (*function) ANSI((FILE *, struct AR *, struct ar_args *)); +struct ar_args *arg; +{ + extern long atol (); + register char *p; + struct ar_hdr arhdr; /* archive member header */ + long nsize; /* size of member name */ + long arind=0; /* archive index offset */ + int process; +#if defined(_AIX) + struct fl_hdr flhdr; /* archive file header */ + char magic[SAIAMAG]; /* size of magic string */ +#else +#if ASCARCH + char magic[SARMAG]; +#else + unsigned short word; +#endif +#endif + + fseek( f, 0L, 0 ); /* Start at the beginning of the archive file */ + +#if ASCARCH +#if defined(_AIX) + fread( (char *)&flhdr, sizeof(flhdr), 1, f ); + if( strncmp(flhdr.fl_magic,AIAMAG, SAIAMAG) != 0 ) return(-1); + fseek(f, atol(flhdr.fl_fstmoff), 0 ); /* postition to first member */ +#else + fread( magic, sizeof(magic), 1, f ); + if( strncmp(magic, ARMAG, SARMAG) != 0 ) return( -1 ); +#endif +#else + fread( (char*)&word, sizeof(word), 1, f ); + if( word != ARMAG ) return( -1 ); +#endif + + /* scan the library, calling `function' for each member + */ + while( 1 ) { + arhdroffset = ftell(f); +#if defined(_AIX) + if( fread((char*)&arhdr,sizeof(arhdr)-sizeof(arhdr._ar_name),1,f)!=1) + break; + nsize = atoi(arhdr.ar_namlen); + fseek(f, arhdroffset+(unsigned long)(((struct ar_hdr *)0)->_ar_name.ar_name), 0); + if( fread((char*)_ar.ar_name,nsize,1,f)!=1) + break; + _ar.ar_name[nsize]='\0'; +#else + if( fread((char*) &arhdr, sizeof(arhdr), 1, f) != 1 ) break; + strncpy(_ar.ar_name, arhdr.ar_name, nsize = sizeof(arhdr.ar_name)); +#endif + + for( p = &_ar.ar_name[nsize]; + --p >= _ar.ar_name && *p == ' ';); + + p[1] = '\0'; + if( *p == '/' ) *p = 0; /* SysV has trailing '/' */ + + /* check to see if this is an archive index using SsysV Index scheme. + * see ar(4) man page for more info */ +#if CHECKELF + if( _ar.ar_name[0] == '/' && _ar.ar_name[1] == '\0' ) { + arind = arhdroffset+sizeof(arhdr); + process = 0; + } + else +#endif + process = 1; + +#if !defined(_AIX) +#if ASCARCH + if( strncmp(arhdr.ar_fmag, ARFMAG, sizeof(arhdr.ar_fmag)) != 0 ) + return( -1 ); + _ar.ar_time = atol(arhdr.ar_date); + _ar.ar_size = atol(arhdr.ar_size); +#else + _ar.ar_time = arhdr.ar_date; + _ar.ar_size = arhdr.ar_size; +#endif +#if CHECKELF + /* check for names of the form /xxxx where xxxx is an offset into the + * name table pointed at by arind. */ + if(arind && _ar.ar_name[0] == '/') { + long offset = atol(_ar.ar_name+1); + long here = ftell(f); + int c; + + fseek(f, arind+offset, 0); + p = _ar.ar_name; + while((c=fgetc(f)) != EOF) { + *p++ = c; + if(c == '/') { + p[-1] = '\0'; + break; + } + } + + if (c==EOF) return(-1); /* 'c' should never be EOF */ + fseek(f, here, 0); + } +#endif +#else +#if ASCARCH + _ar.ar_time = atol(arhdr.ar_date); + _ar.ar_size = atol(arhdr.ar_nxtmem); +#else + _ar.ar_time = arhdr.ar_date; + _ar.ar_size = arhdr.ar_nxtmem; +#endif +#endif + + +#if DECODE_ALL_AR_FIELDS +#if ASCARCH + _ar.ar_mode = atoi(arhdr.ar_mode); + _ar.ar_uid = atoi(arhdr.ar_uid); + _ar.ar_gid = atoi(arhdr.ar_gid); +#else + _ar.ar_mode = arhdr.ar_mode; + _ar.ar_uid = arhdr.ar_uid; + _ar.ar_gid = arhdr.ar_gid; +#endif +#endif + if( process && (*function)(f, &_ar, arg) ) return( 1 ); + +#if defined(_AIX) + if( _ar.ar_size == 0L ) break; + fseek( f, (long) _ar.ar_size, 0 ); +#else + fseek( f, arhdroffset + sizeof(arhdr) + (_ar.ar_size+1 & ~1L), 0 ); +#endif + } + +#if !defined(_AIX) + if( !feof(f) ) return( -1 ); +#endif + return 0; +} + + + +static int +ar_touch( f, now )/* +==================== + touch module header timestamp. */ +FILE *f; +time_t now; +{ + struct ar_hdr arhdr; /* external archive header */ + + fseek(f, arhdroffset + (unsigned long)(((struct ar_hdr *)0)->ar_date), 0); + +#if ASCARCH + fprintf(f, "%lu", now); +#else + fwrite((char *)now, sizeof(now), 1, f); +#endif + + return( ferror(f) ? 0 : 1 ); +} + + +#if LC +typedef struct mem { + time_t m_time; /* modify time of member*/ + struct mem *m_next; /* next member in lib */ + char m_valid; /* valid cache entry */ + char m_name[1]; /* lib member name */ +} MEM, *MEMPTR; + +typedef struct lib { + struct lib *lb_next; /* next library in list */ + struct mem *lb_members; /* list of lib members */ + char lb_valid; /* valid cache entry */ + char *lb_name; /* library name */ +} LIB, *LIBPTR; + +static LIBPTR _cache = NIL(LIB); +static MEMPTR _find_member ANSI(( LIBPTR, char * )); + +static int +_check_cache( name, lib, pmtime, touch )/* +========================================== + Check to see if we have cached member in lib, if so return time in pmtime + and return TRUE, otherwise return FALSE, if touch is TRUE then touch + the archive member instead. */ +char *name; +char *lib; +time_t *pmtime; +int touch; +{ + register MEMPTR mp; + register LIBPTR lp; + + for( lp=_cache; lp != NIL(LIB) && lp->lb_name != lib; lp=lp->lb_next ); + if( lp == NIL(LIB) ) return( FALSE ); + + mp = _find_member( lp, name ); + if( mp == NIL(MEM) || !mp->m_valid ) return( FALSE ); + + if( touch == TRUE ) + { + mp->m_time = *pmtime; + mp->m_valid = 1; + } + else + *pmtime = mp->m_time; + + lp->lb_valid = 1; + lp->lb_members = mp; + + return( TRUE ); +} + + + +static int +_cache_member( name, lib, mtime )/* +=================================== + Cache name in lib along with it's time */ +char *name; +char *lib; +time_t mtime; +{ + register MEMPTR mp; + register LIBPTR lp; + + for( lp=_cache; + lp != NIL(LIB) && lp->lb_name != NIL(char) && lp->lb_name != lib; + lp=lp->lb_next); + + if( lp == NIL(LIB) ) + { + lp = (LIBPTR) malloc(sizeof(LIB)); + if( lp == NIL(LIB) ) No_ram(); + + lp->lb_name = lib; + lp->lb_members = NIL(MEM); + lp->lb_next = _cache; + lp->lb_valid = 0; + _cache = lp; + } + + /* On UNIX ar does not allow multiple copies of the same .o file to live + * in the same AR file. If this is not TRUE then use the commented out + * version to set the value of mp. */ + + /*mp = _find_member(lp, name);*/ + mp = NIL(MEM); + + if( mp == NIL(MEM) ) + { + mp = (MEMPTR) malloc(sizeof(char)*offsetof(MEM,m_name[strlen(name)+1])); + if( mp == NIL(MEM) ) No_ram(); + + strcpy( mp->m_name, name ); + mp->m_time = mtime; + + if( lp->lb_members == NIL(MEM) ) { + mp->m_next = mp; + lp->lb_members = mp; + } + else { + mp->m_next = lp->lb_members->m_next; + lp->lb_members->m_next = mp; + lp->lb_members = mp; + } + } + else + mp->m_time = mtime; + + mp->m_valid = 1; + + return( lp->lb_valid ); +} + + +static MEMPTR +_find_member( lp, name ) +LIBPTR lp; +char *name; +{ + register MEMPTR mp = lp->lb_members; + + if( mp == NIL(MEM) ) return(mp); + + do { + if( !strcmp(mp->m_name, name ) ) return( mp ); + mp = mp->m_next; + } + while( mp != lp->lb_members ); + + return( NIL(MEM) ); +} +#endif + + + +void +void_lcache( lib, member )/* +============================ + Void the library cache for lib. If member is NIL(char) then nuke all + of the members, if member is NOT NIL(char) then invalidate only that + member. */ +char *lib; +char *member; +{ +#if LC + register LIBPTR lp; + register MEMPTR mp; + register MEMPTR tmp; + + for( lp=_cache; lp != NIL(LIB) && lp->lb_name != lib; lp=lp->lb_next ); + if( lp == NIL(LIB) ) return; + + if( member == NIL(char) ) { + mp = lp->lb_members; + do { + tmp = mp->m_next; + (void) free( mp ); + mp = tmp; + } while( mp != lp->lb_members ); + + lp->lb_valid = 0; + lp->lb_members = NIL(MEM); + lp->lb_name = NIL(char); + } + else { + mp=lp->lb_members; + do { + if( strcmp( member, mp->m_name) == 0 ) { + lp->lb_members = mp->m_next; + mp->m_valid = 0; + } + + mp=mp->m_next; + } while( mp != lp->lb_members ); + } +#endif +} diff --git a/dmake/unix/bsd43/config.mk b/dmake/unix/bsd43/config.mk new file mode 100644 index 000000000000..e99937342e68 --- /dev/null +++ b/dmake/unix/bsd43/config.mk @@ -0,0 +1,27 @@ +# This is the BSD 4.3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following sources are required for BSD4.3 +OSDSRC := putenv.c tempnam.c utime.c setvbuf.c +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local BSD includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/bsd43/dirent.h b/dmake/unix/bsd43/dirent.h new file mode 100644 index 000000000000..82f910ed3a7d --- /dev/null +++ b/dmake/unix/bsd43/dirent.h @@ -0,0 +1,28 @@ +/* RCS $Id: dirent.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- dirent +-- +-- DESCRIPTION +-- Deal with sysV'ish dirent.h on BSD4.3 systems, which have the stuff +-- in sys/dir.h +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <sys/dir.h> +#define dirent direct diff --git a/dmake/unix/bsd43/limits.h b/dmake/unix/bsd43/limits.h new file mode 100644 index 000000000000..a08805d00d66 --- /dev/null +++ b/dmake/unix/bsd43/limits.h @@ -0,0 +1,32 @@ +/* RCS $Id: limits.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- limits +-- +-- DESCRIPTION +-- Compensate for systems that don't have a limits.h header file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <sys/types.h> +#include <sys/dirent.h> +#include <sys/param.h> + +#define NAME_MAX MAXNAMLEN +#define PATH_MAX MAXPATHLEN +#define CHILD_MAX 20 diff --git a/dmake/unix/bsd43/make.sh b/dmake/unix/bsd43/make.sh new file mode 100644 index 000000000000..e45d01952f46 --- /dev/null +++ b/dmake/unix/bsd43/make.sh @@ -0,0 +1,69 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/bsd43 -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/putenv.c +mv putenv.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/tempnam.c +mv tempnam.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/utime.c +mv utime.o objects +cc -c -I. -Iunix -Iunix/bsd43 -O unix/bsd43/setvbuf.c +mv setvbuf.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \ +objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o +cp unix/bsd43/template.mk startup/config.mk diff --git a/dmake/unix/bsd43/public.h b/dmake/unix/bsd43/public.h new file mode 100644 index 000000000000..eced883f353d --- /dev/null +++ b/dmake/unix/bsd43/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/bsd43/putenv.c b/dmake/unix/bsd43/putenv.c new file mode 100644 index 000000000000..d0ed998158e0 --- /dev/null +++ b/dmake/unix/bsd43/putenv.c @@ -0,0 +1,78 @@ +/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- My own putenv for BSD like systems. +-- +-- DESCRIPTION +-- This originally came from MKS, but I rewrote it to fix a bug with +-- replacing existing strings, probably never happened but the code +-- was wrong nonetheless. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <stdio.h> +#include <string.h> + +int +putenv( str )/* +=============== + Take a string of the form NAME=value and stick it into the environment. + We do this by allocating a new set of pointers if we have to add a new + string and by replacing an existing pointer if the value replaces the value + of an existing string. */ +char *str; +{ + extern char **environ; /* The current environment. */ + static char **ourenv = NULL; /* A new environment */ + register char **p; + register char *q; + int size; + + /* First search the current environment and see if we can replace a + * string. */ + for( p=environ; *p; p++ ) { + register char *s = str; + + for( q = *p; *q && *s && *s == *q; q++, s++ ) + if( *s == '=' ) { + *p = str; + return(0); /* replaced it so go away */ + } + } + + /* Ok, can't replace a string so need to grow the environment. */ + size = p - environ + 2; /* size of new environment */ + /* size of old is size-1 */ + + /* It's the first time, so allocate a new environment since we don't know + * where the old one is comming from. */ + if( ourenv == NULL ) { + if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL ) + return(1); + + memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) ); + } + else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL ) + return(1); + + ourenv[--size] = NULL; + ourenv[--size] = str; + + environ = ourenv; + return(0); +} diff --git a/dmake/unix/bsd43/setvbuf.c b/dmake/unix/bsd43/setvbuf.c new file mode 100644 index 000000000000..ce5d193fbe89 --- /dev/null +++ b/dmake/unix/bsd43/setvbuf.c @@ -0,0 +1,40 @@ +/* RCS $Id: setvbuf.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- Setvbuf for BSD +-- +-- DESCRIPTION +-- A sysv call, standard BSD doesn't have this. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <stdio.h> + +setvbuf(fp, bp, type, len_unused) +FILE* fp; +char* bp; +int type; +int len_unused; +{ + switch (type) { + case _IOLBF: setlinebuf(fp); return; + case _IONBF: setbuf(fp, NULL); return; + default: setbuf(fp, bp); return; + } +} + diff --git a/dmake/unix/bsd43/stdlib.h b/dmake/unix/bsd43/stdlib.h new file mode 100644 index 000000000000..82ab9627cd65 --- /dev/null +++ b/dmake/unix/bsd43/stdlib.h @@ -0,0 +1,44 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); +extern free(); +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/bsd43/string.h b/dmake/unix/bsd43/string.h new file mode 100644 index 000000000000..862c17960a0b --- /dev/null +++ b/dmake/unix/bsd43/string.h @@ -0,0 +1,43 @@ +/* RCS $Id: string.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- string function headers +-- +-- DESCRIPTION +-- Supply correct definitions for certain string functions. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#ifndef STRING_h +#define STRING_h + +/* +** BSD does this wrong +*/ +#include <strings.h> + +#include "stdmacs.h" +extern char* strpbrk ANSI((char* src, char* any)); + +#ifndef DBUG +#define strchr(str,c) index(str,c) +#define strrchr(str,c) rindex(str,c) +#else +char *strchr ANSI((char*, char)); +char *strrchr ANSI((char*, char)); +#endif +#endif diff --git a/dmake/unix/bsd43/template.mk b/dmake/unix/bsd43/template.mk new file mode 100644 index 000000000000..14a7cab8ed4b --- /dev/null +++ b/dmake/unix/bsd43/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= bsd43 + OSENVIRONMENT *:= diff --git a/dmake/unix/bsd43/tempnam.c b/dmake/unix/bsd43/tempnam.c new file mode 100644 index 000000000000..12512ec9cb8b --- /dev/null +++ b/dmake/unix/bsd43/tempnam.c @@ -0,0 +1,103 @@ +/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- tempnam +-- +-- DESCRIPTION +-- temp file name generation routines. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#define max(A,B) (((A)<(B))?(B):(A)) + +extern char *mktemp(); +extern int access(); + +static char *cpdir(); +static char seed[4]="AAA"; + +/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */ +#ifndef P_tmpdir +static char *P_tmpdir = "/tmp"; +#endif + +char * +tempnam(dir, prefix) +char *dir; /* use this directory please (if non-NULL) */ +char *prefix; /* use this (if non-NULL) as filename prefix */ +{ + register char *p, *q, *tmpdir; + int tl=0, dl=0, pl; + + pl = strlen(P_tmpdir); + + if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); + if( dir != NULL ) dl = strlen(dir); + + if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL ) + return(NULL); + + *p = '\0'; + + if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) ) + if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) ) + if( access( cpdir(p, P_tmpdir), 3) != 0 ) + if( access( cpdir(p, "/tmp"), 3) != 0 ) + return(NULL); + + (void) strcat(p, "/"); + if(prefix) + { + *(p+strlen(p)+5) = '\0'; + (void)strncat(p, prefix, 5); + } + + (void)strcat(p, seed); + (void)strcat(p, "XXXXXX"); + + q = seed; + while(*q == 'Z') *q++ = 'A'; + ++*q; + + if(*mktemp(p) == '\0') return(NULL); + return(p); +} + + + +static char * +cpdir(buf, str) +char *buf; +char *str; +{ + char *p; + + if(str != NULL) + { + (void) strcpy(buf, str); + p = buf - 1 + strlen(buf); + if(*p == '/') *p = '\0'; + } + + return(buf); +} diff --git a/dmake/unix/bsd43/utime.c b/dmake/unix/bsd43/utime.c new file mode 100644 index 000000000000..9d26700d8006 --- /dev/null +++ b/dmake/unix/bsd43/utime.c @@ -0,0 +1,70 @@ +/* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- utime +-- +-- DESCRIPTION +-- Provide our own utime function. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <sys/types.h> +#include <sys/time.h> +#include <sys/stat.h> +#include <sys/file.h> + +int +utime(name, timep) +char* name; +time_t timep[2]; +{ + struct timeval tv[2], *tvp; + struct stat buf; + int fil; + char data; + + if (timep!=0) + { + tvp = tv, tv[0].tv_sec = timep[0], tv[1].tv_sec = timep[1]; + if (utimes(name, tvp)==0) + return (0); + } + + if (stat(name, &buf) != 0) + return (-1); + if (buf.st_size != 0) { + if ((fil = open(name, O_RDWR, 0666)) < 0) + return (-1); + if (read(fil, &data, 1) < 1) { + close(fil); + return (-1); + } + lseek(fil, 0L, 0); + if (write(fil, &data, 1) < 1) { + close(fil); + return (-1); + } + close(fil); + return (0); + } else if ((fil = creat(name, 0666)) < 0) { + return (-1); + } else { + close(fil); + return (0); + } +} diff --git a/dmake/unix/bsd43/uw/config.mk b/dmake/unix/bsd43/uw/config.mk new file mode 100644 index 000000000000..1f94136f6d6e --- /dev/null +++ b/dmake/unix/bsd43/uw/config.mk @@ -0,0 +1,17 @@ +# This is the BSD 4.3 University of Waterloo (uw) UNIX configuration file +# for DMAKE +# It simply modifies the values of LDLIBS to include libuw.a +# so that vfprintf can be found. +# + +LDLIBS += -luw +osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) +CFLAGS += -I$(osredir) + +# install script for UW's /usr/software hierarchy... +install: + mkdir ../bin; strip ./dmake; mv ./dmake ../bin + chmod a+rx ../bin/dmake ../bin + mkdir ../lib; chmod a+rx ../lib + cp $(STARTUPFILE) ../lib + chmod a+r ../lib/startup.mk diff --git a/dmake/unix/bsd43/uw/make.sh b/dmake/unix/bsd43/uw/make.sh new file mode 100644 index 000000000000..f23ecbb8ec44 --- /dev/null +++ b/dmake/unix/bsd43/uw/make.sh @@ -0,0 +1,69 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/putenv.c +mv putenv.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/tempnam.c +mv tempnam.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/utime.c +mv utime.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/uw -O unix/bsd43/setvbuf.c +mv setvbuf.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \ +objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o -luw +cp unix/bsd43/uw/template.mk startup/config.mk diff --git a/dmake/unix/bsd43/uw/public.h b/dmake/unix/bsd43/uw/public.h new file mode 100644 index 000000000000..da4cc6c0b7c4 --- /dev/null +++ b/dmake/unix/bsd43/uw/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/bsd43/uw/template.mk b/dmake/unix/bsd43/uw/template.mk new file mode 100644 index 000000000000..6afe91c1fc7a --- /dev/null +++ b/dmake/unix/bsd43/uw/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= bsd43 + OSENVIRONMENT *:= uw diff --git a/dmake/unix/bsd43/vf/config.mk b/dmake/unix/bsd43/vf/config.mk new file mode 100644 index 000000000000..bf4e64808d6c --- /dev/null +++ b/dmake/unix/bsd43/vf/config.mk @@ -0,0 +1,11 @@ +# This config file adds vfprintf.c and memcpy.c for those systems that +# do not have it. +# + +osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) +CFLAGS += -I$(osredir) + +# The following sources are required for BSD4.3 +OSDESRC := memcpy.c vfprintf.c +SRC += $(OSDESRC) +.SETDIR=$(osredir) : $(OSDESRC) diff --git a/dmake/unix/bsd43/vf/ctype.h b/dmake/unix/bsd43/vf/ctype.h new file mode 100644 index 000000000000..f229a9ab3967 --- /dev/null +++ b/dmake/unix/bsd43/vf/ctype.h @@ -0,0 +1,51 @@ +/* RCS $Id: ctype.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- ctype +-- +-- DESCRIPTION +-- ctype.h 4.2 85/09/04 +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#define _U 01 +#define _L 02 +#define _N 04 +#define _S 010 +#define _P 020 +#define _C 040 +#define _X 0100 +#define _B 0200 + +extern char _ctype_[]; + +#define isalpha(c) ((_ctype_+1)[c]&(_U|_L)) +#define isupper(c) ((_ctype_+1)[c]&_U) +#define islower(c) ((_ctype_+1)[c]&_L) +#define isdigit(c) ((_ctype_+1)[c]&_N) +#define isxdigit(c) ((_ctype_+1)[c]&(_N|_X)) +#define isspace(c) ((_ctype_+1)[c]&_S) +#define ispunct(c) ((_ctype_+1)[c]&_P) +#define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N)) +#define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N|_B)) +#define isgraph(c) ((_ctype_+1)[c]&(_P|_U|_L|_N)) +#define iscntrl(c) ((_ctype_+1)[c]&_C) +#define isascii(c) ((unsigned)(c)<=0177) +#define toupper(c) ((c)-'a'+'A') +#define tolower(c) ((c)-'A'+'a') +#define toascii(c) ((c)&0177) diff --git a/dmake/unix/bsd43/vf/make.sh b/dmake/unix/bsd43/vf/make.sh new file mode 100644 index 000000000000..231b683a80e6 --- /dev/null +++ b/dmake/unix/bsd43/vf/make.sh @@ -0,0 +1,73 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/putenv.c +mv putenv.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/tempnam.c +mv tempnam.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/utime.c +mv utime.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/setvbuf.c +mv setvbuf.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/memcpy.c +mv memcpy.o objects +cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/vfprintf.c +mv vfprintf.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \ +objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o objects/memcpy.o objects/vfprintf.o +cp unix/bsd43/vf/template.mk startup/config.mk diff --git a/dmake/unix/bsd43/vf/memcpy.c b/dmake/unix/bsd43/vf/memcpy.c new file mode 100644 index 000000000000..4ae47722e851 --- /dev/null +++ b/dmake/unix/bsd43/vf/memcpy.c @@ -0,0 +1,36 @@ +/* RCS $Id: memcpy.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- memcpy +-- +-- DESCRIPTION +-- BSD didn't have this in the library many moons ago. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +char * +memcpy(t, f, n) +register char *t, *f; +register n; +{ + register char *p = t; + + while( --n >= 0 ) *t++ = *f++; + + return (p); +} diff --git a/dmake/unix/bsd43/vf/public.h b/dmake/unix/bsd43/vf/public.h new file mode 100644 index 000000000000..da4cc6c0b7c4 --- /dev/null +++ b/dmake/unix/bsd43/vf/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/bsd43/vf/template.mk b/dmake/unix/bsd43/vf/template.mk new file mode 100644 index 000000000000..395cd4718fa0 --- /dev/null +++ b/dmake/unix/bsd43/vf/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= bsd43 + OSENVIRONMENT *:= vf diff --git a/dmake/unix/bsd43/vf/vfprintf.c b/dmake/unix/bsd43/vf/vfprintf.c new file mode 100644 index 000000000000..675e2e83e5ab --- /dev/null +++ b/dmake/unix/bsd43/vf/vfprintf.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include <stdio.h> +#include <varargs.h> + +int +vfprintf(iop, fmt, ap) + FILE *iop; + char *fmt; + va_list ap; +{ + int len; + char localbuf[BUFSIZ]; + + if (iop->_flag & _IONBF) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + len = _doprnt(fmt, ap, iop); + (void) fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = 0; + iop->_cnt = 0; + } else + len = _doprnt(fmt, ap, iop); + + return (ferror(iop) ? EOF : len); +} + diff --git a/dmake/unix/bsdarm32/config.mk b/dmake/unix/bsdarm32/config.mk new file mode 100644 index 000000000000..e99937342e68 --- /dev/null +++ b/dmake/unix/bsdarm32/config.mk @@ -0,0 +1,27 @@ +# This is the BSD 4.3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following sources are required for BSD4.3 +OSDSRC := putenv.c tempnam.c utime.c setvbuf.c +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local BSD includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/bsdarm32/dirent.h b/dmake/unix/bsdarm32/dirent.h new file mode 100644 index 000000000000..b50fa18a9d9e --- /dev/null +++ b/dmake/unix/bsdarm32/dirent.h @@ -0,0 +1,30 @@ +/* RCS $Id: dirent.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- dirent +-- +-- DESCRIPTION +-- Deal with sysV'ish dirent.h on BSD4.3 systems, which have the stuff +-- in sys/dir.h +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <sys/dir.h> +#include </usr/include/dirent.h> +#define dirent direct + diff --git a/dmake/unix/bsdarm32/limits.h b/dmake/unix/bsdarm32/limits.h new file mode 100644 index 000000000000..655d707bb4f6 --- /dev/null +++ b/dmake/unix/bsdarm32/limits.h @@ -0,0 +1,29 @@ +/* RCS $Id: limits.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- limits +-- +-- DESCRIPTION +-- Compensate for systems that don't have a limits.h header file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <sys/types.h> +#include <sys/dirent.h> +#include <sys/param.h> + diff --git a/dmake/unix/bsdarm32/make.sh b/dmake/unix/bsdarm32/make.sh new file mode 100644 index 000000000000..f43dd9425774 --- /dev/null +++ b/dmake/unix/bsdarm32/make.sh @@ -0,0 +1,67 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/bsdarm32/putenv.c +mv putenv.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/bsdarm32/tempnam.c +mv tempnam.o objects +cc -c -I. -Iunix -Iunix/bsdarm32 -O unix/bsdarm32/utime.c +mv utime.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o \ +objects/dcache.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o +cp unix/bsdarm32/template.mk startup/config.mk diff --git a/dmake/unix/bsdarm32/public.h b/dmake/unix/bsdarm32/public.h new file mode 100644 index 000000000000..da4cc6c0b7c4 --- /dev/null +++ b/dmake/unix/bsdarm32/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/bsdarm32/putenv.c b/dmake/unix/bsdarm32/putenv.c new file mode 100644 index 000000000000..d0ed998158e0 --- /dev/null +++ b/dmake/unix/bsdarm32/putenv.c @@ -0,0 +1,78 @@ +/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- My own putenv for BSD like systems. +-- +-- DESCRIPTION +-- This originally came from MKS, but I rewrote it to fix a bug with +-- replacing existing strings, probably never happened but the code +-- was wrong nonetheless. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <stdio.h> +#include <string.h> + +int +putenv( str )/* +=============== + Take a string of the form NAME=value and stick it into the environment. + We do this by allocating a new set of pointers if we have to add a new + string and by replacing an existing pointer if the value replaces the value + of an existing string. */ +char *str; +{ + extern char **environ; /* The current environment. */ + static char **ourenv = NULL; /* A new environment */ + register char **p; + register char *q; + int size; + + /* First search the current environment and see if we can replace a + * string. */ + for( p=environ; *p; p++ ) { + register char *s = str; + + for( q = *p; *q && *s && *s == *q; q++, s++ ) + if( *s == '=' ) { + *p = str; + return(0); /* replaced it so go away */ + } + } + + /* Ok, can't replace a string so need to grow the environment. */ + size = p - environ + 2; /* size of new environment */ + /* size of old is size-1 */ + + /* It's the first time, so allocate a new environment since we don't know + * where the old one is comming from. */ + if( ourenv == NULL ) { + if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL ) + return(1); + + memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) ); + } + else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL ) + return(1); + + ourenv[--size] = NULL; + ourenv[--size] = str; + + environ = ourenv; + return(0); +} diff --git a/dmake/unix/bsdarm32/stdlib.h b/dmake/unix/bsdarm32/stdlib.h new file mode 100644 index 000000000000..82ab9627cd65 --- /dev/null +++ b/dmake/unix/bsdarm32/stdlib.h @@ -0,0 +1,44 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); +extern free(); +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/bsdarm32/string.h b/dmake/unix/bsdarm32/string.h new file mode 100644 index 000000000000..c8abdf137696 --- /dev/null +++ b/dmake/unix/bsdarm32/string.h @@ -0,0 +1,42 @@ +/* RCS $Id: string.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- string function headers +-- +-- DESCRIPTION +-- Supply correct definitions for certain string functions. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + + +/* +** BSD does this wrong +*/ +#include </usr/include/string.h> + +#include "stdmacs.h" +extern char* strpbrk ANSI((const char* src, const char* any)); + +#ifndef DBUG +#define strchr(str,c) index(str,c) +#define strrchr(str,c) rindex(str,c) +#else +char *strchr ANSI((char*, char)); +char *strrchr ANSI((char*, char)); +#endif + diff --git a/dmake/unix/bsdarm32/template.mk b/dmake/unix/bsdarm32/template.mk new file mode 100644 index 000000000000..830e9958394c --- /dev/null +++ b/dmake/unix/bsdarm32/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= bsdarm32 + OSENVIRONMENT *:= diff --git a/dmake/unix/bsdarm32/tempnam.c b/dmake/unix/bsdarm32/tempnam.c new file mode 100644 index 000000000000..a645f41abcf7 --- /dev/null +++ b/dmake/unix/bsdarm32/tempnam.c @@ -0,0 +1,105 @@ +/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- tempnam +-- +-- DESCRIPTION +-- temp file name generation routines. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#define max(A,B) (((A)<(B))?(B):(A)) + +extern char *mktemp(); +extern int access(); + +static char *cpdir(); +static char seed[4]="AAA"; + +/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */ +#ifndef P_tmpdir +static char *P_tmpdir = "/tmp"; +#endif + + +char * +tempnam(dir, prefix) +const char *dir; /* use this directory please (if non-NULL) */ +const char *prefix; /* use this (if non-NULL) as filename prefix */ +{ + register char *p, *q, *tmpdir; + int tl=0, dl=0, pl; + + pl = strlen(P_tmpdir); + + if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); + if( dir != NULL ) dl = strlen(dir); + + if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL ) + return(NULL); + + *p = '\0'; + + if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) ) + if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) ) + if( access( cpdir(p, P_tmpdir), 3) != 0 ) + if( access( cpdir(p, "/tmp"), 3) != 0 ) + return(NULL); + + (void) strcat(p, "/"); + if(prefix) + { + *(p+strlen(p)+5) = '\0'; + (void)strncat(p, prefix, 5); + } + + (void)strcat(p, seed); + (void)strcat(p, "XXXXXX"); + + q = seed; + while(*q == 'Z') *q++ = 'A'; + ++*q; + + if(*mktemp(p) == '\0') return(NULL); + return(p); +} + + + + +static char * +cpdir(buf, str) +char *buf; +char *str; +{ + char *p; + + if(str != NULL) + { + (void) strcpy(buf, str); + p = buf - 1 + strlen(buf); + if(*p == '/') *p = '\0'; + } + + return(buf); +} diff --git a/dmake/unix/bsdarm32/utime.c b/dmake/unix/bsdarm32/utime.c new file mode 100644 index 000000000000..9d26700d8006 --- /dev/null +++ b/dmake/unix/bsdarm32/utime.c @@ -0,0 +1,70 @@ +/* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- utime +-- +-- DESCRIPTION +-- Provide our own utime function. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <sys/types.h> +#include <sys/time.h> +#include <sys/stat.h> +#include <sys/file.h> + +int +utime(name, timep) +char* name; +time_t timep[2]; +{ + struct timeval tv[2], *tvp; + struct stat buf; + int fil; + char data; + + if (timep!=0) + { + tvp = tv, tv[0].tv_sec = timep[0], tv[1].tv_sec = timep[1]; + if (utimes(name, tvp)==0) + return (0); + } + + if (stat(name, &buf) != 0) + return (-1); + if (buf.st_size != 0) { + if ((fil = open(name, O_RDWR, 0666)) < 0) + return (-1); + if (read(fil, &data, 1) < 1) { + close(fil); + return (-1); + } + lseek(fil, 0L, 0); + if (write(fil, &data, 1) < 1) { + close(fil); + return (-1); + } + close(fil); + return (0); + } else if ((fil = creat(name, 0666)) < 0) { + return (-1); + } else { + close(fil); + return (0); + } +} diff --git a/dmake/unix/coherent/config.mk b/dmake/unix/coherent/config.mk new file mode 100644 index 000000000000..9c5890c8065d --- /dev/null +++ b/dmake/unix/coherent/config.mk @@ -0,0 +1,26 @@ +# This is the COHERENT configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) -Dvoid=int + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/coherent/stdlib.h b/dmake/unix/coherent/stdlib.h new file mode 100644 index 000000000000..82ab9627cd65 --- /dev/null +++ b/dmake/unix/coherent/stdlib.h @@ -0,0 +1,44 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); +extern free(); +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/coherent/time.h b/dmake/unix/coherent/time.h new file mode 100644 index 000000000000..e3509ed8ec8b --- /dev/null +++ b/dmake/unix/coherent/time.h @@ -0,0 +1,32 @@ +/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- time_t +-- +-- DESCRIPTION +-- Properly define time_t. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef TIME_h +#define TIME_h + +typedef long time_t; /* this is the thing we use */ + +#endif TIME_h + diff --git a/dmake/unix/coherent/ver40/config.mk b/dmake/unix/coherent/ver40/config.mk new file mode 100644 index 000000000000..df2a702ea02f --- /dev/null +++ b/dmake/unix/coherent/ver40/config.mk @@ -0,0 +1,11 @@ +# This config file adds vfprintf.c and memcpy.c for those systems that +# do not have it. +# + +osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) +CFLAGS += -I$(osredir) + +# The following sources are required for coherent version 4.0 +OSDESRC := vfprintf.c getcwd.c +SRC += $(OSDESRC) +.SETDIR=$(osredir) : $(OSDESRC) diff --git a/dmake/unix/coherent/ver40/getcwd.c b/dmake/unix/coherent/ver40/getcwd.c new file mode 100644 index 000000000000..cc2772494611 --- /dev/null +++ b/dmake/unix/coherent/ver40/getcwd.c @@ -0,0 +1,49 @@ +/* RCS $Id: getcwd.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- +-- SYNOPSIS +-- getcwd +-- +-- DESCRIPTION +-- Wrapper for getcwd. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#if __STDC__ +char *getcwd(char *buffer, int length) +#else +char *getcwd (buffer, length) +char *buffer; +int length; +#endif +{ + extern char *getwd(); + + char *dir; + dir = getwd(); + if (dir) + { + strncpy(buffer,dir,length); + return buffer; + } + else + { + *buffer = 0; + return (char *) 0; + } +} + diff --git a/dmake/unix/coherent/ver40/make.sh b/dmake/unix/coherent/ver40/make.sh new file mode 100644 index 000000000000..1a0c850452f0 --- /dev/null +++ b/dmake/unix/coherent/ver40/make.sh @@ -0,0 +1,64 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/coherent/ver40/vfprintf.c +mv vfprintf.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver40 -O unix/coherent/ver40/getcwd.c +mv getcwd.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/vfprintf.o objects/getcwd.o +cp unix/coherent/ver40/template.mk startup/config.mk diff --git a/dmake/unix/coherent/ver40/public.h b/dmake/unix/coherent/ver40/public.h new file mode 100644 index 000000000000..da4cc6c0b7c4 --- /dev/null +++ b/dmake/unix/coherent/ver40/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/coherent/ver40/template.mk b/dmake/unix/coherent/ver40/template.mk new file mode 100644 index 000000000000..ef23550cf651 --- /dev/null +++ b/dmake/unix/coherent/ver40/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= coherent + OSENVIRONMENT *:= ver40 diff --git a/dmake/unix/coherent/ver40/vfprintf.c b/dmake/unix/coherent/ver40/vfprintf.c new file mode 100644 index 000000000000..907230db2081 --- /dev/null +++ b/dmake/unix/coherent/ver40/vfprintf.c @@ -0,0 +1,190 @@ +/* Portable vfprintf and vprintf by Robert A. Larson <blarson@skat.usc.edu> */ + +/* Copyright 1989 Robert A. Larson. + * Distribution in any form is allowed as long as the author + * retains credit, changes are noted by their author and the + * copyright message remains intact. This program comes as-is + * with no warentee of fitness for any purpouse. + * + * Thanks to Doug Gwen, Chris Torek, and others who helped clarify + * the ansi printf specs. + * + * Please send any bug fixes and improvments to blarson@skat.usc.edu . + * The use of goto is NOT a bug. + */ + +/* Feb 9, 1989 blarson First usenet release */ + +/* This code implements the vfprintf function, without relying on + * the existance of _doprint or other system specific code. + * + * Define NOVOID if void * is not a supported type. + * + * Two compile options are available for efficency: + * INTSPRINTF should be defined if sprintf is int and returns + * the number of chacters formated. + * LONGINT should be defined if sizeof(long) == sizeof(int) + * + * They only make the code smaller and faster, they need not be + * defined. + * + * UNSIGNEDSPECIAL should be defined if unsigned is treated differently + * than int in argument passing. If this is definded, and LONGINT is not, + * the compiler must support the type unsingned long. + * + * Most quirks and bugs of the available fprintf fuction are duplicated, + * however * in the width and precision fields will work correctly + * even if fprintf does not support this. The %n format and the return + * count will only work if fprintf returns the number of characters + * formatted. + * + * Bad format strings, or those with very long width and precision + * fields (including expanded * fields) will cause undesired results. + */ + +#ifdef OSK /* os9/68k can take advantage of both */ +#define INTSPRINTF +#define LONGINT +#endif +#define NOVOID 1 + +/* This must be a typedef not a #define! */ +#ifdef NOVOID +typedef char *pointer; +#else +typedef void *pointer; +#endif + +#include <stdio.h> + +#ifdef INTSPRINTF +#define Sprintf(string,format,arg) (sprintf((string),(format),(arg))) +#else +#define Sprintf(string,format,arg) (\ + sprintf((string),(format),(arg)),\ + strlen(string)\ +) +#endif + +#include <stdarg.h> + +typedef int *intp; + +int vfprintf(dest, format, args) +FILE *dest; +register char *format; +va_list args; +{ + register char c; + register char *tp; + register int count = 0; + char tempfmt[64]; +#ifndef LONGINT + int longflag; +#endif + + tempfmt[0] = '%'; + while(c = *format++) { + if(c=='%') { + tp = &tempfmt[1]; +#ifndef LONGINT + longflag = 0; +#endif +continue_format: + switch(c = *format++) { + case 's': + *tp++ = c; + *tp = '\0'; + count += fprintf(dest, tempfmt, va_arg(args, char *)); + break; + case 'u': + case 'x': + case 'o': + case 'X': +#ifdef UNSIGNEDSPECIAL + *tp++ = c; + *tp = '\0'; +#ifndef LONGINT + if(longflag) + count += fprintf(dest, tempfmt, va_arg(args, unsigned long)); + else +#endif + count += fprintf(dest, tempfmt, va_arg(args, unsigned)); + break; +#endif + case 'd': + case 'c': + case 'i': + *tp++ = c; + *tp = '\0'; +#ifndef LONGINT + if(longflag) + count += fprintf(dest, tempfmt, va_arg(args, long)); + else +#endif + count += fprintf(dest, tempfmt, va_arg(args, int)); + break; + case 'f': + case 'e': + case 'E': + case 'g': + case 'G': + *tp++ = c; + *tp = '\0'; + count += fprintf(dest, tempfmt, va_arg(args, double)); + break; + case 'p': + *tp++ = c; + *tp = '\0'; + count += fprintf(dest, tempfmt, va_arg(args, pointer)); + break; + case '-': + case '+': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case ' ': + case '#': + case 'h': + *tp++ = c; + goto continue_format; + case 'l': +#ifndef LONGINT + longflag = 1; + *tp++ = c; +#endif + goto continue_format; + case '*': + tp += Sprintf(tp, "%d", va_arg(args, int)); + goto continue_format; + case 'n': + *va_arg(args, intp) = count; + break; + case '%': + default: + putc(c, dest); + count++; + break; + } + } else { + putc(c, dest); + count++; + } + } + return count; +} + +vprintf(format, args) +char *format; +va_list args; +{ + return vfprintf(stdout, format, args); +} diff --git a/dmake/unix/coherent/ver42/config.mk b/dmake/unix/coherent/ver42/config.mk new file mode 100644 index 000000000000..2ff06b6b7917 --- /dev/null +++ b/dmake/unix/coherent/ver42/config.mk @@ -0,0 +1,11 @@ +# This config file adds vfprintf.c and memcpy.c for those systems that +# do not have it. +# + +osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) +CFLAGS += -I$(osredir) + +# The following sources are required for Coherent version 4.2 +#OSDESRC := +#SRC += $(OSDESRC) +#.SETDIR=$(osredir) : $(OSDESRC) diff --git a/dmake/unix/coherent/ver42/make.sh b/dmake/unix/coherent/ver42/make.sh new file mode 100644 index 000000000000..bfc7f8252a5d --- /dev/null +++ b/dmake/unix/coherent/ver42/make.sh @@ -0,0 +1,60 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/coherent -Dvoid=int -Iunix/coherent/ver42 -O unix/dcache.c +mv dcache.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/coherent/ver42/template.mk startup/config.mk diff --git a/dmake/unix/coherent/ver42/public.h b/dmake/unix/coherent/ver42/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/coherent/ver42/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/coherent/ver42/template.mk b/dmake/unix/coherent/ver42/template.mk new file mode 100644 index 000000000000..e5dd9f99ffac --- /dev/null +++ b/dmake/unix/coherent/ver42/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= coherent + OSENVIRONMENT *:= ver42 diff --git a/dmake/unix/config.mk b/dmake/unix/config.mk new file mode 100644 index 000000000000..a6859ceb3c50 --- /dev/null +++ b/dmake/unix/config.mk @@ -0,0 +1,39 @@ +# This is an OS specific configuration file +# It assumes that OBJDIR, TARGET and DEBUG are previously defined. +# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS +# PRINTER, PRINTFLAGS +# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS +# +PRINTER = hw +PRINTFLAGS = -P$(PRINTER) +STARTUPFILE = $(OS)/startup.mk +CPPFLAGS = $(CFLAGS) +LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)} +LDARGS = $(LDFLAGS) -o $@ $(LDOBJS) $(LDLIBS) + +# Debug flags +DB_CFLAGS = -g -DDBUG +DB_LDFLAGS = -g +DB_LDLIBS = + +# NO Debug flags +NDB_CFLAGS = -O +NDB_LDFLAGS = -O +NDB_LDLIBS = + +# Local configuration modifications for CFLAGS. +CFLAGS += -I$(OS) + +# Sources that must be defined for each different version +OSSRC := arlib.c dirbrk.c rmprq.c ruletab.c runargv.c dcache.c +SRC += $(OSSRC) +.SETDIR=$(OS) : $(OSSRC) + +# Set source dirs so that we can find files named in this +# config file. +.SOURCE.h : $(OS) + +# See if we modify anything in the lower levels. +.IF $(OSRELEASE) != $(NULL) + .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/dcache.c b/dmake/unix/dcache.c new file mode 100644 index 000000000000..d9ab5d987584 --- /dev/null +++ b/dmake/unix/dcache.c @@ -0,0 +1,198 @@ +/* RCS $Id: dcache.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Directory cache management routines. +-- +-- DESCRIPTION +-- This is the code that maintains a directory cache for each directory +-- that dmake visits. The entire directory is thus only read once and +-- the need for performing costly 'stat' calls when performing target +-- inference is much reduced. The improvement in performance should be +-- significant for NFS or remote mounted file systems. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* For Borland 5.00 compile, for some reason they seem to insist on pulling + * in the winnt.h if __WIN32__ is defined and you include <dirent.h>. This + * is, in my opinion, a BUG! on Borland's part. + */ +#if defined(__BORLANDC__) && defined(__WIN32__) +#undef __WIN32__ +#endif + +#ifdef __APPLE__ +#include <sys/types.h> +#endif +#include <dirent.h> +#include "extern.h" +#include "sysintf.h" + + +typedef struct ent { + char *name; + uint32 hkey; + time_t mtime; + int isdir; + struct ent *next; +} Entry, *EntryPtr; + + +typedef struct mydir { + char *path; + uint32 hkey; + EntryPtr entries; + struct mydir *next; +} DirEntry, *DirEntryPtr; + +static DirEntryPtr dtab[HASH_TABLE_SIZE]; + + +/* Stat a path using the directory cache. + * + * We build a cannonical representation of the path using either an absolute + * path name if that is what 'path' is or the relative path name constructed + * from 'path' and the present value of Pwd. + * + * The present value of Pwd then gives a directory path that we search for + * in our cache using a hash lookup. If the directory component is located + * then we search the basename component of the path and return the result of + * the search: 0L if the component is not in the cache and it's time stamp + * otherwise. + * + * If the directory is not in our cache we insert it into the cache by + * openning the directory and reading all of the files within. Once read + * then we return the result of the above search. + * + * Optionally, if force is TRUE, and we did NOT read the directory to provide + * the result then stat the file anyway and update the internal cache. + */ + +PUBLIC time_t +CacheStat(path, force) +char *path; +int force; +{ + struct stat stbuf; + DirEntryPtr dp; + EntryPtr ep; + uint32 hkey; + uint16 hv; + char *fpath; + char *spath; + char *comp; + char *dir; + int loaded=FALSE; + +#ifdef __APPLE__ + /* On Mac OS X, open, stat, and other system calls are case-insenstive. + Since this function keeps a case-sensitive cache, we need to force + a stat of the file if there is no match in the cache just to make sure + that we don't miss a file when only the case is different */ + force = TRUE; +#endif + + if (If_root_path(path)) + spath = path; + else + spath = Build_path(Pwd,path); + + fpath = DmStrDup(spath); + comp = Basename(fpath); + dir = Filedir(fpath); + + hv = Hash(dir,&hkey); + + for(dp=dtab[hv]; dp; dp=dp->next) + if (hkey == dp->hkey && strcmp(dp->path,dir) == 0) + break; + + if (!dp) { + DIR *dirp; + struct dirent *direntp; + + if( Verbose & V_DIR_CACHE ) + printf( "%s: Caching directory [%s]\n", Pname, dir ); + + /* Load the directory, we have the right hash position already */ + loaded = TRUE; + + TALLOC(dp,1,DirEntry); + dp->next = dtab[hv]; + dtab[hv] = dp; + dp->path = DmStrDup(dir); + dp->hkey = hkey; + + if (Set_dir(dir) == 0) { + if((dirp=opendir(".")) != NIL(DIR)) { + while((direntp=readdir(dirp)) != NULL) { + TALLOC(ep,1,Entry); + ep->name = DmStrDup(direntp->d_name); + + /* Perform case mapping of name if appropriate */ + DMSTRLWR(ep->name, comp); + Hash(ep->name, &ep->hkey); + + ep->next = dp->entries; + dp->entries = ep; + DMSTAT(direntp->d_name,&stbuf); + ep->isdir = (stbuf.st_mode & S_IFDIR); + ep->mtime = stbuf.st_mtime; + } + closedir(dirp); + } + Set_dir(Pwd); + } + } + + Hash(comp, &hkey); + + if (dp) { + for(ep=dp->entries; ep; ep=ep->next) + if(hkey == ep->hkey && strcmp(ep->name,comp) == 0) + break; + } + else + ep = NULL; + + if( force && !loaded) { + if (strlen(comp) > NameMax || DMSTAT(spath,&stbuf) != 0) { + if(ep) + ep->mtime = 0L; + } + else { + if (!ep) { + TALLOC(ep,1,Entry); + ep->name = DmStrDup(comp); + DMSTRLWR(ep->name, comp); + Hash(ep->name, &ep->hkey); + ep->next = dp->entries; + ep->isdir = (stbuf.st_mode & S_IFDIR); + dp->entries = ep; + } + + ep->mtime = stbuf.st_mtime; + } + + if( Verbose & V_DIR_CACHE ) + printf("%s: Updating dir cache entry for [%s], new time is %d\n", + Pname, spath, ep ? ep->mtime : 0L); + } + + FREE(fpath); + return(!ep ? (time_t)0L : ((STOBOOL(Augmake) && ep->isdir)?0L:ep->mtime)); +} diff --git a/dmake/unix/dirbrk.c b/dmake/unix/dirbrk.c new file mode 100644 index 000000000000..727df34f70a4 --- /dev/null +++ b/dmake/unix/dirbrk.c @@ -0,0 +1,42 @@ +/* RCS $Id: dirbrk.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Define the directory separator string. +-- +-- DESCRIPTION +-- Define this string for any character that may appear in a path name +-- and can be used as a directory separator. Also provide a function +-- to indicate if a given path begins at the root of the file system. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include "extern.h" + +/* Unix only uses / */ +char* DirBrkStr = "/"; + +/* +** Return TRUE if the name is the full specification of a path name to a file +** starting at the root of the file system, otherwise return FALSE +*/ +PUBLIC int +If_root_path(name) +char *name; +{ + return( strchr(DirBrkStr, *name) != NIL(char) ); +} diff --git a/dmake/unix/linux/config.mk b/dmake/unix/linux/config.mk new file mode 100644 index 000000000000..75bcf3c2a211 --- /dev/null +++ b/dmake/unix/linux/config.mk @@ -0,0 +1,27 @@ +# This is the SysV R3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/linux/gnu/config.mk b/dmake/unix/linux/gnu/config.mk new file mode 100644 index 000000000000..e351490a6b3d --- /dev/null +++ b/dmake/unix/linux/gnu/config.mk @@ -0,0 +1,4 @@ +# This is the Linux gnu configuration file for DMAKE +# It makes sure we include from the right place. +# +CFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) diff --git a/dmake/unix/linux/gnu/make.sh b/dmake/unix/linux/gnu/make.sh new file mode 100644 index 000000000000..8e0aa400a80b --- /dev/null +++ b/dmake/unix/linux/gnu/make.sh @@ -0,0 +1,193 @@ +platform=`uname -m`; export platform; + +mkdir objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O infer.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O infer.c +fi +mv infer.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O make.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O make.c +fi +mv make.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O stat.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O stat.c +fi +mv stat.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O expand.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O expand.c +fi +mv expand.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmstring.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmstring.c +fi +mv dmstring.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O hash.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O hash.c +fi +mv hash.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dag.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dag.c +fi +mv dag.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmake.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmake.c +fi +mv dmake.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O path.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O path.c +fi +mv path.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O imacs.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O imacs.c +fi +mv imacs.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O sysintf.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O sysintf.c +fi +mv sysintf.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O parse.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O parse.c +fi +mv parse.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O getinp.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O getinp.c +fi +mv getinp.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O quit.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O quit.c +fi +mv quit.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O state.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O state.c +fi +mv state.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmdump.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O dmdump.c +fi +mv dmdump.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O macparse.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O macparse.c +fi +mv macparse.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O rulparse.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O rulparse.c +fi +mv rulparse.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O percent.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O percent.c +fi +mv percent.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O function.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O function.c +fi +mv function.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/arlib.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/arlib.c +fi +mv arlib.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dirbrk.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dirbrk.c +fi +mv dirbrk.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/rmprq.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/rmprq.c +fi +mv rmprq.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/ruletab.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/ruletab.c +fi +mv ruletab.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/runargv.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/runargv.c +fi +mv runargv.o objects + +if test $platform = sparc -o $platform = sparc64; then +gcc -c -ansi -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dcache.c +else +gcc -c -I. -Iunix -Iunix/linux -Iunix/linux/gnu -O unix/dcache.c +fi +mv dcache.o objects + +gcc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/linux/gnu/template.mk startup/config.mk diff --git a/dmake/unix/linux/gnu/public.h b/dmake/unix/linux/gnu/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/linux/gnu/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/linux/gnu/template.mk b/dmake/unix/linux/gnu/template.mk new file mode 100644 index 000000000000..a0bcef64097b --- /dev/null +++ b/dmake/unix/linux/gnu/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= linux + OSENVIRONMENT *:= gnu diff --git a/dmake/unix/macosx/config.mk b/dmake/unix/macosx/config.mk new file mode 100644 index 000000000000..75bcf3c2a211 --- /dev/null +++ b/dmake/unix/macosx/config.mk @@ -0,0 +1,27 @@ +# This is the SysV R3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/macosx/gnu/config.mk b/dmake/unix/macosx/gnu/config.mk new file mode 100644 index 000000000000..e351490a6b3d --- /dev/null +++ b/dmake/unix/macosx/gnu/config.mk @@ -0,0 +1,4 @@ +# This is the Linux gnu configuration file for DMAKE +# It makes sure we include from the right place. +# +CFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) diff --git a/dmake/unix/macosx/gnu/make.sh b/dmake/unix/macosx/gnu/make.sh new file mode 100644 index 000000000000..b17a774defb4 --- /dev/null +++ b/dmake/unix/macosx/gnu/make.sh @@ -0,0 +1,60 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/macosx -Iunix/macosx/gnu -O unix/dcache.c +mv dcache.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/macosx/gnu/template.mk startup/config.mk diff --git a/dmake/unix/macosx/gnu/public.h b/dmake/unix/macosx/gnu/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/macosx/gnu/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/macosx/gnu/template.mk b/dmake/unix/macosx/gnu/template.mk new file mode 100644 index 000000000000..672878dfa095 --- /dev/null +++ b/dmake/unix/macosx/gnu/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= macosx + OSENVIRONMENT *:= gnu diff --git a/dmake/unix/rmprq.c b/dmake/unix/rmprq.c new file mode 100644 index 000000000000..3b95f237b7b8 --- /dev/null +++ b/dmake/unix/rmprq.c @@ -0,0 +1,96 @@ +/* RCS $Id: rmprq.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Remove prerequisites code. +-- +-- DESCRIPTION +-- This code is different for DOS and for UNIX and parallel make +-- architectures since the parallel case requires the rm's to be +-- run in parallel, whereas DOS guarantees to run them sequentially. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include "extern.h" + +PUBLIC void +Remove_prq( tcp ) +CELLPTR tcp; +{ + static LINKPTR rlp = NIL(LINK); + static flag = 0; + static HASHPTR m_at, m_q, m_b, m_g, m_l, m_bb, m_up; + char *m_at_s, *m_g_s, *m_q_s, *m_b_s, *m_l_s, *m_bb_s, *m_up_s; + LINKPTR tlp; + + tcp->ce_flag &= ~(F_MADE|F_VISITED); + tcp->ce_time = 0L; + + for( tlp=rlp; tlp !=NIL(LINK); tlp=tlp->cl_next ) + if( (tlp->cl_prq->ce_flag & (F_VISITED|F_MADE)) != F_VISITED ) + break; + + if( tlp == NIL(LINK) ) { + TALLOC(tlp, 1, LINK); + TALLOC(tlp->cl_prq, 1, CELL); + tlp->cl_next = rlp; + rlp = tlp; + } + + *tlp->cl_prq = *tcp; + + /* We save the dynamic macro values here, as it is possible that the + * .REMOVE recipe is getting executed for a target while some other target + * is in the middle of executing it's list of recipe lines, in this case + * the values of $@ etc, must be preserved so that when we return to + * complete the other recipe we must make certain that the values of it's + * dynamic macros are unmodified. */ + + if( !flag ) { + /* Do the getting of the macros only once. */ + flag = 1; + m_at = Get_name("@", Macs, TRUE); + m_g = Get_name(">", Macs, TRUE); + m_q = Get_name("?", Macs, TRUE); + m_b = Get_name("<", Macs, TRUE); + m_l = Get_name("&", Macs, TRUE); + m_bb = Get_name("*", Macs, TRUE); + m_up = Get_name("^", Macs, TRUE); + } + + m_at_s = m_at->ht_value; m_at->ht_value = NIL(char); + m_g_s = m_g->ht_value; m_g->ht_value = NIL(char); + m_q_s = m_q->ht_value; m_q->ht_value = NIL(char); + m_b_s = m_b->ht_value; m_b->ht_value = NIL(char); + m_l_s = m_l->ht_value; m_l->ht_value = NIL(char); + m_bb_s = m_bb->ht_value; m_bb->ht_value = NIL(char); + m_up_s = m_up->ht_value; m_up->ht_value = NIL(char); + + Make( tlp->cl_prq, tcp ); + if( tlp->cl_prq->ce_dir ){ + FREE(tlp->cl_prq->ce_dir); + tlp->cl_prq->ce_dir=NIL(char); + } + + m_at->ht_value = m_at_s; + m_g->ht_value = m_g_s; + m_q->ht_value = m_q_s; + m_b->ht_value = m_b_s; + m_l->ht_value = m_l_s; + m_bb->ht_value = m_bb_s; + m_up->ht_value = m_up_s; +} diff --git a/dmake/unix/ruletab.c b/dmake/unix/ruletab.c new file mode 100644 index 000000000000..a7723ad0e8bb --- /dev/null +++ b/dmake/unix/ruletab.c @@ -0,0 +1,41 @@ +/* RCS $Id: ruletab.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Default initial configuration of dmake. +-- +-- DESCRIPTION +-- Define here the initial set of rules that are defined before +-- dmake performs any processing. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* These are control macros for dmake that MUST be defined at some point + * if they are NOT dmake will not work! These are default definitions. They + * may be overridden inside the .STARTUP makefile, they are here + * strictly so that dmake can parse the STARTUP makefile */ + +static char *_rules[] = { + "MAXPROCESSLIMIT := 10", + "MAXLINELENGTH := 8190", + ".IMPORT .IGNORE: DMAKEROOT SOLARVER UPD INPATH OS UPDMINOREXT", + ".MAKEFILES : makefile.mk Makefile makefile", + ".SOURCE : .NULL", +#include "startup.h" + 0 }; + +char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */ diff --git a/dmake/unix/runargv.c b/dmake/unix/runargv.c new file mode 100644 index 000000000000..df795c2f6b6f --- /dev/null +++ b/dmake/unix/runargv.c @@ -0,0 +1,307 @@ +/* RCS $Id: runargv.c,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Invoke a sub process. +-- +-- DESCRIPTION +-- Use the standard methods of executing a sub process. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <signal.h> +#include "extern.h" +#include "sysintf.h" + +typedef struct prp { + char *prp_cmd; + int prp_group; + int prp_ignore; + int prp_last; + int prp_shell; + struct prp *prp_next; +} RCP, *RCPPTR; + +typedef struct pr { + int pr_valid; + int pr_pid; + CELLPTR pr_target; + int pr_ignore; + int pr_last; + RCPPTR pr_recipe; + RCPPTR pr_recipe_end; + char *pr_dir; +} PR; + +static PR *_procs = NIL(PR); +static int _proc_cnt = 0; +static int _abort_flg= FALSE; +static int _use_i = -1; +static int _do_upd = 0; + +static void _add_child ANSI((int, CELLPTR, int, int)); +static void _attach_cmd ANSI((char *, int, int, CELLPTR, int, int)); +static void _finished_child ANSI((int, int)); +static int _running ANSI((CELLPTR)); + +PUBLIC int +runargv(target, ignore, group, last, shell, cmd) +CELLPTR target; +int ignore; +int group; +int last; +int shell; +char *cmd; +{ + extern int errno; +#ifndef __APPLE__ +#ifdef arm32 + extern const char * const sys_errlist[]; +#else +#ifdef linux + extern const char * const sys_errlist[]; +#else + extern char *sys_errlist[]; +#endif +#endif +#endif + int pid; + char **argv; + + if( _running(target) /*&& Max_proc != 1*/ ) { + /* The command will be executed when the previous recipe + * line completes. */ + _attach_cmd( cmd, group, ignore, target, last, shell ); + return(1); + } + + while( _proc_cnt == Max_proc ) + if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child %d", errno ); + + argv = Pack_argv( group, shell, cmd ); + + switch( pid=fork() ){ + int wid; + int status; + + case -1: /* fork failed */ + Error("%s: %s", argv[0], sys_errlist[errno]); + Handle_result(-1, ignore, _abort_flg, target); + return(-1); + + case 0: /* child */ + execvp(argv[0], argv); + Continue = TRUE; /* survive error message */ + Error("%s: %s", argv[0], sys_errlist[errno]); + kill(getpid(), SIGTERM); + /*NOTREACHED*/ + + default: /* parent */ + _add_child(pid, target, ignore, last); + } + + return(1); +} + + +PUBLIC int +Wait_for_child( abort_flg, pid ) +int abort_flg; +int pid; +{ + int wid; + int status; + int waitchild; + + waitchild = (pid == -1)? FALSE : Wait_for_completion; + + do { + if( (wid = wait(&status)) == -1 ) return(-1); + + _abort_flg = abort_flg; + _finished_child(wid, status); + _abort_flg = FALSE; + } + while( waitchild && pid != wid ); + + return(0); +} + + +PUBLIC void +Clean_up_processes() +{ + register int i; + + if( _procs != NIL(PR) ) { + for( i=0; i<Max_proc; i++ ) + if( _procs[i].pr_valid ) + kill(_procs[i].pr_pid, SIGTERM); + + while( Wait_for_child(TRUE, -1) != -1 ); + } +} + + +static void +_add_child( pid, target, ignore, last ) +int pid; +CELLPTR target; +int ignore; +int last; +{ + register int i; + register PR *pp; + + if( _procs == NIL(PR) ) { + TALLOC( _procs, Max_proc, PR ); + } + + if( (i = _use_i) == -1 ) + for( i=0; i<Max_proc; i++ ) + if( !_procs[i].pr_valid ) + break; + + pp = _procs+i; + + pp->pr_valid = 1; + pp->pr_pid = pid; + pp->pr_target = target; + pp->pr_ignore = ignore; + pp->pr_last = last; + pp->pr_dir = DmStrDup(Get_current_dir()); + + Current_target = NIL(CELL); + + _proc_cnt++; + + if( Wait_for_completion ) Wait_for_child( FALSE, pid ); +} + + +static void +_finished_child(pid, status) +int pid; +int status; +{ + register int i; + register PR *pp; + char *dir; + + for( i=0; i<Max_proc; i++ ) + if( _procs[i].pr_valid && _procs[i].pr_pid == pid ) + break; + + /* Some children we didn't make esp true if using /bin/sh to execute a + * a pipe and feed the output as a makefile into dmake. */ + if( i == Max_proc ) return; + _procs[i].pr_valid = 0; + _proc_cnt--; + dir = DmStrDup(Get_current_dir()); + Set_dir( _procs[i].pr_dir ); + + if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) { + RCPPTR rp = _procs[i].pr_recipe; + + + Current_target = _procs[i].pr_target; + Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target ); + Current_target = NIL(CELL); + + if ( _procs[i].pr_target->ce_attr & A_ERROR ) { + Unlink_temp_files( _procs[i].pr_target ); + _procs[i].pr_last = TRUE; + goto ABORT_REMAINDER_OF_RECIPE; + } + + _procs[i].pr_recipe = rp->prp_next; + + _use_i = i; + runargv( _procs[i].pr_target, rp->prp_ignore, rp->prp_group, + rp->prp_last, rp->prp_shell, rp->prp_cmd ); + _use_i = -1; + + FREE( rp->prp_cmd ); + FREE( rp ); + + if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 ); + } + else { + Unlink_temp_files( _procs[i].pr_target ); + Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target); + + ABORT_REMAINDER_OF_RECIPE: + if( _procs[i].pr_last ) { + FREE(_procs[i].pr_dir ); + + if( !Doing_bang ) Update_time_stamp( _procs[i].pr_target ); + } + } + + Set_dir(dir); + FREE(dir); +} + + +static int +_running( cp ) +CELLPTR cp; +{ + register int i; + + if( !_procs ) return(FALSE); + + for( i=0; i<Max_proc; i++ ) + if( _procs[i].pr_valid && + _procs[i].pr_target == cp ) + break; + + return( i != Max_proc ); +} + + +static void +_attach_cmd( cmd, group, ignore, cp, last, shell ) +char *cmd; +int group; +int ignore; +CELLPTR cp; +int last; +int shell; +{ + register int i; + RCPPTR rp; + + for( i=0; i<Max_proc; i++ ) + if( _procs[i].pr_valid && + _procs[i].pr_target == cp ) + break; + + TALLOC( rp, 1, RCP ); + rp->prp_cmd = DmStrDup(cmd); + rp->prp_group = group; + rp->prp_ignore= ignore; + rp->prp_last = last; + rp->prp_shell = shell; + + if( _procs[i].pr_recipe == NIL(RCP) ) + _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp; + else { + _procs[i].pr_recipe_end->prp_next = rp; + _procs[i].pr_recipe_end = rp; + } +} diff --git a/dmake/unix/solaris/config.mk b/dmake/unix/solaris/config.mk new file mode 100644 index 000000000000..bc2364a33260 --- /dev/null +++ b/dmake/unix/solaris/config.mk @@ -0,0 +1,27 @@ +# This is the BSD 4.3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following sources are required for Solaris 2.1 or greater +OSDSRC := tempnam.c getcwd.c +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local BSD includes +# too. +CFLAGS += -I$(osrdir) -DSolaris + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/solaris/getcwd.c b/dmake/unix/solaris/getcwd.c new file mode 100644 index 000000000000..f2359bcc795b --- /dev/null +++ b/dmake/unix/solaris/getcwd.c @@ -0,0 +1,231 @@ +/* + getcwd -- get pathname of current working directory + + public-domain implementation + + last edit: 03-Nov-1990 Gwyn@BRL.MIL + + complies with the following standards: + IEEE Std 1003.1-1988 + SVID Issue 3 + X/Open Portability Guide Issue 2 (when "XPG2" is defined) + X/Open Portability Guide Issue 3 + + This implementation of getcwd() can be used to replace the UNIX + System V library routine (which uses popen() to capture the output of + the "pwd" command). Once that is done, "pwd" can be reimplemented as + just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below. + + This implementation depends on every directory having entries for + "." and "..". It also depends on the internals of the <dirent.h> + data structures to some degree. + + I considered using chdir() to ascend the hierarchy, followed by a + final chdir() to the path being returned by getcwd() to restore the + location, but decided that error recovery was too difficult that way. + The algorithm I settled on was inspired by my rewrite of the "pwd" + utility, combined with the dotdots[] array trick from the SVR2 shell. +*/ +#define XPG2 /* define to support obsolete XPG2-mandated feature */ + + +#include <sys/types.h> +#include <sys/stat.h> + +#ifdef M_XENIX +# include <sys/ndir.h> +# define dirent direct +#else +# include <dirent.h> +#endif + +#include <errno.h> +#include <string.h> + +typedef char *pointer; /* (void *) if you have it */ + +extern void free(); +extern pointer malloc(); +extern int fstat(), stat(); + +extern int errno; /* normally done by <errno.h> */ + +#ifndef NULL +#define NULL 0 /* amorphous null pointer constant */ +#endif + +#ifndef NAME_MAX +#define NAME_MAX 255 /* maximum directory entry size */ +#endif + + +char * +getcwd( buf, size ) /* returns pointer to CWD pathname */ + char *buf; /* where to put name (NULL to malloc) */ + int size; /* size of buf[] or malloc()ed memory */ + { + static char dotdots[] = +"../../../../../../../../../../../../../../../../../../../../../../../../../.."; + char *dotdot; /* -> dotdots[.], right to left */ + DIR *dirp; /* -> parent directory stream */ + struct dirent *dir; /* -> directory entry */ + struct stat stat1, + stat2; /* info from stat() */ + struct stat *d = &stat1; /* -> info about "." */ + struct stat *dd = &stat2; /* -> info about ".." */ + register char *buffer; /* local copy of buf, or malloc()ed */ + char *bufend; /* -> buffer[size] */ + register char *endp; /* -> end of reversed string */ + register char *dname; /* entry name ("" for root) */ + int serrno = errno; /* save entry errno */ + + if ( buf != NULL && size <= 0 +#ifndef XPG2 + || buf == NULL +#endif + ) { + errno = EINVAL; /* invalid argument */ + return NULL; + } + + buffer = buf; +#ifdef XPG2 + if ( buf == NULL /* wants us to malloc() the string */ + && (buffer = (char *) malloc( (unsigned) size )) == NULL + /* XXX -- actually should probably not pay attention to "size" arg */ + ) { + errno = ENOMEM; /* cannot malloc() specified size */ + return NULL; + } +#endif + + if ( stat( ".", dd ) != 0 ) /* prime the pump */ + goto error; /* errno already set */ + + endp = buffer; /* initially, empty string */ + bufend = &buffer[size]; + + for ( dotdot = &dotdots[sizeof dotdots]; dotdot != dotdots; ) + { + dotdot -= 3; /* include one more "/.." section */ + /* (first time is actually "..") */ + + /* swap stat() info buffers */ + { + register struct stat *temp = d; + + d = dd; /* new current dir is old parent dir */ + dd = temp; + } + + if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */ + goto error; /* errno already set */ + + if ( fstat( dirp->dd_fd, dd ) != 0 ) + { + serrno = errno; /* set by fstat() */ + (void)closedir( dirp ); + errno = serrno; /* in case closedir() clobbered it */ + goto error; + } + + if ( d->st_dev == dd->st_dev ) + { /* not crossing a mount point */ + if ( d->st_ino == dd->st_ino ) + { /* root directory */ + dname = ""; + goto append; + } + + do + if ( (dir = readdir( dirp )) == NULL ) + { + (void)closedir( dirp ); + errno = ENOENT; /* missing entry */ + goto error; + } + while ( dir->d_ino != d->st_ino ); + } + else { /* crossing a mount point */ + struct stat t; /* info re. test entry */ + char name[sizeof dotdots + 1 + NAME_MAX]; + + (void)strcpy( name, dotdot ); + dname = &name[strlen( name )]; + *dname++ = '/'; + + do { + if ( (dir = readdir( dirp )) == NULL ) + { + (void)closedir( dirp ); + errno = ENOENT; /* missing entry */ + goto error; + } + + (void)strcpy( dname, dir->d_name ); + /* must fit if NAME_MAX is not a lie */ + } + while ( stat( name, &t ) != 0 + || t.st_ino != d->st_ino + || t.st_dev != d->st_dev + ); + } + + dname = dir->d_name; + + /* append "/" and reversed dname string onto buffer */ + append: + if ( endp != buffer /* avoid trailing / in final name */ + || dname[0] == '\0' /* but allow "/" when CWD is root */ + ) + *endp++ = '/'; + + { + register char *app; /* traverses dname string */ + + for ( app = dname; *app != '\0'; ++app ) + ; + + if ( app - dname >= bufend - endp ) + { + (void)closedir( dirp ); + errno = ERANGE; /* won't fit allotted space */ + goto error; + } + + while ( app != dname ) + *endp++ = *--app; + } + + (void)closedir( dirp ); + + if ( dname[0] == '\0' ) /* reached root; wrap it up */ + { + register char *startp; /* -> buffer[.] */ + + *endp = '\0'; /* plant null terminator */ + + /* straighten out reversed pathname string */ + for ( startp = buffer; --endp > startp; ++startp ) + { + char temp = *endp; + + *endp = *startp; + *startp = temp; + } + + errno = serrno; /* restore entry errno */ + /* XXX -- if buf==NULL, realloc here? */ + return buffer; + } + } + + errno = ENOMEM; /* actually, algorithm failure */ + + error: + if ( buf == NULL ) + free( (pointer)buffer ); + + return NULL; + } + diff --git a/dmake/unix/solaris/gnu/config.mk b/dmake/unix/solaris/gnu/config.mk new file mode 100644 index 000000000000..f6f4f2c68cbc --- /dev/null +++ b/dmake/unix/solaris/gnu/config.mk @@ -0,0 +1,8 @@ +# This is the Solaris gcc configuration file for DMAKE +# It modifies the value of CC to be gcc +# + +CC = gcc + +# disable a gcc bug when compiling runargv.c +runargv.o ?= CFLAGS += -g diff --git a/dmake/unix/solaris/gnu/make.sh b/dmake/unix/solaris/gnu/make.sh new file mode 100644 index 000000000000..10a50a837dfa --- /dev/null +++ b/dmake/unix/solaris/gnu/make.sh @@ -0,0 +1,64 @@ +mkdir objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O infer.c +mv infer.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O make.c +mv make.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O stat.c +mv stat.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O expand.c +mv expand.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmstring.c +mv dmstring.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O hash.c +mv hash.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dag.c +mv dag.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmake.c +mv dmake.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O path.c +mv path.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O imacs.c +mv imacs.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O sysintf.c +mv sysintf.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O parse.c +mv parse.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O getinp.c +mv getinp.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O quit.c +mv quit.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O state.c +mv state.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmdump.c +mv dmdump.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O macparse.c +mv macparse.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O rulparse.c +mv rulparse.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O percent.c +mv percent.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O function.c +mv function.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/arlib.c +mv arlib.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dirbrk.c +mv dirbrk.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/rmprq.c +mv rmprq.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/ruletab.c +mv ruletab.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O -g unix/runargv.c +mv runargv.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dcache.c +mv dcache.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/tempnam.c +mv tempnam.o objects +gcc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/getcwd.c +mv getcwd.o objects +gcc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/tempnam.o objects/getcwd.o +cp unix/solaris/gnu/template.mk startup/config.mk diff --git a/dmake/unix/solaris/gnu/public.h b/dmake/unix/solaris/gnu/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/solaris/gnu/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/solaris/gnu/template.mk b/dmake/unix/solaris/gnu/template.mk new file mode 100644 index 000000000000..3f9282027c5c --- /dev/null +++ b/dmake/unix/solaris/gnu/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= solaris + OSENVIRONMENT *:= gnu diff --git a/dmake/unix/solaris/make.sh b/dmake/unix/solaris/make.sh new file mode 100644 index 000000000000..21894778a642 --- /dev/null +++ b/dmake/unix/solaris/make.sh @@ -0,0 +1,64 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/tempnam.c +mv tempnam.o objects +cc -c -I. -Iunix -Iunix/solaris -DSolaris -O unix/solaris/getcwd.c +mv getcwd.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/tempnam.o objects/getcwd.o +cp unix/solaris/template.mk startup/config.mk diff --git a/dmake/unix/solaris/public.h b/dmake/unix/solaris/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/solaris/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/solaris/template.mk b/dmake/unix/solaris/template.mk new file mode 100644 index 000000000000..233917a6ba92 --- /dev/null +++ b/dmake/unix/solaris/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= solaris + OSENVIRONMENT *:= diff --git a/dmake/unix/solaris/tempnam.c b/dmake/unix/solaris/tempnam.c new file mode 100644 index 000000000000..56f23fbe21d4 --- /dev/null +++ b/dmake/unix/solaris/tempnam.c @@ -0,0 +1,103 @@ +/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- +-- SYNOPSIS +-- tempnam +-- +-- DESCRIPTION +-- temp file name generation routines. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#define max(A,B) (((A)<(B))?(B):(A)) + +extern char *mktemp(); +extern int access(); + +static char *cpdir(); +static char seed[4]="AAA"; + +/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */ +#ifndef P_tmpdir +static char *P_tmpdir = "/tmp"; +#endif + +char * +tempnam(dir, prefix) +const char *dir; /* use this directory please (if non-NULL) */ +const char *prefix; /* use this (if non-NULL) as filename prefix */ +{ + register char *p, *q, *tmpdir; + int tl=0, dl=0, pl; + + pl = strlen(P_tmpdir); + + if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); + if( dir != NULL ) dl = strlen(dir); + + if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL ) + return(NULL); + + *p = '\0'; + + if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) ) + if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) ) + if( access( cpdir(p, P_tmpdir), 3) != 0 ) + if( access( cpdir(p, "/tmp"), 3) != 0 ) + return(NULL); + + (void) strcat(p, "/"); + if(prefix) + { + *(p+strlen(p)+5) = '\0'; + (void)strncat(p, prefix, 5); + } + + (void)strcat(p, seed); + (void)strcat(p, "XXXXXX"); + + q = seed; + while(*q == 'Z') *q++ = 'A'; + ++*q; + + if(*mktemp(p) == '\0') return(NULL); + return(p); +} + + + +static char * +cpdir(buf, str) +char *buf; +char *str; +{ + char *p; + + if(str != NULL) + { + (void) strcpy(buf, str); + p = buf - 1 + strlen(buf); + if(*p == '/') *p = '\0'; + } + + return(buf); +} diff --git a/dmake/unix/startup.h b/dmake/unix/startup.h new file mode 100644 index 000000000000..b445a86cecef --- /dev/null +++ b/dmake/unix/startup.h @@ -0,0 +1,27 @@ +/* RCS $Id: startup.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Definition of MAKESTARTUP +-- +-- DESCRIPTION +-- Default MAKESTARTUP value defining where dmake locates the +-- startup file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +"MAKESTARTUP := $(DMAKEROOT)/startup.mk", diff --git a/dmake/unix/sysintf.h b/dmake/unix/sysintf.h new file mode 100644 index 000000000000..36bf60c559ee --- /dev/null +++ b/dmake/unix/sysintf.h @@ -0,0 +1,51 @@ +/* RCS $Id: sysintf.h,v 1.1.1.1 2000-09-22 15:33:33 hr Exp $ +-- +-- SYNOPSIS +-- Interfaces for sysintf.c +-- +-- DESCRIPTION +-- Abstractions of functions in sysintf.c +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#define DMSTAT stat +#define VOID_LCACHE(l,m) (void) void_lcache(l,m) +#define Hook_std_writes(A) +#define GETPID getpid() +#define DMSTRLWR(A,B) + +#ifndef S_IFDIR +#define S_IFDIR 0040000 +#endif + +#ifndef S_IFMT +#define S_IFMT 0170000 +#endif + +/* +** standard C items +*/ + +/* +** DOS interface standard items +*/ +#define getswitchar() '-' + +/* +** Make parameters +*/ diff --git a/dmake/unix/sysvr1/config.mk b/dmake/unix/sysvr1/config.mk new file mode 100644 index 000000000000..d1cd2d8810f5 --- /dev/null +++ b/dmake/unix/sysvr1/config.mk @@ -0,0 +1,28 @@ +# This is the SysV R3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := vfprintf.c + +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/sysvr1/make.sh b/dmake/unix/sysvr1/make.sh new file mode 100644 index 000000000000..1db251f3361e --- /dev/null +++ b/dmake/unix/sysvr1/make.sh @@ -0,0 +1,62 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/sysvr1 -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/sysvr1 -O unix/sysvr1/vfprintf.c +mv vfprintf.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/vfprintf.o +cp unix/sysvr1/template.mk startup/config.mk diff --git a/dmake/unix/sysvr1/public.h b/dmake/unix/sysvr1/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/sysvr1/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/sysvr1/putenv.c b/dmake/unix/sysvr1/putenv.c new file mode 100644 index 000000000000..1453852710c2 --- /dev/null +++ b/dmake/unix/sysvr1/putenv.c @@ -0,0 +1,78 @@ +/* RCS $Id: putenv.c,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- +-- SYNOPSIS +-- My own putenv for BSD like systems. +-- +-- DESCRIPTION +-- This originally came from MKS, but I rewrote it to fix a bug with +-- replacing existing strings, probably never happened but the code +-- was wrong nonetheless. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <stdio.h> +#include <string.h> + +int +putenv( str )/* +=============== + Take a string of the form NAME=value and stick it into the environment. + We do this by allocating a new set of pointers if we have to add a new + string and by replacing an existing pointer if the value replaces the value + of an existing string. */ +char *str; +{ + extern char **environ; /* The current environment. */ + static char **ourenv = NULL; /* A new environment */ + register char **p; + register char *q; + int size; + + /* First search the current environment and see if we can replace a + * string. */ + for( p=environ; *p; p++ ) { + register char *s = str; + + for( q = *p; *q && *s && *s == *q; q++, s++ ) + if( *s == '=' ) { + *p = str; + return(0); /* replaced it so go away */ + } + } + + /* Ok, can't replace a string so need to grow the environment. */ + size = p - environ + 2; /* size of new environment */ + /* size of old is size-1 */ + + /* It's the first time, so allocate a new environment since we don't know + * where the old one is comming from. */ + if( ourenv == NULL ) { + if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL ) + return(1); + + memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) ); + } + else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL ) + return(1); + + ourenv[--size] = NULL; + ourenv[--size] = str; + + environ = ourenv; + return(0); +} diff --git a/dmake/unix/sysvr1/stdlib.h b/dmake/unix/sysvr1/stdlib.h new file mode 100644 index 000000000000..3b612c2fd601 --- /dev/null +++ b/dmake/unix/sysvr1/stdlib.h @@ -0,0 +1,44 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); +extern free(); +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/sysvr1/template.mk b/dmake/unix/sysvr1/template.mk new file mode 100644 index 000000000000..4eb40febb3a1 --- /dev/null +++ b/dmake/unix/sysvr1/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= sysvr1 + OSENVIRONMENT *:= diff --git a/dmake/unix/sysvr1/time.h b/dmake/unix/sysvr1/time.h new file mode 100644 index 000000000000..3b3dfac5684f --- /dev/null +++ b/dmake/unix/sysvr1/time.h @@ -0,0 +1,32 @@ +/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- +-- SYNOPSIS +-- time_t +-- +-- DESCRIPTION +-- Properly define time_t. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef TIME_h +#define TIME_h + +typedef long time_t; /* this is the thing we use */ + +#endif TIME_h + diff --git a/dmake/unix/sysvr1/vfprintf.c b/dmake/unix/sysvr1/vfprintf.c new file mode 100644 index 000000000000..1d24a1c19b08 --- /dev/null +++ b/dmake/unix/sysvr1/vfprintf.c @@ -0,0 +1,58 @@ +/* From: + * John Limpert johnl@gronk.UUCP uunet!n3dmc!gronk!johnl + */ + +#include <stdio.h> +#include <varargs.h> + +#ifndef BUFSIZ +#include <stdio.h> +#endif + +#ifndef va_dcl +#include <varargs.h> +#endif + +int +vsprintf(str, fmt, ap) + char *str, *fmt; + va_list ap; +{ + FILE f; + int len; + + f._flag = _IOWRT+_IOMYBUF; + f._ptr = (char *)str; /* My copy of BSD stdio.h has this as (char *) + * with a comment that it should be + * (unsigned char *). Since this code is + * intended for use on a vanilla BSD system, + * we'll stick with (char *) for now. + */ + f._cnt = 32767; + len = _doprnt(fmt, ap, &f); + *f._ptr = 0; + return (len); +} + +int +vfprintf(iop, fmt, ap) + FILE *iop; + char *fmt; + va_list ap; +{ + int len; + + len = _doprnt(fmt, ap, iop); + return (ferror(iop) ? EOF : len); +} + +int +vprintf(fmt, ap) + char *fmt; + va_list ap; +{ + int len; + + len = _doprnt(fmt, ap, stdout); + return (ferror(stdout) ? EOF : len); +} diff --git a/dmake/unix/sysvr3/config.mk b/dmake/unix/sysvr3/config.mk new file mode 100644 index 000000000000..75bcf3c2a211 --- /dev/null +++ b/dmake/unix/sysvr3/config.mk @@ -0,0 +1,27 @@ +# This is the SysV R3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/sysvr3/gnu/public.h b/dmake/unix/sysvr3/gnu/public.h new file mode 100644 index 000000000000..d5c3111d1345 --- /dev/null +++ b/dmake/unix/sysvr3/gnu/public.h @@ -0,0 +1,162 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +int Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +int Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/sysvr3/make.sh b/dmake/unix/sysvr3/make.sh new file mode 100644 index 000000000000..505670f8b708 --- /dev/null +++ b/dmake/unix/sysvr3/make.sh @@ -0,0 +1,60 @@ +mkdir objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O infer.c +mv infer.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O make.c +mv make.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O stat.c +mv stat.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O expand.c +mv expand.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O dmstring.c +mv dmstring.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O hash.c +mv hash.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O dag.c +mv dag.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O dmake.c +mv dmake.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O path.c +mv path.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O imacs.c +mv imacs.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O sysintf.c +mv sysintf.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O parse.c +mv parse.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O getinp.c +mv getinp.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O quit.c +mv quit.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O state.c +mv state.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O dmdump.c +mv dmdump.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O macparse.c +mv macparse.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O rulparse.c +mv rulparse.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O percent.c +mv percent.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O function.c +mv function.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/arlib.c +mv arlib.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/dirbrk.c +mv dirbrk.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/rmprq.c +mv rmprq.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/ruletab.c +mv ruletab.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/runargv.c +mv runargv.o objects +gcc -c -I. -Iunix -Iunix/sysvr3 -O unix/dcache.c +mv dcache.o objects +gcc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/sysvr3/template.mk startup/config.mk diff --git a/dmake/unix/sysvr3/public.h b/dmake/unix/sysvr3/public.h new file mode 100644 index 000000000000..01e80862fbbd --- /dev/null +++ b/dmake/unix/sysvr3/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/sysvr3/pwd/config.mk b/dmake/unix/sysvr3/pwd/config.mk new file mode 100644 index 000000000000..86c535a64c1d --- /dev/null +++ b/dmake/unix/sysvr3/pwd/config.mk @@ -0,0 +1,20 @@ +# This is the Sys VR3 PWD configuration file. It configures SysvR3 unix +# versions of dmake to use a provided version of getcwd rather than the +# standard library version that uses popen to capture the output of pwd. +# + +osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) + +# The following are required sources +OSRESRC := getcwd.c + +.IF $(OSRESRC) + SRC += $(OSRESRC) + .SETDIR=$(osredir) : $(OSRESRC) +.END + +.SOURCE.h : $(osredir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osredir) diff --git a/dmake/unix/sysvr3/pwd/getcwd.c b/dmake/unix/sysvr3/pwd/getcwd.c new file mode 100644 index 000000000000..f2359bcc795b --- /dev/null +++ b/dmake/unix/sysvr3/pwd/getcwd.c @@ -0,0 +1,231 @@ +/* + getcwd -- get pathname of current working directory + + public-domain implementation + + last edit: 03-Nov-1990 Gwyn@BRL.MIL + + complies with the following standards: + IEEE Std 1003.1-1988 + SVID Issue 3 + X/Open Portability Guide Issue 2 (when "XPG2" is defined) + X/Open Portability Guide Issue 3 + + This implementation of getcwd() can be used to replace the UNIX + System V library routine (which uses popen() to capture the output of + the "pwd" command). Once that is done, "pwd" can be reimplemented as + just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below. + + This implementation depends on every directory having entries for + "." and "..". It also depends on the internals of the <dirent.h> + data structures to some degree. + + I considered using chdir() to ascend the hierarchy, followed by a + final chdir() to the path being returned by getcwd() to restore the + location, but decided that error recovery was too difficult that way. + The algorithm I settled on was inspired by my rewrite of the "pwd" + utility, combined with the dotdots[] array trick from the SVR2 shell. +*/ +#define XPG2 /* define to support obsolete XPG2-mandated feature */ + + +#include <sys/types.h> +#include <sys/stat.h> + +#ifdef M_XENIX +# include <sys/ndir.h> +# define dirent direct +#else +# include <dirent.h> +#endif + +#include <errno.h> +#include <string.h> + +typedef char *pointer; /* (void *) if you have it */ + +extern void free(); +extern pointer malloc(); +extern int fstat(), stat(); + +extern int errno; /* normally done by <errno.h> */ + +#ifndef NULL +#define NULL 0 /* amorphous null pointer constant */ +#endif + +#ifndef NAME_MAX +#define NAME_MAX 255 /* maximum directory entry size */ +#endif + + +char * +getcwd( buf, size ) /* returns pointer to CWD pathname */ + char *buf; /* where to put name (NULL to malloc) */ + int size; /* size of buf[] or malloc()ed memory */ + { + static char dotdots[] = +"../../../../../../../../../../../../../../../../../../../../../../../../../.."; + char *dotdot; /* -> dotdots[.], right to left */ + DIR *dirp; /* -> parent directory stream */ + struct dirent *dir; /* -> directory entry */ + struct stat stat1, + stat2; /* info from stat() */ + struct stat *d = &stat1; /* -> info about "." */ + struct stat *dd = &stat2; /* -> info about ".." */ + register char *buffer; /* local copy of buf, or malloc()ed */ + char *bufend; /* -> buffer[size] */ + register char *endp; /* -> end of reversed string */ + register char *dname; /* entry name ("" for root) */ + int serrno = errno; /* save entry errno */ + + if ( buf != NULL && size <= 0 +#ifndef XPG2 + || buf == NULL +#endif + ) { + errno = EINVAL; /* invalid argument */ + return NULL; + } + + buffer = buf; +#ifdef XPG2 + if ( buf == NULL /* wants us to malloc() the string */ + && (buffer = (char *) malloc( (unsigned) size )) == NULL + /* XXX -- actually should probably not pay attention to "size" arg */ + ) { + errno = ENOMEM; /* cannot malloc() specified size */ + return NULL; + } +#endif + + if ( stat( ".", dd ) != 0 ) /* prime the pump */ + goto error; /* errno already set */ + + endp = buffer; /* initially, empty string */ + bufend = &buffer[size]; + + for ( dotdot = &dotdots[sizeof dotdots]; dotdot != dotdots; ) + { + dotdot -= 3; /* include one more "/.." section */ + /* (first time is actually "..") */ + + /* swap stat() info buffers */ + { + register struct stat *temp = d; + + d = dd; /* new current dir is old parent dir */ + dd = temp; + } + + if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */ + goto error; /* errno already set */ + + if ( fstat( dirp->dd_fd, dd ) != 0 ) + { + serrno = errno; /* set by fstat() */ + (void)closedir( dirp ); + errno = serrno; /* in case closedir() clobbered it */ + goto error; + } + + if ( d->st_dev == dd->st_dev ) + { /* not crossing a mount point */ + if ( d->st_ino == dd->st_ino ) + { /* root directory */ + dname = ""; + goto append; + } + + do + if ( (dir = readdir( dirp )) == NULL ) + { + (void)closedir( dirp ); + errno = ENOENT; /* missing entry */ + goto error; + } + while ( dir->d_ino != d->st_ino ); + } + else { /* crossing a mount point */ + struct stat t; /* info re. test entry */ + char name[sizeof dotdots + 1 + NAME_MAX]; + + (void)strcpy( name, dotdot ); + dname = &name[strlen( name )]; + *dname++ = '/'; + + do { + if ( (dir = readdir( dirp )) == NULL ) + { + (void)closedir( dirp ); + errno = ENOENT; /* missing entry */ + goto error; + } + + (void)strcpy( dname, dir->d_name ); + /* must fit if NAME_MAX is not a lie */ + } + while ( stat( name, &t ) != 0 + || t.st_ino != d->st_ino + || t.st_dev != d->st_dev + ); + } + + dname = dir->d_name; + + /* append "/" and reversed dname string onto buffer */ + append: + if ( endp != buffer /* avoid trailing / in final name */ + || dname[0] == '\0' /* but allow "/" when CWD is root */ + ) + *endp++ = '/'; + + { + register char *app; /* traverses dname string */ + + for ( app = dname; *app != '\0'; ++app ) + ; + + if ( app - dname >= bufend - endp ) + { + (void)closedir( dirp ); + errno = ERANGE; /* won't fit allotted space */ + goto error; + } + + while ( app != dname ) + *endp++ = *--app; + } + + (void)closedir( dirp ); + + if ( dname[0] == '\0' ) /* reached root; wrap it up */ + { + register char *startp; /* -> buffer[.] */ + + *endp = '\0'; /* plant null terminator */ + + /* straighten out reversed pathname string */ + for ( startp = buffer; --endp > startp; ++startp ) + { + char temp = *endp; + + *endp = *startp; + *startp = temp; + } + + errno = serrno; /* restore entry errno */ + /* XXX -- if buf==NULL, realloc here? */ + return buffer; + } + } + + errno = ENOMEM; /* actually, algorithm failure */ + + error: + if ( buf == NULL ) + free( (pointer)buffer ); + + return NULL; + } + diff --git a/dmake/unix/sysvr3/pwd/make.sh b/dmake/unix/sysvr3/pwd/make.sh new file mode 100644 index 000000000000..1f57569f61df --- /dev/null +++ b/dmake/unix/sysvr3/pwd/make.sh @@ -0,0 +1,62 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/sysvr3 -Iunix/sysvr3/pwd -O unix/sysvr3/pwd/getcwd.c +mv getcwd.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/getcwd.o +cp unix/sysvr3/pwd/template.mk startup/config.mk diff --git a/dmake/unix/sysvr3/pwd/public.h b/dmake/unix/sysvr3/pwd/public.h new file mode 100644 index 000000000000..ea923dad37d1 --- /dev/null +++ b/dmake/unix/sysvr3/pwd/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/sysvr3/pwd/template.mk b/dmake/unix/sysvr3/pwd/template.mk new file mode 100644 index 000000000000..fa6b4aa6bd1b --- /dev/null +++ b/dmake/unix/sysvr3/pwd/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= sysvr3 + OSENVIRONMENT *:= pwd diff --git a/dmake/unix/sysvr3/stdlib.h b/dmake/unix/sysvr3/stdlib.h new file mode 100644 index 000000000000..077123d5494f --- /dev/null +++ b/dmake/unix/sysvr3/stdlib.h @@ -0,0 +1,55 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +#ifndef _AIX +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); + +/* The AIX compiler dies on illegal redefinition of free */ +extern free(); +#endif + +/* AIX doesn't use NAME_MAX anylonger... */ +#ifdef _AIX +#include <unistd.h> +#define NAME_MAX pathconf("/dev/null",_PC_NAME_MAX) +#endif + +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/sysvr3/template.mk b/dmake/unix/sysvr3/template.mk new file mode 100644 index 000000000000..3cb518671142 --- /dev/null +++ b/dmake/unix/sysvr3/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= sysvr3 + OSENVIRONMENT *:= diff --git a/dmake/unix/sysvr3/time.h b/dmake/unix/sysvr3/time.h new file mode 100644 index 000000000000..3b3dfac5684f --- /dev/null +++ b/dmake/unix/sysvr3/time.h @@ -0,0 +1,32 @@ +/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:35 hr Exp $ +-- +-- SYNOPSIS +-- time_t +-- +-- DESCRIPTION +-- Properly define time_t. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef TIME_h +#define TIME_h + +typedef long time_t; /* this is the thing we use */ + +#endif TIME_h + diff --git a/dmake/unix/sysvr4/config.mk b/dmake/unix/sysvr4/config.mk new file mode 100644 index 000000000000..6443ff6a91c9 --- /dev/null +++ b/dmake/unix/sysvr4/config.mk @@ -0,0 +1,27 @@ +# This is the SysV R4 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/sysvr4/make.sh b/dmake/unix/sysvr4/make.sh new file mode 100644 index 000000000000..9ab5904422f0 --- /dev/null +++ b/dmake/unix/sysvr4/make.sh @@ -0,0 +1,60 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/sysvr4 -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/sysvr4 -O unix/dcache.c +mv dcache.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/sysvr4/template.mk startup/config.mk diff --git a/dmake/unix/sysvr4/public.h b/dmake/unix/sysvr4/public.h new file mode 100644 index 000000000000..ea923dad37d1 --- /dev/null +++ b/dmake/unix/sysvr4/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/sysvr4/template.mk b/dmake/unix/sysvr4/template.mk new file mode 100644 index 000000000000..553878268e59 --- /dev/null +++ b/dmake/unix/sysvr4/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= sysvr4 + OSENVIRONMENT *:= diff --git a/dmake/unix/xenix/config.mk b/dmake/unix/xenix/config.mk new file mode 100644 index 000000000000..a4f8f78f3ee1 --- /dev/null +++ b/dmake/unix/xenix/config.mk @@ -0,0 +1,27 @@ +# This is the SysV R3 UNIX configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following are required sources +OSDSRC := +.IF $(OSDSRC) + SRC += $(OSDSRC) + .SETDIR=$(osrdir) : $(OSDSRC) +.END + +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osrdir) -DM_XENIX + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/unix/xenix/make.sh b/dmake/unix/xenix/make.sh new file mode 100644 index 000000000000..597936f38061 --- /dev/null +++ b/dmake/unix/xenix/make.sh @@ -0,0 +1,60 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -O unix/dcache.c +mv dcache.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o +cp unix/xenix/template.mk startup/config.mk diff --git a/dmake/unix/xenix/public.h b/dmake/unix/xenix/public.h new file mode 100644 index 000000000000..ea923dad37d1 --- /dev/null +++ b/dmake/unix/xenix/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/xenix/pwd/config.mk b/dmake/unix/xenix/pwd/config.mk new file mode 100644 index 000000000000..095ff3587a68 --- /dev/null +++ b/dmake/unix/xenix/pwd/config.mk @@ -0,0 +1,23 @@ +# This is the Sys VR3 PWD configuration file. It configures SysvR3 unix +# versions of dmake to use a provided version of getcwd rather than the +# standard library version that uses popen to capture the output of pwd. +# + +osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) + +# The following are required sources +OSRESRC := getcwd.c + +.IF $(OSRESRC) + SRC += $(OSRESRC) + .SETDIR=$(osredir) : $(OSRESRC) +.END + +.SOURCE.h : $(osredir) + +# Local configuration modifications for CFLAGS, there's local SysV includes +# too. +CFLAGS += -I$(osredir) + +# Xenix needs -lx in order to link successfully. +LDLIBS += -lx diff --git a/dmake/unix/xenix/pwd/getcwd.c b/dmake/unix/xenix/pwd/getcwd.c new file mode 100644 index 000000000000..f2359bcc795b --- /dev/null +++ b/dmake/unix/xenix/pwd/getcwd.c @@ -0,0 +1,231 @@ +/* + getcwd -- get pathname of current working directory + + public-domain implementation + + last edit: 03-Nov-1990 Gwyn@BRL.MIL + + complies with the following standards: + IEEE Std 1003.1-1988 + SVID Issue 3 + X/Open Portability Guide Issue 2 (when "XPG2" is defined) + X/Open Portability Guide Issue 3 + + This implementation of getcwd() can be used to replace the UNIX + System V library routine (which uses popen() to capture the output of + the "pwd" command). Once that is done, "pwd" can be reimplemented as + just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below. + + This implementation depends on every directory having entries for + "." and "..". It also depends on the internals of the <dirent.h> + data structures to some degree. + + I considered using chdir() to ascend the hierarchy, followed by a + final chdir() to the path being returned by getcwd() to restore the + location, but decided that error recovery was too difficult that way. + The algorithm I settled on was inspired by my rewrite of the "pwd" + utility, combined with the dotdots[] array trick from the SVR2 shell. +*/ +#define XPG2 /* define to support obsolete XPG2-mandated feature */ + + +#include <sys/types.h> +#include <sys/stat.h> + +#ifdef M_XENIX +# include <sys/ndir.h> +# define dirent direct +#else +# include <dirent.h> +#endif + +#include <errno.h> +#include <string.h> + +typedef char *pointer; /* (void *) if you have it */ + +extern void free(); +extern pointer malloc(); +extern int fstat(), stat(); + +extern int errno; /* normally done by <errno.h> */ + +#ifndef NULL +#define NULL 0 /* amorphous null pointer constant */ +#endif + +#ifndef NAME_MAX +#define NAME_MAX 255 /* maximum directory entry size */ +#endif + + +char * +getcwd( buf, size ) /* returns pointer to CWD pathname */ + char *buf; /* where to put name (NULL to malloc) */ + int size; /* size of buf[] or malloc()ed memory */ + { + static char dotdots[] = +"../../../../../../../../../../../../../../../../../../../../../../../../../.."; + char *dotdot; /* -> dotdots[.], right to left */ + DIR *dirp; /* -> parent directory stream */ + struct dirent *dir; /* -> directory entry */ + struct stat stat1, + stat2; /* info from stat() */ + struct stat *d = &stat1; /* -> info about "." */ + struct stat *dd = &stat2; /* -> info about ".." */ + register char *buffer; /* local copy of buf, or malloc()ed */ + char *bufend; /* -> buffer[size] */ + register char *endp; /* -> end of reversed string */ + register char *dname; /* entry name ("" for root) */ + int serrno = errno; /* save entry errno */ + + if ( buf != NULL && size <= 0 +#ifndef XPG2 + || buf == NULL +#endif + ) { + errno = EINVAL; /* invalid argument */ + return NULL; + } + + buffer = buf; +#ifdef XPG2 + if ( buf == NULL /* wants us to malloc() the string */ + && (buffer = (char *) malloc( (unsigned) size )) == NULL + /* XXX -- actually should probably not pay attention to "size" arg */ + ) { + errno = ENOMEM; /* cannot malloc() specified size */ + return NULL; + } +#endif + + if ( stat( ".", dd ) != 0 ) /* prime the pump */ + goto error; /* errno already set */ + + endp = buffer; /* initially, empty string */ + bufend = &buffer[size]; + + for ( dotdot = &dotdots[sizeof dotdots]; dotdot != dotdots; ) + { + dotdot -= 3; /* include one more "/.." section */ + /* (first time is actually "..") */ + + /* swap stat() info buffers */ + { + register struct stat *temp = d; + + d = dd; /* new current dir is old parent dir */ + dd = temp; + } + + if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */ + goto error; /* errno already set */ + + if ( fstat( dirp->dd_fd, dd ) != 0 ) + { + serrno = errno; /* set by fstat() */ + (void)closedir( dirp ); + errno = serrno; /* in case closedir() clobbered it */ + goto error; + } + + if ( d->st_dev == dd->st_dev ) + { /* not crossing a mount point */ + if ( d->st_ino == dd->st_ino ) + { /* root directory */ + dname = ""; + goto append; + } + + do + if ( (dir = readdir( dirp )) == NULL ) + { + (void)closedir( dirp ); + errno = ENOENT; /* missing entry */ + goto error; + } + while ( dir->d_ino != d->st_ino ); + } + else { /* crossing a mount point */ + struct stat t; /* info re. test entry */ + char name[sizeof dotdots + 1 + NAME_MAX]; + + (void)strcpy( name, dotdot ); + dname = &name[strlen( name )]; + *dname++ = '/'; + + do { + if ( (dir = readdir( dirp )) == NULL ) + { + (void)closedir( dirp ); + errno = ENOENT; /* missing entry */ + goto error; + } + + (void)strcpy( dname, dir->d_name ); + /* must fit if NAME_MAX is not a lie */ + } + while ( stat( name, &t ) != 0 + || t.st_ino != d->st_ino + || t.st_dev != d->st_dev + ); + } + + dname = dir->d_name; + + /* append "/" and reversed dname string onto buffer */ + append: + if ( endp != buffer /* avoid trailing / in final name */ + || dname[0] == '\0' /* but allow "/" when CWD is root */ + ) + *endp++ = '/'; + + { + register char *app; /* traverses dname string */ + + for ( app = dname; *app != '\0'; ++app ) + ; + + if ( app - dname >= bufend - endp ) + { + (void)closedir( dirp ); + errno = ERANGE; /* won't fit allotted space */ + goto error; + } + + while ( app != dname ) + *endp++ = *--app; + } + + (void)closedir( dirp ); + + if ( dname[0] == '\0' ) /* reached root; wrap it up */ + { + register char *startp; /* -> buffer[.] */ + + *endp = '\0'; /* plant null terminator */ + + /* straighten out reversed pathname string */ + for ( startp = buffer; --endp > startp; ++startp ) + { + char temp = *endp; + + *endp = *startp; + *startp = temp; + } + + errno = serrno; /* restore entry errno */ + /* XXX -- if buf==NULL, realloc here? */ + return buffer; + } + } + + errno = ENOMEM; /* actually, algorithm failure */ + + error: + if ( buf == NULL ) + free( (pointer)buffer ); + + return NULL; + } + diff --git a/dmake/unix/xenix/pwd/make.sh b/dmake/unix/xenix/pwd/make.sh new file mode 100644 index 000000000000..e7c02e53ace6 --- /dev/null +++ b/dmake/unix/xenix/pwd/make.sh @@ -0,0 +1,62 @@ +mkdir objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O infer.c +mv infer.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O make.c +mv make.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O stat.c +mv stat.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O expand.c +mv expand.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dmstring.c +mv dmstring.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O hash.c +mv hash.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dag.c +mv dag.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dmake.c +mv dmake.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O path.c +mv path.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O imacs.c +mv imacs.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O sysintf.c +mv sysintf.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O parse.c +mv parse.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O getinp.c +mv getinp.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O quit.c +mv quit.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O state.c +mv state.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O dmdump.c +mv dmdump.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O macparse.c +mv macparse.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O rulparse.c +mv rulparse.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O percent.c +mv percent.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O function.c +mv function.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/arlib.c +mv arlib.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/dirbrk.c +mv dirbrk.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/rmprq.c +mv rmprq.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/ruletab.c +mv ruletab.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/runargv.c +mv runargv.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/dcache.c +mv dcache.o objects +cc -c -I. -Iunix -Iunix/xenix -DM_XENIX -Iunix/xenix/pwd -O unix/xenix/pwd/getcwd.c +mv getcwd.o objects +cc -O -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o \ +objects/dmstring.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o \ +objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o \ +objects/quit.o objects/state.o objects/dmdump.o objects/macparse.o \ +objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o \ +objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/dcache.o objects/getcwd.o -lx +cp unix/xenix/pwd/template.mk startup/config.mk diff --git a/dmake/unix/xenix/pwd/public.h b/dmake/unix/xenix/pwd/public.h new file mode 100644 index 000000000000..ea923dad37d1 --- /dev/null +++ b/dmake/unix/xenix/pwd/public.h @@ -0,0 +1,164 @@ +/* RCS $Id: public.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +void main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); +char ** Pack_argv ANSI((int, int, char *)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)())); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *, int)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI(()); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +time_t seek_arch ANSI((char *, char *)); +int If_root_path ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int runargv ANSI((CELLPTR, int, int, int, int, char *)); +int Wait_for_child ANSI((int, int)); +void Clean_up_processes ANSI(()); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/unix/xenix/pwd/template.mk b/dmake/unix/xenix/pwd/template.mk new file mode 100644 index 000000000000..abd4066c347b --- /dev/null +++ b/dmake/unix/xenix/pwd/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= xenix + OSENVIRONMENT *:= pwd diff --git a/dmake/unix/xenix/stdlib.h b/dmake/unix/xenix/stdlib.h new file mode 100644 index 000000000000..fe814c798a0b --- /dev/null +++ b/dmake/unix/xenix/stdlib.h @@ -0,0 +1,50 @@ +/* RCS $Id: stdlib.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $ +-- +-- SYNOPSIS +-- stdlib interface +-- +-- DESCRIPTION +-- Specially needed pieces of interface to the standard C lib. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + + +#ifndef _STDLIB_INCLUDED_ +#define _STDLIB_INCLUDED_ + +extern /*GOTO*/ _exit(); +extern /*GOTO*/ exit(); +extern /*GOTO*/ abort(); +extern int system(); +extern char *getenv(); +extern char *calloc(); +extern char *malloc(); +extern char *realloc(); + +#ifndef _AIX +/* The AIX compiler dies on illegal redefinition of free */ +extern free(); +#endif + +extern int errno; + +#ifndef EIO +# include <errno.h> +#endif + +#endif /* _STDLIB_INCLUDED_ */ diff --git a/dmake/unix/xenix/template.mk b/dmake/unix/xenix/template.mk new file mode 100644 index 000000000000..7ab223fbdb9f --- /dev/null +++ b/dmake/unix/xenix/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= unix + OSRELEASE *:= xenix + OSENVIRONMENT *:= diff --git a/dmake/unix/xenix/time.h b/dmake/unix/xenix/time.h new file mode 100644 index 000000000000..c7102cfc18cb --- /dev/null +++ b/dmake/unix/xenix/time.h @@ -0,0 +1,32 @@ +/* RCS $Id: time.h,v 1.1.1.1 2000-09-22 15:33:36 hr Exp $ +-- +-- SYNOPSIS +-- time_t +-- +-- DESCRIPTION +-- Properly define time_t. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef TIME_h +#define TIME_h + +typedef long time_t; /* this is the thing we use */ + +#endif TIME_h + |