aboutsummaryrefslogtreecommitdiff
path: root/dos
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-10-09 19:28:49 +0300
committerLasse Collin <lasse.collin@tukaani.org>2010-10-09 19:28:49 +0300
commit5629c4be07b6c67e79842b2569da1cedc9c0d69a (patch)
tree5bad7e5c6db9ac9dbed4987810952184dbe33271 /dos
parentWindows: Put some license info into README-Windows.txt. (diff)
downloadxz-5629c4be07b6c67e79842b2569da1cedc9c0d69a.tar.xz
DOS: Update the Makefile, config.h and README.
This is now simpler and builds only xz.exe.
Diffstat (limited to 'dos')
-rw-r--r--dos/Makefile211
-rw-r--r--dos/README73
-rw-r--r--dos/config.h45
3 files changed, 86 insertions, 243 deletions
diff --git a/dos/Makefile b/dos/Makefile
index 0b8a088c..d67451a0 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -2,16 +2,6 @@
#
# Makefile to build XZ Utils using DJGPP
#
-# Make flags to alter compilation:
-#
-# DEBUG=1 Enable assertions. Don't use this for production builds!
-# You may also want to set CFLAGS="-g -O0" to disable
-# optimizations.
-#
-# The usual CPPFLAGS and CFLAGS are supported too.
-#
-###############################################################################
-#
# Author: Lasse Collin
#
# This file has been put into the public domain.
@@ -19,15 +9,16 @@
#
###############################################################################
+# 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
-AR = ar
STRIP = strip
-SED = sed
-RM = rm -f
+CPPFLAGS =
+CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
+LDFLAGS =
-CFLAGS = -g -Wextra -Wfatal-errors -Wall -march=i386 -mtune=i686 -O2
-
-# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC 4.3.2
+# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0
# because time.h uses GNU-style "extern inline".
ALL_CFLAGS = -std=gnu99 -fgnu89-inline
@@ -43,61 +34,46 @@ ALL_CPPFLAGS = \
-I../src/liblzma/lzma \
-I../src/liblzma/delta \
-I../src/liblzma/simple \
- -I../src/liblzma/subblock
-
-ALL_CPPFLAGS += -DHAVE_CONFIG_H
-
-ifdef DEBUG
-STRIP := rem Skipping strip
-else
-ALL_CPPFLAGS += -DNDEBUG
-endif
+ -DHAVE_CONFIG_H
ALL_CPPFLAGS += $(CPPFLAGS)
ALL_CFLAGS += $(CFLAGS)
+.PHONY: all
+all: xz.exe
-################
-# Common rules #
-################
-
-.PHONY: all clean
-all: liblzma.a getopt.a xzdec.exe lzmadec.exe xz.exe
-clean: liblzma-clean getopt-clean xzdec-clean xz-clean
-
-
-#############
-# liblzma.a #
-#############
-
-LIBLZMA_SRCS_C = \
+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/auto_decoder.c \
- ../src/liblzma/common/block_buffer_decoder.c \
- ../src/liblzma/common/block_buffer_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/easy_buffer_encoder.c \
- ../src/liblzma/common/easy_decoder_memusage.c \
- ../src/liblzma/common/easy_encoder.c \
- ../src/liblzma/common/easy_encoder_memusage.c \
- ../src/liblzma/common/easy_preset.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/stream_buffer_decoder.c \
- ../src/liblzma/common/stream_buffer_encoder.c \
../src/liblzma/common/stream_decoder.c \
../src/liblzma/common/stream_encoder.c \
../src/liblzma/common/stream_flags_common.c \
@@ -106,11 +82,9 @@ LIBLZMA_SRCS_C = \
../src/liblzma/common/vli_decoder.c \
../src/liblzma/common/vli_encoder.c \
../src/liblzma/common/vli_size.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/rangecoder/price_table.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 \
@@ -122,9 +96,7 @@ LIBLZMA_SRCS_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/delta/delta_common.c \
- ../src/liblzma/delta/delta_decoder.c \
- ../src/liblzma/delta/delta_encoder.c \
+ ../src/liblzma/rangecoder/price_table.c \
../src/liblzma/simple/arm.c \
../src/liblzma/simple/armthumb.c \
../src/liblzma/simple/ia64.c \
@@ -133,123 +105,42 @@ LIBLZMA_SRCS_C = \
../src/liblzma/simple/simple_decoder.c \
../src/liblzma/simple/simple_encoder.c \
../src/liblzma/simple/sparc.c \
- ../src/liblzma/simple/x86.c
-
-LIBLZMA_SRCS_ASM = \
- ../src/liblzma/check/crc32_x86.S \
- ../src/liblzma/check/crc64_x86.S
-
-LIBLZMA_OBJS_C = $(LIBLZMA_SRCS_C:.c=.o)
-LIBLZMA_OBJS_ASM = $(LIBLZMA_SRCS_ASM:.S=.o)
-LIBLZMA_OBJS = $(LIBLZMA_OBJS_C) $(LIBLZMA_OBJS_ASM)
-
-$(LIBLZMA_OBJS_C): %.o: %.c
- $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
-
-$(LIBLZMA_OBJS_ASM): %.o: %.S
- $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
-
-liblzma.a: $(LIBLZMA_OBJS)
- $(RM) $@
- $(AR) rcs $@ $(LIBLZMA_OBJS)
- $(STRIP) --strip-unneeded $@
-
-# Avoid too long command lines.
-.PHONY: liblzma-clean $(LIBLZMA_OBJS:.o=-clean)
-liblzma-clean: $(LIBLZMA_OBJS:.o=-clean)
- -$(RM) liblzma.a
-
-$(LIBLZMA_OBJS:.o=-clean):
- -$(RM) $(@:-clean=.o)
-
-
-###############
-# getopt_long #
-###############
-
-GETOPT_SRCS = \
- ../lib/getopt.c \
- ../lib/getopt1.c
-
-GETOPT_OBJS = $(GETOPT_SRCS:.c=.o)
-
-GETOPT_H = ../lib/getopt.h
-
-$(GETOPT_H): %.h: %.in.h
- $(SED) "" $< > $@
-
-$(GETOPT_OBJS): %.o: %.c $(GETOPT_H)
- $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
-
-getopt.a: $(GETOPT_OBJS)
- $(RM) $@
- $(AR) rcs $@ $(GETOPT_OBJS)
- $(STRIP) --strip-unneeded $@
-
-getopt-clean:
- $(RM) $(GETOPT_H) $(GETOPT_OBJS) getopt.a
-
-
-###########################
-# xzdec.exe & lzmadec.exe #
-###########################
-
-XZDEC_SRCS = ../src/xzdec/xzdec.c
-
-xzdec.exe: getopt.a liblzma.a $(XZDEC_SRCS)
- $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(XZDEC_SRCS) -o $@ getopt.a liblzma.a
- $(STRIP) --strip-all $@
- exe2coff $@
- $(RM) $@
- copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
- $(RM) $(@:.exe=)
-
-lzmadec.exe: getopt.a liblzma.a $(XZDEC_SRCS)
- $(CC) $(ALL_CPPFLAGS) -DLZMADEC $(ALL_CFLAGS) $(XZDEC_SRCS) -o $@ getopt.a liblzma.a
- $(STRIP) --strip-all $@
- exe2coff $@
- $(RM) $@
- copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
- $(RM) $(@:.exe=)
-
-.PHONY: xzdec-clean
-xzdec-clean:
- -$(RM) xzdec.exe lzmadec.exe xzdec lzmadec
-
-
-##########
-# xz.exe #
-##########
-
-XZ_SRCS = \
+ ../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/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
-XZ_OBJS = $(XZ_SRCS:.c=.o)
+$(OBJS): getopt.h
-$(XZ_OBJS): %.o: %.c
+$(OBJS_C): %.o: %.c
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
-xz.exe: getopt.a liblzma.a $(XZ_OBJS)
- $(CC) $(ALL_CFLAGS) $(XZ_OBJS) -o $@ getopt.a liblzma.a
+$(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 $@
- $(RM) $@
+ del $@
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
- $(RM) $(@:.exe=)
-
-# Avoid too long command lines.
-.PHONY: xz-clean $(XZ_OBJS:.o=-clean)
-xz-clean: $(XZ_OBJS:.o=-clean)
- -$(RM) xz.exe xz
-
-$(XZ_OBJS:.o=-clean):
- -$(RM) $(@:-clean=.o)
+ del $(@:.exe=)
diff --git a/dos/README b/dos/README
index 649c58c4..1ed84934 100644
--- a/dos/README
+++ b/dos/README
@@ -6,36 +6,40 @@ 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, which cannot run the Windows version
- of XZ Utils.
+ and under Windows 95/98/98SE/ME, although the Windows version of
+ XZ Utils is recommended under Windows 95 and later.
This is currently experimental and has got very little testing.
+ Note: Makefile and config.h are updated only now and then. This
+ means that especially if you checked out a development version,
+ building for DOS probably won't work without updating Makefile
+ and config.h first.
+
Getting and Installing DJGPP
You may use <http://www.delorie.com/djgpp/zip-picker.html> to help
- deciding what to download, but as of writing (2009-02-13) that may
+ deciding what to download, but as of writing (2010-10-09) that may
not be the most convenient way taking into account what components
are actually required to build XZ Utils. However, using the
zip-picker can still be worth doing to get nice short summary of
installation instructions (they can be found from readme.1st too).
- For more manual method, first select a mirror from
+ For a more manual method, first select a mirror from
<http://www.delorie.com/djgpp/getting.html>. You need
the following files:
- unzip32.exe
+ unzip32.exe (if you don't already have a LFN-capable unzipper)
beta/v2/djdev204.zip
v2gnu/bnu219b.zip
- v2gnu/gcc432b.zip
+ v2gnu/gcc444b.zip
v2gnu/mak3791b.zip
- v2gnu/sed415b.zip
- v2misc/csdpmi5b.zip
+ v2misc/csdpmi7b.zip
If newer versions are available, probably you should try them first.
Note that djdev203.zip is too old to build XZ Utils; you need at
- least djdev204.zip. Also note that you want csdpmi5b.zip even if you
+ least djdev204.zip. 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 binaries.
@@ -46,10 +50,9 @@ Getting and Installing DJGPP
C:\> cd DJGPP
C:\DJGPP> c:\download\unzip32 c:\download\djdev204.zip
C:\DJGPP> c:\download\unzip32 c:\download\bnu219b.zip
- C:\DJGPP> c:\download\unzip32 c:\download\gcc432b.zip
+ C:\DJGPP> c:\download\unzip32 c:\download\gcc444b.zip
C:\DJGPP> c:\download\unzip32 c:\download\mak3791b.zip
- C:\DJGPP> c:\download\unzip32 c:\download\sed415b.zip
- C:\DJGPP> c:\download\unzip32 c:\download\csdpmi5b.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
@@ -65,49 +68,21 @@ Getting and Installing DJGPP
Building
- Just run "make" in this directory (the directory containing this
- README). You should get liblzma.a, xz.exe, xzdec.exe, and
- lzmadec.exe. Of these, probably xz.exe is the only interesting one.
-
- Note: You need to have an environment that supports long filenames.
+ 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.
-
-Additional Make Flags and Targets
-
- You may want to try some additional optimizations, which may or
- may not make the code faster (and may or may not hit possible
- compiler bugs more easily):
-
- make CFLAGS="-O3 -fomit-frame-pointer -funroll-loops"
-
- If you want to enable assertions (the assert() macro), use DEBUG=1.
- You may want to disable optimizations too if you plan to actually
- debug the code. Never use DEBUG=1 for production builds!
-
- make DEBUG=1 CFLAGS="-g -O0"
+ Run "make" in this directory (the directory containing this README).
+ 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.
Bugs
- "make clean" may remove src/xz/hardware.c when it tries to remove
- src/xz/hardware-fixed.c. This is probably a bug somewhere in the
- DOS environment I use. Maybe it tries truncated 8.3 name first and
- since that gives a name of an existing file, it doesn't look for
- long filename.
-
- "xz -fc /dev/tty" hangs at least in DOSEMU and cannot be interrupted
- by pressing C-c. Maybe xz should never accept non-regular files on
- DOS even when --force is used.
-
- Using different memory usage limit for encoding and decoding doesn't
- make sense under pure DOS. Maybe it is still OK when running under
- Windows.
-
- The progress indicator of "xz -v" doesn't get updated when running
- under Dosbox, but it works in DOSEMU. I currently (2009-02-13) don't
- know if it works in other environments.
+ xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
- Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
+ 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). Use the Windows build of XZ Utils on Windows.
diff --git a/dos/config.h b/dos/config.h
index dfd6f797..1ed81f67 100644
--- a/dos/config.h
+++ b/dos/config.h
@@ -1,5 +1,5 @@
-/* Define to 1 if using x86 assembler optimizations. */
-#define HAVE_ASM_X86 1
+/* 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
@@ -10,9 +10,6 @@
/* Define to 1 if sha256 integrity check is enabled. */
#define HAVE_CHECK_SHA256 1
-/* Define to 1 if decoder components are enabled. */
-#define HAVE_DECODER 1
-
/* Define to 1 if arm decoder is enabled. */
#define HAVE_DECODER_ARM 1
@@ -37,15 +34,9 @@
/* Define to 1 if sparc decoder is enabled. */
#define HAVE_DECODER_SPARC 1
-/* Define to 1 if subblock decoder is enabled. */
-/* #undef HAVE_DECODER_SUBBLOCK */
-
/* Define to 1 if x86 decoder is enabled. */
#define HAVE_DECODER_X86 1
-/* Define to 1 if encoder components are enabled. */
-#define HAVE_ENCODER 1
-
/* Define to 1 if arm encoder is enabled. */
#define HAVE_ENCODER_ARM 1
@@ -70,24 +61,15 @@
/* Define to 1 if sparc encoder is enabled. */
#define HAVE_ENCODER_SPARC 1
-/* Define to 1 if subblock encoder is enabled. */
-/* #undef HAVE_ENCODER_SUBBLOCK */
-
/* Define to 1 if x86 encoder is enabled. */
#define HAVE_ENCODER_X86 1
-/* Define to 1 if the system supports fast unaligned memory access. */
-#define HAVE_FAST_UNALIGNED_ACCESS 1
-
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_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 <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
/* Define to 1 to enable bt2 match finder. */
#define HAVE_MF_BT2 1
@@ -103,9 +85,6 @@
/* Define to 1 to enable hc4 match finder. */
#define HAVE_MF_HC4 1
-/* Define to 1 if optimizing for size. */
-/* #undef HAVE_SMALL */
-
/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1
@@ -115,15 +94,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 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 the system has the type `uintptr_t'. */
-#define HAVE_UINTPTR_T 1
-
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
@@ -137,17 +110,21 @@
/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 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 "lasse.collin@tukaani.org"
-/* Define to the URL of the home page of this package. */
-#define PACKAGE_HOMEPAGE "http://tukaani.org/xz/"
-
/* Define to the full name of this package. */
#define PACKAGE_NAME "XZ Utils"
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://tukaani.org/xz/"
+
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
+/* Define to 1 if the system supports fast unaligned access to 16-bit and
+ 32-bit integers. */
+#define TUKLIB_FAST_UNALIGNED_ACCESS 1