Skip to content

Commit

Permalink
dev-embedded/xa: Fix build system
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/722600
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
SoapGentoo committed Jul 5, 2020
1 parent 762a294 commit 455ef7e
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 9 deletions.
77 changes: 77 additions & 0 deletions dev-embedded/xa/files/xa-2.3.10-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,7 @@
# Unix gcc or DOS go32 cross-compiling gcc
#
-CC = gcc
-LD = gcc
# for testing. not to be used; build failures in misc/.
#CFLAGS = -O2 -W -Wall -pedantic -ansi
-CFLAGS = -O2
-LDFLAGS = -lc

# for DOS?
# CC = gcc-go32
@@ -32,13 +28,13 @@
rm -f xa

xa:
- (cd src && LD=${LD} CC="${CC} ${CFLAGS}" ${MAKE})
+ (cd src && ${MAKE})

load:
- (cd loader && CC="${CC} ${CFLAGS}" ${MAKE})
+ (cd loader && ${MAKE})

uncpk:
- (cd misc && CC="${CC} ${CFLAGS}" ${MAKE})
+ (cd misc && ${MAKE})

dos: clean
(cd src && LD=gcc-go32 CC=gcc-go32 CFLAGS="-W -Wall -pedantic" ${MAKE})
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -2,7 +2,6 @@
XCBMLIB = ..

# -Wall -ansi et al. cause compile problems.
-CFLAGS = -O2

LIBS = #-lncurses -ltermcap -lm

@@ -10,19 +9,19 @@
all: ../mkrom.sh ../uncpk ../printcbm ../file65 ../reloc65 ../ldo65

../uncpk: uncpk.c
- ${CC} ${CFLAGS} uncpk.c -o $(XCBMLIB)/uncpk
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} uncpk.c -o $(XCBMLIB)/uncpk

../printcbm: printcbm.c
- ${CC} ${CFLAGS} printcbm.c -o $(XCBMLIB)/printcbm
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} printcbm.c -o $(XCBMLIB)/printcbm

../file65: file65.c
- ${CC} ${CFLAGS} file65.c -o $(XCBMLIB)/file65
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} file65.c -o $(XCBMLIB)/file65

../ldo65: ldo65.c
- ${CC} ${CFLAGS} ldo65.c -o $(XCBMLIB)/ldo65
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ldo65.c -o $(XCBMLIB)/ldo65

../reloc65: reloc65.c
- ${CC} ${CFLAGS} reloc65.c -o $(XCBMLIB)/reloc65
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} reloc65.c -o $(XCBMLIB)/reloc65

../mkrom.sh: mkrom.sh
cp mkrom.sh ../mkrom.sh
--- a/src/Makefile
+++ b/src/Makefile
@@ -8,7 +8,7 @@
all: xa

xa: ${OBJ}
- ${LD} -o ../xa ${OBJ} ${LDFLAGS}
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ../xa ${OBJ}

clean:
rm -f *.o *.o65
17 changes: 8 additions & 9 deletions dev-embedded/xa/xa-2.3.10.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@ LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"

PATCHES=( "${FILESDIR}"/${PN}-2.3.10-fix-gcc10-fno-common.patch )

src_compile() {
emake \
CC="$(tc-getCC)" \
LD="$(tc-getCC) " \
CFLAGS="${CFLAGS} ${LDFLAGS}" \
LDFLAGS="${LDFLAGS}"
PATCHES=(
"${FILESDIR}"/${PN}-2.3.10-Makefile.patch
"${FILESDIR}"/${PN}-2.3.10-fix-gcc10-fno-common.patch
)

src_configure() {
tc-export CC
}

src_test() {
emake -j1 test
}

src_install() {
emake install DESTDIR="${ED}/usr"
emake DESTDIR="${ED}"/usr install
einstalldocs
}

0 comments on commit 455ef7e

Please sign in to comment.