VirtualBox

Changeset 632 in kBuild for trunk/src/ash


Ignore:
Timestamp:
Nov 26, 2006 1:46:21 PM (18 years ago)
Author:
bird
Message:

MSC hacking.

Location:
trunk/src/ash
Files:
15 added
5 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/ash/Makefile.kmk

    r630 r632  
    1717kmk_ash_DEFS.linux = BSD
    1818kmk_ash_DEFS.win = \
    19         PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
     19        BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
    2020kmk_ash_DEFS.os2 = \
    2121        HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME \
    2222        EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
    2323kmk_ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
     24kmk_ash_INCS.win = win
    2425kmk_ash_SOURCES = \
    2526        alias.c \
     
    5758        strlcpy.c \
    5859        setmode.c
     60#kmk_ash_SOURCES.win = \
     61#       win/mscfakes.c
     62
    5963kmk_ash_DEPS = \
    6064        $(PATH_TARGET)/arith.h \
     
    7579#ash.man_SYMLINKS = \
    7680#       ash.1.gz=>sh.1
     81
     82
     83
     84ifeq ($(filter-out nt win win32 win64,$(BUILD_TARGET)),)
     85
     86#
     87# Use the pregenerated code.
     88#
     89kmk_ash_DEPS :=
     90
     91define def_copy_generated
     92$(PATH_TARGET)/$(src): generated/$(src)
     93        $$(RM) -f $$@
     94        $$(CP) -f $$^ $$@
     95kmk_ash_DEPS += $(PATH_TARGET)/$(src)
     96endef
     97
     98$(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
     99$(eval $(def_copy_generated)))
     100
     101include $(PATH_KBUILD)/footer.kmk
     102
     103else
    77104
    78105include $(PATH_KBUILD)/footer.kmk
     
    112139        $(MV) init.c $@
    113140
     141endif
  • trunk/src/ash/bltin/kill.c

    r630 r632  
    224224        }
    225225#else
     226#ifndef _MSC_VER
    226227#warning TIOCGWINSZ is not present.
     228#endif
    227229#endif
    228230#ifndef HAVE_SYS_SIGNAME
  • trunk/src/ash/bltin/test.c

    r630 r632  
    361361                return S_ISDIR(s.st_mode);
    362362        case FILCDEV:
     363#ifdef S_ISCHR
    363364                return S_ISCHR(s.st_mode);
     365#else
     366        return 0;
     367#endif
    364368        case FILBDEV:
     369#ifdef S_ISBLK
    365370                return S_ISBLK(s.st_mode);
     371#else
     372        return 0;
     373#endif
    366374        case FILFIFO:
     375#ifdef S_ISFIFO
    367376                return S_ISFIFO(s.st_mode);
     377#else
     378        return 0;
     379#endif
    368380        case FILSOCK:
     381#ifdef S_ISSOCK
    369382                return S_ISSOCK(s.st_mode);
     383#else
     384        return 0;
     385#endif
    370386        case FILSYM:
    371387                return S_ISLNK(s.st_mode);
     
    375391                return (s.st_mode & S_ISGID) != 0;
    376392        case FILSTCK:
     393#ifdef S_ISVTX
    377394                return (s.st_mode & S_ISVTX) != 0;
     395#else
     396        return 0;
     397#endif
    378398        case FILGZ:
    379399                return s.st_size > (off_t)0;
  • trunk/src/ash/error.c

    r626 r632  
    315315        { ENXIO,        ALL,    "no such device or address" },
    316316        { EROFS,        ALL,    "read-only file system" },
     317#ifdef ETXTBSY
    317318        { ETXTBSY,      ALL,    "text busy" },
     319#endif
    318320#ifdef EAGAIN
    319321        { EAGAIN,       E_EXEC, "not enough memory" },
  • trunk/src/ash/error.h

    r629 r632  
    112112 */
    113113
    114 #if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) && !defined(__KLIBC__)
     114#if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) && !defined(__KLIBC__) && !defined(_MSC_VER)
    115115#define setjmp(jmploc)  _setjmp(jmploc)
    116116#define longjmp(jmploc, val)    _longjmp(jmploc, val)
  • trunk/src/ash/win/mscfakes.h

    r630 r632  
    3131#include <direct.h>
    3232#include <time.h>
     33#include <fcntl.h>
     34#include <limits.h>
    3335#undef setmode
    34 #include "getopt.h"
     36//#include "getopt.h"
     37
     38#if !defined(__GNUC__) && !defined(__attribute__)
     39#define __attribute__(a)
     40#endif
     41
     42typedef int pid_t;
    3543
    3644#define S_ISDIR(m)  (((m) & _S_IFMT) == _S_IFDIR)
     
    115123#define mkfifo(path, mode) -1
    116124#define mknod(path, mode, devno) -1
     125#define pipe(v) _pipe(v,0,0)
    117126int mkstemp(char *temp);
    118127#define readlink(link, buf, size) -1
    119128#define reallocf(old, size) realloc(old, size)
     129#define strcasecmp stricmp
     130#define strncasecmp strnicmp
    120131#if _MSC_VER < 1400
    121132int snprintf(char *buf, size_t size, const char *fmt, ...);
     
    127138int utimes(const char *pszPath, const struct timeval *paTimes);
    128139int writev(int fd, const struct iovec *vector, int count);
     140#define F_DUPFD 0
     141#define F_GETFD 1
     142#define F_SETFD 2
     143#define F_GETFL 3
     144#define F_SETFL 4
     145#define FD_CLOEXEC 1
     146#define O_NONBLOCK 0 /// @todo
     147#define EWOULDBLOCK 512
     148int fcntl (int, int, ...);
     149
     150/* signal hacks */
     151typedef struct sigset
     152{   
     153    unsigned long __bitmap[1];
     154} sigset_t;
     155int     sigprocmask(int, const sigset_t *, sigset_t *);
     156#define SIG_BLOCK           1
     157#define SIG_UNBLOCK         2
     158#define SIG_SETMASK         3
     159
     160#define SIGTTIN 0
     161#define SIGTSTP 0
     162#define SIGTTOU 0
     163#define SIGCONT 0
     164#define SIGPIPE 0
     165#define SIGQUIT 0
     166#define SIGHUP 0
     167#ifndef NSIG
     168#define NSIG 32
     169#endif
     170extern const char *const sys_siglist[NSIG];
     171
     172int     kill(pid_t, int);
     173int     sigaction(int, const struct sigaction *, struct sigaction *);
     174//int   sigaddset(sigset_t *, int);
     175//int   sigdelset(sigset_t *, int);
     176int     sigemptyset(sigset_t *);
     177//int   sigfillset(sigset_t *);
     178//int   sigismember(const sigset_t *, int);
     179//int   sigpending(sigset_t *);
     180//int   sigsuspend(const sigset_t *);
     181//int   sigwait(const sigset_t *, int *);
    129182
    130183#endif /* _MSC_VER */
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