VirtualBox

Changeset 809 in kBuild


Ignore:
Timestamp:
Jan 29, 2007 5:54:36 AM (18 years ago)
Author:
bird
Message:

Solaris + cleanup.

Location:
trunk
Files:
4 added
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r804 r809  
    8484
    8585ifeq ($(filter-out win nt,$(BUILD_TARGET)),)
    86 include $(PATH_KBUILD)/tools/VCC70.kmk  # fixme! template expanding does something bad to _LIBS /me thinks.
    87 TEMPLATE_BIN_TOOL               = VCC70
    88 TEMPLATE_BIN_DEFS               = WINDOWS32 _CONSOLE WIN32 __WIN32__
    89 TEMPLATE_BIN_DEFS.release       = NDEBUG
    90 TEMPLATE_BIN_SDKS               = WINPSDK
    91 TEMPLATE_BIN_CFLAGS             = -W3 -Zi -Zl
    92 TEMPLATE_BIN_CFLAGS.release     = -O2
    93 TEMPLATE_BIN_CFLAGS.profile     = -O2 -GH -Gh
    94 TEMPLATE_BIN_INCS              += \
     86 include $(PATH_KBUILD)/tools/VCC70.kmk # fixme! template expanding does something bad to _LIBS /me thinks.
     87 TEMPLATE_BIN_TOOL              = VCC70
     88 TEMPLATE_BIN_DEFS              = WINDOWS32 _CONSOLE WIN32 __WIN32__
     89 TEMPLATE_BIN_DEFS.release      = NDEBUG
     90 TEMPLATE_BIN_SDKS              = WINPSDK
     91 TEMPLATE_BIN_CFLAGS            = -W3 -Zi -Zl
     92 TEMPLATE_BIN_CFLAGS.release    = -O2
     93 TEMPLATE_BIN_CFLAGS.profile    = -O2 -GH -Gh
     94 TEMPLATE_BIN_INCS             += \
    9595        . \
    9696        $(PATH_ROOT)/src/gmake/w32/include \
    9797        $(PATH_ROOT)/src/gmake/glob
    98 TEMPLATE_BIN_LDFLAGS            = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG
    99 ifeq (1,0)
    100 TEMPLATE_BIN_CFLAGS            += -MT
    101 TEMPLATE_BIN_LIBS               = \
     98 TEMPLATE_BIN_LDFLAGS           = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG
     99 ifeq (1,0)
     100 TEMPLATE_BIN_CFLAGS           += -MT
     101 TEMPLATE_BIN_LIBS              = \
    102102        $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
    103103        $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
    104104        $(PATH_TOOL_VCC70_LIB)/libcpmt.lib
    105 else
    106 TEMPLATE_BIN_CFLAGS            += -MD
    107 TEMPLATE_BIN_LIBS               = \
     105 else
     106 TEMPLATE_BIN_CFLAGS           += -MD
     107 TEMPLATE_BIN_LIBS              = \
    108108        $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
    109109        $(PATH_TOOL_VCC70_LIB)/msvcrt.lib
    110 #       $(PATH_TOOL_VCC70_LIB)/msvcprt.lib
    111 endif
    112 TEMPLATE_BIN_LIBS.profile       = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib
     110 #      $(PATH_TOOL_VCC70_LIB)/msvcprt.lib
     111 endif
     112 TEMPLATE_BIN_LIBS.profile      = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib
    113113 ifdef NIX_INSTALL_DIR
    114 TEMPLATE_BIN_INST               = $(NIX_INSTALL_DIR_BIN)/
     114 TEMPLATE_BIN_INST              = $(NIX_INSTALL_DIR_BIN)/
    115115 else
    116 TEMPLATE_BIN_INST               = kBuild/bin/win.$(BUILD_TARGET_ARCH)/
     116 TEMPLATE_BIN_INST              = kBuild/bin/win.$(BUILD_TARGET_ARCH)/
    117117 endif
    118118endif
     
    121121TEMPLATE_BIN_TOOL               = GCC3
    122122TEMPLATE_BIN_CFLAGS.release     = -O3
    123 ifeq ($(BUILD_TARGET),linux)
    124 TEMPLATE_BIN_LIBS              += rt
    125 endif
    126 ifeq ($(BUILD_TARGET),freebsd)
     123 endif
     124 ifeq ($(BUILD_TARGET),freebsd)
    127125TEMPLATE_BIN_LIBS              += iconv intl
    128126TEMPLATE_BIN_LIBPATH           += /usr/local/lib
    129127TEMPLATE_BIN_INCS              += $(PATH_ROOT)/src/gmake/glob /usr/local/include
    130 endif
     128 endif
     129 ifeq ($(BUILD_TARGET),linux)
     130TEMPLATE_BIN_LIBS              += rt
     131 ifeq ($(BUILD_TARGET),solaris)
     132TEMPLATE_BIN_LIBS              += rt
     133 endif
    131134 ifdef NIX_INSTALL_DIR
    132135TEMPLATE_BIN_INST               = $(NIX_INSTALL_DIR_BIN)/
  • trunk/src/ash/Makefile.kmk

    r785 r809  
    1616kmk_ash_DEFS = lint SHELL SMALL
    1717kmk_ash_DEFS.linux = BSD
     18kmk_ash_DEFS.solaris = BSD
    1819kmk_ash_DEFS.win = \
    1920        BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
     
    6768        win/err.c \
    6869        win/dirent.c \
     70        sys_signame.c \
     71        strlcpy.c \
     72        setmode.c
     73kmk_ash_SOURCES.solaris = \
    6974        sys_signame.c \
    7075        strlcpy.c \
  • trunk/src/ash/alias.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/arith.y

    r626 r809  
    3434 */
    3535
     36#ifdef HAVE_SYS_CDEFS_H
    3637#include <sys/cdefs.h>
     38#endif
    3739#ifndef lint
    3840#if 0
  • trunk/src/ash/arith_lex.l

    r626 r809  
    3535 */
    3636
     37#ifdef HAVE_SYS_CDEFS_H
    3738#include <sys/cdefs.h>
     39#endif
    3840#ifndef lint
    3941#if 0
  • trunk/src/ash/bltin/kill.c

    r632 r809  
    3030 */
    3131
     32#ifndef __sun__
    3233#include <sys/cdefs.h>
     34#endif
    3335#if !defined(lint) && !defined(SHELL)
    3436__COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\
     
    4547
    4648#include <ctype.h>
     49#ifndef __sun__
    4750#include <err.h>
     51#endif
    4852#include <errno.h>
    4953#include <signal.h>
  • trunk/src/ash/bltin/test.c

    r632 r809  
    1111 */
    1212
     13#ifndef __sun__
    1314#include <sys/cdefs.h>
     15#endif
    1416#ifndef lint
    1517__RCSID("$NetBSD: test.c,v 1.26 2005/02/10 06:56:55 simonb Exp $");
     
    2022
    2123#include <ctype.h>
     24#ifndef __sun__
    2225#include <err.h>
     26#endif
    2327#include <errno.h>
    2428#include <stdio.h>
  • trunk/src/ash/cd.c

    r626 r809  
    3333 */
    3434
     35#ifndef __sun__
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/error.c

    r632 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/eval.c

    r629 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    5355#ifdef HAVE_SYSCTL_H
    5456#include <sys/sysctl.h>
     57#endif
     58#ifdef __sun__
     59#include <iso/limits_iso.h>
    5560#endif
    5661
     
    609614        static char *sys_path = NULL;
    610615        static int mib[] = {CTL_USER, USER_CS_PATH};
    611 #endif 
     616#endif
    612617#ifdef PC_PATH_SEP
    613618        static char def_path[] = "PATH=/usr/bin;/bin;/usr/sbin;/sbin";
     
    632637#else
    633638    return def_path;
    634 #endif 
     639#endif
    635640}
    636641
  • trunk/src/ash/exec.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/expand.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    5153#include <stdlib.h>
    5254#include <stdio.h>
     55#ifdef __sun__
     56#include <iso/limits_iso.h>
     57#endif
    5358
    5459/*
     
    101106STATIC void varvalue(char *, int, int, int);
    102107STATIC void recordregion(int, int, int);
    103 STATIC void removerecordregions(int); 
     108STATIC void removerecordregions(int);
    104109STATIC void ifsbreakup(char *, struct arglist *);
    105110STATIC void ifsfree(void);
     
    305310
    306311
    307 STATIC void 
     312STATIC void
    308313removerecordregions(int endoff)
    309314{
     
    328333                return;
    329334        }
    330        
     335
    331336        ifslastp = &ifsfirst;
    332337        while (ifslastp->next && ifslastp->next->begoff < endoff)
     
    562567                        loc--;
    563568                        if ((varflags & VSQUOTE) && loc > startp &&
    564                             *(loc - 1) == CTLESC) { 
     569                            *(loc - 1) == CTLESC) {
    565570                                for (q = startp; q < loc; q++)
    566571                                        if (*q == CTLESC)
     
    740745                if (subevalvar(p, var, 0, subtype, startloc, varflags)) {
    741746                        varflags &= ~VSNUL;
    742                         /* 
    743                          * Remove any recorded regions beyond 
    744                          * start of variable 
     747                        /*
     748                         * Remove any recorded regions beyond
     749                         * start of variable
    745750                         */
    746751                        removerecordregions(startloc);
  • trunk/src/ash/histedit.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4345
    4446#include <sys/param.h>
     47#ifndef __sun__
    4548#include <paths.h>
     49#endif
    4650#include <stdio.h>
    4751#include <stdlib.h>
     
    154158                        else if (Eflag)
    155159                                el_set(el, EL_EDITOR, "emacs");
    156                         el_set(el, EL_BIND, "^I", 
     160                        el_set(el, EL_BIND, "^I",
    157161                            tabcomplete ? "rl-complete" : "ed-insert", NULL);
    158162                        el_source(el, NULL);
  • trunk/src/ash/input.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4850#include <stdlib.h>
    4951#include <string.h>
     52#ifdef __sun__
     53#include <iso/limits_iso.h>
     54#endif
    5055
    5156/*
  • trunk/src/ash/jobs.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#else
     38#define _PATH_DEVNULL "/dev/null"
     39#endif
    3640#ifndef lint
    3741#if 0
     
    4347
    4448#include <fcntl.h>
     49#ifdef __sun__
     50#define sys_siglist _sys_siglist
     51#endif
    4552#include <signal.h>
    4653#include <errno.h>
    4754#include <unistd.h>
    4855#include <stdlib.h>
     56#ifndef __sun__
    4957#include <paths.h>
     58#endif
    5059#include <sys/types.h>
    5160#include <sys/param.h>
    52 #ifdef BSD
     61#if defined(BSD) || defined(__sun__)
    5362#include <sys/wait.h>
    5463#include <sys/time.h>
     
    688697        int i;
    689698        const char *err_msg = "No such job: %s";
    690                
     699
    691700        if (name == NULL) {
    692701#if JOBS
  • trunk/src/ash/mail.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/main.c

    r638 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739__COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
     
    179181        init_syntax();
    180182    }
    181 #endif 
     183#endif
    182184        init();
    183185        setstackmark(&smark);
     
    202204        if (sflag == 0 || minusc) {
    203205                static int sigs[] =  {
    204                     SIGINT, SIGQUIT, SIGHUP, 
     206                    SIGINT, SIGQUIT, SIGHUP,
    205207#ifdef SIGTSTP
    206208                    SIGTSTP,
  • trunk/src/ash/memalloc.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    224226                /*
    225227                 * Stack marks pointing to the start of the old block
    226                  * must be relocated to point to the new block 
     228                 * must be relocated to point to the new block
    227229                 */
    228230                xmark = markp;
  • trunk/src/ash/miscbltin.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/mkbuiltins

    r629 r809  
    1 #!/bin/sh -
     1#!/bin/sh -x
    22#       $NetBSD: mkbuiltins,v 1.21 2004/06/06 07:03:11 christos Exp $
    33#
     
    6666 */
    6767
     68#ifdef HAVE_SYS_CDEFS_H
    6869#include <sys/cdefs.h>
     70#endif
    6971
    7072struct builtincmd {
  • trunk/src/ash/mystring.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/options.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/output.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/parser.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4345
    4446#include <stdlib.h>
     47#ifdef __sun__
     48#include <iso/limits_iso.h>
     49#endif
    4550
    4651#include "shell.h"
     
    746751                                if (**pp == *wordtext && equal(*pp, wordtext))
    747752                                {
    748                                         lasttoken = t = pp - 
     753                                        lasttoken = t = pp -
    749754                                            parsekwd + KWDOFFSET;
    750755                                        TRACE(("keyword %s recognized\n", tokname[t]));
  • trunk/src/ash/redir.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/shell.h

    r626 r809  
    7070#define MKINIT  /* empty */
    7171
     72#ifdef HAVE_SYS_CDEFS_H
    7273#include <sys/cdefs.h>
     74#endif
    7375
    7476extern char nullstr[1];         /* null string */
  • trunk/src/ash/show.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/syntax.c

    r638 r809  
    11/*      $NetBSD: syntax.c,v 1.1 2004/01/17 17:38:12 dsl Exp $   */
     2
     3#ifdef __sun__
     4#include <stdio.h>
     5#include <iso/limits_iso.h>
     6#endif
    27
    38#include "shell.h"
  • trunk/src/ash/syntax.h

    r638 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#include <ctype.h>
    3739
     
    8991extern const char arisyntax[];
    9092extern const char is_type[];
    91 #endif 
     93#endif
  • trunk/src/ash/trap.c

    r630 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    6466extern void init_sys_signame(void);
    6567extern char sys_signame[NSIG][16];
    66 #endif 
     68#endif
    6769
    6870/*
     
    8486int pendingsigs;                /* indicates some signal received */
    8587
     88#ifdef __sun__
     89typedef void (*sig_t) (int);
     90#endif
    8691static int getsigaction(int, sig_t *);
    8792
     
    101106        if (strcasecmp(p, "exit") == 0 )
    102107                return 0;
    103        
     108
    104109        if (strncasecmp(p, "sig", 3) == 0)
    105110                p += 3;
     
    107112#ifndef HAVE_SYS_SIGNAME
    108113        init_sys_signame();
    109 #endif 
     114#endif
    110115        for (i = 0; i < NSIG; ++i)
    111116                if (strcasecmp (p, sys_signame[i]) == 0)
     
    125130#ifndef HAVE_SYS_SIGNAME
    126131        init_sys_signame();
    127 #endif 
     132#endif
    128133
    129134        for (n = 1; n < NSIG; n++) {
     
    148153#ifndef HAVE_SYS_SIGNAME
    149154        init_sys_signame();
    150 #endif 
     155#endif
    151156
    152157        if (argc <= 1) {
  • trunk/src/ash/var.c

    r637 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4547#include <stdlib.h>
    4648#include <strings.h>
     49#ifndef __sun__
    4750#include <paths.h>
     51#else
     52#define _PATH_DEFPATH        "/usr/bin:/usr/sbin"
     53#include <iso/limits_iso.h>
     54#endif
    4855
    4956#ifdef PC_OS2_LIBPATHS
     
    123130#ifdef _MSC_VER
    124131struct var vpath2;
    125 #endif 
     132#endif
    126133struct var vps1;
    127134struct var vps2;
     
    155162        { &vpath2,      VSTRFIXED|VTEXTFIXED,           "Path=",
    156163          changepath },
    157 #endif 
     164#endif
    158165        /*
    159166         * vps1 depends on uid
  • trunk/src/gmake/Makefile.kmk

    r778 r809  
    55include $(PATH_KBUILD)/header.kmk
    66
     7
     8#
     9# Template for kmk and the kmk_* binaries in this makefile.
     10#
     11TEMPLATE_BIN-KMK = Template for src/gmake binaries
     12TEMPLATE_BIN-KMK_EXTENDS = BIN
     13TEMPLATE_BIN-KMK_DEFS = HAVE_CONFIG_H $(TEMPLATE_BIN_DEFS)
     14TEMPLATE_BIN-KMK_DEPS = $(PATH_TARGET)/config.h
     15TEMPLATE_BIN-KMK_DEPS.solaris = \
     16        $(PATH_TARGET)/fts.h \
     17        $(PATH_TARGET)/paths.h
     18TEMPLATE_BIN-KMK_DEPS.win     = \
     19        $(PATH_TARGET)/fts.h \
     20        $(PATH_TARGET)/sysexits.h \
     21        $(PATH_TARGET)/unistd.h \
     22        $(PATH_TARGET)/paths.h \
     23        $(PATH_TARGET)/grp.h \
     24        $(PATH_TARGET)/pwd.h \
     25        $(PATH_TARGET)/inttypes.h
     26TEMPLATE_BIN-KMK_INCS = $(PATH_TARGET) . $(TEMPLATE_BIN_INCS)
     27TEMPLATE_BIN-KMK_INCS.darwin = glob
     28TEMPLATE_BIN-KMK_INCS.freebsd = glob
     29TEMPLATE_BIN-KMK_INCS.solaris = glob
     30TEMPLATE_BIN-KMK_LIBS = $(TEMPLATE_BIN_LIBS) $(TARGET_kmkmissing)
     31
     32
     33#
     34# A library containing the missing features needed by kmk and the
     35# kmk_* binaries. Saves a bit of work later on.
     36#
     37LIBRARIES += kmkmissing
     38kmkmissing_TEMPLATE = BIN-KMK
     39kmkmissing_NOINST = 1
     40kmkmissing_SOURCES = \
     41        kmkbuiltin/err.c \
     42        kmkbuiltin/setmode.c \
     43        kmkbuiltin/strmode.c \
     44        kmkbuiltin/strlcpy.c
     45
     46kmkmissing_SOURCES.darwin = \
     47        kmkbuiltin/darwin.c \
     48        glob/glob.c \
     49        glob/fnmatch.c
     50
     51kmkmissing_SOURCES.freebsd = \
     52        glob/glob.c \
     53        glob/fnmatch.c
     54
     55kmkmissing_SOURCES.solaris = \
     56        kmkbuiltin/solfakes.c \
     57        kmkbuiltin/fts.c \
     58        glob/glob.c \
     59        glob/fnmatch.c \
     60        getopt.c \
     61        getopt1.c
     62
     63kmkmissing_SOURCES.win += \
     64        glob/glob.c \
     65        glob/fnmatch.c \
     66        getopt.c \
     67        getopt1.c \
     68        getloadavg.c \
     69        w32/subproc/misc.c \
     70        w32/subproc/sub_proc.c \
     71        w32/subproc/w32err.c \
     72        w32/compat/dirent.c \
     73        w32/pathstuff.c \
     74        kmkbuiltin/mscfakes.c \
     75        kmkbuiltin/fts.c
     76
    777#
    878# kmk
     
    1080PROGRAMS += kmk
    1181
    12 kmk_TEMPLATE = BIN
    13 kmk_DEPS = $(PATH_TARGET)/config.h
    14 kmk_INCS = $(PATH_TARGET) .
    15 kmk_INCS.darwin = glob
    16 kmk_INCS.freebsd = glob
    17 #ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    18 #kmk_INCS += kmkbuiltin/w32
    19 #endif
     82kmk_TEMPLATE = BIN-KMK
    2083
    2184kmk_DEFS = \
    22         HAVE_CONFIG_H \
    2385        NO_ARCHIVES \
     86        EXPERIMENTAL \
     87        CONFIG_WITH_TOUPPER_TOLOWER \
     88        \
     89        KMK \
     90        KMK_HELPERS \
     91        VARIABLE_HASH \
    2492        CONFIG_NO_DEFAULT_SUFFIXES \
    2593        CONFIG_NO_DEFAULT_PATTERN_RULES \
     
    2997        CONFIG_WITH_EXTENDED_NOTPARALLEL \
    3098        CONFIG_WITH_INCLUDEDEP \
    31         CONFIG_WITH_TOUPPER_TOLOWER \
    32         CONFIG_WITH_ABSPATHEX \
    33         CONFIG_PRETTY_COMMAND_PRINTING \
    34         KMK \
    35         \
    36         KMK_HELPERS \
    37         VARIABLE_HASH \
    3899        CONFIG_WITH_OPTIMIZATION_HACKS \
    39100        CONFIG_WITH_VALUE_LENGTH \
     101        CONFIG_WITH_ABSPATHEX \
    40102        CONFIG_WITH_COMPARE \
    41103        CONFIG_WITH_STACK \
    42104        CONFIG_WITH_MATH \
    43         EXPERIMENTAL \
     105        CONFIG_PRETTY_COMMAND_PRINTING \
    44106        \
    45107        BUILD_PLATFORM=\"$(BUILD_TARGET)\" \
    46108        BUILD_PLATFORM_ARCH=\"$(BUILD_TARGET_ARCH)\" \
    47109        BUILD_PLATFORM_CPU=\"$(BUILD_TARGET_CPU)\"
    48 kmk_DEFS.win = CONFIG_NEW_WIN32_CTRL_EVENT
     110kmk_DEFS.win = \
     111        CONFIG_NEW_WIN32_CTRL_EVENT
    49112
    50113kmk_SOURCES = \
     
    73136        kbuild.c
    74137
    75 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    76 kmk_SOURCES += \
    77         getopt.c \
    78         getopt1.c \
    79         getloadavg.c \
    80         w32/subproc/misc.c \
    81         w32/subproc/sub_proc.c \
    82         w32/subproc/w32err.c \
    83         glob/glob.c \
    84         glob/fnmatch.c \
    85         w32/compat/dirent.c \
    86         w32/pathstuff.c
    87 endif
    88 
    89 kmk_SOURCES.freebsd = \
    90         glob/glob.c \
    91         glob/fnmatch.c
    92 
    93 kmk_SOURCES.darwin = \
    94         glob/glob.c \
    95         glob/fnmatch.c
    96 
    97138#
    98139# kmkbuiltin commands
     
    113154        kmkbuiltin/rm.c \
    114155        kmkbuiltin/rmdir.c \
    115         \
    116         kmkbuiltin/err.c \
    117         kmkbuiltin/setmode.c \
    118         kmkbuiltin/strmode.c \
    119         kmkbuiltin/strlcpy.c
    120 
    121 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    122 kmk_SOURCES += \
    123         kmkbuiltin/mscfakes.c \
    124         kmkbuiltin/fts.c
    125 endif
    126 
    127 kmk_SOURCES.darwin += \
    128         kmkbuiltin/darwin.c
    129156
    130157
     
    132159# Standalone kmkbuiltin commands.
    133160#
     161## @todo should probably put all those
    134162PROGRAMS += kmk_append kmk_cat kmk_cp kmk_echo kmk_mkdir kmk_mv kmk_install kmk_ln kmk_printf kmk_rm kmk_rmdir
    135163
    136 kmk_append_TEMPLATE = BIN
     164kmk_append_TEMPLATE = BIN-KMK
    137165kmk_append_DEFS = kmk_builtin_append=main
    138166kmk_append_INCS = .
    139167kmk_append_SOURCES = \
    140         kmkbuiltin/append.c \
    141         kmkbuiltin/err.c
    142 
    143 kmk_cat_TEMPLATE = BIN
     168        kmkbuiltin/append.c
     169
     170kmk_cat_TEMPLATE = BIN-KMK
    144171kmk_cat_DEFS = kmk_builtin_cat=main
    145172kmk_cat_SOURCES = \
    146         kmkbuiltin/cat.c \
    147         kmkbuiltin/err.c
    148 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    149 kmk_cat_INCS += $(PATH_TARGET) .
    150 kmk_cat_DEFS += HAVE_CONFIG_H
    151 kmk_cat_SOURCES += \
    152         kmkbuiltin/mscfakes.c \
    153         getopt.c \
    154         getopt1.c
    155 endif
    156 
    157 kmk_cp_TEMPLATE = BIN
     173        kmkbuiltin/cat.c
     174
     175kmk_cp_TEMPLATE = BIN-KMK
    158176kmk_cp_DEFS = kmk_builtin_cp=main
    159177kmk_cp_SOURCES = \
    160178        kmkbuiltin/cp.c \
    161         kmkbuiltin/cp_utils.c \
    162         kmkbuiltin/strlcpy.c \
    163         kmkbuiltin/err.c
    164 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    165 kmk_cp_INCS += $(PATH_TARGET) .
    166 kmk_cp_DEFS += HAVE_CONFIG_H
    167 kmk_cp_SOURCES += \
    168         kmkbuiltin/mscfakes.c \
    169         kmkbuiltin/fts.c \
    170         w32/compat/dirent.c \
    171         getopt.c \
    172         getopt1.c
    173 endif
    174 kmk_cp_SOURCES.darwin = \
    175         kmkbuiltin/darwin.c
    176 
    177 kmk_echo_TEMPLATE = BIN
     179        kmkbuiltin/cp_utils.c
     180
     181kmk_echo_TEMPLATE = BIN-KMK
    178182kmk_echo_DEFS = kmk_builtin_echo=main
    179183kmk_echo_SOURCES = \
    180184        kmkbuiltin/echo.c
    181 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    182 kmk_echo_SOURCES += \
    183         kmkbuiltin/mscfakes.c \
    184         kmkbuiltin/err.c
    185 endif
    186 
    187 kmk_install_TEMPLATE = BIN
     185
     186kmk_install_TEMPLATE = BIN-KMK
    188187kmk_install_DEFS = kmk_builtin_install=main
    189188kmk_install_SOURCES = \
    190         kmkbuiltin/install.c \
    191         kmkbuiltin/err.c \
    192         kmkbuiltin/strmode.c \
    193         kmkbuiltin/setmode.c
    194 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    195 kmk_install_INCS += $(PATH_TARGET) .
    196 kmk_install_DEFS += HAVE_CONFIG_H
    197 kmk_install_SOURCES += \
    198         kmkbuiltin/mscfakes.c \
    199         getopt.c \
    200         getopt1.c
    201 endif
    202 
    203 kmk_ln_TEMPLATE = BIN
     189        kmkbuiltin/install.c
     190
     191kmk_ln_TEMPLATE = BIN-KMK
    204192kmk_ln_DEFS = kmk_builtin_ln=main
    205193kmk_ln_SOURCES = \
    206         kmkbuiltin/ln.c \
    207         kmkbuiltin/err.c
    208 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    209 kmk_ln_INCS += $(PATH_TARGET) .
    210 kmk_ln_DEFS += HAVE_CONFIG_H
    211 kmk_ln_SOURCES += \
    212         kmkbuiltin/mscfakes.c\
    213         getopt.c \
    214         getopt1.c
    215 endif
    216 
    217 kmk_mkdir_TEMPLATE = BIN
     194        kmkbuiltin/ln.c
     195
     196kmk_mkdir_TEMPLATE = BIN-KMK
    218197kmk_mkdir_DEFS = kmk_builtin_mkdir=main
    219198kmk_mkdir_SOURCES = \
    220         kmkbuiltin/mkdir.c \
    221         kmkbuiltin/err.c \
    222         kmkbuiltin/setmode.c
    223 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    224 kmk_mkdir_INCS += $(PATH_TARGET) .
    225 kmk_mkdir_DEFS += HAVE_CONFIG_H
    226 kmk_mkdir_SOURCES += \
    227         kmkbuiltin/mscfakes.c \
    228         getopt.c \
    229         getopt1.c
    230 endif
    231 
    232 kmk_mv_TEMPLATE = BIN
     199        kmkbuiltin/mkdir.c
     200
     201kmk_mv_TEMPLATE = BIN-KMK
    233202kmk_mv_DEFS = kmk_builtin_mv=main
    234203kmk_mv_SOURCES = \
    235         kmkbuiltin/mv.c \
    236         kmkbuiltin/err.c \
    237         kmkbuiltin/strmode.c
    238 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    239 kmk_mv_INCS += $(PATH_TARGET) .
    240 kmk_mv_DEFS += HAVE_CONFIG_H
    241 kmk_mv_SOURCES += \
    242         kmkbuiltin/mscfakes.c \
    243         getopt.c \
    244         getopt1.c
    245 endif
    246 
    247 kmk_printf_TEMPLATE = BIN
     204        kmkbuiltin/mv.c
     205
     206kmk_printf_TEMPLATE = BIN-KMK
    248207kmk_printf_DEFS = kmk_builtin_printf=main
    249208kmk_printf_SOURCES = \
    250         kmkbuiltin/printf.c \
    251         kmkbuiltin/err.c
    252 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    253 kmk_printf_INCS += $(PATH_TARGET) .
    254 kmk_printf_DEFS += HAVE_CONFIG_H
    255 kmk_printf_SOURCES += \
    256         kmkbuiltin/mscfakes.c \
    257         getopt.c \
    258         getopt1.c
    259 endif
    260 
    261 kmk_rm_TEMPLATE = BIN
     209        kmkbuiltin/printf.c
     210
     211kmk_rm_TEMPLATE = BIN-KMK
    262212kmk_rm_DEFS = kmk_builtin_rm=main
    263213kmk_rm_SOURCES = \
    264         kmkbuiltin/rm.c \
    265         kmkbuiltin/err.c \
    266         kmkbuiltin/strmode.c
    267 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    268 kmk_rm_INCS += $(PATH_TARGET) .
    269 kmk_rm_DEFS += HAVE_CONFIG_H
    270 kmk_rm_SOURCES += \
    271         kmkbuiltin/mscfakes.c\
    272         getopt.c \
    273         getopt1.c
    274 endif
    275 
    276 kmk_rmdir_TEMPLATE = BIN
     214        kmkbuiltin/rm.c
     215
     216kmk_rmdir_TEMPLATE = BIN-KMK
    277217kmk_rmdir_DEFS = kmk_builtin_rmdir=main
    278218kmk_rmdir_SOURCES = \
    279         kmkbuiltin/rmdir.c \
    280         kmkbuiltin/err.c \
    281         kmkbuiltin/setmode.c
    282 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    283 kmk_rmdir_INCS += $(PATH_TARGET) .
    284 kmk_rmdir_DEFS += HAVE_CONFIG_H
    285 kmk_rmdir_SOURCES += \
    286         kmkbuiltin/mscfakes.c \
    287         getopt.c \
    288         getopt1.c
    289 endif
    290 
     219        kmkbuiltin/rmdir.c
    291220
    292221
     
    295224#
    296225PROGRAMS += kmk_gmake
    297 kmk_gmake_TEMPLATE = BIN
    298 kmk_gmake_DEPS = $(PATH_TARGET)/config.h
    299 kmk_gmake_INCS = $(PATH_TARGET) .
    300 kmk_gmake_INCS.darwin = glob
    301 kmk_gmake_INCS.freebsd = glob
    302 
    303 
     226
     227kmk_gmake_TEMPLATE = BIN-KMK
    304228kmk_gmake_DEFS = \
    305229        HAVE_CONFIG_H \
     
    332256        remote-stub.c
    333257
    334 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    335 kmk_gmake_SOURCES += \
    336         getopt.c \
    337         getopt1.c \
    338         getloadavg.c \
    339         w32/subproc/misc.c \
    340         w32/subproc/sub_proc.c \
    341         w32/subproc/w32err.c \
    342         glob/glob.c \
    343         glob/fnmatch.c \
    344         w32/compat/dirent.c \
    345         w32/pathstuff.c
    346 endif
    347 
    348 kmk_gmake_SOURCES.freebsd = \
    349         glob/glob.c \
    350         glob/fnmatch.c
    351 
    352 kmk_gmake_SOURCES.darwin = \
    353         glob/glob.c \
    354         glob/fnmatch.c
    355 
    356 
    357258
    358259include $(PATH_KBUILD)/footer.kmk
     
    364265config.h.$(BUILD_TARGET) := config.h.$(BUILD_TARGET)
    365266config.h.win   := config.h.W32
    366 config.h.win32 := config.h.W32
    367 config.h.win64 := config.h.W32
    368 config.h.nt    := config.h.W32
    369267
    370268$(PATH_TARGET)/config.h: $(config.h.$(BUILD_TARGET))
    371269        $(MKDIR) -p $(dir $@)
    372270        $(CP) $^ $@
     271
     272#
     273# Some missing headers.
     274#
     275$(PATH_TARGET)/fts.h: kmkbuiltin/ftsfake.h | $(call DIRDEP,$(PATH_TARGET))
     276        $(CP) $^ $@
     277
     278$(PATH_TARGET)/unistd.h: | $(call DIRDEP,$(PATH_TARGET))
     279        $(ECHO_EXT) > $@
     280
     281$(PATH_TARGET)/sysexits.h: | $(call DIRDEP,$(PATH_TARGET))
     282        $(ECHO_EXT) > $@
     283
     284$(PATH_TARGET)/inttypes.h: | $(call DIRDEP,$(PATH_TARGET))
     285        $(ECHO_EXT) > $@
     286
     287$(PATH_TARGET)/paths.h: | $(call DIRDEP,$(PATH_TARGET))
     288        $(ECHO_EXT) > $@
     289
     290$(PATH_TARGET)/pwd.h: | $(call DIRDEP,$(PATH_TARGET))
     291        $(ECHO_EXT) > $@
     292
     293$(PATH_TARGET)/grp.h: | $(call DIRDEP,$(PATH_TARGET))
     294        $(ECHO_EXT) > $@
    373295
    374296
     
    430352
    431353test_all:       test_math test_stack test_shell
     354
  • trunk/src/gmake/kmkbuiltin/cat.c

    r611 r809  
    4949#else
    5050#define NO_UDOM_SUPPORT /* kmk */
    51 #endif 
     51#endif
    5252
    5353#ifndef _MSC_VER
    54 #include <sys/param.h>
     54# include <sys/param.h>
    5555#endif
    5656#include <sys/stat.h>
    5757#ifndef NO_UDOM_SUPPORT
    58 #include <sys/socket.h>
    59 #include <sys/un.h>
    60 #include <errno.h>
     58# include <sys/socket.h>
     59# include <sys/un.h>
     60# include <errno.h>
    6161#endif
    6262
     
    6868#include <stdlib.h>
    6969#include <string.h>
    70 #ifndef _MSC_VER
    7170#include <unistd.h>
    72 #else
    73 #include "mscfakes.h"
    74 #endif
    7571#include <stddef.h>
     72
     73#ifdef __sun__
     74# include "solfakes.h"
     75#endif
     76#ifdef _MSC_VER
     77# include "mscfakes.h"
     78#endif
    7679
    7780int bflag, eflag, nflag, sflag, tflag, vflag;
     
    111114#ifdef kmk_builtin_cat /* kmk did this already. */
    112115        setlocale(LC_CTYPE, "");
    113 #endif 
     116#endif
    114117
    115118        while ((ch = getopt(argc, argv, "benstuv")) != -1)
     
    285288#else
    286289                bsize = MAX(sbuf.st_blksize, 1024);
    287 #endif 
     290#endif
    288291                if ((buf = malloc(bsize)) == NULL)
    289292                        return err(1, "buffer");
  • trunk/src/gmake/kmkbuiltin/cp.c

    r557 r809  
    6565#include "err.h"
    6666#include <errno.h>
    67 #ifndef _MSC_VER
    6867#include <fts.h>
    69 #endif
    7068#include <limits.h>
    7169#include <signal.h>
     
    7371#include <stdlib.h>
    7472#include <string.h>
    75 #ifndef _MSC_VER
    7673#include <unistd.h>
    77 #else
    78 #include "mscfakes.h"
    79 #include "ftsfake.h"
     74
     75#ifdef _MSC_VER
     76# include "mscfakes.h"
    8077#endif
    8178
     
    471468                                if (copy_file(curr, dne))
    472469                                        badcp = rval = 1;
    473                         } else {       
     470                        } else {
    474471                                if (copy_link(curr, !dne))
    475472                                        badcp = rval = 1;
  • trunk/src/gmake/kmkbuiltin/cp_utils.c

    r370 r809  
    3737
    3838#ifndef _MSC_VER
    39 #include <sys/param.h>
    40 #endif 
     39# include <sys/param.h>
     40#endif
    4141#include <sys/stat.h>
    4242#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
    43 #include <sys/mman.h>
     43# include <sys/mman.h>
    4444#endif
    4545
     
    4747#include <errno.h>
    4848#include <fcntl.h>
    49 #ifndef _MSC_VER
    5049#include <fts.h>
    51 #endif
    5250#include <limits.h>
    5351#include <stdio.h>
    5452#include <stdlib.h>
    5553#include <signal.h>
    56 #ifndef _MSC_VER
    5754#include <sysexits.h>
    5855#include <unistd.h>
    59 #else
    60 #include "mscfakes.h"
    61 #include "ftsfake.h"
    62 #endif
     56
     57#ifdef __sun__
     58# include "solfakes.h"
     59#endif
     60#ifdef _MSC_VER
     61# include "mscfakes.h"
     62#endif
    6363
    6464#include "cp_extern.h"
     
    7474#ifndef S_ISVTX
    7575# define S_ISVTX 0
    76 #endif 
     76#endif
    7777
    7878int
     
    123123                        }
    124124                }
    125                
     125
    126126                if (fflag) {
    127127                    /* remove existing destination file name,
     
    169169                                                entp->fts_path, to.p_path,
    170170                                                cp_pct(wtotal, fs->st_size));
    171                                                
     171
    172172                                }
    173173                                if (wcount >= (ssize_t)wresid || wcount <= 0)
     
    199199                                                entp->fts_path, to.p_path,
    200200                                                cp_pct(wtotal, fs->st_size));
    201                                                
     201
    202202                                }
    203203                                if (wcount >= (ssize_t)wresid || wcount <= 0)
  • trunk/src/gmake/kmkbuiltin/fts.c

    r621 r809  
    5656#include <stdlib.h>
    5757#include <string.h>
    58 #ifndef _MSC_VER
    5958#include <unistd.h>
    60 #else
    61 #include "mscfakes.h"
    62 #define dirfd(dir) -1
    63 #endif
    64 #include "ftsfake.h"
     59
     60#ifdef __sun__
     61# include "solfakes.h"
     62# define dirfd(dir) -1
     63#endif
     64#ifdef _MSC_VER
     65# include "mscfakes.h"
     66# define dirfd(dir) -1
     67#endif
    6568
    6669#if ! HAVE_NBTOOL_CONFIG_H
     70#ifndef __sun__
    6771#define HAVE_STRUCT_DIRENT_D_NAMLEN 1
     72#endif
    6873#endif
    6974
     
    7883#endif /* __LIBC12_SOURCE__ */
    7984#endif /* __weak_alias */
    80 #endif 
     85#endif
    8186
    8287#ifdef __LIBC12_SOURCE__
     
    120125#undef HAVE_STRUCT_DIRENT_D_NAMLEN
    121126#undef HAVE_FCHDIR
    122 #endif 
     127#endif
    123128
    124129#if defined(__EMX__) || defined(_MSC_VER)
     
    268273                if ((sp->fts_rdir = getcwd(NULL, 0)) != NULL)
    269274                        SET(FTS_NOCHDIR);
    270 #endif 
     275#endif
    271276        }
    272277
     
    374379                if (chdir(sp->fts_rdir))
    375380                        saved_errno =  errno;
    376         free(sp->fts_rdir); 
     381        free(sp->fts_rdir);
    377382                sp->fts_rdir = NULL;
    378 #endif 
     383#endif
    379384        }
    380385
     
    467472                        p->fts_info = FTS_DP;
    468473                        return (p);
    469                 } 
     474                }
    470475
    471476                /* Rebuild if only read the names and now traversing. */
     
    520525#else
    521526                        if (CHDIR(sp, sp->fts_rdir)) {
    522 #endif 
     527#endif
    523528                                SET(FTS_STOP);
    524529                                return (NULL);
     
    587592#else
    588593                if (CHDIR(sp, sp->fts_rdir)) {
    589 #endif 
     594#endif
    590595                        SET(FTS_STOP);
    591596                        return (NULL);
     
    691696                SET(FTS_NAMEONLY);
    692697                instr = BNAMES;
    693         } else 
     698        } else
    694699                instr = BCHILD;
    695700
     
    913918                } else if (nlinks == 0
    914919#ifdef DT_DIR
    915                     || (nostat && 
     920                    || (nostat &&
    916921                    dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
    917922#endif
     
    979984#else
    980985            CHDIR(sp, sp->fts_rdir) :
    981 #endif 
     986#endif
    982987            fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
    983988                cur->fts_info = FTS_ERR;
     
    10391044                                errno = 0;
    10401045                                return (FTS_SLNONE);
    1041                         } 
     1046                        }
    10421047                        p->fts_errno = saved_errno;
    10431048                        goto err;
     
    11141119        for (ap = sp->fts_array, p = head; p; p = p->fts_link)
    11151120                *ap++ = p;
    1116         qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), 
     1121        qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *),
    11171122                (int (*)(const void *, const void *))sp->fts_compar);
    11181123        for (head = *(ap = sp->fts_array); --nitems; ++ap)
     
    12221227 * Most systems will allow creation of paths much longer than MAXPATHLEN, even
    12231228 * though the kernel won't resolve them.  Round up the new size to a power of 2,
    1224  * so we don't realloc the path 2 bytes at a time. 
     1229 * so we don't realloc the path 2 bytes at a time.
    12251230 */
    12261231static int
  • trunk/src/gmake/kmkbuiltin/ftsfake.h

    r621 r809  
    3535#define _FTS_H_
    3636
     37#ifdef _MSC_VER
     38# include "kmkbuiltin/mscfakes.h"
     39#endif
     40
    3741typedef struct {
    3842        struct _ftsent *fts_cur;        /* current node */
     
    6064#ifndef _MSC_VER
    6165#define FTS_WHITEOUT    0x080           /* return whiteout information */
    62 #endif 
     66#endif
    6367#define FTS_OPTIONMASK  0x0ff           /* valid user option mask */
    6468
     
    7983#ifndef _MSC_VER
    8084        int fts_symfd;                  /* fd for symlink */
    81 #endif 
     85#endif
    8286        u_short fts_pathlen;            /* strlen(fts_path) */
    8387        u_short fts_namelen;            /* strlen(fts_name) */
     
    9296#else
    9397        int fts_nlink;          /* link count */
    94 #endif 
     98#endif
    9599#endif
    96100
     
    121125#ifndef _MSC_VER
    122126#define FTS_ISW          0x04           /* this is a whiteout object */
    123 #endif 
     127#endif
    124128        u_short fts_flags;              /* private flags for FTSENT structure */
    125129
     
    138142} FTSENT;
    139143
     144#ifndef __sun__
    140145#ifndef _MSC_VER
    141146#include <sys/cdefs.h>
    142147__BEGIN_DECLS
    143148#else
    144 #define __RENAME(a)
    145 #endif
     149#define __RENAME(a)
     150#endif
     151#endif
    146152
    147 #ifdef __LIBC12_SOURCE__
     153#if defined(__LIBC12_SOURCE__) || defined(__sun__)
    148154FTSENT  *fts_children(FTS *, int);
    149155int      fts_close(FTS *);
     
    162168#endif
    163169
     170#ifndef __sun__
    164171#ifndef _MSC_VER
    165172__END_DECLS
    166173#endif
     174#endif
    167175
    168176#endif /* !_FTS_H_ */
  • trunk/src/gmake/kmkbuiltin/install.c

    r758 r809  
    4848
    4949#ifndef _MSC_VER
    50 #include <sys/param.h>
    51 #ifdef USE_MMAP
    52 #include <sys/mman.h>
    53 #endif
    54 #include <sys/mount.h>
    55 #include <sys/wait.h>
    56 #include <sys/time.h>
    57 #endif
     50# include <sys/param.h>
     51# ifdef USE_MMAP
     52#  include <sys/mman.h>
     53# endif
     54# include <sys/mount.h>
     55# include <sys/wait.h>
     56# include <sys/time.h>
     57#endif /* !_MSC_VER */
    5858#include <sys/stat.h>
    5959
     
    6262#include <errno.h>
    6363#include <fcntl.h>
    64 #ifndef _MSC_VER
    6564#include <grp.h>
    6665#include <paths.h>
    6766#include <pwd.h>
    68 #endif
    6967#include <stdio.h>
    7068#include <stdlib.h>
    7169#include <string.h>
    72 #ifndef _MSC_VER
    7370#include <sysexits.h>
    7471#include <unistd.h>
    75 #else
    76 #include "mscfakes.h"
    77 #endif
    7872#if defined(__EMX__) || defined(_MSC_VER)
    7973# include <process.h>
     74#endif
     75
     76#ifdef __sun__
     77# include "solfakes.h"
     78#endif
     79#ifdef _MSC_VER
     80# include "mscfakes.h"
    8081#endif
    8182
  • trunk/src/gmake/kmkbuiltin/ln.c

    r557 r809  
    4343
    4444#ifndef _MSC_VER
    45 #include <sys/param.h>
     45# include <sys/param.h>
    4646#endif
    4747#include <sys/stat.h>
     
    5353#include <stdlib.h>
    5454#include <string.h>
    55 #ifndef _MSC_VER
    5655#include <unistd.h>
    57 #else
    58 #include "mscfakes.h"
     56
     57#ifdef __sun__
     58# include "getopt.h"
     59#endif
     60#ifdef _MSC_VER
     61# include "mscfakes.h"
    5962#endif
    6063
  • trunk/src/gmake/kmkbuiltin/mkdir.c

    r611 r809  
    4848#include <errno.h>
    4949#ifndef _MSC_VER
    50 #include <libgen.h>
     50# include <libgen.h>
    5151#endif
    5252#include <stdio.h>
    5353#include <stdlib.h>
    5454#include <string.h>
    55 #ifndef _MSC_VER
    5655#include <sysexits.h>
    5756#include <unistd.h>
    58 #else
    59 #include "mscfakes.h"
    60 #include <malloc.h>
     57
     58#ifdef __sun__
     59# include "getopt.h"
     60#endif
     61#ifdef _MSC_VER
     62# include <malloc.h>
     63# include "mscfakes.h"
    6164#endif
    6265
     
    8184    /* reinitialize globals */
    8285    vflag = 0;
    83    
     86
    8487    /* kmk: reset getopt and set progname */
    8588    g_progname = argv[0];
     
    136139                } else if (vflag)
    137140                        (void)printf("%s\n", *argv);
    138                
     141
    139142                if (!success)
    140143                        exitval = 1;
     
    172175                p = strchr(p, '\\');
    173176        }
    174 #endif 
     177#endif
    175178
    176179        p = path;
  • trunk/src/gmake/kmkbuiltin/mscfakes.h

    r805 r809  
    3232#include <time.h>
    3333#include <stdarg.h>
     34#include <malloc.h>
    3435#undef setmode
    3536#include "getopt.h"
  • trunk/src/gmake/kmkbuiltin/mv.c

    r714 r809  
    4949#include <sys/types.h>
    5050#ifndef _MSC_VER
    51 #ifndef __OS2__
    52 #include <sys/acl.h>
    53 #endif
    54 #include <sys/param.h>
    55 #include <sys/time.h>
    56 #include <sys/wait.h>
    57 #include <sys/mount.h>
     51# ifndef __OS2__
     52#  include <sys/acl.h>
     53# endif
     54# include <sys/param.h>
     55# include <sys/time.h>
     56# include <sys/wait.h>
     57# include <sys/mount.h>
    5858#endif
    5959#include <sys/stat.h>
     
    6262#include <errno.h>
    6363#include <fcntl.h>
    64 #ifndef _MSC_VER
    6564#include <grp.h>
    66 #endif
    6765#include <limits.h>
    68 #ifndef _MSC_VER
    6966#include <paths.h>
    7067#include <pwd.h>
    71 #endif
    7268#include <stdio.h>
    7369#include <stdlib.h>
    7470#include <string.h>
    75 #ifndef _MSC_VER
    7671#include <sysexits.h>
    7772#include <unistd.h>
    78 #else
    79 #include "mscfakes.h"
     73
     74#ifdef __sun__
     75# include "solfakes.h"
     76#endif
     77#ifdef _MSC_VER
     78# include "mscfakes.h"
    8079#endif
    8180
  • trunk/src/gmake/kmkbuiltin/printf.c

    r775 r809  
    5151#include "err.h"
    5252#include <errno.h>
    53 #ifndef _MSC_VER
    5453#include <inttypes.h>
    55 #endif
    5654#include <limits.h>
    5755#include <locale.h>
     
    6058#include <stdlib.h>
    6159#include <string.h>
    62 #ifndef _MSC_VER
    6360#include <unistd.h>
    64 #else
    65 #include "mscfakes.h"
     61
     62#ifdef __sun__
     63# include "solfakes.h"
     64#endif
     65#ifdef _MSC_VER
     66# include "mscfakes.h"
    6667#endif
    6768
  • trunk/src/gmake/kmkbuiltin/rm.c

    r557 r809  
    4747#include <sys/stat.h>
    4848#ifndef _MSC_VER
    49 #include <sys/param.h>
    50 #include <sys/mount.h>
     49# include <sys/param.h>
     50# include <sys/mount.h>
    5151#endif
    5252
     
    5555#include <fcntl.h>
    5656#ifdef DO_RMTREE
    57 #include <fts.h>
    58 #endif
    59 #ifndef _MSC_VER
     57# include <fts.h>
     58#endif
    6059#include <grp.h>
    6160#include <pwd.h>
    62 #endif
    6361#include <stdio.h>
    6462#include <stdlib.h>
    6563#include <string.h>
    66 #ifndef _MSC_VER
    6764#include <sysexits.h>
    6865#include <unistd.h>
    69 #else
    70 #include "mscfakes.h"
     66
     67#ifdef __sun__
     68# include "getopt.h"
     69#endif
     70#ifdef _MSC_VER
     71# include "mscfakes.h"
    7172#endif
    7273
  • trunk/src/gmake/kmkbuiltin/rmdir.c

    r695 r809  
    4949#include <string.h>
    5050#include <errno.h>
    51 #ifndef _MSC_VER
    5251#include <unistd.h>
    53 #else
    54 #include <malloc.h>
    55 #include "mscfakes.h"
    56 #endif
    57 #include <getopt.h>
     52#include "getopt.h"
     53
     54#ifdef _MSC_VER
     55# include "mscfakes.h"
     56#endif
    5857
    5958static int rm_path(char *);
     
    8281        /* reinitialize globals */
    8382        ignore_fail_on_not_exist = ignore_fail_on_non_empty = vflag = pflag = 0;
    84        
     83
    8584        /* kmk: reset getopt and set progname */
    8685        g_progname = argv[0];
     
    150149                p = strchr(p, '\\');
    151150        }
    152 #endif 
     151#endif
    153152
    154153        p = path + len;
     
    166165                if (p[-1] == ':' && p - 2 == path)
    167166                        break;
    168 #endif 
     167#endif
    169168
    170169                if (rmdir(path) < 0) {
  • trunk/src/sed/Makefile.kmk

    r801 r809  
    3232        lib/utils.c \
    3333        lib/regex.c
    34 kmk_sed_SOURCES.darwin += \
     34kmk_sed_SOURCES.darwin = \
    3535        lib/strverscmp.c \
    3636        lib/obstack.c \
    3737        lib/getline.c
    38 kmk_sed_SOURCES.freebsd += \
     38kmk_sed_SOURCES.freebsd = \
    3939        lib/strverscmp.c \
    4040        lib/obstack.c \
    4141        lib/getline.c
    42 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)
    43 kmk_sed_SOURCES += \
     42kmk_sed_SOURCES.solaris = \
     43        lib/strverscmp.c \
     44        lib/obstack.c \
     45        lib/getline.c
     46kmk_sed_SOURCES.win = \
    4447        lib/strverscmp.c \
    4548        lib/obstack.c \
     
    4750        lib/getline.c \
    4851        ../lib/startuphacks-win.c
    49 endif
    5052
    5153include $(PATH_KBUILD)/footer.kmk
     
    5557#
    5658config.h.$(BUILD_TARGET) := config.h.$(BUILD_TARGET)
    57 config.h.win32 := config.h.win
    58 config.h.win64 := config.h.win
    59 config.h.nt    := config.h.win
    6059
    6160$(PATH_TARGET)/config.h: $(config.h.$(BUILD_TARGET)) | $(call DIRDEP,$(PATH_TARGET))
Note: See TracChangeset for help on using the changeset viewer.

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