Added android arm receipe for fltk
authorDaniel G <giri@nwrk.biz>
Sat, 26 Jan 2019 12:18:21 +0000 (13:18 +0100)
committerDaniel G <giri@nwrk.biz>
Sat, 26 Jan 2019 12:18:21 +0000 (13:18 +0100)
_template/packages/fltk1.3/Makefile

index ac2e28f..5ae1f58 100644 (file)
@@ -6,6 +6,9 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
+# Add android ndk toolchain
+export PATH := /usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
+
 all: unpack windows clean linux
 
 .PHONY: unpack
@@ -47,6 +50,20 @@ linux_nanox:
        cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
        cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/*.a $(WORKDIR)/../../lib/linux32
 
+.PHONY: android_arm
+android_arm:
+       cd $(WORKDIR)/fltk-1.3.4-1; \
+       ./configure CFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-24/arch-arm" CXXFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-24/arch-arm" LDFLAGS="-static-libgcc -static-libstdc++ --sysroot=/usr/lib/android-ndk/platforms/android-24/arch-arm" --enable-static --x-includes=../../../../include/X11  --x-libraries=../../../../lib/android_arm --host=arm-linux-androideabi --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --disable-xinerama --disable-xft --disable-xdbe --disable-xfixes --disable-xcursor --disable-xrender; \
+       sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./makeinclude; \
+       sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./fltk-config; \
+       sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/Fl_x.cxx; \
+       sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/screen_xywh.cxx; \
+       make -k -j4
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/*.a $(WORKDIR)/../../lib/android_arm
+
 .PHONY: clean
 clean:
        cd $(WORKDIR)/fltk-1.3.4-1; \