Browse Source

kona: Updates to build on non-arm platforms

Patch the Makefile to avoid assuming that CC is
arm-linux-androideabi-gcc on Android, and use the CFLAGS and
LDFLAGS already set.

Also avoid inlining the TERMUX_PREFIX value.
android-5
Fredrik Fornwall 9 years ago
parent
commit
9a0f600ca2
  1. 42
      packages/kona/Makefile.patch
  2. 6
      packages/kona/build.sh

42
packages/kona/Makefile.patch

@ -1,11 +1,11 @@
diff -u -r ../kona-Win.3.36-64/Makefile ./Makefile
--- ../kona-Win.3.36-64/Makefile 2015-07-30 11:18:02.000000000 -0400
+++ ./Makefile 2015-12-06 04:14:40.000000000 -0500
@@ -1,10 +1,10 @@
+++ ./Makefile 2015-12-06 14:40:50.325235408 -0500
@@ -1,10 +1,8 @@
-PREFIX = /usr/local
-CFLAGS=-g
+PREFIX = @TERMUX_PREFIX@
+CFLAGS=-O3
PRODFLAGS = -O3 #-pg -g3
-PRODFLAGS = -O3 #-pg -g3
+PRODFLAGS =
LIB=libkona.a
DEVFLAGS = -O0 -g3 -DDEBUG -Wunused -Wreturn-type -Wimplicit-int #-Wall
@ -14,21 +14,23 @@
# Win-64
ifeq (mingw32_nt-6.2,$(OS))
@@ -34,7 +34,7 @@
@@ -28,16 +26,12 @@
endif
ifeq (android,$(OS))
-CC=arm-linux-androideabi-gcc
OBJS= src/0.o src/c.o src/getline.o src/getline_android.o src/mt.o src/p.o \
src/r.o src/k.o src/kc.o src/kx.o src/kg.o src/km.o src/kn.o src/ko.o \
src/ks.o src/v.o src/va.o src/vc.o src/vd.o src/vf.o src/vg.o src/vq.o
LDFLAGS = -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \
-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -mthumb \
-LDFLAGS = -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \
- -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -mthumb \
- -lc -lm -ldl
+ -fPIE -pie -lc -lm -ldl
CFLAGS += -fPIE -fpic -ffunction-sections -funwind-tables -fstack-protector \
-no-canonical-prefixes -mtune=xscale -msoft-float -mthumb \
-fomit-frame-pointer -fno-strict-aliasing
@@ -109,7 +109,7 @@
test: k_test
install:
- install k $(PREFIX)/bin/k
+ install k ${PREFIX}/bin/k
-CFLAGS += -fPIE -fpic -ffunction-sections -funwind-tables -fstack-protector \
- -no-canonical-prefixes -mtune=xscale -msoft-float -mthumb \
- -fomit-frame-pointer -fno-strict-aliasing
+LDFLAGS += -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \
+ -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
+ -lm
endif
clean:
$(RM) -r k k_test *.exe k.dSYM k_test.dSYM src/*.o src/win/*.o
ifeq (linux,$(OS))

6
packages/kona/build.sh

@ -3,10 +3,8 @@ TERMUX_PKG_FOLDERNAME=kona-Win.$TERMUX_PKG_VERSION-64
TERMUX_PKG_HOMEPAGE=https://github.com/kevinlawler/kona
TERMUX_PKG_DESCRIPTION="Open-source implementation of the APL-like K programming language"
TERMUX_PKG_SRCURL="https://github.com/kevinlawler/kona/archive/Win.$TERMUX_PKG_VERSION-64.zip"
TERMUX_PKG_DEPENDS=""
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_MAINTAINER="Jonathan Badger <jhbadger@gmail.com>"
termux_step_make_install () {
make install
}
export PREFIX=$TERMUX_PREFIX

Loading…
Cancel
Save