From eac54b7c4aec25060d7bd856f7cdc290943d6aae Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 23:12:04 +0200 Subject: Adding upstream version 5.4.1. Signed-off-by: Daniel Baumann --- dos/INSTALL.txt | 78 +++++++++++++++++++++++++++++ dos/Makefile | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ dos/README.txt | 123 +++++++++++++++++++++++++++++++++++++++++++++ dos/config.h | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 503 insertions(+) create mode 100644 dos/INSTALL.txt create mode 100644 dos/Makefile create mode 100644 dos/README.txt create mode 100644 dos/config.h (limited to 'dos') diff --git a/dos/INSTALL.txt b/dos/INSTALL.txt new file mode 100644 index 0000000..4c13211 --- /dev/null +++ b/dos/INSTALL.txt @@ -0,0 +1,78 @@ + +Building XZ Utils for DOS +========================= + +Introduction + + This document explains how to build XZ Utils for DOS using DJGPP. + The resulting binaries should run at least on various DOS versions + and under Windows 95/98/98SE/ME. + + This is somewhat experimental and has got very little testing. + + Note: Makefile and config.h are updated only now and then. This + means that if you checked out a development version, building for + DOS might not work without updating Makefile and config.h first. + + +Getting and Installing DJGPP + + You may use to help + deciding what to download. If you are only interested in building + XZ Utils, the zip-picker may list files that you don't strictly + need. However, using the zip-picker can still be worth it to get a + nice short summary of installation instructions (they can be found + from readme.1st too). + + For a more manual method, first select a mirror from + and go the + subdirectory named "current". You need the following files: + + unzip32.exe (if you don't already have a LFN-capable unzipper) + v2/djdev205.zip + v2gnu/bnu234b.zip + v2gnu/gcc920b.zip + v2gnu/mak43b.zip + v2misc/csdpmi7b.zip + + If newer versions are available, probably you should try them first. + Note that versions older than djdev205.zip aren't supported. Also + note that you want csdpmi7b.zip even if you run under Windows or + DOSEMU because the XZ Utils Makefile will embed cwsdstub.exe to + the resulting xz.exe. + + See the instructions in readme.1st found from djdev205.zip. Here's + a short summary, but you should still read readme.1st. + + C:\> mkdir DJGPP + C:\> cd DJGPP + C:\DJGPP> c:\download\unzip32 c:\download\djdev205.zip + C:\DJGPP> c:\download\unzip32 c:\download\bnu234b.zip + C:\DJGPP> c:\download\unzip32 c:\download\gcc920b.zip + C:\DJGPP> c:\download\unzip32 c:\download\mak43b.zip + C:\DJGPP> c:\download\unzip32 c:\download\csdpmi7b.zip + + C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH% + C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV + + You may want to add the last two lines into AUTOEXEC.BAT or have, + for example, DJGPP.BAT which you can run before using DJGPP. + + Make sure you use completely upper case path in the DJGPP environment + variable. This is not required by DJGPP, but the XZ Utils Makefile is + a bit stupid and expects that everything in DJGPP environment variable + is uppercase. + + +Building + + You need to have an environment that supports long filenames (LFN). + Once you have built XZ Utils, the resulting binaries can be run + without long filename support. + + Run "make" in this directory (the directory containing this + INSTALL.txt). You should get xz.exe (and a bunch of temporary files). + Other tools are not built. Having e.g. xzdec.exe doesn't save much + space compared to xz.exe because the DJGPP runtime makes the .exe + quite big anyway. + diff --git a/dos/Makefile b/dos/Makefile new file mode 100644 index 0000000..793adc1 --- /dev/null +++ b/dos/Makefile @@ -0,0 +1,149 @@ +############################################################################### +# +# Makefile to build XZ Utils using DJGPP +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +# For debugging, set comment "#define NDEBUG 1" from config.h to enable +# the assert() macro, set STRIP=rem to disable stripping, and finally +# e.g. CFLAGS="-g -O0". +CC = gcc +STRIP = strip +CPPFLAGS = +CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2 +LDFLAGS = -lemu + +ALL_CFLAGS = -std=gnu99 + +ALL_CPPFLAGS = \ + -I. \ + -I../lib \ + -I../src/common \ + -I../src/liblzma/api \ + -I../src/liblzma/common \ + -I../src/liblzma/check \ + -I../src/liblzma/rangecoder \ + -I../src/liblzma/lz \ + -I../src/liblzma/lzma \ + -I../src/liblzma/delta \ + -I../src/liblzma/simple \ + -DHAVE_CONFIG_H + +ALL_CPPFLAGS += $(CPPFLAGS) +ALL_CFLAGS += $(CFLAGS) + +.PHONY: all +all: xz.exe + +SRCS_C = \ + ../lib/getopt.c \ + ../lib/getopt1.c \ + ../src/common/tuklib_cpucores.c \ + ../src/common/tuklib_exit.c \ + ../src/common/tuklib_mbstr_fw.c \ + ../src/common/tuklib_mbstr_width.c \ + ../src/common/tuklib_open_stdxxx.c \ + ../src/common/tuklib_physmem.c \ + ../src/common/tuklib_progname.c \ + ../src/liblzma/check/check.c \ + ../src/liblzma/check/crc32_table.c \ + ../src/liblzma/check/crc64_table.c \ + ../src/liblzma/check/sha256.c \ + ../src/liblzma/common/alone_decoder.c \ + ../src/liblzma/common/alone_encoder.c \ + ../src/liblzma/common/block_decoder.c \ + ../src/liblzma/common/block_encoder.c \ + ../src/liblzma/common/block_header_decoder.c \ + ../src/liblzma/common/block_header_encoder.c \ + ../src/liblzma/common/block_util.c \ + ../src/liblzma/common/common.c \ + ../src/liblzma/common/file_info.c \ + ../src/liblzma/common/filter_common.c \ + ../src/liblzma/common/filter_decoder.c \ + ../src/liblzma/common/filter_encoder.c \ + ../src/liblzma/common/filter_flags_decoder.c \ + ../src/liblzma/common/filter_flags_encoder.c \ + ../src/liblzma/common/hardware_physmem.c \ + ../src/liblzma/common/index.c \ + ../src/liblzma/common/index_decoder.c \ + ../src/liblzma/common/index_encoder.c \ + ../src/liblzma/common/index_hash.c \ + ../src/liblzma/common/lzip_decoder.c \ + ../src/liblzma/common/stream_decoder.c \ + ../src/liblzma/common/stream_encoder.c \ + ../src/liblzma/common/stream_flags_common.c \ + ../src/liblzma/common/stream_flags_decoder.c \ + ../src/liblzma/common/stream_flags_encoder.c \ + ../src/liblzma/common/string_conversion.c \ + ../src/liblzma/common/vli_decoder.c \ + ../src/liblzma/common/vli_encoder.c \ + ../src/liblzma/common/vli_size.c \ + ../src/liblzma/delta/delta_common.c \ + ../src/liblzma/delta/delta_decoder.c \ + ../src/liblzma/delta/delta_encoder.c \ + ../src/liblzma/lz/lz_decoder.c \ + ../src/liblzma/lz/lz_encoder.c \ + ../src/liblzma/lz/lz_encoder_mf.c \ + ../src/liblzma/lzma/fastpos_table.c \ + ../src/liblzma/lzma/lzma2_decoder.c \ + ../src/liblzma/lzma/lzma2_encoder.c \ + ../src/liblzma/lzma/lzma_decoder.c \ + ../src/liblzma/lzma/lzma_encoder.c \ + ../src/liblzma/lzma/lzma_encoder_optimum_fast.c \ + ../src/liblzma/lzma/lzma_encoder_optimum_normal.c \ + ../src/liblzma/lzma/lzma_encoder_presets.c \ + ../src/liblzma/rangecoder/price_table.c \ + ../src/liblzma/simple/arm.c \ + ../src/liblzma/simple/arm64.c \ + ../src/liblzma/simple/armthumb.c \ + ../src/liblzma/simple/ia64.c \ + ../src/liblzma/simple/powerpc.c \ + ../src/liblzma/simple/simple_coder.c \ + ../src/liblzma/simple/simple_decoder.c \ + ../src/liblzma/simple/simple_encoder.c \ + ../src/liblzma/simple/sparc.c \ + ../src/liblzma/simple/x86.c \ + ../src/xz/args.c \ + ../src/xz/coder.c \ + ../src/xz/file_io.c \ + ../src/xz/hardware.c \ + ../src/xz/list.c \ + ../src/xz/main.c \ + ../src/xz/message.c \ + ../src/xz/mytime.c \ + ../src/xz/options.c \ + ../src/xz/signals.c \ + ../src/xz/suffix.c \ + ../src/xz/util.c +SRCS_ASM = \ + ../src/liblzma/check/crc32_x86.S \ + ../src/liblzma/check/crc64_x86.S + +OBJS_C = $(SRCS_C:.c=.o) +OBJS_ASM = $(SRCS_ASM:.S=.o) +OBJS = $(OBJS_C) $(OBJS_ASM) + +getopt.h: + update ../lib/getopt.in.h getopt.h + +$(OBJS): getopt.h + +$(OBJS_C): %.o: %.c + $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $< + +$(OBJS_ASM): %.o: %.S + $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $< + +# Make xz.exe not depend on an external DPMI server. +xz.exe: $(OBJS) + $(CC) $(ALL_CFLAGS) $(OBJS) $(LDFLAGS) -o $@ + $(STRIP) --strip-all $@ + exe2coff $@ + del $@ + copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@ + del $(@:.exe=) diff --git a/dos/README.txt b/dos/README.txt new file mode 100644 index 0000000..0e8f6c0 --- /dev/null +++ b/dos/README.txt @@ -0,0 +1,123 @@ + +XZ Utils on DOS +=============== + +DOS-specific filename handling + + xz detects at runtime if long filename (LFN) support is + available and will use it by default. It can be disabled by + setting an environment variable: + + set lfn=n + + When xz is in LFN mode, it behaves pretty much the same as it + does on other operating systems. Examples: + + xz foo.tar -> foo.tar.xz + xz -d foo.tar.xz -> foo.tar + + xz -F lzma foo.tar -> foo.tar.lzma + xz -d foo.tar.lzma -> foo.tar + + When LFN support isn't available or it is disabled with LFN=n + environment setting, xz works in short filename (SFN) mode. This + affects filename suffix handling when compressing. + + When compressing to the .xz format in SFN mode: + + - Files without an extension get .xz just like on LFN systems. + + - *.tar files become *.txz (shorthand for *.tar.xz). *.txz + is recognized by xz on all supported operating systems. + (Try to avoid confusing this with gzipped .txt files.) + + - Files with 1-3 character extension have their extension modified + so that the last character is a dash ("-"). If the extension + is already three characters, the last character is lost. The + resulting *.?- or *.??- filename is recognized in LFN mode, but + it isn't recognized by xz on other operating systems. + + Examples: + + xz foo -> foo.xz | xz -d foo.xz -> foo + xz foo.tar -> foo.txz | xz -d foo.txz -> foo.tar + xz foo.c -> foo.c- | xz -d foo.c- -> foo.c + xz read.me -> read.me- | xz -d read.me- -> read.me + xz foo.txt -> foo.tx- | xz -d foo.tx- -> foo.tx ! + + Note that in the last example above, the third character of the + filename extension is lost. + + When compressing to the legacy .lzma format in SFN mode: + + - *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz + is recognized by xz on all supported operating systems. + + - Other files become *.lzm. The original filename extension + is lost. *.lzm is recognized also in LFN mode, but it is not + recognized by xz on other operating systems. + + Examples: + + xz -F lzma foo -> foo.lzm | xz -d foo.lzm -> foo + xz -F lzma foo.tar -> foo.tlz | xz -d foo.tlz -> foo.tar + xz -F lzma foo.c -> foo.lzm | xz -d foo.lzm -> foo ! + xz -F lzma read.me -> read.lzm | xz -d read.lzm -> read ! + xz -F lzma foo.txt -> foo.lzm | xz -d foo.lzm -> foo ! + + When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to + any file format: + + - If the suffix begins with a dot, the filename extension is + replaced with the new suffix. The original extension is lost. + + - If the suffix doesn't begin with a dot and the filename has no + extension and the filename given on the command line doesn't + have a dot at the end, the custom suffix is appended just like + on LFN systems. + + - If the suffix doesn't begin with a dot and the filename has + an extension (or an extension-less filename is given with a dot + at the end), the last 1-3 characters of the filename extension + may get overwritten to fit the given custom suffix. + + Examples: + + xz -S x foo -> foox | xz -dS x foox -> foo + xz -S x foo. -> foo.x | xz -dS x foo.x -> foo + xz -S .x foo -> foo.x | xz -dS .x foo.x -> foo + xz -S .x foo. -> foo.x | xz -dS .x foo.x -> foo + xz -S x.y foo -> foox.y | xz -dS x.y foox.y -> foo + xz -S .a foo.c -> foo.a | xz -dS .a foo.a -> foo ! + xz -S a foo.c -> foo.ca | xz -dS a foo.ca -> foo.c + xz -S ab foo.c -> foo.cab | xz -dS ab foo.cab -> foo.c + xz -S ab read.me -> read.mab | xz -dS ab read.mab -> read.m ! + xz -S ab foo.txt -> foo.tab | xz -dS ab foo.tab -> foo.t ! + xz -S abc foo.txt -> foo.abc | xz -dS abc foo.abc -> foo ! + + When decompressing, the suffix handling in SFN mode is the same as + in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are + recognized also in LFN mode. + + xz handles certain uncommon situations safely: + + - If the generated output filename refers to the same file as + the input file, xz detects this and refuses to compress or + decompress the input file even if --force is used. This can + happen when giving an overlong filename in SFN mode. E.g. + "xz -S x foo.texinfo" would try to write to foo.tex which on + SFN system is the same file as foo.texinfo. + + - If the generated output filename is a special file like "con" + or "prn", xz detects this and refuses to compress or decompress + the input file even if --force is used. + + +Bugs + + xz doesn't necessarily work in Dosbox. It should work in DOSEMU. + + Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file + when running under Windows XP Command Prompt (something goes wrong + with SIGINT handling). It works correctly under Windows 95/98/98SE/ME. + diff --git a/dos/config.h b/dos/config.h new file mode 100644 index 0000000..67b72f8 --- /dev/null +++ b/dos/config.h @@ -0,0 +1,153 @@ +/* How many MiB of RAM to assume if the real amount cannot be determined. */ +#define ASSUME_RAM 32 + +/* Define to 1 if crc32 integrity check is enabled. */ +#define HAVE_CHECK_CRC32 1 + +/* Define to 1 if crc64 integrity check is enabled. */ +#define HAVE_CHECK_CRC64 1 + +/* Define to 1 if sha256 integrity check is enabled. */ +#define HAVE_CHECK_SHA256 1 + +/* Define to 1 if any of HAVE_DECODER_foo have been defined. */ +#define HAVE_DECODERS 1 + +/* Define to 1 if arm decoder is enabled. */ +#define HAVE_DECODER_ARM 1 + +/* Define to 1 if arm64 decoder is enabled. */ +#define HAVE_DECODER_ARM64 1 + +/* Define to 1 if armthumb decoder is enabled. */ +#define HAVE_DECODER_ARMTHUMB 1 + +/* Define to 1 if delta decoder is enabled. */ +#define HAVE_DECODER_DELTA 1 + +/* Define to 1 if ia64 decoder is enabled. */ +#define HAVE_DECODER_IA64 1 + +/* Define to 1 if lzma1 decoder is enabled. */ +#define HAVE_DECODER_LZMA1 1 + +/* Define to 1 if lzma2 decoder is enabled. */ +#define HAVE_DECODER_LZMA2 1 + +/* Define to 1 if powerpc decoder is enabled. */ +#define HAVE_DECODER_POWERPC 1 + +/* Define to 1 if sparc decoder is enabled. */ +#define HAVE_DECODER_SPARC 1 + +/* Define to 1 if x86 decoder is enabled. */ +#define HAVE_DECODER_X86 1 + +/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */ +#define HAVE_ENCODERS 1 + +/* Define to 1 if arm encoder is enabled. */ +#define HAVE_ENCODER_ARM 1 + +/* Define to 1 if arm64 encoder is enabled. */ +#define HAVE_ENCODER_ARM64 1 + +/* Define to 1 if armthumb encoder is enabled. */ +#define HAVE_ENCODER_ARMTHUMB 1 + +/* Define to 1 if delta encoder is enabled. */ +#define HAVE_ENCODER_DELTA 1 + +/* Define to 1 if ia64 encoder is enabled. */ +#define HAVE_ENCODER_IA64 1 + +/* Define to 1 if lzma1 encoder is enabled. */ +#define HAVE_ENCODER_LZMA1 1 + +/* Define to 1 if lzma2 encoder is enabled. */ +#define HAVE_ENCODER_LZMA2 1 + +/* Define to 1 if powerpc encoder is enabled. */ +#define HAVE_ENCODER_POWERPC 1 + +/* Define to 1 if sparc encoder is enabled. */ +#define HAVE_ENCODER_SPARC 1 + +/* Define to 1 if x86 encoder is enabled. */ +#define HAVE_ENCODER_X86 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if .lz (lzip) decompression support is enabled. */ +#define HAVE_LZIP_DECODER 1 + +/* Define to 1 to enable bt2 match finder. */ +#define HAVE_MF_BT2 1 + +/* Define to 1 to enable bt3 match finder. */ +#define HAVE_MF_BT3 1 + +/* Define to 1 to enable bt4 match finder. */ +#define HAVE_MF_BT4 1 + +/* Define to 1 to enable hc3 match finder. */ +#define HAVE_MF_HC3 1 + +/* Define to 1 to enable hc4 match finder. */ +#define HAVE_MF_HC4 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the `utimes' function. */ +#define HAVE_UTIMES 1 + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#define HAVE_VISIBILITY 0 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported. + */ +#define HAVE___BUILTIN_ASSUME_ALIGNED 1 + +/* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported. + */ +#define HAVE___BUILTIN_BSWAPXX 1 + +/* Define to 1 to disable debugging code. */ +#define NDEBUG 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "xz@tukaani.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "XZ Utils" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://tukaani.org/xz/" + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* Define to 1 if the system supports fast unaligned access to 16-bit and + 32-bit integers. */ +#define TUKLIB_FAST_UNALIGNED_ACCESS 1 -- cgit v1.2.3