Changeset 809 in kBuild
- Timestamp:
- Jan 29, 2007 5:54:36 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r804 r809 84 84 85 85 ifeq ($(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= VCC7088 TEMPLATE_BIN_DEFS= WINDOWS32 _CONSOLE WIN32 __WIN32__89 TEMPLATE_BIN_DEFS.release= NDEBUG90 TEMPLATE_BIN_SDKS= WINPSDK91 TEMPLATE_BIN_CFLAGS= -W3 -Zi -Zl92 TEMPLATE_BIN_CFLAGS.release= -O293 TEMPLATE_BIN_CFLAGS.profile= -O2 -GH -Gh94 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 += \ 95 95 . \ 96 96 $(PATH_ROOT)/src/gmake/w32/include \ 97 97 $(PATH_ROOT)/src/gmake/glob 98 TEMPLATE_BIN_LDFLAGS= /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG99 ifeq (1,0)100 TEMPLATE_BIN_CFLAGS+= -MT101 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 = \ 102 102 $(PATH_TOOL_VCC70_LIB)/oldnames.lib \ 103 103 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \ 104 104 $(PATH_TOOL_VCC70_LIB)/libcpmt.lib 105 else106 TEMPLATE_BIN_CFLAGS+= -MD107 TEMPLATE_BIN_LIBS= \105 else 106 TEMPLATE_BIN_CFLAGS += -MD 107 TEMPLATE_BIN_LIBS = \ 108 108 $(PATH_TOOL_VCC70_LIB)/oldnames.lib \ 109 109 $(PATH_TOOL_VCC70_LIB)/msvcrt.lib 110 # $(PATH_TOOL_VCC70_LIB)/msvcprt.lib111 endif112 TEMPLATE_BIN_LIBS.profile= g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib110 # $(PATH_TOOL_VCC70_LIB)/msvcprt.lib 111 endif 112 TEMPLATE_BIN_LIBS.profile = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib 113 113 ifdef NIX_INSTALL_DIR 114 TEMPLATE_BIN_INST= $(NIX_INSTALL_DIR_BIN)/114 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/ 115 115 else 116 TEMPLATE_BIN_INST= kBuild/bin/win.$(BUILD_TARGET_ARCH)/116 TEMPLATE_BIN_INST = kBuild/bin/win.$(BUILD_TARGET_ARCH)/ 117 117 endif 118 118 endif … … 121 121 TEMPLATE_BIN_TOOL = GCC3 122 122 TEMPLATE_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) 127 125 TEMPLATE_BIN_LIBS += iconv intl 128 126 TEMPLATE_BIN_LIBPATH += /usr/local/lib 129 127 TEMPLATE_BIN_INCS += $(PATH_ROOT)/src/gmake/glob /usr/local/include 130 endif 128 endif 129 ifeq ($(BUILD_TARGET),linux) 130 TEMPLATE_BIN_LIBS += rt 131 ifeq ($(BUILD_TARGET),solaris) 132 TEMPLATE_BIN_LIBS += rt 133 endif 131 134 ifdef NIX_INSTALL_DIR 132 135 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/ -
trunk/src/ash/Makefile.kmk
r785 r809 16 16 kmk_ash_DEFS = lint SHELL SMALL 17 17 kmk_ash_DEFS.linux = BSD 18 kmk_ash_DEFS.solaris = BSD 18 19 kmk_ash_DEFS.win = \ 19 20 BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS … … 67 68 win/err.c \ 68 69 win/dirent.c \ 70 sys_signame.c \ 71 strlcpy.c \ 72 setmode.c 73 kmk_ash_SOURCES.solaris = \ 69 74 sys_signame.c \ 70 75 strlcpy.c \ -
trunk/src/ash/alias.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/arith.y
r626 r809 34 34 */ 35 35 36 #ifdef HAVE_SYS_CDEFS_H 36 37 #include <sys/cdefs.h> 38 #endif 37 39 #ifndef lint 38 40 #if 0 -
trunk/src/ash/arith_lex.l
r626 r809 35 35 */ 36 36 37 #ifdef HAVE_SYS_CDEFS_H 37 38 #include <sys/cdefs.h> 39 #endif 38 40 #ifndef lint 39 41 #if 0 -
trunk/src/ash/bltin/kill.c
r632 r809 30 30 */ 31 31 32 #ifndef __sun__ 32 33 #include <sys/cdefs.h> 34 #endif 33 35 #if !defined(lint) && !defined(SHELL) 34 36 __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\ … … 45 47 46 48 #include <ctype.h> 49 #ifndef __sun__ 47 50 #include <err.h> 51 #endif 48 52 #include <errno.h> 49 53 #include <signal.h> -
trunk/src/ash/bltin/test.c
r632 r809 11 11 */ 12 12 13 #ifndef __sun__ 13 14 #include <sys/cdefs.h> 15 #endif 14 16 #ifndef lint 15 17 __RCSID("$NetBSD: test.c,v 1.26 2005/02/10 06:56:55 simonb Exp $"); … … 20 22 21 23 #include <ctype.h> 24 #ifndef __sun__ 22 25 #include <err.h> 26 #endif 23 27 #include <errno.h> 24 28 #include <stdio.h> -
trunk/src/ash/cd.c
r626 r809 33 33 */ 34 34 35 #ifndef __sun__ 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/error.c
r632 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/eval.c
r629 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 53 55 #ifdef HAVE_SYSCTL_H 54 56 #include <sys/sysctl.h> 57 #endif 58 #ifdef __sun__ 59 #include <iso/limits_iso.h> 55 60 #endif 56 61 … … 609 614 static char *sys_path = NULL; 610 615 static int mib[] = {CTL_USER, USER_CS_PATH}; 611 #endif 616 #endif 612 617 #ifdef PC_PATH_SEP 613 618 static char def_path[] = "PATH=/usr/bin;/bin;/usr/sbin;/sbin"; … … 632 637 #else 633 638 return def_path; 634 #endif 639 #endif 635 640 } 636 641 -
trunk/src/ash/exec.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/expand.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 51 53 #include <stdlib.h> 52 54 #include <stdio.h> 55 #ifdef __sun__ 56 #include <iso/limits_iso.h> 57 #endif 53 58 54 59 /* … … 101 106 STATIC void varvalue(char *, int, int, int); 102 107 STATIC void recordregion(int, int, int); 103 STATIC void removerecordregions(int); 108 STATIC void removerecordregions(int); 104 109 STATIC void ifsbreakup(char *, struct arglist *); 105 110 STATIC void ifsfree(void); … … 305 310 306 311 307 STATIC void 312 STATIC void 308 313 removerecordregions(int endoff) 309 314 { … … 328 333 return; 329 334 } 330 335 331 336 ifslastp = &ifsfirst; 332 337 while (ifslastp->next && ifslastp->next->begoff < endoff) … … 562 567 loc--; 563 568 if ((varflags & VSQUOTE) && loc > startp && 564 *(loc - 1) == CTLESC) { 569 *(loc - 1) == CTLESC) { 565 570 for (q = startp; q < loc; q++) 566 571 if (*q == CTLESC) … … 740 745 if (subevalvar(p, var, 0, subtype, startloc, varflags)) { 741 746 varflags &= ~VSNUL; 742 /* 743 * Remove any recorded regions beyond 744 * start of variable 747 /* 748 * Remove any recorded regions beyond 749 * start of variable 745 750 */ 746 751 removerecordregions(startloc); -
trunk/src/ash/histedit.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 43 45 44 46 #include <sys/param.h> 47 #ifndef __sun__ 45 48 #include <paths.h> 49 #endif 46 50 #include <stdio.h> 47 51 #include <stdlib.h> … … 154 158 else if (Eflag) 155 159 el_set(el, EL_EDITOR, "emacs"); 156 el_set(el, EL_BIND, "^I", 160 el_set(el, EL_BIND, "^I", 157 161 tabcomplete ? "rl-complete" : "ed-insert", NULL); 158 162 el_source(el, NULL); -
trunk/src/ash/input.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 48 50 #include <stdlib.h> 49 51 #include <string.h> 52 #ifdef __sun__ 53 #include <iso/limits_iso.h> 54 #endif 50 55 51 56 /* -
trunk/src/ash/jobs.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #else 38 #define _PATH_DEVNULL "/dev/null" 39 #endif 36 40 #ifndef lint 37 41 #if 0 … … 43 47 44 48 #include <fcntl.h> 49 #ifdef __sun__ 50 #define sys_siglist _sys_siglist 51 #endif 45 52 #include <signal.h> 46 53 #include <errno.h> 47 54 #include <unistd.h> 48 55 #include <stdlib.h> 56 #ifndef __sun__ 49 57 #include <paths.h> 58 #endif 50 59 #include <sys/types.h> 51 60 #include <sys/param.h> 52 #if def BSD61 #if defined(BSD) || defined(__sun__) 53 62 #include <sys/wait.h> 54 63 #include <sys/time.h> … … 688 697 int i; 689 698 const char *err_msg = "No such job: %s"; 690 699 691 700 if (name == NULL) { 692 701 #if JOBS -
trunk/src/ash/mail.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/main.c
r638 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\ … … 179 181 init_syntax(); 180 182 } 181 #endif 183 #endif 182 184 init(); 183 185 setstackmark(&smark); … … 202 204 if (sflag == 0 || minusc) { 203 205 static int sigs[] = { 204 SIGINT, SIGQUIT, SIGHUP, 206 SIGINT, SIGQUIT, SIGHUP, 205 207 #ifdef SIGTSTP 206 208 SIGTSTP, -
trunk/src/ash/memalloc.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 224 226 /* 225 227 * 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 227 229 */ 228 230 xmark = markp; -
trunk/src/ash/miscbltin.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/mkbuiltins
r629 r809 1 #!/bin/sh - 1 #!/bin/sh -x 2 2 # $NetBSD: mkbuiltins,v 1.21 2004/06/06 07:03:11 christos Exp $ 3 3 # … … 66 66 */ 67 67 68 #ifdef HAVE_SYS_CDEFS_H 68 69 #include <sys/cdefs.h> 70 #endif 69 71 70 72 struct builtincmd { -
trunk/src/ash/mystring.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/options.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/output.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/parser.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 43 45 44 46 #include <stdlib.h> 47 #ifdef __sun__ 48 #include <iso/limits_iso.h> 49 #endif 45 50 46 51 #include "shell.h" … … 746 751 if (**pp == *wordtext && equal(*pp, wordtext)) 747 752 { 748 lasttoken = t = pp - 753 lasttoken = t = pp - 749 754 parsekwd + KWDOFFSET; 750 755 TRACE(("keyword %s recognized\n", tokname[t])); -
trunk/src/ash/redir.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/shell.h
r626 r809 70 70 #define MKINIT /* empty */ 71 71 72 #ifdef HAVE_SYS_CDEFS_H 72 73 #include <sys/cdefs.h> 74 #endif 73 75 74 76 extern char nullstr[1]; /* null string */ -
trunk/src/ash/show.c
r626 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 -
trunk/src/ash/syntax.c
r638 r809 1 1 /* $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 2 7 3 8 #include "shell.h" -
trunk/src/ash/syntax.h
r638 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #include <ctype.h> 37 39 … … 89 91 extern const char arisyntax[]; 90 92 extern const char is_type[]; 91 #endif 93 #endif -
trunk/src/ash/trap.c
r630 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 64 66 extern void init_sys_signame(void); 65 67 extern char sys_signame[NSIG][16]; 66 #endif 68 #endif 67 69 68 70 /* … … 84 86 int pendingsigs; /* indicates some signal received */ 85 87 88 #ifdef __sun__ 89 typedef void (*sig_t) (int); 90 #endif 86 91 static int getsigaction(int, sig_t *); 87 92 … … 101 106 if (strcasecmp(p, "exit") == 0 ) 102 107 return 0; 103 108 104 109 if (strncasecmp(p, "sig", 3) == 0) 105 110 p += 3; … … 107 112 #ifndef HAVE_SYS_SIGNAME 108 113 init_sys_signame(); 109 #endif 114 #endif 110 115 for (i = 0; i < NSIG; ++i) 111 116 if (strcasecmp (p, sys_signame[i]) == 0) … … 125 130 #ifndef HAVE_SYS_SIGNAME 126 131 init_sys_signame(); 127 #endif 132 #endif 128 133 129 134 for (n = 1; n < NSIG; n++) { … … 148 153 #ifndef HAVE_SYS_SIGNAME 149 154 init_sys_signame(); 150 #endif 155 #endif 151 156 152 157 if (argc <= 1) { -
trunk/src/ash/var.c
r637 r809 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 35 36 #include <sys/cdefs.h> 37 #endif 36 38 #ifndef lint 37 39 #if 0 … … 45 47 #include <stdlib.h> 46 48 #include <strings.h> 49 #ifndef __sun__ 47 50 #include <paths.h> 51 #else 52 #define _PATH_DEFPATH "/usr/bin:/usr/sbin" 53 #include <iso/limits_iso.h> 54 #endif 48 55 49 56 #ifdef PC_OS2_LIBPATHS … … 123 130 #ifdef _MSC_VER 124 131 struct var vpath2; 125 #endif 132 #endif 126 133 struct var vps1; 127 134 struct var vps2; … … 155 162 { &vpath2, VSTRFIXED|VTEXTFIXED, "Path=", 156 163 changepath }, 157 #endif 164 #endif 158 165 /* 159 166 * vps1 depends on uid -
trunk/src/gmake/Makefile.kmk
r778 r809 5 5 include $(PATH_KBUILD)/header.kmk 6 6 7 8 # 9 # Template for kmk and the kmk_* binaries in this makefile. 10 # 11 TEMPLATE_BIN-KMK = Template for src/gmake binaries 12 TEMPLATE_BIN-KMK_EXTENDS = BIN 13 TEMPLATE_BIN-KMK_DEFS = HAVE_CONFIG_H $(TEMPLATE_BIN_DEFS) 14 TEMPLATE_BIN-KMK_DEPS = $(PATH_TARGET)/config.h 15 TEMPLATE_BIN-KMK_DEPS.solaris = \ 16 $(PATH_TARGET)/fts.h \ 17 $(PATH_TARGET)/paths.h 18 TEMPLATE_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 26 TEMPLATE_BIN-KMK_INCS = $(PATH_TARGET) . $(TEMPLATE_BIN_INCS) 27 TEMPLATE_BIN-KMK_INCS.darwin = glob 28 TEMPLATE_BIN-KMK_INCS.freebsd = glob 29 TEMPLATE_BIN-KMK_INCS.solaris = glob 30 TEMPLATE_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 # 37 LIBRARIES += kmkmissing 38 kmkmissing_TEMPLATE = BIN-KMK 39 kmkmissing_NOINST = 1 40 kmkmissing_SOURCES = \ 41 kmkbuiltin/err.c \ 42 kmkbuiltin/setmode.c \ 43 kmkbuiltin/strmode.c \ 44 kmkbuiltin/strlcpy.c 45 46 kmkmissing_SOURCES.darwin = \ 47 kmkbuiltin/darwin.c \ 48 glob/glob.c \ 49 glob/fnmatch.c 50 51 kmkmissing_SOURCES.freebsd = \ 52 glob/glob.c \ 53 glob/fnmatch.c 54 55 kmkmissing_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 63 kmkmissing_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 7 77 # 8 78 # kmk … … 10 80 PROGRAMS += kmk 11 81 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 82 kmk_TEMPLATE = BIN-KMK 20 83 21 84 kmk_DEFS = \ 22 HAVE_CONFIG_H \23 85 NO_ARCHIVES \ 86 EXPERIMENTAL \ 87 CONFIG_WITH_TOUPPER_TOLOWER \ 88 \ 89 KMK \ 90 KMK_HELPERS \ 91 VARIABLE_HASH \ 24 92 CONFIG_NO_DEFAULT_SUFFIXES \ 25 93 CONFIG_NO_DEFAULT_PATTERN_RULES \ … … 29 97 CONFIG_WITH_EXTENDED_NOTPARALLEL \ 30 98 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 \38 99 CONFIG_WITH_OPTIMIZATION_HACKS \ 39 100 CONFIG_WITH_VALUE_LENGTH \ 101 CONFIG_WITH_ABSPATHEX \ 40 102 CONFIG_WITH_COMPARE \ 41 103 CONFIG_WITH_STACK \ 42 104 CONFIG_WITH_MATH \ 43 EXPERIMENTAL\105 CONFIG_PRETTY_COMMAND_PRINTING \ 44 106 \ 45 107 BUILD_PLATFORM=\"$(BUILD_TARGET)\" \ 46 108 BUILD_PLATFORM_ARCH=\"$(BUILD_TARGET_ARCH)\" \ 47 109 BUILD_PLATFORM_CPU=\"$(BUILD_TARGET_CPU)\" 48 kmk_DEFS.win = CONFIG_NEW_WIN32_CTRL_EVENT 110 kmk_DEFS.win = \ 111 CONFIG_NEW_WIN32_CTRL_EVENT 49 112 50 113 kmk_SOURCES = \ … … 73 136 kbuild.c 74 137 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.c87 endif88 89 kmk_SOURCES.freebsd = \90 glob/glob.c \91 glob/fnmatch.c92 93 kmk_SOURCES.darwin = \94 glob/glob.c \95 glob/fnmatch.c96 97 138 # 98 139 # kmkbuiltin commands … … 113 154 kmkbuiltin/rm.c \ 114 155 kmkbuiltin/rmdir.c \ 115 \116 kmkbuiltin/err.c \117 kmkbuiltin/setmode.c \118 kmkbuiltin/strmode.c \119 kmkbuiltin/strlcpy.c120 121 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),)122 kmk_SOURCES += \123 kmkbuiltin/mscfakes.c \124 kmkbuiltin/fts.c125 endif126 127 kmk_SOURCES.darwin += \128 kmkbuiltin/darwin.c129 156 130 157 … … 132 159 # Standalone kmkbuiltin commands. 133 160 # 161 ## @todo should probably put all those 134 162 PROGRAMS += kmk_append kmk_cat kmk_cp kmk_echo kmk_mkdir kmk_mv kmk_install kmk_ln kmk_printf kmk_rm kmk_rmdir 135 163 136 kmk_append_TEMPLATE = BIN 164 kmk_append_TEMPLATE = BIN-KMK 137 165 kmk_append_DEFS = kmk_builtin_append=main 138 166 kmk_append_INCS = . 139 167 kmk_append_SOURCES = \ 140 kmkbuiltin/append.c \ 141 kmkbuiltin/err.c 142 143 kmk_cat_TEMPLATE = BIN 168 kmkbuiltin/append.c 169 170 kmk_cat_TEMPLATE = BIN-KMK 144 171 kmk_cat_DEFS = kmk_builtin_cat=main 145 172 kmk_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 175 kmk_cp_TEMPLATE = BIN-KMK 158 176 kmk_cp_DEFS = kmk_builtin_cp=main 159 177 kmk_cp_SOURCES = \ 160 178 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 181 kmk_echo_TEMPLATE = BIN-KMK 178 182 kmk_echo_DEFS = kmk_builtin_echo=main 179 183 kmk_echo_SOURCES = \ 180 184 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 186 kmk_install_TEMPLATE = BIN-KMK 188 187 kmk_install_DEFS = kmk_builtin_install=main 189 188 kmk_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 191 kmk_ln_TEMPLATE = BIN-KMK 204 192 kmk_ln_DEFS = kmk_builtin_ln=main 205 193 kmk_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 196 kmk_mkdir_TEMPLATE = BIN-KMK 218 197 kmk_mkdir_DEFS = kmk_builtin_mkdir=main 219 198 kmk_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 201 kmk_mv_TEMPLATE = BIN-KMK 233 202 kmk_mv_DEFS = kmk_builtin_mv=main 234 203 kmk_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 206 kmk_printf_TEMPLATE = BIN-KMK 248 207 kmk_printf_DEFS = kmk_builtin_printf=main 249 208 kmk_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 211 kmk_rm_TEMPLATE = BIN-KMK 262 212 kmk_rm_DEFS = kmk_builtin_rm=main 263 213 kmk_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 216 kmk_rmdir_TEMPLATE = BIN-KMK 277 217 kmk_rmdir_DEFS = kmk_builtin_rmdir=main 278 218 kmk_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 291 220 292 221 … … 295 224 # 296 225 PROGRAMS += 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 227 kmk_gmake_TEMPLATE = BIN-KMK 304 228 kmk_gmake_DEFS = \ 305 229 HAVE_CONFIG_H \ … … 332 256 remote-stub.c 333 257 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.c346 endif347 348 kmk_gmake_SOURCES.freebsd = \349 glob/glob.c \350 glob/fnmatch.c351 352 kmk_gmake_SOURCES.darwin = \353 glob/glob.c \354 glob/fnmatch.c355 356 357 258 358 259 include $(PATH_KBUILD)/footer.kmk … … 364 265 config.h.$(BUILD_TARGET) := config.h.$(BUILD_TARGET) 365 266 config.h.win := config.h.W32 366 config.h.win32 := config.h.W32367 config.h.win64 := config.h.W32368 config.h.nt := config.h.W32369 267 370 268 $(PATH_TARGET)/config.h: $(config.h.$(BUILD_TARGET)) 371 269 $(MKDIR) -p $(dir $@) 372 270 $(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) > $@ 373 295 374 296 … … 430 352 431 353 test_all: test_math test_stack test_shell 354 -
trunk/src/gmake/kmkbuiltin/cat.c
r611 r809 49 49 #else 50 50 #define NO_UDOM_SUPPORT /* kmk */ 51 #endif 51 #endif 52 52 53 53 #ifndef _MSC_VER 54 # include <sys/param.h>54 # include <sys/param.h> 55 55 #endif 56 56 #include <sys/stat.h> 57 57 #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> 61 61 #endif 62 62 … … 68 68 #include <stdlib.h> 69 69 #include <string.h> 70 #ifndef _MSC_VER71 70 #include <unistd.h> 72 #else73 #include "mscfakes.h"74 #endif75 71 #include <stddef.h> 72 73 #ifdef __sun__ 74 # include "solfakes.h" 75 #endif 76 #ifdef _MSC_VER 77 # include "mscfakes.h" 78 #endif 76 79 77 80 int bflag, eflag, nflag, sflag, tflag, vflag; … … 111 114 #ifdef kmk_builtin_cat /* kmk did this already. */ 112 115 setlocale(LC_CTYPE, ""); 113 #endif 116 #endif 114 117 115 118 while ((ch = getopt(argc, argv, "benstuv")) != -1) … … 285 288 #else 286 289 bsize = MAX(sbuf.st_blksize, 1024); 287 #endif 290 #endif 288 291 if ((buf = malloc(bsize)) == NULL) 289 292 return err(1, "buffer"); -
trunk/src/gmake/kmkbuiltin/cp.c
r557 r809 65 65 #include "err.h" 66 66 #include <errno.h> 67 #ifndef _MSC_VER68 67 #include <fts.h> 69 #endif70 68 #include <limits.h> 71 69 #include <signal.h> … … 73 71 #include <stdlib.h> 74 72 #include <string.h> 75 #ifndef _MSC_VER76 73 #include <unistd.h> 77 #else 78 #i nclude "mscfakes.h"79 # include "ftsfake.h"74 75 #ifdef _MSC_VER 76 # include "mscfakes.h" 80 77 #endif 81 78 … … 471 468 if (copy_file(curr, dne)) 472 469 badcp = rval = 1; 473 } else { 470 } else { 474 471 if (copy_link(curr, !dne)) 475 472 badcp = rval = 1; -
trunk/src/gmake/kmkbuiltin/cp_utils.c
r370 r809 37 37 38 38 #ifndef _MSC_VER 39 # include <sys/param.h>40 #endif 39 # include <sys/param.h> 40 #endif 41 41 #include <sys/stat.h> 42 42 #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED 43 # include <sys/mman.h>43 # include <sys/mman.h> 44 44 #endif 45 45 … … 47 47 #include <errno.h> 48 48 #include <fcntl.h> 49 #ifndef _MSC_VER50 49 #include <fts.h> 51 #endif52 50 #include <limits.h> 53 51 #include <stdio.h> 54 52 #include <stdlib.h> 55 53 #include <signal.h> 56 #ifndef _MSC_VER57 54 #include <sysexits.h> 58 55 #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 63 63 64 64 #include "cp_extern.h" … … 74 74 #ifndef S_ISVTX 75 75 # define S_ISVTX 0 76 #endif 76 #endif 77 77 78 78 int … … 123 123 } 124 124 } 125 125 126 126 if (fflag) { 127 127 /* remove existing destination file name, … … 169 169 entp->fts_path, to.p_path, 170 170 cp_pct(wtotal, fs->st_size)); 171 171 172 172 } 173 173 if (wcount >= (ssize_t)wresid || wcount <= 0) … … 199 199 entp->fts_path, to.p_path, 200 200 cp_pct(wtotal, fs->st_size)); 201 201 202 202 } 203 203 if (wcount >= (ssize_t)wresid || wcount <= 0) -
trunk/src/gmake/kmkbuiltin/fts.c
r621 r809 56 56 #include <stdlib.h> 57 57 #include <string.h> 58 #ifndef _MSC_VER59 58 #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 65 68 66 69 #if ! HAVE_NBTOOL_CONFIG_H 70 #ifndef __sun__ 67 71 #define HAVE_STRUCT_DIRENT_D_NAMLEN 1 72 #endif 68 73 #endif 69 74 … … 78 83 #endif /* __LIBC12_SOURCE__ */ 79 84 #endif /* __weak_alias */ 80 #endif 85 #endif 81 86 82 87 #ifdef __LIBC12_SOURCE__ … … 120 125 #undef HAVE_STRUCT_DIRENT_D_NAMLEN 121 126 #undef HAVE_FCHDIR 122 #endif 127 #endif 123 128 124 129 #if defined(__EMX__) || defined(_MSC_VER) … … 268 273 if ((sp->fts_rdir = getcwd(NULL, 0)) != NULL) 269 274 SET(FTS_NOCHDIR); 270 #endif 275 #endif 271 276 } 272 277 … … 374 379 if (chdir(sp->fts_rdir)) 375 380 saved_errno = errno; 376 free(sp->fts_rdir); 381 free(sp->fts_rdir); 377 382 sp->fts_rdir = NULL; 378 #endif 383 #endif 379 384 } 380 385 … … 467 472 p->fts_info = FTS_DP; 468 473 return (p); 469 } 474 } 470 475 471 476 /* Rebuild if only read the names and now traversing. */ … … 520 525 #else 521 526 if (CHDIR(sp, sp->fts_rdir)) { 522 #endif 527 #endif 523 528 SET(FTS_STOP); 524 529 return (NULL); … … 587 592 #else 588 593 if (CHDIR(sp, sp->fts_rdir)) { 589 #endif 594 #endif 590 595 SET(FTS_STOP); 591 596 return (NULL); … … 691 696 SET(FTS_NAMEONLY); 692 697 instr = BNAMES; 693 } else 698 } else 694 699 instr = BCHILD; 695 700 … … 913 918 } else if (nlinks == 0 914 919 #ifdef DT_DIR 915 || (nostat && 920 || (nostat && 916 921 dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN) 917 922 #endif … … 979 984 #else 980 985 CHDIR(sp, sp->fts_rdir) : 981 #endif 986 #endif 982 987 fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) { 983 988 cur->fts_info = FTS_ERR; … … 1039 1044 errno = 0; 1040 1045 return (FTS_SLNONE); 1041 } 1046 } 1042 1047 p->fts_errno = saved_errno; 1043 1048 goto err; … … 1114 1119 for (ap = sp->fts_array, p = head; p; p = p->fts_link) 1115 1120 *ap++ = p; 1116 qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), 1121 qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), 1117 1122 (int (*)(const void *, const void *))sp->fts_compar); 1118 1123 for (head = *(ap = sp->fts_array); --nitems; ++ap) … … 1222 1227 * Most systems will allow creation of paths much longer than MAXPATHLEN, even 1223 1228 * 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. 1225 1230 */ 1226 1231 static int -
trunk/src/gmake/kmkbuiltin/ftsfake.h
r621 r809 35 35 #define _FTS_H_ 36 36 37 #ifdef _MSC_VER 38 # include "kmkbuiltin/mscfakes.h" 39 #endif 40 37 41 typedef struct { 38 42 struct _ftsent *fts_cur; /* current node */ … … 60 64 #ifndef _MSC_VER 61 65 #define FTS_WHITEOUT 0x080 /* return whiteout information */ 62 #endif 66 #endif 63 67 #define FTS_OPTIONMASK 0x0ff /* valid user option mask */ 64 68 … … 79 83 #ifndef _MSC_VER 80 84 int fts_symfd; /* fd for symlink */ 81 #endif 85 #endif 82 86 u_short fts_pathlen; /* strlen(fts_path) */ 83 87 u_short fts_namelen; /* strlen(fts_name) */ … … 92 96 #else 93 97 int fts_nlink; /* link count */ 94 #endif 98 #endif 95 99 #endif 96 100 … … 121 125 #ifndef _MSC_VER 122 126 #define FTS_ISW 0x04 /* this is a whiteout object */ 123 #endif 127 #endif 124 128 u_short fts_flags; /* private flags for FTSENT structure */ 125 129 … … 138 142 } FTSENT; 139 143 144 #ifndef __sun__ 140 145 #ifndef _MSC_VER 141 146 #include <sys/cdefs.h> 142 147 __BEGIN_DECLS 143 148 #else 144 #define __RENAME(a) 145 #endif 149 #define __RENAME(a) 150 #endif 151 #endif 146 152 147 #if def __LIBC12_SOURCE__153 #if defined(__LIBC12_SOURCE__) || defined(__sun__) 148 154 FTSENT *fts_children(FTS *, int); 149 155 int fts_close(FTS *); … … 162 168 #endif 163 169 170 #ifndef __sun__ 164 171 #ifndef _MSC_VER 165 172 __END_DECLS 166 173 #endif 174 #endif 167 175 168 176 #endif /* !_FTS_H_ */ -
trunk/src/gmake/kmkbuiltin/install.c
r758 r809 48 48 49 49 #ifndef _MSC_VER 50 # include <sys/param.h>51 # ifdef USE_MMAP52 # include <sys/mman.h>53 # endif54 # 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 */ 58 58 #include <sys/stat.h> 59 59 … … 62 62 #include <errno.h> 63 63 #include <fcntl.h> 64 #ifndef _MSC_VER65 64 #include <grp.h> 66 65 #include <paths.h> 67 66 #include <pwd.h> 68 #endif69 67 #include <stdio.h> 70 68 #include <stdlib.h> 71 69 #include <string.h> 72 #ifndef _MSC_VER73 70 #include <sysexits.h> 74 71 #include <unistd.h> 75 #else76 #include "mscfakes.h"77 #endif78 72 #if defined(__EMX__) || defined(_MSC_VER) 79 73 # include <process.h> 74 #endif 75 76 #ifdef __sun__ 77 # include "solfakes.h" 78 #endif 79 #ifdef _MSC_VER 80 # include "mscfakes.h" 80 81 #endif 81 82 -
trunk/src/gmake/kmkbuiltin/ln.c
r557 r809 43 43 44 44 #ifndef _MSC_VER 45 # include <sys/param.h>45 # include <sys/param.h> 46 46 #endif 47 47 #include <sys/stat.h> … … 53 53 #include <stdlib.h> 54 54 #include <string.h> 55 #ifndef _MSC_VER56 55 #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" 59 62 #endif 60 63 -
trunk/src/gmake/kmkbuiltin/mkdir.c
r611 r809 48 48 #include <errno.h> 49 49 #ifndef _MSC_VER 50 # include <libgen.h>50 # include <libgen.h> 51 51 #endif 52 52 #include <stdio.h> 53 53 #include <stdlib.h> 54 54 #include <string.h> 55 #ifndef _MSC_VER56 55 #include <sysexits.h> 57 56 #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" 61 64 #endif 62 65 … … 81 84 /* reinitialize globals */ 82 85 vflag = 0; 83 86 84 87 /* kmk: reset getopt and set progname */ 85 88 g_progname = argv[0]; … … 136 139 } else if (vflag) 137 140 (void)printf("%s\n", *argv); 138 141 139 142 if (!success) 140 143 exitval = 1; … … 172 175 p = strchr(p, '\\'); 173 176 } 174 #endif 177 #endif 175 178 176 179 p = path; -
trunk/src/gmake/kmkbuiltin/mscfakes.h
r805 r809 32 32 #include <time.h> 33 33 #include <stdarg.h> 34 #include <malloc.h> 34 35 #undef setmode 35 36 #include "getopt.h" -
trunk/src/gmake/kmkbuiltin/mv.c
r714 r809 49 49 #include <sys/types.h> 50 50 #ifndef _MSC_VER 51 # ifndef __OS2__52 # include <sys/acl.h>53 # endif54 # 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> 58 58 #endif 59 59 #include <sys/stat.h> … … 62 62 #include <errno.h> 63 63 #include <fcntl.h> 64 #ifndef _MSC_VER65 64 #include <grp.h> 66 #endif67 65 #include <limits.h> 68 #ifndef _MSC_VER69 66 #include <paths.h> 70 67 #include <pwd.h> 71 #endif72 68 #include <stdio.h> 73 69 #include <stdlib.h> 74 70 #include <string.h> 75 #ifndef _MSC_VER76 71 #include <sysexits.h> 77 72 #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" 80 79 #endif 81 80 -
trunk/src/gmake/kmkbuiltin/printf.c
r775 r809 51 51 #include "err.h" 52 52 #include <errno.h> 53 #ifndef _MSC_VER54 53 #include <inttypes.h> 55 #endif56 54 #include <limits.h> 57 55 #include <locale.h> … … 60 58 #include <stdlib.h> 61 59 #include <string.h> 62 #ifndef _MSC_VER63 60 #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" 66 67 #endif 67 68 -
trunk/src/gmake/kmkbuiltin/rm.c
r557 r809 47 47 #include <sys/stat.h> 48 48 #ifndef _MSC_VER 49 # include <sys/param.h>50 # include <sys/mount.h>49 # include <sys/param.h> 50 # include <sys/mount.h> 51 51 #endif 52 52 … … 55 55 #include <fcntl.h> 56 56 #ifdef DO_RMTREE 57 #include <fts.h> 58 #endif 59 #ifndef _MSC_VER 57 # include <fts.h> 58 #endif 60 59 #include <grp.h> 61 60 #include <pwd.h> 62 #endif63 61 #include <stdio.h> 64 62 #include <stdlib.h> 65 63 #include <string.h> 66 #ifndef _MSC_VER67 64 #include <sysexits.h> 68 65 #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" 71 72 #endif 72 73 -
trunk/src/gmake/kmkbuiltin/rmdir.c
r695 r809 49 49 #include <string.h> 50 50 #include <errno.h> 51 #ifndef _MSC_VER52 51 #include <unistd.h> 53 # else54 #include <malloc.h> 55 #i nclude "mscfakes.h"56 # endif57 # include <getopt.h>52 #include "getopt.h" 53 54 #ifdef _MSC_VER 55 # include "mscfakes.h" 56 #endif 58 57 59 58 static int rm_path(char *); … … 82 81 /* reinitialize globals */ 83 82 ignore_fail_on_not_exist = ignore_fail_on_non_empty = vflag = pflag = 0; 84 83 85 84 /* kmk: reset getopt and set progname */ 86 85 g_progname = argv[0]; … … 150 149 p = strchr(p, '\\'); 151 150 } 152 #endif 151 #endif 153 152 154 153 p = path + len; … … 166 165 if (p[-1] == ':' && p - 2 == path) 167 166 break; 168 #endif 167 #endif 169 168 170 169 if (rmdir(path) < 0) { -
trunk/src/sed/Makefile.kmk
r801 r809 32 32 lib/utils.c \ 33 33 lib/regex.c 34 kmk_sed_SOURCES.darwin += \34 kmk_sed_SOURCES.darwin = \ 35 35 lib/strverscmp.c \ 36 36 lib/obstack.c \ 37 37 lib/getline.c 38 kmk_sed_SOURCES.freebsd += \38 kmk_sed_SOURCES.freebsd = \ 39 39 lib/strverscmp.c \ 40 40 lib/obstack.c \ 41 41 lib/getline.c 42 ifeq ($(filter-out win32 win64 win nt,$(BUILD_TARGET)),) 43 kmk_sed_SOURCES += \ 42 kmk_sed_SOURCES.solaris = \ 43 lib/strverscmp.c \ 44 lib/obstack.c \ 45 lib/getline.c 46 kmk_sed_SOURCES.win = \ 44 47 lib/strverscmp.c \ 45 48 lib/obstack.c \ … … 47 50 lib/getline.c \ 48 51 ../lib/startuphacks-win.c 49 endif50 52 51 53 include $(PATH_KBUILD)/footer.kmk … … 55 57 # 56 58 config.h.$(BUILD_TARGET) := config.h.$(BUILD_TARGET) 57 config.h.win32 := config.h.win58 config.h.win64 := config.h.win59 config.h.nt := config.h.win60 59 61 60 $(PATH_TARGET)/config.h: $(config.h.$(BUILD_TARGET)) | $(call DIRDEP,$(PATH_TARGET))
Note:
See TracChangeset
for help on using the changeset viewer.