Add gl4es to prepare adding basic opengl support for android. Add zoom to SDL android.
authorDaniel G <giri@nwrk.biz>
Wed, 13 Feb 2019 02:28:13 +0000 (03:28 +0100)
committerDaniel G <giri@nwrk.biz>
Wed, 13 Feb 2019 02:28:13 +0000 (03:28 +0100)
_template/Makefile
_template/packages/fltk1.3.4/Makefile
_template/packages/gl4es1.1.0/Makefile
_template/src/Makefile

index 001b2d6..b307025 100644 (file)
@@ -8,7 +8,7 @@ WORKDIR = $(shell pwd)
 APPINFO = $(WORKDIR)/src/appinfo
 
 all: deps _template create_installers
-deps: freetype sdl nanox fltk
+deps: freetype sdl nanox gl4es fltk
 create_installers: linux32_package linux_arm_package windows_package android_package
 
 #### Dependencies
index a151351..5bc168e 100644 (file)
@@ -84,7 +84,8 @@ android_arm:
        cp /usr/include/X11/cursorfont.h ../../lib_include/android_arm/X11/
        cd $(WORKDIR)/fltk-1.3.4-1; \
        make clean; \
-       ./configure CFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" CXXFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" LDFLAGS="-static-libgcc -static-libstdc++ --sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" --enable-static  --x-includes=../../../../lib_include/android_arm --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/ac_cv_lib_GL_glXMakeCurrent=no/ac_cv_lib_GL_glXMakeCurrent=yes/g' ./configure; \
+       ./configure CFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm -I$(WORKDIR)/../../lib_include/android_arm" CXXFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm -I$(WORKDIR)/../../lib_include/android_arm" LDFLAGS="-static-libgcc -static-libstdc++ --sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm -L$(WORKDIR)/../../lib/android_arm" --enable-static  --x-includes=../../../../lib_include/android_arm --x-libraries=../../../../lib/android_arm --host=arm-linux-androideabi --enable-localjpeg --enable-localzlib --enable-localpng --enable-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; \
index 73e6ff6..d0392ad 100644 (file)
@@ -20,6 +20,11 @@ unpack:
 android_arm:
        export NDK_PROJECT_PATH=$(WORKDIR); \
        cp -r $(WORKDIR)/gl4es-1.1.0 $(WORKDIR)/jni; \
+       sed -i -e 's~-DNOX11~-I$(WORKDIR)/../../lib_include/android_arm~g' $(WORKDIR)/jni/Android.mk; \
+#      sed -i -e 's/BUILD_STATIC_LIBRARY/BUILD_SHARED_LIBRARY/g' $(WORKDIR)/jni/Android.mk; \
+       sed -i -e 's/#LOCAL_CFLAGS += -DDEFAULT_ES=2/LOCAL_CFLAGS += -DDEFAULT_ES=2/g' $(WORKDIR)/jni/Android.mk; \
+#      sed -i -e 's/#LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR/LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR/g' $(WORKDIR)/jni/Android.mk; \
+       sed -i -e '/src\/glx\/streaming.c.*/ a  src\/glx\/rpi.c src\/glx\/utils.c' $(WORKDIR)/jni/Android.mk; \
        echo "APP_ABI := armeabi-v7a"> $(WORKDIR)/jni/Application.mk; \
        /usr/lib/android-ndk/ndk-build
        mkdir -p $(WORKDIR)/../../lib_include/android_arm
index bd85c50..8c7df9f 100644 (file)
@@ -125,7 +125,7 @@ LIBDIR_ANDROID += -L$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(ANDRO
 CFLAGS_ANDROID  = $(CFLAGS) --sysroot=$(ANDROID_NDK_ROOT)/platforms/$(ANDROID_PLATORM)/arch-$(ANDROID_ARCH) -D_ANDROID
 RESINC_ANDROID = assets
 LDFLAGS_ANDROID  =  $(LDFLAGS) -shared --sysroot=$(ANDROID_NDK_ROOT)/platforms/$(ANDROID_PLATORM)/arch-$(ANDROID_ARCH)
-LIB_ANDROID  = $(LIB) -lc++ -lNX11 -lnano-X -lfreetype -lm -Wl,-Bdynamic -lSDL2 -lz
+LIB_ANDROID  = $(LIB) -lc++ -lGL -lNX11 -lnano-X -lfreetype -lm -Wl,-Bdynamic -lSDL2 -lz -lGLESv2
 RESLIST_ANDROID=$(shell find $(RESINC_ANDROID) -type f -follow)
 
 ###################################