VirtualBox

Changeset 27 in kBuild


Ignore:
Timestamp:
Nov 27, 2002 12:35:20 AM (22 years ago)
Author:
bird
Message:

OS2 / VAC308

Location:
trunk/src/kmk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/arch.c

    r25 r27  
    9898#include    <sys/time.h>
    9999#include    <sys/param.h>
    100 #include    <ctype.h>
     100# include    <ctype.h>
    101101#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
    103108#include    <stdio.h>
    104109#include    <stdlib.h>
     
    107112#include    "dir.h"
    108113#include    "config.h"
     114#if defined(__IBMC__)
     115# ifndef MAXPATHLEN
     116#  define MAXPATHLEN _MAX_PATH
     117# endif
     118#endif
    109119
    110120static Lst        archives;   /* Lst of archives we've already examined */
  • trunk/src/kmk/compat.c

    r25 r27  
    6262#include    <sys/types.h>
    6363#include    <sys/stat.h>
     64#ifdef __IBMC__
     65#else
    6466#include    <sys/wait.h>
     67#endif
    6568#include    <ctype.h>
    6669#include    <errno.h>
     
    8689static int CompatMake __P((ClientData, ClientData));
    8790
    88 static char *sh_builtin[] = { 
    89         "alias", "cd", "eval", "exec", "exit", "read", "set", "ulimit", 
     91static char *sh_builtin[] = {
     92        "alias", "cd", "eval", "exec", "exit", "read", "set", "ulimit",
    9093        "unalias", "umask", "unset", "wait", ":", 0};
    9194
     
    343346    }
    344347
    345     /* 
     348    /*
    346349     * we need to print out the command associated with this Gnode in
    347350     * Targ_PrintCmd from Targ_PrintGraph when debugging at level g2,
    348351     * in main(), Fatal() and DieHorribly(), therefore do not free it
    349      * when debugging. 
     352     * when debugging.
    350353     */
    351354    if (!DEBUG(GRAPH2)) {
  • trunk/src/kmk/job.c

    r25 r27  
    108108#include <sys/types.h>
    109109#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
    113121#include <fcntl.h>
    114122#include <errno.h>
    115 #include <utime.h>
     123#if !defined(__IBMC__)
     124# include <utime.h>
     125#endif
    116126#include <stdio.h>
    117127#include <string.h>
     
    126136# define STATIC
    127137#else
    128 # define STATIC static
     138# if defined(__IBMC__)
     139#  define STATIC
     140# else
     141#  define STATIC static
     142# endif
    129143#endif
    130144
     
    165179/*
    166180 * tfile is used to build temp file names to store shell commands to
    167  * execute. 
     181 * execute.
    168182 */
    169183static char     tfile[sizeof(TMPPAT)];
  • trunk/src/kmk/lst.lib/lstInt.h

    r25 r27  
    5151        struct ListNode *prevPtr;   /* previous element in list */
    5252        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
    5359        short           useCount:8, /* Count of functions using the node.
    5460                                     * node may not be deleted until count
    5561                                     * goes to 0 */
    5662                        flags:8;    /* Node status flags */
     63#endif
    5764        ClientData      datum;      /* datum associated with this element */
    5865} *ListNode;
  • trunk/src/kmk/main.c

    r25 r27  
    7979 */
    8080
     81#ifdef USE_KLIB
     82 #include <kLib/kLib.h>
     83#endif
     84
    8185#include <sys/types.h>
    8286#include <sys/time.h>
    8387#include <sys/param.h>
     88#if !defined(__IBMC__)
    8489#include <sys/resource.h>
    8590#include <sys/signal.h>
     91#endif
    8692#include <sys/stat.h>
    8793#if defined(__i386__)
     
    8995#endif
    9096#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__)
    93102#include <sys/wait.h>
    94103#include <err.h>
     104#endif
    95105#include <stdlib.h>
    96106#include <errno.h>
    97107#include <fcntl.h>
    98108#include <stdio.h>
     109#if !defined(__IBMC__)
    99110#include <sysexits.h>
    100 #ifdef __STDC__
     111#endif
     112#if defined(__STDC__) || defined(__IBMC__)
    101113#include <stdarg.h>
    102114#else
    103115#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
    104130#endif
    105131#include "make.h"
     
    629655
    630656#ifdef WANT_ENV_PWD
     657        #ifdef USE_KLIB
     658        kEnvSet("PWD", objdir);
     659        #else
    631660        setenv("PWD", objdir, 1);
     661        #endif
    632662#endif
    633663
     
    791821        if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p)
    792822#ifdef POSIX
     823                #ifdef USE_KLIB
     824                kEnvSet("MAKEFLAGS", p);
     825                #else
    793826                setenv("MAKEFLAGS", p, 1);
     827                #endif
    794828#else
     829                #ifdef USE_KLIB
     830                kEnvSet("MAKE", p);
     831                #else
    795832                setenv("MAKE", p, 1);
     833                #endif
    796834#endif
    797835        efree(p1);
     
    11311169/* VARARGS */
    11321170void
    1133 #ifdef __STDC__
     1171#if defined(__STDC__) || defined(__IBMC__)
    11341172Error(char *fmt, ...)
    11351173#else
     
    11391177{
    11401178        va_list ap;
    1141 #ifdef __STDC__
     1179#if defined(__STDC__) || defined(__IBMC__)
    11421180        va_start(ap, fmt);
    11431181#else
     
    11661204/* VARARGS */
    11671205void
    1168 #ifdef __STDC__
     1206#if defined(__STDC__) || defined(__IBMC__)
    11691207Fatal(char *fmt, ...)
    11701208#else
     
    11741212{
    11751213        va_list ap;
    1176 #ifdef __STDC__
     1214#if defined(__STDC__) || defined(__IBMC__)
    11771215        va_start(ap, fmt);
    11781216#else
     
    12081246/* VARARGS */
    12091247void
    1210 #ifdef __STDC__
     1248#if defined(__STDC__) || defined(__IBMC__)
    12111249Punt(char *fmt, ...)
    12121250#else
     
    12161254{
    12171255        va_list ap;
    1218 #if __STDC__
     1256#if defined(__STDC__) || defined(__IBMC__)
    12191257        va_start(ap, fmt);
    12201258#else
  • trunk/src/kmk/make.h

    r25 r27  
    5454#include <err.h>
    5555
    56 #if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4)
     56#if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4) && !defined(__IBMC__)
    5757# include <sys/cdefs.h>
    5858#else
    5959# ifndef __P
    60 #  if defined(__STDC__) || defined(__cplusplus)
     60/*kso: #  if defined(__STDC__) || defined(__cplusplus) */
     61#  if defined(__STDC__) || defined(__cplusplus) || defined(__IBMC__)
    6162#   define      __P(protos)     protos          /* full-blown ANSI C */
    6263#  else
     
    6465#  endif
    6566# endif
    66 # ifndef __STDC__
     67/*kso: # ifndef __STDC__*/
     68# if !defined(__STDC__) && !defined(__IBMC__)
    6769#  ifndef const
    6870#   define const
     
    7476#endif
    7577
    76 #ifdef __STDC__
     78#if defined(__IBMC__)
     79#include <stdlib.h>
     80#include <time.h>
     81/*#ifdef __STDC__*/
     82#elif defined(__STDC__)
    7783#include <stdlib.h>
    7884#include <unistd.h>
    7985#endif
     86
    8087#include "sprite.h"
    8188#include "lst.h"
     
    364371#define DEBUG_LOUD      0x0800
    365372
    366 #ifdef __STDC__
     373/*#ifdef __STDC__*/
     374#if defined(__STDC__) || defined(__IBMC__)
    367375#define CONCAT(a,b)     a##b
    368376#else
     
    370378#define CONCAT(a,b)     I(a)b
    371379#endif /* __STDC__ */
     380
     381
    372382
    373383#define DEBUG(module)   (debug & CONCAT(DEBUG_,module))
  • trunk/src/kmk/parse.c

    r25 r27  
    8888 */
    8989
    90 #ifdef __STDC__
     90#if defined(__STDC__) || defined(__IBMC__)
    9191#include <stdarg.h>
    9292#else
     
    315315/* VARARGS */
    316316void
    317 #ifdef __STDC__
     317#if defined(__STDC__) || defined(__IBMC__)
    318318Parse_Error(int type, char *fmt, ...)
    319319#else
     
    323323{
    324324        va_list ap;
    325 #ifdef __STDC__
     325#if defined(__STDC__) || defined(__IBMC__)
    326326        va_start(ap, fmt);
    327327#else
     
    24222422                } else if (strncmp (cp, "error", 5) == 0) {
    24232423                    ParseDoError(cp + 5);
    2424                     goto nextLine;         
     2424                    goto nextLine;     
    24252425                } else if (strncmp(cp, "undef", 5) == 0) {
    24262426                    char *cp2;
  • trunk/src/kmk/var.c

    r25 r27  
    8888 */
    8989
     90#ifdef USE_KLIB
     91 #include <kLib/kLib.h>
     92#endif
     93
    9094#include    <ctype.h>
    9195#include    <sys/types.h>
     
    163167} VarPattern;
    164168
    165 typedef struct { 
    166     regex_t        re; 
     169typedef struct {
     170    regex_t        re;
    167171    int            nsub;
    168172    regmatch_t    *matches;
     
    309313    }
    310314    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;
    313320        if ((env = getenv (name)) != NULL) {
     321        #endif
    314322            int         len;
    315323
     
    493501     */
    494502    if (ctxt == VAR_CMD) {
     503        #ifdef USE_KLIB
     504        kEnvSet(name, val);
     505        #else
    495506        setenv(name, val, 1);
     507        #endif
    496508    }
    497509}
     
    15471559                        Boolean rfree;
    15481560                        char*   rval = Var_Parse(tstr, ctxt, err, &rlen, &rfree);
    1549                
     1561
    15501562                        if (rval == var_Error) {
    15511563                                Fatal("Error expanding embedded variable.");
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette