summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanez Zemva2017-09-04 21:03:29 +0200
committerJanez Zemva2017-09-04 21:03:29 +0200
commit12760a3c06c4e6945ee0cb74834d1cfb2acbbb9e (patch)
tree29301344d03855c151be458ed08367b4f68654c4
downloadaur-12760a3c06c4e6945ee0cb74834d1cfb2acbbb9e.tar.gz
initial commit
-rw-r--r--.SRCINFO36
-rw-r--r--PKGBUILD100
-rw-r--r--asm.patch11
-rw-r--r--dxegen.patch36
-rw-r--r--environ.c8
-rw-r--r--fseeko64.patch10
-rw-r--r--gcc-no-werror.patch21
-rw-r--r--nmemalign.patch22
-rw-r--r--ttyscrn.patch11
9 files changed, 255 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1c6d6725496f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = djgpp-djcrx
+ pkgdesc = Headers and utilities for the dosbox gcc cross-compiler
+ pkgver = 2.05
+ pkgrel = 7
+ url = http://www.delorie.com/djgpp/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = LGPL
+ license = custom:djgpp
+ makedepends = djgpp-gcc
+ depends = glibc
+ depends = gcc-libs
+ options = !buildflags
+ options = !strip
+ source = http://www.delorie.com/pub/djgpp/current/v2/djcrx205.zip
+ source = http://www.delorie.com/pub/djgpp/current/v2/djlsr205.zip
+ source = ttyscrn.patch
+ source = nmemalign.patch
+ source = fseeko64.patch
+ source = asm.patch
+ source = dxegen.patch
+ source = gcc-no-werror.patch
+ source = environ.c
+ sha256sums = 22274ed8d5ee57cf7ccf161f5e1684fd1c0192068724a7d34e1bde168041ca60
+ sha256sums = 80690b6e44ff8bc6c6081fca1f4faeba1591c4490b76ef0ec8b35847baa5deea
+ sha256sums = 83bc02407566c0613c2eeb86d78f2968c11256dfc8d3c2805a5488540e059124
+ sha256sums = ffdbab52eb13dde716fbcce54154f7c95644afd6333f4931b2cceeb95935c675
+ sha256sums = 536684b0152f7ad77b99bcc5ea535ca8339832399c4582b944ccd882e4b261a1
+ sha256sums = 693810c3242f4e23cdc55d3101281721da9407851e5d29459ad59405e534b916
+ sha256sums = 0debe0161e27aeb004e89a43915d6d77bcd07a5db2c67e2798568535fe9143f1
+ sha256sums = e768d4f2ac8c5b2f21afd7a0dddfc1921377a6675ca099e78baffe9ecab081db
+ sha256sums = 4d5a1448a12fdcebc37578da8a29a1924f68495d4c27b75297ead8ac0542e816
+
+pkgname = dosbox-djcrx
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..eebe1ef6f826
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,100 @@
+# Contributor: carstene1ns <arch carsten-teibes de>
+# Contributor: felix <base64 -d <<< ZmVsaXgudm9uLnNAcG9zdGVvLmRlCg==>
+# Contributor: Schala
+# Contributor: janezz55
+
+pkgname=dosbox-djcrx
+pkgver=2.05
+pkgrel=7
+pkgdesc="Headers and utilities for the dosbox gcc cross-compiler"
+arch=('i686' 'x86_64')
+url="http://www.delorie.com/djgpp/"
+depends=('glibc' 'gcc-libs')
+license=('GPL' 'LGPL' 'custom:djgpp')
+source=("http://www.delorie.com/pub/djgpp/current/v2/djcrx${pkgver//./}.zip"
+ "http://www.delorie.com/pub/djgpp/current/v2/djlsr${pkgver//./}.zip"
+ ttyscrn.patch
+ nmemalign.patch
+ fseeko64.patch
+ asm.patch
+ dxegen.patch
+ gcc-no-werror.patch
+ environ.c)
+makedepends=('dosbox-gcc')
+sha256sums=('22274ed8d5ee57cf7ccf161f5e1684fd1c0192068724a7d34e1bde168041ca60'
+ '80690b6e44ff8bc6c6081fca1f4faeba1591c4490b76ef0ec8b35847baa5deea'
+ '83bc02407566c0613c2eeb86d78f2968c11256dfc8d3c2805a5488540e059124'
+ 'ffdbab52eb13dde716fbcce54154f7c95644afd6333f4931b2cceeb95935c675'
+ '536684b0152f7ad77b99bcc5ea535ca8339832399c4582b944ccd882e4b261a1'
+ '693810c3242f4e23cdc55d3101281721da9407851e5d29459ad59405e534b916'
+ '0debe0161e27aeb004e89a43915d6d77bcd07a5db2c67e2798568535fe9143f1'
+ 'e768d4f2ac8c5b2f21afd7a0dddfc1921377a6675ca099e78baffe9ecab081db'
+ '4d5a1448a12fdcebc37578da8a29a1924f68495d4c27b75297ead8ac0542e816')
+options=('!buildflags' '!strip')
+_target='i586-pc-msdosdjgpp'
+
+prepare() {
+ sed -i "s/i586-pc-msdosdjgpp/$_target/" src/makefile.def src/dxe/makefile.dxe
+ sed -i 's/ln/ln -f/' src/dxe/makefile.dxe
+
+ # enable building without an ldscript
+ ln -fs ../../../environ.c src/libc/crt0/environ.c
+ sed -i '/dfinfo\.c/ a \
+SRC += environ.c' src/libc/crt0/makefile
+
+ # fix build with gcc > 6
+ patch -Np0 < gcc-no-werror.patch
+
+ # gcc provides its own float.h which masks this one
+ ln -fs float.h include/djfloat.h
+ sed -i 's/<float\.h>/<djfloat.h>/' src/libc/{go32/dpmiexcp,emu387/npxsetup}.c src/utils/redir.c
+
+ # fix libc bugs
+ patch -Np0 < ttyscrn.patch
+ patch -Np0 < nmemalign.patch
+ patch -Np0 < fseeko64.patch
+ patch -Np0 < asm.patch
+
+ # allow using dxe3gen without DJDIR and without dxe3res in PATH
+ patch -Np0 < dxegen.patch
+
+ # be verbose
+ #sed -i '/@$(MISC) echo - / d; s/^\t@/\t/' src/makefile.inc src/libc/makefile src/utils/makefile
+}
+
+build() {
+ cd src
+ make clean
+ make -j1
+
+ cd dxe
+ make -f makefile.dxe
+}
+
+package() {
+ install -d "$pkgdir"/usr/bin
+ install -d "$pkgdir"/usr/$_target/bin
+
+ cp -r lib include "$pkgdir"/usr/$_target
+
+ cd hostbin
+ for _file in djasm mkdoc stubedit stubify; do
+ install -m0755 $_file.exe "$pkgdir"/usr/$_target/bin/$_file
+ ln -s ../$_target/bin/$_file "$pkgdir"/usr/bin/$_target-$_file
+ done
+
+ cd ../src/dxe
+ for _file in dxe3gen dxe3res; do
+ install -m0755 $_file "$pkgdir"/usr/$_target/bin/$_file
+ ln -s ../$_target/bin/$_file "$pkgdir"/usr/bin/$_target-$_file
+ done
+ ln -s dxe3gen "$pkgdir"/usr/$_target/bin/dxegen
+
+ cd "$srcdir"
+ install -Dm644 copying.dj "$pkgdir"/usr/share/licenses/$pkgname/copying.dj
+
+ cd info
+ for _file in *.info; do
+ install -Dm0644 $_file "$pkgdir"/usr/share/info/djgpp-$_file
+ done
+}
diff --git a/asm.patch b/asm.patch
new file mode 100644
index 000000000000..efb3d7b9dcf4
--- /dev/null
+++ b/asm.patch
@@ -0,0 +1,11 @@
+--- src/libc/go32/dpmiexcp.c
++++ src/libc/go32/dpmiexcp.c
+@@ -197,7 +197,7 @@
+
+ /* check video mode for original here and reset (not if PC98) */
+ if(ScreenPrimary != 0xa0000 && _farpeekb(_dos_ds, 0x449) != old_video_mode) {
+- asm volatile ("pusha;movzbl _old_video_mode,%eax; int $0x10;popa;nop");
++ asm volatile ("pusha; int $0x10; popa; nop" : : "a" ((__UINT32_TYPE__)old_video_mode));
+ }
+ en = (signum >= EXCEPTION_COUNT) ? 0 :
+ exception_names[signum];
diff --git a/dxegen.patch b/dxegen.patch
new file mode 100644
index 000000000000..24b1968b3164
--- /dev/null
+++ b/dxegen.patch
@@ -0,0 +1,36 @@
+--- src/dxe/dxegen.c
++++ src/dxe/dxegen.c
+@@ -106,8 +106,7 @@
+ libdir = getenv("DJDIR");
+ if (!libdir)
+ {
+- fprintf(stderr, "Error: neither DXE_LD_LIBRARY_PATH nor DJDIR are set in environment\n");
+- exit(1);
++ libdir = "/usr/i686-pc-msdosdjgpp";
+ }
+ strcat(command, libdir);
+ strcat(command, "/lib");
+--- src/dxe/dxe3gen.c
++++ src/dxe/dxe3gen.c
+@@ -461,7 +461,7 @@
+ canonicalize_path(libdir);
+ }
+ else
+- libdir = NULL;
++ libdir = strdup("/usr/i686-pc-msdosdjgpp/lib");
+ }
+
+
+@@ -1366,7 +1366,11 @@
+ if (opt.autoresolve)
+ {
+ /* Fire the resolver. It should take care of the dependencies (if any) */
+- strcpy(cmdbuf, "dxe3res -o "TEMP_BASE".c ");
++ const char *djdir = getenv("DJDIR");
++ if (!djdir)
++ djdir = "/usr/i686-pc-msdosdjgpp";
++ strcpy(cmdbuf, djdir);
++ strcat(cmdbuf, "/bin/dxe3res -o "TEMP_BASE".c ");
+ strcat(cmdbuf, opt.dxefile);
+ if ((rv = system(cmdbuf)) != 0)
+ {
diff --git a/environ.c b/environ.c
new file mode 100644
index 000000000000..3a33927b2f23
--- /dev/null
+++ b/environ.c
@@ -0,0 +1,8 @@
+__asm__ (
+ ".data" "\n\t"
+ ".weak _environ" "\n\t"
+ ".globl __environ" "\n\t"
+ "_environ:" "\n\t"
+ "__environ:" "\n\t"
+ ".long 0"
+);
diff --git a/fseeko64.patch b/fseeko64.patch
new file mode 100644
index 000000000000..3483574d6ed4
--- /dev/null
+++ b/fseeko64.patch
@@ -0,0 +1,10 @@
+--- src/libc/compat/stdio/fseeko64.c
++++ src/libc/compat/stdio/fseeko64.c
+@@ -19,6 +19,8 @@ fseeko64(FILE *_stream, off64_t _offset,
+ o = llseek(fileno(_stream), _offset, _mode);
+ if (o == -1)
+ return -1;
++ if (_stream)
++ _stream->_cnt = 0;
+ return 0;
+ }
diff --git a/gcc-no-werror.patch b/gcc-no-werror.patch
new file mode 100644
index 000000000000..fa31565925aa
--- /dev/null
+++ b/gcc-no-werror.patch
@@ -0,0 +1,21 @@
+--- src/makefile.cfg
++++ src/makefile.cfg
+@@ -36,7 +36,7 @@
+ @./misc.exe echo - "-Wall" >>gcc.opt
+ @./misc.exe echo - "-Wbad-function-cast" >>gcc.opt
+ @./misc.exe echo - "-Wcast-qual" >>gcc.opt
+- @./misc.exe echo - "-Werror" >>gcc.opt
++ @./misc.exe echo - "-Wno-error" >>gcc.opt
+ @./misc.exe echo - "-Wmissing-declarations" >>gcc.opt
+ @./misc.exe echo - "-Wmissing-prototypes" >>gcc.opt
+ @./misc.exe echo - "-Wpointer-arith" >>gcc.opt
+@@ -47,6 +47,9 @@
+ @./misc.exe echo - "-Wcast-align" >>gcc.opt
+ @./misc.exe echo - "-Wsign-compare" >>gcc.opt
+ @./misc.exe echo - "-nostdinc" >>gcc.opt
++ @./misc.exe echo - "-Wno-nonnull-compare" >>gcc.opt
++ @./misc.exe echo - "-Wno-misleading-indentation" >>gcc.opt
++ @./misc.exe echo - "-Wno-unused-const-variable" >>gcc.opt
+ @./misc.exe echo - "$(IQUOTE)" >>gcc.opt
+
+
diff --git a/nmemalign.patch b/nmemalign.patch
new file mode 100644
index 000000000000..19310a8e182b
--- /dev/null
+++ b/nmemalign.patch
@@ -0,0 +1,22 @@
+--- src/libc/ansi/stdlib/nmalloc.c
++++ src/libc/ansi/stdlib/nmalloc.c
+@@ -1145,6 +1145,7 @@
+ return nmalloc(szneed); /* EXIT */
+ }
+ else if ((minit = nmalloc(szneed + XTRA))) {
++ m = MEMBLKp(minit);
+ /* alignment >= 2*ALIGN and power of 2 if here */
+ misalign = (ulong)minit % alignment;
+ DBGPRTM(" misalignment = %d", misalign);
+@@ -1154,9 +1155,10 @@
+ }
+ else {
+ /* two or more chunks to release */
+- /* for now, just return NULL and have a leak */
+ DBGPRTM(" Complex case, release multiple chunks");
+ DBGEOLN;
++ nfree(PTR(split(&m, alignment - misalign)));
++ return nrealloc(PTR(m), size);
+ }
+ } /* alignment > ALIGN */
+ } /* valid parameters */
diff --git a/ttyscrn.patch b/ttyscrn.patch
new file mode 100644
index 000000000000..a6d0f1a5a1ce
--- /dev/null
+++ b/ttyscrn.patch
@@ -0,0 +1,11 @@
+--- src/libc/posix/termios/ttyscrn.c
++++ src/libc/posix/termios/ttyscrn.c
+@@ -464,7 +464,7 @@
+ __dpmi_int(0x10, &r);
+ if (++(*col) > __tty_screen.max_col)
+ {
+- col = 0;
++ *col = 0;
+ ++row;
+ }
+ __tty_screen.set_cursor(*col, *row);