Fix issues with InfoZip build

Artifacts weren't being invalidated because THIRD_PARTY_ZIP_SRCS_C
needed to be renamed THIRD_PARTY_ZIP_SRCS. This caused a build break.
This commit is contained in:
Justine Tunney 2021-09-04 06:50:57 -07:00
parent a81192e0b9
commit ab64c746cc
23 changed files with 40 additions and 3414 deletions

View file

@ -1,329 +0,0 @@
# Makefile for Zip, ZipNote, ZipCloak and ZipSplit
# what you can make ...
all:
@echo ''
@echo 'Make what? You must say what system to make Zip for--e.g.'
@echo '"make generic".'
@echo 'Choices: generic, generic_gcc, att6300nodir,'
@echo 'coherent, cray_v3, cygwin, lynx, minix, os390,'
@echo 'qnx, qnxnto, solaris, solaris_gcc'
@echo 'Try first "make -f unix/Makefile generic" as'
@echo 'it should autodetect and set the proper flags.'
@echo 'To make the manuals use "make zipsman" after Zip is made.'
@echo 'See the files INSTALL and zip.txt for more information.'
@echo ''
list: all
#MAKE = make -f unix/Makefile
MAKEF = -f unix/Makefile
SHELL = /bin/sh
LN = ln -s
# (to use the GNU compiler, change cc to gcc in CC)
CC = cc
BIND = $(CC)
AS = $(CC) -c
CPP = /lib/cpp
E =
# probably can change this to 'install' if you have it
INSTALL_PROGRAM = cp
# probably can change this to 'install -d' if you have it
# XXX NextStep 3.3 and Openstep 4.x don't know about -p !
INSTALL_D = mkdir -p
CHMOD = chmod
BINFLAGS = 755
MANFLAGS = 644
# target directories - where to install executables and man pages to
prefix = /usr/local
BINDIR = $(prefix)/bin
MANEXT=1
MANDIR = $(prefix)/man/man$(MANEXT)
ZIPMANUAL = zip.txt
ZIPMANUALcloak = zipcloak.txt
ZIPMANUALnote = zipnote.txt
ZIPMANUALsplit = zipsplit.txt
ZIPMANUALs = zip.txt zipcloak.txt zipnote.txt zipsplit.txt
PKGDIR = IZzip
VERSION = Version 3.0
# Our bzip2 directory
IZ_OUR_BZIP2_DIR = bzip2
# flags
# CFLAGS flags for C compile
# LFLAGS1 flags after output file spec, before obj file list
# LFLAGS2 flags after obj file list (libraries, etc)
CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)
CFLAGS = -O2 $(CFLAGS_NOOPT)
LFLAGS1 =
LFLAGS2 = -s
# object file lists
OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \
unix.o crc32.o zbz2err.o
OBJI = deflate.o trees.o
OBJA =
OCRCU8 =
OCRCTB = crc32_.o
OBJU = zipfile_.o fileio_.o util_.o globals.o unix_.o $(OCRCU8)
OBJN = zipnote.o $(OBJU)
OBJC = zipcloak.o $(OBJU) $(OCRCTB) crypt_.o ttyio.o
OBJS = zipsplit.o $(OBJU)
ZIP_H = zip.h ziperr.h tailor.h unix/osdep.h
# suffix rules
.SUFFIXES:
.SUFFIXES: _.o .o .c .doc .1
.c_.o:
$(CC) -c $(CFLAGS) -DUTIL -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $<
.1.doc:
nroff -man $< | col -bx | uniq > $@
# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUALs.
$(OBJZ): $(ZIP_H)
$(OBJI): $(ZIP_H)
$(OBJN): $(ZIP_H)
$(OBJS): $(ZIP_H)
$(OBJC): $(ZIP_H)
zip.o zipup.o zipfile.o fileio.o crc32.o crypt.o: crc32.h
zipcloak.o zipfile_.o fileio_.o crc32_.o crypt_.o: crc32.h
zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h
zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
zipup.o: unix/zipup.h
match.o: match.S
$(CPP) match.S > _match.s
$(AS) _match.s
mv _match.o match.o
rm -f _match.s
crc_i386.o: crc_i386.S
$(CPP) crc_i386.S > _crc_i386.s
$(AS) _crc_i386.s
mv _crc_i386.o crc_i386.o
rm -f _crc_i386.s
unix.o: unix/unix.c
$(CC) -c $(CFLAGS) unix/unix.c
unix_.o: unix/unix.c
$(CC) -c $(CFLAGS) -DUTIL -o $@ unix/unix.c
ZIPS = zip$E zipcloak$E zipnote$E zipsplit$E
zips: $(ZIPS)
zipsman: $(ZIPS) $(ZIPMANUALs)
zip$E: $(OBJZ) $(OBJI) $(OBJA) $(LIB_BZ)
$(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
zipnote$E: $(OBJN)
$(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
zipcloak$E: $(OBJC) $(OCRCTB)
$(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
zipsplit$E: $(OBJS)
$(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
$(ZIPMANUAL): man/zip.1
nroff -man man/zip.1 | col -bx | uniq > $(ZIPMANUAL)
$(ZIPMANUALcloak): man/zipcloak.1
nroff -man man/zipcloak.1 | col -bx | uniq > $(ZIPMANUALcloak)
$(ZIPMANUALnote): man/zipnote.1
nroff -man man/zipnote.1 | col -bx | uniq > $(ZIPMANUALnote)
$(ZIPMANUALsplit): man/zipsplit.1
nroff -man man/zipsplit.1 | col -bx | uniq > $(ZIPMANUALsplit)
# bzip2 object library
$(IZ_OUR_BZIP2_DIR)/libbz2.a : $(IZ_OUR_BZIP2_DIR)/Makefile
@echo "Building bzip2 object library..."
( cd $(IZ_OUR_BZIP2_DIR); \
$(MAKE) CC="$(CC_BZ)" CFLAGS="$(CFLAGS_BZ)" libbz2.a )
@echo " bzip2 object library created."
# install
install: $(ZIPS)
-$(INSTALL_D) $(BINDIR)
$(INSTALL_PROGRAM) $(ZIPS) $(BINDIR)
-cd $(BINDIR); $(CHMOD) $(BINFLAGS) $(ZIPS)
-$(INSTALL_D) $(MANDIR)
$(INSTALL_PROGRAM) man/zip.1 $(MANDIR)/zip.$(MANEXT)
$(CHMOD) $(MANFLAGS) $(MANDIR)/zip.$(MANEXT)
$(INSTALL_PROGRAM) man/zipcloak.1 $(MANDIR)/zipcloak.$(MANEXT)
$(CHMOD) $(MANFLAGS) $(MANDIR)/zipcloak.$(MANEXT)
$(INSTALL_PROGRAM) man/zipnote.1 $(MANDIR)/zipnote.$(MANEXT)
$(CHMOD) $(MANFLAGS) $(MANDIR)/zipnote.$(MANEXT)
$(INSTALL_PROGRAM) man/zipsplit.1 $(MANDIR)/zipsplit.$(MANEXT)
$(CHMOD) $(MANFLAGS) $(MANDIR)/zipsplit.$(MANEXT)
uninstall:
-cd $(BINDIR); rm -f $(ZIPS)
-cd $(MANDIR); rm -f \
zip.$(MANEXT) zipcloak.$(MANEXT) zipnote.$(MANEXT) zipsplit.$(MANEXT)
flags: unix/configure
sh unix/configure "${CC}" "${CFLAGS_NOOPT}" "${IZ_BZIP2}"
# These symbols, when #defined using -D have these effects on compilation:
# ZMEM - includes C language versions of memset(), memcpy(),
# and memcmp() (util.c).
# HAVE_DIRENT_H - use <dirent.h> instead of <sys/dir.h>
# NODIR - for 3B1, which has neither getdents() nor opendir().
# HAVE_NDIR_H - use <ndir.h> (unix/unix.c).
# HAVE_SYS_DIR_H - use <sys/dir.h>
# HAVE_SYS_NDIR_H - use <sys/ndir.h>
# UTIL - select routines for utilities (note, cloak, split)
# NO_RMDIR - remove directories using a system("rmdir ...") call.
# NO_PROTO - cannot handle ANSI prototypes
# NO_CONST - cannot handle ANSI const
# NO_LARGE_FILE_SUPPORT - do not enable Large File support even if available.
# NO_ZIP64_SUPPORT - do not enable Zip64 archive support even if available.
# NO_UNICODE_SUPPORT - do not enable Unicode support even if available.
# NO_BZIP2_SUPPORT - do not compile in bzip2 code even if available.
# Generic targets:
generic: flags
eval $(MAKE) $(MAKEF) zips `cat flags`
generic_gcc:
$(MAKE) $(MAKEF) generic CC=gcc CPP="gcc -E"
# AT&T 6300 PLUS (don't know yet how to allocate 64K bytes):
att6300nodir:
$(MAKE) $(MAKEF) zips LFLAGS1="-Ml -s" \
CFLAGS="-DUNIX -I. -O -Ml -DNO_RMDIR -DDYN_ALLOC -DMEDIUM_MEM \
-DWSIZE=16384 -DNO_STDLIB_H -DNO_STDDEF_H -DNO_RENAME \
-DNO_MKTIME -DNO_SIZE_T -DNO_VOID -DNO_PROTO -DNO_DIR \
-DNO_CONST -DHAVE_TERMIO_H" \
"LFLAGS2="
# Coherent (AS definition not needed for gcc)
coherent:
$(MAKE) $(MAKEF) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DASMV" \
AS="as -gx" OBJA=match.o
# Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c
# may be compiled with vector3; internal compiler bug in 3.0.2.3 and
# earlier requires vector2 for trees.c)
cray_v3:
$(MAKE) $(MAKEF) zips CC="scc" \
CFLAGS="-DUNIX -I. -O -h vector2 -h scalar3 -DHAVE_DIRENT_H"
# Cygwin
cygwin:
$(MAKE) $(MAKEF) generic CC="gcc" CPP="gcc -E" EXE=".exe"
# LynxOS
lynx:
$(MAKE) $(MAKEF) generic CC=gcc CPP="gcc -E" CFLAGS="$(CFLAGS) \
-DNO_UNDERLINE -DLynx -DLYNX LFLAGS2="$LFLAGS2 -lc_p"
# MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
minix:
$(MAKE) $(MAKEF) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DMINIX" CC=gcc
chmem =262144 zip
# IBM OS/390 (formerly MVS) compiled under "OpenEdition" shell
# You can make the zip executable with IBM's make, but you will
# get errors dealing with the _.o targets for the other executables
# (zipcloak, etc). GNU make will build all the executables.
# If you have GNU make in your path as gmake, you can uncomment
# the following, but it shouldn't be needed:
#MAKE = gmake
os390:
$(MAKE) $(MAKEF) zips CFLAGS="$(CF) -I. -DUNIX -DOS390 -DEBCDIC \
-DSYSV -DNO_PARAM_H" LFLAGS2=""
# QNX is "special" because out /bin/sh is ksh and it doesn't grok the
# configure script properly, generating a bad flags file. D'oh! [cjh]
#
# QNX/Neutrino is "special" because you don't have any native development
# tools yet. Set ARCH to "x86", "ppcbe", "ppcle", "mipsbe", or "mipsle"
# to produce x86, PowerPC (big- or little-endian) and MIPS (big-
# or little-endian) using gcc. [cjh]
qnx:
$(MAKE) $(MAKEF) zips LN=ln CC=cc CFLAGS="-DUNIX -I. -O \
-DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP"
qnxnto:
@if [ "$(ARCH)" = "" ] ; then \
echo "You didn't set ARCH; I'll assume you meant ARCH=x86..." ; \
echo "" ; \
$(MAKE) $(MAKEF) zips LN=ln CC="qcc -Vgcc_ntox86" \
CFLAGS="-g -DUNIX -I. -O -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP" \
LFLAGS2=-g ; \
else \
echo "Making zip for $(ARCH)..." ; \
echo "" ; \
$(MAKE) $(MAKEF) zips LN=ln CC="qcc -Vgcc_nto$(ARCH)" \
CFLAGS="-g -DUNIX -I. -O -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP" \
LFLAGS2=-g ; \
fi
# Solaris: Generic, plus generation of installable package.
solaris: generic svr4package
# Solaris with GCC: generic_gcc, plus generation of installable package
solaris_gcc: generic_gcc svr4package
# Package generation interface (by JBush). Originally tested under Sun Solaris.
# Other SVr4s may be very similar, and could possibly use this.
# Note: Expects version info to be stored in VERSION macro variable.
# See "README" under ./unix/Packaging
svr4package:
@echo "Creating SVR4 package for Unix ..."
-@rm -rf ./$(PKGDIR) ./$(PKGDIR)_`uname -p`.pkg
-@sed -e "s/.VERSION./$(VERSION)/g" \
-e "s/.PSTAMP./$(LOGNAME)_`date | tr ' ' '_'`/g" \
-e "s/.ARCH./Solaris_`uname -rp | tr ' ' ','`/g" \
./unix/Packaging/pkginfo.in > ./unix/Packaging/pkginfo
-@sed -e "s/.ARCH./`uname -p`/g" \
./unix/Packaging/preinstall.in > ./unix/Packaging/preinstall
/usr/bin/pkgmk -d . -b . -r . -f ./unix/Packaging/prototype $(PKGDIR)
/usr/bin/pkgtrans -o -s . $(PKGDIR)_`uname -p`.pkg $(PKGDIR)
@echo " "
@echo "To install, copy $(PKGDIR)_`uname -p`.pkg to the target system, and"
@echo "issue the command (as root): pkgadd -d $(PKGDIR)_`uname -p`.pkg"
@echo " "
# make a distribution
dist: $(ZIPMANUAL)
eval zip -r9 zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
-e 's/[.]//g' -e 's/ .*//g' -e q revision.h` *
# clean up after making stuff and installing it
clean:
rm -f *.o $(ZIPS) flags
rm -rf $(PKGDIR)
clean_bzip2 :
@if test -f "$(IZ_OUR_BZIP2_DIR)/Makefile"; then \
( cd $(IZ_OUR_BZIP2_DIR); make clean ); \
else \
if test -z "$(IZ_OUR_BZIP2_DIR)"; then \
echo "No bzip2 directory (\"IZ_OUR_BZIP2_DIR\") specified."; \
else \
echo "No bzip2 make file found: $(IZ_OUR_BZIP2_DIR)/Makefile."; \
fi; \
fi
clean_exe :
rm -f $(ZIPS)
#

View file

@ -1,44 +0,0 @@
Solaris packaging
-----------------
To generate a Solaris package for Info-ZIP zip utilities,
first see the top level INSTALL and README files. Do a
"make solaris", which will automatically build two Solaris
installable package files for the package, IZzip.
IZzip -- Solaris installable package in directory format.
IZzip_$(arch).pkg -- Solaris installable package in "stream" format.
Where: $(arch) := system architecture, currently i386, sparc, or ppc.
(use "uname -p" to determine)
The ".pkg" file is a single file datastream that can be compressed
and/or ftp'd. This is the recommended form, because all required
files are resident in the archive, and it is easily distributed.
To install, simply:
1) copy the package to the target system's /tmp directory.
2) login or su to root
3) pkgadd -d /tmp/IZzip_$(arch).pkg
4) add /opt/Info-ZIP/IZzip/bin to PATH
5) add /opt/Info-ZIP/IZzip/man to MANPATH
This works for both SPARC and x86.
Ongoing maintenance:
Keep the files, "prototype" and "pkginfo.in" up to date.
Observe variable substitutions made by "Makefile".
See manpages for pkginfo(1), pkginfo(4), pkgmk(1), pkgproto(1)
Variations:
If you wish the base directory to be set to something other than
/opt/Info-ZIP, change the setting BASEDIR in pkginfo.in and
re-run the make.
-John Bush (John.Bush@East.Sun.COM)
July 20, 1996

View file

@ -1,13 +0,0 @@
PKG=IZzip
NAME=Info-ZIP Zip Utilities
CATEGORY=application
VENDOR=Info-ZIP
EMAIL=http://info-zip.org/zip-bug.html
HOTLINE=http://info-zip.org/zip-bug.html
DESC=Copyrighted FREEWARE. See README, WHERE, and docs in pkg's doc dir.
CLASSES=none
BASEDIR=/opt/Info-ZIP
#BASEDIR=/usr/local
VERSION=".VERSION."
PSTAMP=".PSTAMP."
ARCH=".ARCH."

View file

@ -1,29 +0,0 @@
#!/bin/sh
#
# Info-ZIP Zip post-installation script.
#
# Last revised: 2007-09-29 SMS. Zip 3.0.
#
# Post installation script (simply inform installer about PATH etc)
#
echo ''
echo 'Installation is complete. Users should adjust their environment'
echo 'variables to include these directories:'
echo " PATH: ${BASEDIR}/${PKG}/bin"
echo " MANPATH: ${BASEDIR}/${PKG}/man"
echo ''
echo "Commands like the following may be added to a user's shell start-up"
echo 'file (.cshrc, .login, .profile, ...) to do this:'
echo ''
echo ' For a Bourne-like shell:'
echo " PATH=\"\${PATH}:${BASEDIR}/${PKG}/bin\""
echo " MANPATH=\"\${MANPATH}:${BASEDIR}/${PKG}/man\""
echo ' export PATH MANPATH'
echo ''
echo ' For a C shell:'
echo " setenv PATH \"\${PATH}:${BASEDIR}/${PKG}/bin\""
echo " setenv MANPATH \"\${MANPATH}:${BASEDIR}/${PKG}/man\""
echo ''
echo "See the files under ${BASEDIR}/${PKG}/doc for more information."
echo ''
exit 0

View file

@ -1,29 +0,0 @@
#!/bin/sh
#
# Info-ZIP Zip pre-installation script.
#
# Last revised: 2007-09-29 SMS. Zip 3.0.
#
# pkgadd should set a good PATH, but just in case, ...
PATH="/sbin:/usr/bin:${PATH}"
export PATH
echo ''
echo 'Please report problems to Info-ZIP using:'
echo ''
echo ' http://info-zip.org/zip-bug.html'
echo ''
arch=`uname -p`
if [ "arch_${arch}" != "arch_.ARCH." ]; then
echo "This product MUST be installed on a Solaris \".ARCH.\" system."
echo "This system appears to have \"${arch}\" architecture, not \".ARCH.\"."
echo "Please install the version for the \".ARCH.\" architecture."
echo 'Aborting installation...'
returncode=1
else
echo "Installing on \".ARCH.\" architecture..."
returncode=0
fi
echo ''
sleep 4
exit ${returncode:-1}
#

View file

@ -1,29 +0,0 @@
d none $BASEDIR 0755 root bin
d none $PKG 0755 root bin
d none $PKG/doc 0755 root bin
f none $PKG/doc/BUGS=BUGS 0644 root bin
f none $PKG/doc/CHANGES=CHANGES 0644 root bin
f none $PKG/doc/INSTALL=INSTALL 0644 root bin
f none $PKG/doc/LICENSE=LICENSE 0644 root bin
f none $PKG/doc/README=README 0644 root bin
f none $PKG/doc/TODO=TODO 0644 root bin
f none $PKG/doc/USexport.msg=USexport.msg 0644 root bin
f none $PKG/doc/WHATSNEW=WHATSNEW 0644 root bin
f none $PKG/doc/WHERE=WHERE 0644 root bin
f none $PKG/doc/zip.txt=zip.txt 0644 root bin
d none $PKG/man 0755 root bin
d none $PKG/man/man1 0755 root bin
f none $PKG/man/man1/zip.1=man/zip.1 0644 root bin
f none $PKG/man/man1/zipcloak.1=man/zipcloak.1 0644 root bin
f none $PKG/man/man1/zipnote.1=man/zipnote.1 0644 root bin
f none $PKG/man/man1/zipsplit.1=man/zipsplit.1 0644 root bin
d none $PKG/bin 0755 root bin
f none $PKG/bin/zip=zip 0755 root bin
f none $PKG/bin/zipcloak=zipcloak 0755 root bin
f none $PKG/bin/zipnote=zipnote 0755 root bin
f none $PKG/bin/zipsplit=zipsplit 0755 root bin
i README
i pkginfo
i prototype
i preinstall
i postinstall

View file

@ -1,85 +0,0 @@
OS/390 is IBM's follow-on to MVS and includes a POSIX, XOPEN,
XPG4, build environment, a Unix-style filesystem (called HFS), and
a POSIX (Born) shell. This port uses this environment and is a fairly
straight-forward port of ZIP's Unix port - but uses the existing EBCDIC
code. This port does not work with non-HFS (traditional MVS)
filesystems.
I believe all my changes are isolated with #ifdef's.
Here's some text which might be useful for an OS390 README or
the manual.
ZIP for OS390 HFS datasets
--------------------------
Allows you to create ZIP archives from the OS/390 OpenEdition
command prompt. This port uses standard Unix-style I/O routines
and only works with HFS files.
Usage
-----
By default, ZIP does not perform character-set translation, but has
options to make it easy to convert text files to be compatible with
other systems
zip zipfile list # add the files in 'list' to archive 'zipfile'
zip -a zipfile list # same as above, but translate files to ASCII
zip -al zipfile list # same as above, translate linefeeds to DOS style
zip -all zipfile list # same as '-a', translate linefeeds to UNIX style
Build process
-------------
Assuming GNU make is available in your path and is called "gmake" (See
the notes on Makefile changes below) and a C compiler is available as
"cc", then type
gmake -f unix/Makefile MAKE=gmake os390
If GNU make is not available, the existing makefile can create zip, but will
error on the other executable (zipsplit, zipcloak, zipnote) if you type
make -f unix/Makefile os390
Overview of Changes
-------------------
The OS/390 port is treated as a variant of the Unix port. EBCDIC support
was already implemented for CMS/MVS-batch ports. The specific changes I
made are summarized below.
unix/Makefile - zip uses a unusual _.o target which IBM's make can't handle.
Since the Makefile has a macro called MAKE that is used for a recursive
call to make, I changed the MACRO to call "gmake" - GNU's make - which
can handle the _.o target. If you don't have GNU make, you can
workaround by manually applying symlinks from whatever.c to whatever_.c.
Alternatively, the whatever_.o files could be explicitely added for os390.
I added an os390 target with appropriate defines.
zipup.c - added code (#ifdef OS390) to convert test to ASCII if -a flag
was set.
zip.c - changed logic which always used DOS-style newlines when -a was
set to be consistent with other port (DOS newlines if -l option)
zipfile.c - miscellaneous changes to force storing file names and
descriptions in ASCII in the zip directory. This makes zip files
portable across all platforms. This in turn meant names did not
need to be translated when displaying messages.
zip.h - strtoasc was missing a closing parenthesis.
ebcdic.h - changed translation table to be consistent with current IBM
recommendations - exact same changes to ebcdic.h as in my unzip port.
tailor.h - define huge/far/near to be empty
unix/unix.c - substantial changes to deal with mode flags. Under
the current XOPEN standards, some of the traditional unix file mode
bits need not be in fixed locations, but standard access macros must be
available to access the values. The old unix.c code just picked up these
values and saved them as-is where unzip interpreted them. Existing
Unix system provided the macros for XOPEN compliance, but left the flags
in their traditional locations. OS/390 has a brand new filesystem which
is XOPEN compliant without revealing the positions of these flags.
To create the bitmask in the same format unzip expects, the macros are
tested one-by-one to set the appropriate bits. This same logic should
work on any XOPEN system, but takes more instructions (I did test this
logic on Linux).

View file

@ -1,695 +0,0 @@
:
#!/bin/sh -x
# The above : is necessary on some buggy systems.
# configure: Guess values for system-dependent variables
# Output the flag definitions to the file "flags".
#
# Parameters: $1 = $CC, $2 = $CFLAGS, $3 = $IZ_BZIP2
#
# This file is typically called from Makefile rather than executed
# from the command line.
#
# To construct zip automatically using this file, type
# "make -f unix/Makefile generic".
# If this fails, then type "make list" to get a list of special targets.
trap "rm -f conftest* core a.out; exit 1" 1 2 3 15
CC=${1-cc}
CFLAGS=${2-"-I. -DUNIX"}
LFLAGS1=''
LFLAGS2=''
LN="ln -s"
CFLAGS_OPT=''
# bzip2
IZ_BZIP2=${3-}
CFLAGS_BZ=''
echo 'Check C compiler type (optimization options)'
# Sun C?
cat > conftest.c << _EOF_
int main()
{
#ifndef __SUNPRO_C
bad code
#endif
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
if test $? -eq 0; then
CFLAGS_OPT='-xO3'
echo " Sun C ($CFLAGS_OPT)"
else
# Tru64 DEC/Compaq/HP C?
cat > conftest.c << _EOF_
int main()
{
#ifndef __DECC
bad code
#endif
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
if test $? -eq 0; then
CFLAGS_OPT='-O3'
echo " DEC C ($CFLAGS_OPT)"
else
# HP-UX HP C?
cat > conftest.c << _EOF_
int main()
{
#ifdef __GNUC__
bad code
#endif
#ifndef __hpux
bad code
#endif
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
if test $? -eq 0; then
# HP-UX, not GCC. Lame bundled or real ANSI compiler?
CFLAGS_OPT_TRY="+O3 +Onolimit"
$CC $CFLAGS $CFLAGS_OPT_TRY -c conftest.c 2>&1 | \
grep '(Bundled)' > /dev/null
if test $? -ne 0; then
CFLAGS_OPT="$CFLAGS_OPT_TRY"
echo " HP-UX ANSI C ($CFLAGS_OPT)"
else
echo ' HP-UX Bundled C (no opt)'
fi
else
# GNU C?
cat > conftest.c << _EOF_
int main()
{
#ifndef __GNUC__
bad code
#endif
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
if test $? -eq 0; then
CFLAGS_OPT='-O3'
echo " GNU C ($CFLAGS_OPT)"
# Special Mac OS X shared library "ld" option?
if test ` uname -s 2> /dev/null ` = 'Darwin'; then
lf='-Wl,-search_paths_first'
$CC $CFLAGS $lf conftest.c > /dev/null 2>/dev/null
if test $? -eq 0; then
LFLAGS2="${LFLAGS2} ${lf}"
fi
rm -f conftest
fi
else
CFLAGS_OPT='-O'
echo " Other-unknown C ($CFLAGS_OPT)"
fi
fi
fi
fi
# optimization flags
if test -n "${CFLAGS_OPT}"; then
CFLAGS="${CFLAGS} ${CFLAGS_OPT}"
CFLAGS_BZ="${CFLAGS_BZ} ${CFLAGS_OPT}"
fi
# bzip2
echo "Check bzip2 support"
CC_BZ="${CC}"
LIB_BZ=''
if test -n "${IZ_BZIP2}"; then
echo " Check for bzip2 compiled library in IZ_BZIP2 (${IZ_BZIP2})"
if test -f "${IZ_BZIP2}/libbz2.a"; then
#
# A bzip2 library built with BZ_NO_STDIO should have an
# unresolved external, "bz_internal_error". The default,
# full-function library will not mention it.
#
nm ${IZ_BZIP2}/libbz2.a | grep bz_internal_error > /dev/null
if test $? -eq 0; then
echo " Found bzip2 BZ_NO_STDIO library, ${IZ_BZIP2}/libbz2.a"
else
echo " Found bzip2 library, ${IZ_BZIP2}/libbz2.a,"
echo " but library not compiled with BZ_NO_STDIO"
echo " WARNING: We recommend using a bzip2 library compiled"
echo " with BZ_NO_STDIO defined for proper error handling"
echo " Please see the Zip installation instructions in bzip2/install.txt"
echo " Continuing anyway with standard bzip2 library..."
fi
if test -f "${IZ_BZIP2}/bzlib.h"; then
CFLAGS="${CFLAGS} -I${IZ_BZIP2} -DBZIP2_SUPPORT"
LFLAGS2="${LFLAGS2} -L${IZ_BZIP2} -lbz2"
echo "-- Found bzip2 library - linking in bzip2"
else
echo " ${IZ_BZIP2}/bzlib.h not found"
echo "-- Since IZ_BZIP2 defined, skipping OS and bzip2 dir checks - no bzip2"
fi
else
echo " ${IZ_BZIP2}/libbz2.a not found"
echo "-- Since IZ_BZIP2 defined, skipping OS and bzip2 checks - no bzip2"
fi
else
echo " Check for bzip2 in bzip2 directory"
IZ_BZIP2=bzip2
if test -f "${IZ_BZIP2}/libbz2.a"; then
nm ${IZ_BZIP2}/libbz2.a | grep bz_internal_error > /dev/null
if test $? -eq 0; then
echo " Found bzip2 BZ_NO_STDIO library in bzip2 directory"
else
echo " Found bzip2 library in bzip2 directory,"
echo " but not built with the BZ_NO_STDIO option"
echo " WARNING: We recommend using a bzip2 library compiled"
echo " with BZ_NO_STDIO defined for proper error handling"
echo " Please see the Zip installation instructions"
echo " Continuing anyway with standard bzip2 library..."
fi
fi
if test -f "bzip2/bzlib.h" -a -f "bzip2/libbz2.a"; then
CFLAGS="${CFLAGS} -I${IZ_BZIP2} -DBZIP2_SUPPORT"
LFLAGS2="${LFLAGS2} -Lbzip2 -lbz2"
echo "-- Found bzip2 library - linking in bzip2"
else
if test -f "bzip2/bzlib.c" -a -f "bzip2/bzlib.h"; then
echo "-- No library, but found bzip2 source in bzip2 directory"
echo "-- Will try to build bzip2 library from source and link in"
#
# Arrange to build a BZ_NO_STDIO bzip2 object library using the
# same compiler and optimization options as used for Zip, and
# to compile and link Zip with bzip2.
#
CFLAGS_BZ="${CFLAGS_BZ} -DBZ_NO_STDIO"
LIB_BZ="bzip2/libbz2.a"
CFLAGS="${CFLAGS} -Ibzip2 -DBZIP2_SUPPORT"
LFLAGS2="${LFLAGS2} -Lbzip2 -lbz2"
else
echo " Check if OS already has bzip2 library installed"
cat > conftest.c << _EOF_
#include "bzlib.h"
int main()
{
bz_stream strm;
BZ2_bzCompressEnd(&strm);
return 0;
}
_EOF_
$CC $CFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
if test $? -eq 0; then
echo "-- OS supports bzip2 - linking in bzip2"
CFLAGS="${CFLAGS} -DBZIP2_SUPPORT"
LFLAGS2="${LFLAGS2} -lbz2"
else
echo "-- Either bzlib.h or libbz2.a not found - no bzip2"
fi
fi
fi
fi
echo Check for the C preprocessor
# on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
CPP="${CC} -E"
# solaris as(1) needs -P, maybe others as well ?
[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
[ -f /lib/cpp ] && CPP=/lib/cpp
[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
[ -f /xenix ] && CPP="${CC} -E"
[ -f /lynx.os ] && CPP="${CC} -E"
echo "#include <stdio.h>" > conftest.c
$CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"
echo Check if we can use asm code
OBJA=""
OCRCU8=""
if eval "$CPP match.S > _match.s 2>/dev/null"; then
if test ! -s _match.s || grep error < _match.s > /dev/null; then
:
elif eval "$CC -c _match.s >/dev/null 2>/dev/null" && [ -f _match.o ]; then
CFLAGS="${CFLAGS} -DASMV"
OBJA="match.o"
echo "int foo() { return 0;}" > conftest.c
$CC -c conftest.c >/dev/null 2>/dev/null
echo Check if compiler generates underlines
nm conftest.o | grep "(^|[^_])foo" >/dev/null 2>/dev/null
[ $? -eq 0 ] && CPP="${CPP} -DNO_UNDERLINE"
if eval "$CPP crc_i386.S > _crc_i386.s 2>/dev/null"; then
if eval "$CC -c _crc_i386.s >/dev/null 2>/dev/null" && [ -f _crc_i386.o ]
then
OBJA="$OBJA crc_i386.o"
OCRCU8="crc_i386.o"
CFLAGS="${CFLAGS} -DASM_CRC"
fi
fi
fi
fi
rm -f _match.s _match.o _crc_i386.s _crc_i386.o
# ANSI options for compilers that don't have __STDC__ defined by default
# Currently HPUX, pyramid, Dynix, AIX, OSF/1 and ultrix
echo Check for ANSI options
cat > conftest.c << _EOF_
int main()
{
#ifndef __STDC__
forget it
#endif
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
if [ $? -ne 0 ]; then
for OPT in -Ae -Xa -qlanglvl=ansi -std1 -std
do
$CC $CFLAGS $OPT -c conftest.c > /dev/null 2>/dev/null
[ $? -eq 0 ] && CFLAGS="${CFLAGS} ${OPT}" && break
done
fi
echo Check for prototypes
echo "int main(int argc, char *argv[]) { return 0; }" > conftest.c
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_PROTO"
# const check currently handles mips cc and non ANSI compilers.
# does it need more ?
echo Check the handling of const
cat > conftest.c << _EOF_
typedef int charset[2];
int main()
{
const charset x;
const char *foo;
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_CONST"
echo Check for time_t
cat > conftest.c << _EOF_
#include <sys/types.h>
#include <time.h>
int main()
{
time_t t;
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_TIME_T"
echo Check for size_t
cat > conftest.c << _EOF_
#include <sys/types.h>
int main()
{
size_t s;
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_SIZE_T"
echo Check for off_t
cat > conftest.c << _EOF_
#include <sys/types.h>
int main()
{
off_t s;
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_OFF_T"
echo Check size of UIDs and GIDs
echo "(Now zip stores variable size UIDs/GIDs using a new extra field. This"
echo " tests if this OS uses 16-bit UIDs/GIDs and so if the old 16-bit storage"
echo " should also be used for backward compatibility.)"
# Added 2008-04-15 CS
cat > conftest.c << _EOF_
# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
# define _LARGEFILE64_SOURCE
# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
# define _LARGE_FILES /* some OSes need this for 64-bit off_t */
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
struct stat s;
printf(" s.st_uid is %u bytes\n", sizeof(s.st_uid));
printf(" s.st_gid is %u bytes\n", sizeof(s.st_gid));
/* see if have 16-bit UID */
if (sizeof(s.st_uid) != 2) {
return 1;
}
/* see if have 16-bit GID */
if (sizeof(s.st_gid) != 2) {
return 2;
}
return 3;
}
_EOF_
# compile it
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
echo -- UID/GID test failed on compile - disabling old 16-bit UID/GID support
CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
else
# run it
./conftest
r=$?
if [ $r -eq 1 ]; then
echo -- UID not 2 bytes - disabling old 16-bit UID/GID support
CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
elif [ $r -eq 2 ]; then
echo -- GID not 2 bytes - disabling old 16-bit UID/GID support
CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
elif [ $r -eq 3 ]; then
echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support
else
echo -- test failed - conftest returned $r - disabling old 16-bit UID/GID support
CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
fi
fi
# Now we set the 64-bit file environment and check the size of off_t
# Added 11/4/2003 EG
# Revised 8/12/2004 EG
echo Check for Large File Support
cat > conftest.c << _EOF_
# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
# define _LARGEFILE64_SOURCE
# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
# define _LARGE_FILES /* some OSes need this for 64-bit off_t */
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
off_t offset;
struct stat s;
/* see if have 64-bit off_t */
if (sizeof(offset) < 8)
return 1;
printf(" off_t is %d bytes\n", sizeof(off_t));
/* see if have 64-bit stat */
if (sizeof(s.st_size) < 8) {
printf(" s.st_size is %d bytes\n", sizeof(s.st_size));
return 2;
}
return 3;
}
_EOF_
# compile it
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
echo -- no Large File Support
else
# run it
./conftest
r=$?
if [ $r -eq 1 ]; then
echo -- no Large File Support - no 64-bit off_t
elif [ $r -eq 2 ]; then
echo -- no Large File Support - no 64-bit stat
elif [ $r -eq 3 ]; then
echo -- yes we have Large File Support!
CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT"
else
echo -- no Large File Support - conftest returned $r
fi
fi
# Check for wide char for Unicode support
# Added 11/24/2005 EG
echo Check for wide char support
cat > conftest.c << _EOF_
#include <stdlib.h>
#include <stdio.h>
int main()
{
int wsize;
wchar_t *wide_string;
if ((wide_string = (wchar_t *)malloc(4 * sizeof(wchar_t))) == NULL) {
return 0;
}
/* get wide string */
wsize = mbstowcs(wide_string, "foo", 3);
wide_string[wsize] = (wchar_t) NULL;
return 1;
}
_EOF_
# compile it
$CC -o conftest conftest.c >/dev/null 2>/dev/null
# OCRCU8 is used by all utilities if Unicode is enabled
# OCRCTB is only used by zipcloak
if [ $? -ne 0 ]; then
echo -- no Unicode support
OCRCU8=""
OCRCTB="crc32_.o"
else
# have wide char support
echo -- have wchar_t - enabling Unicode support
CFLAGS="${CFLAGS} -DUNICODE_SUPPORT"
OCRCU8="crc32_.o ${OCRCU8}"
OCRCTB=""
fi
# from configure 2.4i (Onno) 12/5/04
echo Check for gcc no-builtin flag
# -fno-builtin since version 2
cat > conftest.c << _EOF_
int main()
{
#if __GNUC__ >= 2
return 0;
#else
forget it
#endif
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -eq 0 ] && BFLAG="-fno-builtin"
# Check for missing functions
# add NO_'function_name' to flags if missing
for func in rmdir strchr strrchr rename mktemp mktime mkstemp
do
echo Check for $func
echo "int main(){ $func(); return 0; }" > conftest.c
$CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`"
done
echo Check for memset
echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM"
echo Check for memmove
cat > conftest.c << _EOF_
#include <string.h>
int main() { int a; int b = 0; memmove( &a, &b, sizeof( a)); return a; }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_MEMMOVE"
echo Check for strerror
cat > conftest.c << _EOF_
#include <string.h>
int main() { strerror( 0); return 0; }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_STRERROR"
echo Check for errno declaration
cat > conftest.c << _EOF_
#include <errno.h>
main()
{
errno = 0;
return 0;
}
_EOF_
$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO"
echo Check for directory libraries
cat > conftest.c << _EOF_
int main() { return closedir(opendir(".")); }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
OPT=""
for lib in ndir dir ucb bsd BSD PW x dirent
do
$CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null
[ $? -eq 0 ] && OPT=-l$lib && break
done
if [ ${OPT} ]; then
LFLAGS2="${LFLAGS2} ${OPT}"
else
CFLAGS="${CFLAGS} -DNO_DIR"
fi
fi
# Dynix/ptx 1.3 needed this
echo Check for readlink
echo "int main(){ return readlink(); }" > conftest.c
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
$CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null
[ $? -eq 0 ] && LFLAGS2="${LFLAGS2} -lseq"
fi
echo Check for directory include file
OPT=""
for inc in dirent.h sys/ndir.h ndir.h sys/dir.h
do
echo "#include <$inc>" > conftest.c
$CPP conftest.c > /dev/null 2>/dev/null
[ $? -eq 0 ] && OPT="-DHAVE_`echo $inc | tr '[a-z]./' '[A-Z]__'`" && break
done
CFLAGS="${CFLAGS} ${OPT}"
echo Check for nonexistent include files
for inc in stdlib.h stddef.h unistd.h fcntl.h string.h
do
echo "#include <$inc>" > conftest.c
$CPP conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $inc | tr '[a-z]./' '[A-Z]__'`"
done
echo Check for term I/O include file
OPT=""
for inc in termios.h termio.h sgtty.h
do
echo "#include <$inc>" > conftest.c
$CPP conftest.c > /dev/null 2>/dev/null
[ $? -eq 0 ] && OPT="-DHAVE_`echo $inc | tr '[a-z]./' '[A-Z]__'`" && break
done
CFLAGS="${CFLAGS} ${OPT}"
# needed for AIX (and others ?) when mmap is used
echo Check for valloc
cat > conftest.c << _EOF_
main()
{
#ifdef MMAP
valloc();
#endif
}
_EOF_
$CC ${CFLAGS} -c conftest.c > /dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_VALLOC"
echo Check for /usr/local/bin and /usr/local/man
BINDIR=$HOME/bin
[ -d /usr/local/bin ] && BINDIR=/usr/local/bin
MANDIR=manl
[ -d /usr/man/manl ] && MANDIR=/usr/man/manl
[ -d /usr/local/man/manl ] && MANDIR=/usr/local/man/manl
[ -d /usr/local/man/man1 ] && MANDIR=/usr/local/man/man1
echo Check for OS-specific flags
if [ -f /usr/bin/hostinfo ]; then
if /usr/bin/hostinfo | grep NeXT > /dev/null; then
CFLAGS="${CFLAGS} -posix"
LFLAGS1="${LFLAGS1} -posix -object"
fi
# XXX ATT6300, Cray
elif [ -f /xenix ]; then
if uname -p | grep 286 > /dev/null; then
CFLAGS="${CFLAGS} -LARGE -Mel2 -DMEDIUM_MEM -DWSIZE=16384 -DNO_VOID"
LFLAGS1="${LFLAGS1} -LARGE -Mel2"
fi
elif uname -X >/dev/null 2>/dev/null; then
# SCO shared library check
echo "int main() { return 0;}" > conftest.c
$CC -o conftest conftest.c -lc_s -nointl >/dev/null 2> /dev/null
[ $? -eq 0 ] && LFLAGS2="-lc_s -nointl"
else
SYSTEM=`uname -s 2>/dev/null` || SYSTEM="unknown"
echo "int main() { return 0;}" > conftest.c
case $SYSTEM in
OSF1|ULTRIX)
echo Check for -Olimit option
$CC ${CFLAGS} -Olimit 1000 -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -eq 0 ] && CFLAGS="${CFLAGS} -Olimit 1000"
;;
### HP-UX)
### echo Check for +Onolimit option
### $CC ${CFLAGS} +Onolimit -o conftest conftest.c >/dev/null 2>/dev/null
### [ $? -eq 0 ] && CFLAGS="${CFLAGS} +Onolimit"
### ;;
### SunOS)
### CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64"
### ;;
esac
fi
echo Check for symbolic links
ln -s /dev/null null > /dev/null 2>/dev/null || LN=ln
rm -f a.out conftest.c conftest.o conftest null
echo CC=\"${CC}\" CFLAGS=\"${CFLAGS}\" CPP=\"${CPP}\" OBJA=\"${OBJA}\" \
OCRCU8=\"${OCRCU8}\" OCRCTB=\"${OCRCTB}\" \
BINDIR=${BINDIR} MANDIR=${MANDIR} LFLAGS1=\"${LFLAGS1}\" \
LFLAGS2=\"${LFLAGS2}\" LN=\"${LN}\" \
CC_BZ=\"${CC_BZ}\" CFLAGS_BZ=\"${CFLAGS_BZ}\" \
IZ_BZIP2=\"${IZ_BZIP2}\" LIB_BZ=\"${LIB_BZ}\" > flags

View file

@ -15,6 +15,7 @@
#include "libc/time/time.h"
#include "libc/sysv/consts/_posix.h"
#include "libc/calls/struct/stat.macros.h"
#if defined(MINIX) || defined(__mpexl)
# ifdef S_IWRITE

View file

@ -1,25 +1,20 @@
/* clang-format off */
/*
unix/zipup.h - Zip 3
#ifndef COSMOPOLITAN_THIRD_PARTY_INFOZIP_ZIP_UNIX_ZIPUP_H_
#define COSMOPOLITAN_THIRD_PARTY_INFOZIP_ZIP_UNIX_ZIPUP_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/o.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
Copyright (c) 1990-2005 Info-ZIP. All rights reserved.
#define fhow O_RDONLY
#define fbad (-1)
#define zopen(n, p) open(n, p)
#define zread(f, b, n) read(f, b, n)
#define zclose(f) close(f)
#define zerr(f) (k == (extent)(-1L))
#define zstdin 0
See the accompanying file LICENSE, version 2005-Feb-10 or later
(the contents of which are also included in zip.h) for terms of use.
If, for some reason, both of these files are missing, the Info-ZIP license
also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
*/
#ifndef O_RDONLY
# define O_RDONLY 0
#endif
#ifndef O_BINARY
# define O_BINARY 0
#endif
#define fhow (O_RDONLY|O_BINARY)
#define fbad (-1)
typedef int ftype;
#define zopen(n,p) open(n,p)
#define zread(f,b,n) read(f,b,n)
#define zclose(f) close(f)
#define zerr(f) (k == (extent)(-1L))
#define zstdin 0
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_INFOZIP_ZIP_UNIX_ZIPUP_H_ */