Index: trunk/essentials/app-arch/gzip/Makefile.kmk
===================================================================
--- trunk/essentials/app-arch/gzip/Makefile.kmk	(revision 3330)
+++ trunk/essentials/app-arch/gzip/Makefile.kmk	(revision 3330)
@@ -0,0 +1,157 @@
+# $Id$
+## @file
+#
+# kNIX Makefile for gzip
+#
+# Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
+#
+#
+# This file is part of kLIBC.
+#
+# kLIBC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# kLIBC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with kLIBC; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+DEPTH = ../../..
+include $(PATH_KBUILD)/header.kmk
+
+
+#
+# Internal library.
+#
+LIBRARIES += libgzip
+libgzip_TEMPLATE = usr.bin
+libgzip_NOINST = yes
+libgzip_DEFS = HAVE_CONFIG_H
+libgzip_INCS = $(PATH_TARGET) lib
+libgzip_SOURCES = \
+	lib/xalloc-die.c \
+	lib/creat-safer.c \
+	lib/dup-safer.c \
+	lib/exitfail.c \
+	lib/fd-safer.c \
+	lib/open-safer.c \
+	lib/pipe-safer.c \
+	lib/utimens.c \
+	lib/xmalloc.c \
+	lib/yesno.c
+libgzip_ORDERDEPS = $(PATH_TARGET)/config.h
+
+#
+# The gzip program and associated scripts.
+#
+PROGRAMS += gzip
+gzip_TEMPLATE = usr.bin
+gzip_DEFS = HAVE_CONFIG_H
+gzip_INCS = $(PATH_TARGET) lib
+gzip_SOURCES = \
+	bits.c \
+	crypt.c \
+	deflate.c \
+	gzip.c \
+	inflate.c \
+	lzw.c \
+	trees.c \
+	unlzh.c \
+	unlzw.c \
+	unpack.c \
+	unzip.c \
+	util.c \
+	zip.c
+gzip_LIBS = $(TARGET_libgzip)
+gzip_ORDERDEPS = $(PATH_TARGET)/config.h
+
+INSTALLS += gzip-scripts
+gzip-scripts_TEMPLATE = usr.bin.script
+gzip-scripts_SOURCES = \
+	$(PATH_TARGET)/gunzip \
+	$(PATH_TARGET)/gzexe \
+	$(PATH_TARGET)/zcat \
+	$(PATH_TARGET)/zcmp \
+	$(PATH_TARGET)/zdiff \
+	$(PATH_TARGET)/zegrep \
+	$(PATH_TARGET)/zfgrep \
+	$(PATH_TARGET)/zforce \
+	$(PATH_TARGET)/zgrep \
+	$(PATH_TARGET)/zless \
+	$(PATH_TARGET)/zmore \
+	$(PATH_TARGET)/znew
+gzip-scripts_SYMLINKS = \
+	uncompress=>gunzip
+
+$(gzip-scripts_SOURCES): $$(notdir $$(@)).in
+	$(SED) \
+		-e 's|/bin/sh|sh.exe|g' \
+		-e 's|BINDIR|${GZIP_BINDIR-'\''/@unixroot/usr/bin'\''}|g' \
+		-e 's|[@]VERSION@|1.3.11|g' \
+		$< > $@
+
+$(PATH_TARGET)/config.h: kNIX-bootstrap-os2.x86-config.h | $(call DIRDEP,$(PATH_TARGET))
+	$(CP) -f $< $@
+
+#
+# The man pages.
+#
+INSTALLS += gzip-manpages
+gzip-manpages_TEMPLATE = usr.bin.man
+gzip-manpages_SOURCES = \
+	gunzip.1 \
+	gzexe.1 \
+	gzip.1 \
+	zcat.1 \
+	zcmp.1 \
+	zdiff.1 \
+	zforce.1 \
+	zgrep.1 \
+	zless.1 \
+	zmore.1 \
+	znew.1
+
+
+#
+# Documentation.
+#
+INSTALLS += gzip-docs
+gzip-docs_TEMPLATE = usr.bin.doc
+gzip-docs_SOURCES = \
+	ChangeLog \
+	NEWS \
+	README \
+	THANKS \
+	TODO \
+	algorithm.doc \
+	gzip.doc
+
+#
+# Integrity checks.
+#
+OTHERS += $(PATH_TARGET)/gzip-tests
+OTHER_CLEAN += \
+	$(PATH_TARGET)/gzip.doc.gz \
+
+$(PATH_TARGET)/gzip-tests: $$(TARGET_gzip) $(gzip-scripts_SOURCES)
+	$(RM) -f $@
+	$(TARGET_gzip) -c gzip.doc > $(PATH_TARGET)/gzip.doc.gz
+	GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c $(PATH_TARGET)/gzip.doc.gz gzip.doc
+	GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c gzip.doc $(PATH_TARGET)/gzip.doc.gz
+	GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - gzip.doc < $(PATH_TARGET)/gzip.doc.gz
+	GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - $(PATH_TARGET)/gzip.doc.gz < gzip.doc
+	GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zgrep -iV > /dev/null
+	$(foreach file,$(TARGET_gzip) $(gzip-scripts_SOURCES),\
+		$(NL)$(TAB)$(TARGET_gzip) -cv -- "$(file)" | $(TARGET_gzip) -d | cmp - "$(file)")
+	$(APPEND) $@ done
+
+include $(PATH_KBUILD)/footer.kmk
+
Index: trunk/essentials/app-arch/gzip/kNIX-bootstrap-os2.x86-config.h
===================================================================
--- trunk/essentials/app-arch/gzip/kNIX-bootstrap-os2.x86-config.h	(revision 3330)
+++ trunk/essentials/app-arch/gzip/kNIX-bootstrap-os2.x86-config.h	(revision 3330)
@@ -0,0 +1,283 @@
+/* lib/config.h.  Generated from config.hin by configure.  */
+/* lib/config.hin.  Generated from configure.ac by autoheader.  */
+
+#if 0
+/* Define this to an absolute name of <fcntl.h>. */
+#define ABSOLUTE_FCNTL_H "///usr/include/fcntl.h"
+
+/* Define this to an absolute name of <sys/stat.h>. */
+#define ABSOLUTE_SYS_STAT_H "///usr/include/sys/stat.h"
+
+/* Define this to an absolute name of <sys/time.h>. */
+#define ABSOLUTE_SYS_TIME_H "///usr/include/sys/time.h"
+
+/* Define this to an absolute name of <unistd.h>. */
+#define ABSOLUTE_UNISTD_H "///usr/include/unistd.h"
+#else
+# ifndef S_IRWXUGO
+#  define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
+# endif
+#endif 
+
+/* Define if an assembler version of longest_match is available. */
+/* #undef ASMV */
+
+/* Define to 1 when using the gnulib module fcntl-safer. */
+#define GNULIB_FCNTL_SAFER 1
+
+/* Define to 1 if you have the `chown' function. */
+#define HAVE_CHOWN 1
+
+/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
+   */
+#define HAVE_DECL_GETENV 1
+
+/* Define to 1 if you have the declaration of `mkdir', and to 0 if you don't.
+   */
+#define HAVE_DECL_MKDIR 1
+
+/* Define to 1 if you have the declaration of `nanosleep', and to 0 if you
+   don't. */
+#define HAVE_DECL_NANOSLEEP 1
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+   don't. */
+#define HAVE_DECL_STRERROR_R 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+   */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the `fchmod' function. */
+#define HAVE_FCHMOD 1
+
+/* Define to 1 if you have the `fchown' function. */
+#define HAVE_FCHOWN 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fdopendir' function. */
+/* #undef HAVE_FDOPENDIR */
+
+/* Define to 1 if you have the `futimes' function. */
+#define HAVE_FUTIMES 1
+
+/* Define to 1 if you have the `futimesat' function. */
+/* #undef HAVE_FUTIMESAT */
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
+
+/* Define to 1 if you have the `getopt_long_only' function. */
+#define HAVE_GETOPT_LONG_ONLY 1
+
+/* Define to 1 if the compiler supports one of the keywords 'inline',
+   '__inline__', '__inline' and effectively inlines functions marked as such.
+   */
+#define HAVE_INLINE 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+#define HAVE_IO_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `lstat' function. */
+#define HAVE_LSTAT 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the `pipe' function. */
+#define HAVE_PIPE 1
+
+/* Define to 1 if you have the `siginterrupt' function. */
+#define HAVE_SIGINTERRUPT 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+#define HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if `st_atimensec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_ATIMENSEC */
+
+/* Define to 1 if `st_atimespec.tv_nsec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC */
+
+/* Define to 1 if `st_atim.st__tim.tv_nsec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC */
+
+/* Define to 1 if `st_atim.tv_nsec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC */
+
+/* Define to 1 if `st_spare1' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_SPARE1 */
+
+/* Define if struct timespec is declared in <time.h>. */
+#define HAVE_STRUCT_TIMESPEC 1
+
+/* Define if struct utimbuf is declared -- usually in <utime.h>. Some systems
+   have utime.h but don't declare the struct anywhere. */
+#define HAVE_STRUCT_UTIMBUF 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+   */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+   */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if O_NOATIME works. */
+/* #undef HAVE_WORKING_O_NOATIME */
+
+/* Define to 1 if O_NOFOLLOW works. */
+#define HAVE_WORKING_O_NOFOLLOW 1
+
+/* Define if utimes works properly. */
+#define HAVE_WORKING_UTIMES 1
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "gzip"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-gzip@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "gzip"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "gzip 1.3.11"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "gzip"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.3.11"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+/* #undef STAT_MACROS_BROKEN */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if strerror_r returns char *. */
+#define STRERROR_R_CHAR_P 1
+
+/* Define to 1 if the type of the st_atim member of a struct stat is struct
+   timespec. */
+#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1
+
+/* Version number of package */
+#define VERSION "1.3.11"
+
+/* Define to 1 if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+/* # undef _ALL_SOURCE */
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#define _FILE_OFFSET_BITS 64
+
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+
+/* Define to rpl_ if the getopt replacement functions and variables should be
+   used. */
+/* #undef __GETOPT_PREFIX */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to equivalent of C99 restrict keyword, or to nothing if this is not
+   supported. Do not define if restrict is supported directly. */
+/* #undef restrict */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
