From 7039717f5e0ca2566ce5d2f776f22fd8a0c438dd Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 12 Oct 2024 15:10:51 +0300 Subject: [PATCH] drop ccwrp.sh --- bin/ccwrp.sh | 54 ----------------------------------------- debian/dj64-dev.install | 3 --- dj64.mk | 21 ++++++++++------ dj64.spec.rpkg | 3 --- makefile | 6 ----- man/dj64-gcc.1 | 41 ------------------------------- 6 files changed, 13 insertions(+), 115 deletions(-) delete mode 100755 bin/ccwrp.sh delete mode 100644 man/dj64-gcc.1 diff --git a/bin/ccwrp.sh b/bin/ccwrp.sh deleted file mode 100755 index b2f269b2..00000000 --- a/bin/ccwrp.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail - -[ -n "$CC" ] || CC=cc -[ -n "$CPP" ] || CPP=cpp -ASCPPFLAGS=`pkg-config --variable=cppflags dj64` -XCPPFLAGS=`pkg-config --variable=xcppflags dj64` -[ -n "$DJ64AS" ] || DJ64AS="$CC -x assembler" -[ -n "$DJ64ASFLAGS" ] || DJ64ASFLAGS="-m32 -Wa,-defsym,_DJ64=1 -c" - -ORIG_ARGS="$*" -if [ $# -lt 2 ]; then - $CC ${ORIG_ARGS} - exit $? -fi -LAST_ARG=${!#} -set -- "${@:1:$(($#-1))}" -PLAST_ARG=${!#} -if [ "$PLAST_ARG" != "-c" ]; then - $CC ${ORIG_ARGS} - exit $? -fi -for arg in "$@" -do - case "$arg" in - -I*) INCS="$INCS $arg" - shift - ;; - esac -done -case "${LAST_ARG}" in - *.S|-) - set -- "${@:1:$(($#-1))}" - echo "$CPP -x assembler-with-cpp $ASCPPFLAGS ${INCS} ${LAST_ARG} | " \ - "$DJ64AS $DJ64ASFLAGS - $*" - $CPP -x assembler-with-cpp $ASCPPFLAGS ${INCS} ${LAST_ARG} | \ - $DJ64AS $DJ64ASFLAGS - $* - exit $? - ;; - *.s) - set -- "${@:1:$(($#-1))}" - echo "$DJ64AS $DJ64ASFLAGS $* ${LAST_ARG}" - $DJ64AS $DJ64ASFLAGS $* ${LAST_ARG} - exit $? - ;; -esac -if [ -n "$*" ]; then - $CPP -CC -g0 $XCPPFLAGS $CPPFLAGS ${INCS} ${LAST_ARG} | \ - sed -E -e 's/^\*\/#/\*\/\n#/' -e 's/^\*\/ *;/\*\/\n;\n/' | \ - eval $CC -xc `pkg-config --cflags dj64` $CFLAGS ${*//\"/\\\"} - -else - $CC ${LAST_ARG} -fi diff --git a/debian/dj64-dev.install b/debian/dj64-dev.install index 1710f902..c575796c 100644 --- a/debian/dj64-dev.install +++ b/debian/dj64-dev.install @@ -1,9 +1,6 @@ usr/i386-pc-dj64/include usr/i386-pc-dj64/lib/*.o usr/i386-pc-dj64/lib64/*.so -usr/i386-pc-dj64/bin/* usr/i386-pc-dj64/share/* -usr/bin/* usr/share/pkgconfig/dj64.pc -usr/share/man/man1/* usr/share/doc/dj64/* diff --git a/dj64.mk b/dj64.mk index 2e40545c..68afdb91 100644 --- a/dj64.mk +++ b/dj64.mk @@ -9,16 +9,18 @@ ifeq ($(shell $(DJ64AS) --version 2>/dev/null),) ifneq ($(filter x86_64 amd64,$(shell uname -m)),) CROSS_PREFIX := ifeq ($(shell $(DJ64AS) --version 2>/dev/null),) -# found nothing, allow dj64-gcc to use defaults -DJ64AS = -DJ64ASFLAGS = +# found nothing, try built-in assembler +DJ64AS = $(CC) -x assembler +DJ64ASFLAGS = -m32 -Wa,-defsym,_DJ64=1 -c endif else $(error cross-binutils not installed) endif endif -export DJ64AS -export DJ64ASFLAGS + +DJ64CFLAGS = $(shell pkg-config --cflags dj64) +XCPPFLAGS = $(shell pkg-config --variable=xcppflags dj64) +ASCPPFLAGS = $(shell pkg-config --variable=cppflags dj64) XSTRIP = $(CROSS_PREFIX)strip --strip-debug XLD = $(CROSS_PREFIX)ld @@ -86,11 +88,14 @@ $(DJ64_XLIB): $(OBJECTS) $(LD) $^ $(DJLDFLAGS) -o $@ %.o: %.c - dj64-gcc $(CFLAGS) -I. -o $@ -c $< + $(CC) $(DJ64CFLAGS) $(XCPPFLAGS) $(CFLAGS) -I. -o $@ -c $< %.o: %.S - dj64-gcc -o $@ -c $< + $(CPP) -x assembler-with-cpp $(ASCPPFLAGS) $< | \ + $(DJ64AS) $(DJ64ASFLAGS) -o $@ - plt.o: plt.inc $(GLOB_ASM) - echo "#include " | dj64-gcc -I. -o $@ -c - + echo "#include " | \ + $(CPP) -x assembler-with-cpp $(ASCPPFLAGS) -I. - | \ + $(DJ64AS) $(DJ64ASFLAGS) -o $@ - thunks_c.o: thunk_calls.h thunks_p.o: thunk_asms.h plt_asmc.h diff --git a/dj64.spec.rpkg b/dj64.spec.rpkg index c0e3ea9e..d828dbe0 100644 --- a/dj64.spec.rpkg +++ b/dj64.spec.rpkg @@ -80,11 +80,8 @@ This package contains tools and headers for building dj64-enabled programs. %{_prefix}/i386-pc-dj64/include %{_prefix}/i386-pc-dj64/lib/*.o %{_prefix}/i386-pc-dj64/lib64/*.so -%{_prefix}/i386-pc-dj64/bin/* %{_prefix}/i386-pc-dj64/share/* -%{_bindir}/* %{_datadir}/pkgconfig/dj64.pc -%{_mandir}/man1/* %{_docdir}/dj64 %end diff --git a/makefile b/makefile index 5c6b66f6..1effaf7c 100644 --- a/makefile +++ b/makefile @@ -74,19 +74,13 @@ install_dj64: $(INSTALL) -m 0644 $(DJ64LIBS) $(DESTDIR)$(PREFIX)/i386-pc-dj64/lib64 $(INSTALL) -d $(DESTDIR)$(PREFIX)/i386-pc-dj64/include cp -r $(TOP)/include $(DESTDIR)$(PREFIX)/i386-pc-dj64 - $(INSTALL) -d $(DESTDIR)$(PREFIX)/i386-pc-dj64/bin - $(INSTALL) -m 0755 bin/ccwrp.sh $(DESTDIR)$(PREFIX)/i386-pc-dj64/bin $(INSTALL) -d $(DESTDIR)$(PREFIX)/i386-pc-dj64/share $(INSTALL) -m 0644 dj64.mk $(DESTDIR)$(PREFIX)/i386-pc-dj64/share - $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin - ln -sf ../i386-pc-dj64/bin/ccwrp.sh $(DESTDIR)$(PREFIX)/bin/dj64-gcc $(INSTALL) -d $(DESTDIR)$(PREFIX)/share $(INSTALL) -d $(DESTDIR)$(PREFIX)/share/pkgconfig $(INSTALL) -m 0644 dj64.pc $(DESTDIR)$(PREFIX)/share/pkgconfig $(INSTALL) -m 0644 dj64_s.pc $(DESTDIR)$(PREFIX)/share/pkgconfig $(INSTALL) -m 0644 dj64static.pc $(DESTDIR)$(PREFIX)/share/pkgconfig - $(INSTALL) -d $(DESTDIR)$(PREFIX)/share/man/man1 - $(INSTALL) -m 0644 man/*.1 $(DESTDIR)$(PREFIX)/share/man/man1 install_djdev64: $(INSTALL) -d $(DESTDIR)$(PREFIX)/share diff --git a/man/dj64-gcc.1 b/man/dj64-gcc.1 deleted file mode 100644 index daf9564c..00000000 --- a/man/dj64-gcc.1 +++ /dev/null @@ -1,41 +0,0 @@ -.\" -*- nroff -*- (This is for Emacs) -.TH dj64-gcc 1 "2024-06-13" "Version 0.1" "Development" -.SH NAME -dj64-gcc \- cross-compile 64-bit DOS programs -.SH SYNOPSIS -.B dj64-gcc -[ -.B gcc_opts -] -.B -o .o -.B -c .[cSs] -.PP -.SH DESCRIPTION -.B dj64-gcc -compiles the C or assembler source files into an intermediate object files. -It is used by dj64-provided -.I dj64.mk -makefile hook and should not be called directly. The intermediate object -files compiled with -.I dj64-gcc -are further processed in -.I dj64.mk -and you get a different object files as an output. - -.SH "EXAMPLES" -.TP -dj64-gcc -Wall -Os -ggdb3 -DREV=\\"0.1\\" -I. -o command.o -c command.c -.TP -dj64-gcc -o asm.o -c asm.S - -.SH "NOTES" -You may want to use -.I dj64-gcc -directly only if you use non-make-based build system, like meson. - -You can't freely reorder command-line arguments. Please use the order -specified in this man page. - -.SH "AUTHOR" -.TP -stsp2@yandex.ru (@stsp on github)