[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH v2] lbuilds: FASM



From: Max Reitz <max@xxxxxxxxxx>

+ Cross-FASM (1.69.09)
+ FASM 1.69.09

Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
 lbuilds/fasm/1.69.09/fasm-1.69.09.lbuild |   33 ++++++++++++++++++++++++++++++
 lbuilds/fasm/1.69.09/files/formats.patch |    4 +++
 patches/fasm/1.69.09/formats.patch       |    4 +++
 scripts/build_crosstools                 |   21 +++++++++++++++++++
 4 files changed, 62 insertions(+), 0 deletions(-)
 create mode 100644 lbuilds/fasm/1.69.09/fasm-1.69.09.lbuild
 create mode 100644 lbuilds/fasm/1.69.09/files/formats.patch
 create mode 100644 patches/fasm/1.69.09/formats.patch

diff --git a/lbuilds/fasm/1.69.09/fasm-1.69.09.lbuild b/lbuilds/fasm/1.69.09/fasm-1.69.09.lbuild
new file mode 100644
index 0000000..23da5b2
--- /dev/null
+++ b/lbuilds/fasm/1.69.09/fasm-1.69.09.lbuild
@@ -0,0 +1,33 @@
+include toolchain
+include lutils
+
+DESCRIPTION="Der Flatassembler (Intelsyntax)"
+HOMEPAGE="http://flatassembler.net/";
+SRC_URI="http://flatassembler.net/${P}.tar.gz";
+
+LICENSE="Proprietary"
+
+BUILD_DEPEND=""
+RUN_DEPEND=""
+
+MY_S="${S}/${P}"
+
+src_unpack() {
+lunpack ${P}.tar.gz
+cd fasm
+
+    patch source/formats.inc ${F}/formats.patch || die "could not patch formats.inc"
+}
+
+src_compile() {
+	cd fasm
+	fasm source/libc/fasm.asm fasm.o || die "assembling failed"
+	i386-pc-tyndur-gcc fasm.o -o fasm || die "linking failed"
+	cd ..
+}
+
+src_install() {
+	cd fasm
+	install -d ${D}${R}/bin
+	cp fasm ${D}${R}/bin || die "could not install fasm"
+}
diff --git a/lbuilds/fasm/1.69.09/files/formats.patch b/lbuilds/fasm/1.69.09/files/formats.patch
new file mode 100644
index 0000000..7e4ec4b
--- /dev/null
+++ b/lbuilds/fasm/1.69.09/files/formats.patch
@@ -0,0 +1,4 @@
+3606c3606
+< 	mov	[image_base],8048000h
+---
+> 	mov	[image_base],40000000h
diff --git a/patches/fasm/1.69.09/formats.patch b/patches/fasm/1.69.09/formats.patch
new file mode 100644
index 0000000..7e4ec4b
--- /dev/null
+++ b/patches/fasm/1.69.09/formats.patch
@@ -0,0 +1,4 @@
+3606c3606
+< 	mov	[image_base],8048000h
+---
+> 	mov	[image_base],40000000h
diff --git a/scripts/build_crosstools b/scripts/build_crosstools
index febb5eb..0726936 100755
--- a/scripts/build_crosstools
+++ b/scripts/build_crosstools
@@ -9,6 +9,7 @@ MAKEOPTS=-j3
 mkdir -p ${TMP}/cross-binutils/build
 mkdir -p ${TMP}/cross-gcc/build
 mkdir -p ${TMP}/cross-fpc
+mkdir -p ${TMP}/cross-fasm
 
 cd ${TMP}/cross-binutils
 echo "[binutils] Herunterladen..."
@@ -68,6 +69,26 @@ cp compiler/ppc386 ${PREFIX}/bin/fpc
 cp utils/fpcm/fpcmake ${PREFIX}/bin/fpcmake
 echo -e "[fpc] Abgeschlossen\n"
 
+cd ${TMP}/cross-fasm
+echo "[fasm] Herunterladen..."
+[ -f fasm-1.69.09.tar.gz ] || wget -q http://flatassembler.net/fasm-1.69.09.tar.gz || exit -1
+echo "[fasm] Entpacken..."
+tar -xzf fasm-1.69.09.tar.gz || exit -1
+echo "[fasm] Linux-FASM linken..."
+cd fasm
+gcc fasm.o -o fasm || exit -1
+echo "[fasm] Patch anwenden..."
+patch source/formats.inc ${PATCHES}/fasm/1.69.09/formats.patch || exit -1
+echo "[fasm] Assemblieren..."
+./fasm source/libc/fasm.asm fasm.o || exit -1
+echo "[fasm] Týndur-FASM linken..."
+gcc fasm.o -o fasm || exit -1
+echo "[fasm] Installieren..."
+cp fasm ${PREFIX}/bin/fasm
+echo -e "[fasm] Abgeschlossen\n"
+
+
 rm -rf ${TMP}/cross-binutils/binutils-2.18/
 rm -rf ${TMP}/cross-gcc/gcc-4.2.2/
 rm -rf ${TMP}/cross-fpc/fpc/
+rm -rf ${TMP}/cross-fasm/fasm/
-- 
1.6.3.3