dj64: new recipe.

This commit is contained in:
PulkoMandy
2025-06-23 21:33:53 +02:00
parent 7fb44fcbbf
commit 3a8d9634f4
2 changed files with 147 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
SUMMARY="Development suite that allows to cross-build 64-bit programs for DOS"
DESCRIPTION="dj64 is a 64-bit tool-chain that compiles the djgpp-buildable sources for DOS. \
There are the following differences with djgpp:
- dj64 produces 64-bit code, djgpp produces 32-bit
- dj64 uses ELF file format, djgpp uses COFF
- dj64 allows to use host's gdb, djgpp uses some old DOS port of gdb
- preliminary unicode support
- mostly complete BSD sockets support
- out-of-the-box ncurses support
The resulting programs run on the emulated DOS environment, with eg dosemu2 emulator. In theory \
the 64-bit DOS extender can be written to run such programs under the bare-metal DOS, but the \
future of DOS is probably in the emulated environments anyway."
HOMEPAGE="https://github.com/stsp/dj64dev"
COPYRIGHT="2024 Stas Sergeev, 19??-2024 DJ Delorie and others"
LICENSE="GNU GPL v3"
SOURCE_URI="https://github.com/stsp/dj64dev/archive/5c4ecc1256ad2047734ceef547e6d19fcf50e59d.tar.gz"
SOURCE_DIR="dj64dev-5c4ecc1256ad2047734ceef547e6d19fcf50e59d"
CHECKSUM_SHA256="096e70ebec77c60b54cd8a4a557c2c45e9aaf35aaf41d3636714934aa31d14f7"
REVISION="1"
PATCHES="$portVersionedName.patchset"
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
dj64$secondaryArchSuffix = $portVersion
lib:libdjdev64$secondaryArchSuffix
lib:libdjstub64$secondaryArchSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libelf$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libelf$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autoreconf
cmd:ctags
cmd:djlink
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:smlrcc
cmd:thunk_gen >= 1.5
"
targetArch="i386-pc-dj64"
relativeInstallDir="develop/tools/${targetArch}"
installDir="$prefix/$relativeInstallDir"
BUILD()
{
# Official instructions are to just run make (it will run configure if needed), but we need to
# pass options to configure for installation paths, etc.
autoreconf -v -i -I m4
runConfigure --omit-dirs prefix ./configure --prefix=$installDir
# ncurses build needs HOME to be set, otherwise it tries to write into system directories.
export TERMINFO=/tmp
make
}
INSTALL()
{
make install
}

View File

@@ -0,0 +1,73 @@
From 512c7d2a96633940ec3ba00b78461fce1d6f8c12 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Sun, 22 Jun 2025 18:16:51 +0200
Subject: fix build for Haiku
diff --git a/dj64.mk b/dj64.mk
index 8cf7b86..7c5dff9 100644
--- a/dj64.mk
+++ b/dj64.mk
@@ -100,7 +100,7 @@ endif
GLOB_ASM = $(wildcard glob_asm.h)
ifneq ($(AS_OBJECTS),)
-XLDFLAGS = -melf_i386 -static
+XLDFLAGS = -melf_i386_haiku -static
ifeq ($(DJ64STATIC),1)
XLDFLAGS += $(shell pkg-config --static --libs dj64static)
DJ64_XLDFLAGS += -f 0x4000
diff --git a/src/libc/dj64/makefile b/src/libc/dj64/makefile
index 91a7014..c2670ce 100644
--- a/src/libc/dj64/makefile
+++ b/src/libc/dj64/makefile
@@ -95,7 +95,7 @@ $(LIB)/libc.a: libc_tmp.a plt.o | $(LIB)
mv -f libctmp.a $@
$(LIB)/crt0.elf: $(LIB)/libc.a
- $(CROSS_LD) --whole-archive $< -melf_i386 -static $(XLD_IMB_OPT)=0x08048000 -o $@
+ $(CROSS_LD) --whole-archive $< -melf_i386_haiku -static $(XLD_IMB_OPT)=0x08048000 -o $@
$(CROSS_STRIP) --strip-debug $@
chmod -x $@
diff --git a/src/libc/dj64/parsers/mkproto.sh b/src/libc/dj64/parsers/mkproto.sh
index 18da1df..cc36e87 100755
--- a/src/libc/dj64/parsers/mkproto.sh
+++ b/src/libc/dj64/parsers/mkproto.sh
@@ -40,7 +40,7 @@ TF=/tmp/tagsxx
TL=/tmp/a.so
set -e
-${CROSS_LD} -melf_i386 -shared -Bsymbolic -z notext -o $TL --whole-archive "$1"
+${CROSS_LD} -melf_i386_haiku -shared -Bsymbolic -z notext -o $TL --whole-archive "$1"
shift
PRUNES="-name libm -prune -o -name machine -prune"
PRUNES="$PRUNES -o -name string.h -prune -o -name in.h -prune"
--
2.48.1
From f4220a32d87745d85e64cdcee20c0645c28bd989 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Mon, 23 Jun 2025 21:20:27 +0200
Subject: Use static mode for Haiku
As recommended by dj64 developer
diff --git a/dj64.mk b/dj64.mk
index 7c5dff9..83fda82 100644
--- a/dj64.mk
+++ b/dj64.mk
@@ -66,6 +66,9 @@ endif
ifneq ($(filter freebsd%,$(MACH)),)
DJ64STATIC = 1
endif
+ifneq ($(filter haiku%,$(MACH)),)
+DJ64STATIC = 1
+endif
ifneq ($(filter android%,$(MACH)),)
DJ64STATIC = 1
endif
--
2.48.1