Changeset 27 in kBuild
- Timestamp:
- Nov 27, 2002 12:35:20 AM (22 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/arch.c
r25 r27 98 98 #include <sys/time.h> 99 99 #include <sys/param.h> 100 # include <ctype.h>100 # include <ctype.h> 101 101 #include <ar.h> 102 #include <utime.h> 102 #if defined(__IBMC__) 103 # include <limits.h> 104 # include <sys/utime.h> 105 #else 106 # include <utime.h> 107 #endif 103 108 #include <stdio.h> 104 109 #include <stdlib.h> … … 107 112 #include "dir.h" 108 113 #include "config.h" 114 #if defined(__IBMC__) 115 # ifndef MAXPATHLEN 116 # define MAXPATHLEN _MAX_PATH 117 # endif 118 #endif 109 119 110 120 static Lst archives; /* Lst of archives we've already examined */ -
trunk/src/kmk/compat.c
r25 r27 62 62 #include <sys/types.h> 63 63 #include <sys/stat.h> 64 #ifdef __IBMC__ 65 #else 64 66 #include <sys/wait.h> 67 #endif 65 68 #include <ctype.h> 66 69 #include <errno.h> … … 86 89 static int CompatMake __P((ClientData, ClientData)); 87 90 88 static char *sh_builtin[] = { 89 "alias", "cd", "eval", "exec", "exit", "read", "set", "ulimit", 91 static char *sh_builtin[] = { 92 "alias", "cd", "eval", "exec", "exit", "read", "set", "ulimit", 90 93 "unalias", "umask", "unset", "wait", ":", 0}; 91 94 … … 343 346 } 344 347 345 /* 348 /* 346 349 * we need to print out the command associated with this Gnode in 347 350 * Targ_PrintCmd from Targ_PrintGraph when debugging at level g2, 348 351 * in main(), Fatal() and DieHorribly(), therefore do not free it 349 * when debugging. 352 * when debugging. 350 353 */ 351 354 if (!DEBUG(GRAPH2)) { -
trunk/src/kmk/job.c
r25 r27 108 108 #include <sys/types.h> 109 109 #include <sys/stat.h> 110 #include <sys/file.h> 111 #include <sys/time.h> 112 #include <sys/wait.h> 110 #if defined(__IBMC__) 111 # include <io.h> 112 # include <process.h> 113 # include <sys/utime.h> 114 #else 115 # include <sys/file.h> 116 #endif 117 # include <sys/time.h> 118 #if !defined(__IBMC__) 119 # include <sys/wait.h> 120 #endif 113 121 #include <fcntl.h> 114 122 #include <errno.h> 115 #include <utime.h> 123 #if !defined(__IBMC__) 124 # include <utime.h> 125 #endif 116 126 #include <stdio.h> 117 127 #include <string.h> … … 126 136 # define STATIC 127 137 #else 128 # define STATIC static 138 # if defined(__IBMC__) 139 # define STATIC 140 # else 141 # define STATIC static 142 # endif 129 143 #endif 130 144 … … 165 179 /* 166 180 * tfile is used to build temp file names to store shell commands to 167 * execute. 181 * execute. 168 182 */ 169 183 static char tfile[sizeof(TMPPAT)]; -
trunk/src/kmk/lst.lib/lstInt.h
r25 r27 51 51 struct ListNode *prevPtr; /* previous element in list */ 52 52 struct ListNode *nextPtr; /* next in list */ 53 #ifdef __IBMC__ 54 int useCount:8, /* Count of functions using the node. 55 * node may not be deleted until count 56 * goes to 0 */ 57 flags:8; /* Node status flags */ 58 #else 53 59 short useCount:8, /* Count of functions using the node. 54 60 * node may not be deleted until count 55 61 * goes to 0 */ 56 62 flags:8; /* Node status flags */ 63 #endif 57 64 ClientData datum; /* datum associated with this element */ 58 65 } *ListNode; -
trunk/src/kmk/main.c
r25 r27 79 79 */ 80 80 81 #ifdef USE_KLIB 82 #include <kLib/kLib.h> 83 #endif 84 81 85 #include <sys/types.h> 82 86 #include <sys/time.h> 83 87 #include <sys/param.h> 88 #if !defined(__IBMC__) 84 89 #include <sys/resource.h> 85 90 #include <sys/signal.h> 91 #endif 86 92 #include <sys/stat.h> 87 93 #if defined(__i386__) … … 89 95 #endif 90 96 #ifndef MACHINE 91 #include <sys/utsname.h> 92 #endif 97 # if !defined(__IBMC__) 98 # include <sys/utsname.h> 99 # endif 100 #endif 101 #if !defined(__IBMC__) 93 102 #include <sys/wait.h> 94 103 #include <err.h> 104 #endif 95 105 #include <stdlib.h> 96 106 #include <errno.h> 97 107 #include <fcntl.h> 98 108 #include <stdio.h> 109 #if !defined(__IBMC__) 99 110 #include <sysexits.h> 100 #ifdef __STDC__ 111 #endif 112 #if defined(__STDC__) || defined(__IBMC__) 101 113 #include <stdarg.h> 102 114 #else 103 115 #include <varargs.h> 116 #endif 117 #if defined(__IBMC__) 118 #include <io.h> 119 #include <direct.h> 120 #ifndef MAXPATHLEN 121 #define MAXPATHLEN _MAX_PATH 122 #endif 123 #ifndef EISDIR 124 #define EISDIR 21 /* unused in errno.h, defined like this in DDK header. */ 125 #endif 126 #ifndef S_ISDIR 127 #define S_IFMT (S_IFDIR | S_IFCHR | S_IFREG) 128 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) 129 #endif 104 130 #endif 105 131 #include "make.h" … … 629 655 630 656 #ifdef WANT_ENV_PWD 657 #ifdef USE_KLIB 658 kEnvSet("PWD", objdir); 659 #else 631 660 setenv("PWD", objdir, 1); 661 #endif 632 662 #endif 633 663 … … 791 821 if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p) 792 822 #ifdef POSIX 823 #ifdef USE_KLIB 824 kEnvSet("MAKEFLAGS", p); 825 #else 793 826 setenv("MAKEFLAGS", p, 1); 827 #endif 794 828 #else 829 #ifdef USE_KLIB 830 kEnvSet("MAKE", p); 831 #else 795 832 setenv("MAKE", p, 1); 833 #endif 796 834 #endif 797 835 efree(p1); … … 1131 1169 /* VARARGS */ 1132 1170 void 1133 #if def __STDC__1171 #if defined(__STDC__) || defined(__IBMC__) 1134 1172 Error(char *fmt, ...) 1135 1173 #else … … 1139 1177 { 1140 1178 va_list ap; 1141 #if def __STDC__1179 #if defined(__STDC__) || defined(__IBMC__) 1142 1180 va_start(ap, fmt); 1143 1181 #else … … 1166 1204 /* VARARGS */ 1167 1205 void 1168 #if def __STDC__1206 #if defined(__STDC__) || defined(__IBMC__) 1169 1207 Fatal(char *fmt, ...) 1170 1208 #else … … 1174 1212 { 1175 1213 va_list ap; 1176 #if def __STDC__1214 #if defined(__STDC__) || defined(__IBMC__) 1177 1215 va_start(ap, fmt); 1178 1216 #else … … 1208 1246 /* VARARGS */ 1209 1247 void 1210 #if def __STDC__1248 #if defined(__STDC__) || defined(__IBMC__) 1211 1249 Punt(char *fmt, ...) 1212 1250 #else … … 1216 1254 { 1217 1255 va_list ap; 1218 #if __STDC__1256 #if defined(__STDC__) || defined(__IBMC__) 1219 1257 va_start(ap, fmt); 1220 1258 #else -
trunk/src/kmk/make.h
r25 r27 54 54 #include <err.h> 55 55 56 #if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4) 56 #if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4) && !defined(__IBMC__) 57 57 # include <sys/cdefs.h> 58 58 #else 59 59 # ifndef __P 60 # if defined(__STDC__) || defined(__cplusplus) 60 /*kso: # if defined(__STDC__) || defined(__cplusplus) */ 61 # if defined(__STDC__) || defined(__cplusplus) || defined(__IBMC__) 61 62 # define __P(protos) protos /* full-blown ANSI C */ 62 63 # else … … 64 65 # endif 65 66 # endif 66 # ifndef __STDC__ 67 /*kso: # ifndef __STDC__*/ 68 # if !defined(__STDC__) && !defined(__IBMC__) 67 69 # ifndef const 68 70 # define const … … 74 76 #endif 75 77 76 #ifdef __STDC__ 78 #if defined(__IBMC__) 79 #include <stdlib.h> 80 #include <time.h> 81 /*#ifdef __STDC__*/ 82 #elif defined(__STDC__) 77 83 #include <stdlib.h> 78 84 #include <unistd.h> 79 85 #endif 86 80 87 #include "sprite.h" 81 88 #include "lst.h" … … 364 371 #define DEBUG_LOUD 0x0800 365 372 366 #ifdef __STDC__ 373 /*#ifdef __STDC__*/ 374 #if defined(__STDC__) || defined(__IBMC__) 367 375 #define CONCAT(a,b) a##b 368 376 #else … … 370 378 #define CONCAT(a,b) I(a)b 371 379 #endif /* __STDC__ */ 380 381 372 382 373 383 #define DEBUG(module) (debug & CONCAT(DEBUG_,module)) -
trunk/src/kmk/parse.c
r25 r27 88 88 */ 89 89 90 #if def __STDC__90 #if defined(__STDC__) || defined(__IBMC__) 91 91 #include <stdarg.h> 92 92 #else … … 315 315 /* VARARGS */ 316 316 void 317 #if def __STDC__317 #if defined(__STDC__) || defined(__IBMC__) 318 318 Parse_Error(int type, char *fmt, ...) 319 319 #else … … 323 323 { 324 324 va_list ap; 325 #if def __STDC__325 #if defined(__STDC__) || defined(__IBMC__) 326 326 va_start(ap, fmt); 327 327 #else … … 2422 2422 } else if (strncmp (cp, "error", 5) == 0) { 2423 2423 ParseDoError(cp + 5); 2424 goto nextLine; 2424 goto nextLine; 2425 2425 } else if (strncmp(cp, "undef", 5) == 0) { 2426 2426 char *cp2; -
trunk/src/kmk/var.c
r25 r27 88 88 */ 89 89 90 #ifdef USE_KLIB 91 #include <kLib/kLib.h> 92 #endif 93 90 94 #include <ctype.h> 91 95 #include <sys/types.h> … … 163 167 } VarPattern; 164 168 165 typedef struct { 166 regex_t re; 169 typedef struct { 170 regex_t re; 167 171 int nsub; 168 172 regmatch_t *matches; … … 309 313 } 310 314 if ((var == NILLNODE) && (flags & FIND_ENV)) { 311 char *env; 312 315 #ifdef USE_KLIB 316 const char *env; 317 if ((env = kEnvGet (name)) != NULL) { 318 #else 319 char *env; 313 320 if ((env = getenv (name)) != NULL) { 321 #endif 314 322 int len; 315 323 … … 493 501 */ 494 502 if (ctxt == VAR_CMD) { 503 #ifdef USE_KLIB 504 kEnvSet(name, val); 505 #else 495 506 setenv(name, val, 1); 507 #endif 496 508 } 497 509 } … … 1547 1559 Boolean rfree; 1548 1560 char* rval = Var_Parse(tstr, ctxt, err, &rlen, &rfree); 1549 1561 1550 1562 if (rval == var_Error) { 1551 1563 Fatal("Error expanding embedded variable.");
Note:
See TracChangeset
for help on using the changeset viewer.