[OLD-1] AGS engine Android port

Started by JJS, Thu 03/11/2011 20:18:29

Previous topic - Next topic

eri0o

You read right Snarky, if I understood, touch needs to be a click but still keep the state of the left mouse button pressed while the finger is pressed on the screen. At least this is how I understand the mouse works in AGS, it emits the mouse click event on click and not on release.

Crimson Wizard

Quote from: eri0o on Sat 30/12/2017 22:05:07
You read right Snarky, if I understood, touch needs to be a click but still keep the state of the left mouse button pressed while the finger is pressed on the screen.

Maybe I did not understand your previous explanations, what is the difference between "longclick" mode set in config and what you want to achieve?

eri0o

To trigger long click, you have to hold your finger and wait until the device vibrates, and then the longclick is processed. The idea would be that once the screen is touched, the mouse button is already considered down.:/ Also as is, to remove the finger, you have to click with the finger again. CW don't worry. (I really don't like how written text makes me sound like I am ungrateful...)

Crimson Wizard

Quote from: eri0o on Sun 31/12/2017 00:08:23CW don't worry. (I really don't like how written text makes me sound like I am ungrateful...)
The purpose I am asking is to learn more about Android port, because so far I only used it few times on emulator :).

sawyer

#724
:=

sawyer

#725
:confused:

Crimson Wizard

#726
@eri0o, I found why it does not find allegro.h for you.

There were patched allegro sources for Android right in our repository earlier. Nick Sonneveld has removed them and added download & patch script instead. But he did not change instructions in Readme.

You now have to perform "Native 3rd party libraries" step before doing "Native engine library".

Firstly, you need to have "curl" utility installed. (Maybe it is standard, but my Ubuntu did not have it)

Then:
QuoteThe scripts require standalone toolchains for all Android platforms and they have to be available on the PATH. See https://developer.android.com/ndk/guides/standalone_toolchain.html for instructions on creating the standalone toolchains.


EDIT
Well, I looked into the NDK/toolchains, and there are already several toolchains created. Problem is that when I run buildall.sh, I get this:

Quote
cd builds/unix; /bin/sh ./configure '--host=arm-linux-androideabi' '--prefix=/home/ikm/git/ags/Android/nativelibs/armeabi' '--without-zlib' '--disable-shared'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/ikm/git/ags/Android/buildlibs/armeabi/freetype-2.4.12/builds/unix':
configure: error: C compiler cannot create executables

Not sure what is missing and how to proceed from here.

EDIT2:
I was able to find out that "configure: error: C compiler cannot create executables" was caused by gcc error "Unrecognized command '-mthumb'". That's all I can add at this point.

sawyer

#727
Hope this works out so everyone can enjoy.
Either way, what each of you do is truly something special.
All the personal time you each put into these games/engines, is something I myself am truly thankful for.
Your selflessness truly lifts my spirits!
So to everyone involved, you are appricated!!  8-)

Crimson Wizard

#728
Continuing....

Quote from: Crimson Wizard on Thu 11/01/2018 22:39:59
Well, I looked into the NDK/toolchains, and there are already several toolchains created. Problem is that when I run buildall.sh, I get this:

Quote
cd builds/unix; /bin/sh ./configure '--host=arm-linux-androideabi' '--prefix=/home/ikm/git/ags/Android/nativelibs/armeabi' '--without-zlib' '--disable-shared'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/ikm/git/ags/Android/buildlibs/armeabi/freetype-2.4.12/builds/unix':
configure: error: C compiler cannot create executables

Not sure what is missing and how to proceed from here.

EDIT2:
I was able to find out that "configure: error: C compiler cannot create executables" was caused by gcc error "Unrecognized command '-mthumb'". That's all I can add at this point.

Alright, a bit of a progress here.

1) First of all, I managed to create standalone toolchains myself, although I had to modify the script that does that, because the existing one did not work for me. I honestly don't know why, maybe it refers to an old version of NDK.

What I had to do is open Android/buildlibs/makestandalones.sh and in the line -
Code: bash
$NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch

remove the "--platform=$PLATFORM" part.
Code: bash
$NDK_HOME/build/tools/make-standalone-toolchain.sh --install-dir=$INSTALL_DIR --arch=$arch

That said, I am not sure whether this was even needed, since some toolchains were already included in NDK distributive.


2) Now, regarding actual library building.
Apparently I misunderstood how the building script works. I thought it somehow refers to the toolchains explicitly, but no, I had to add all the necessary toolchain into PATH. I guess that makes sense (also documentation page mentioned this, albeit non-explicitly, which I missed).

Straight to the point, each toolchain you are using must be referenced in $PATH.
For example, I created a toolchain in "~/ndk-standalone/android-9/arm". Then I had to add following path to $PATH: "~/ndk-standalone/android-9/arm/bin".
Then, the building process will actually be using a gcc compiler from Android toolchain, rather than the one from your system.

3) After that I was even able to finally launch library compilation. Then it failed while compiling "lua" library (why does it need lua anyway... probably for lua plugin?).

Anyway, at that point I've stumbled into a problem with my virtual machine running out of disk space... which was unexpected. I will continue after fixing that...


UPDATE:

4) Had to install autoconf, automake, cmake, libtool utilities (required to build some of the libs).

5) So far managed to compile freetype, allegro and dumb libraries.
Other libraries: lua and ogg failed with similar errors:
Quote
undefined reference to 'stderr'
undefined reference to 'stdout'
undefined reference to 'signal'
undefined reference to 'rand'
Tremor and theora could not be built without ogg.

Errors may be related to this:
https://github.com/android-ndk/ndk/issues/410
https://github.com/openssl/openssl/issues/445

eri0o

#729
Hey, I just built love2d for android today, Lua wouldn't build for armeabi because it's support has been dropped, but will build for armeabi-v7a. (in love's case)

I am looking into the project, and for some reason the ndkenv file inside each platform in buildlibs (x86, mips, ...) has the wrong root path. I think first you need to install the toolchains using makestandalones.sh and them use the paths to update ndkenv. Also the project expects Android-9, which is old as hell, I would try with at least 14. Unfortunately, I already spent a lot of time on love2d today, so I will probably only be seriously looking into this tomorrow.  (I felt a lot of pressure from the forums, from 'the future of' discussions, so I had to be away for some time)

Right now I got until (even if I skip armeabi and go directly to armeabi-v7a, so it's not the same case as Lua for love2d apparently)
Spoiler
Code: ags

lua.o:lua.c:function laction: error: undefined reference to 'signal'
lua.o:lua.c:function l_message: error: undefined reference to 'stderr'
lua.o:lua.c:function l_message: error: undefined reference to 'stderr'
lua.o:lua.c:function pushline: error: undefined reference to 'stdout'
lua.o:lua.c:function pushline: error: undefined reference to 'stdin'
lua.o:lua.c:function docall: error: undefined reference to 'signal'
lua.o:lua.c:function docall: error: undefined reference to 'signal'
lua.o:lua.c:function dotty: error: undefined reference to 'stdout'
lua.o:lua.c:function pmain: error: undefined reference to 'stderr'
liblua.a(lauxlib.o):lauxlib.c:function panic: error: undefined reference to 'stderr'
liblua.a(lauxlib.o):lauxlib.c:function luaL_loadfile: error: undefined reference to 'stdin'
liblua.a(lbaselib.o):lbaselib.c:function luaB_print: error: undefined reference to 'stdout'
liblua.a(ldblib.o):ldblib.c:function db_debug: error: undefined reference to 'stdin'
liblua.a(liolib.o):liolib.c:function luaopen_io: error: undefined reference to 'stdin'
liblua.a(liolib.o):liolib.c:function luaopen_io: error: undefined reference to 'stdout'
liblua.a(lmathlib.o):lmathlib.c:function math_randomseed: error: undefined reference to 'srand'
liblua.a(lmathlib.o):lmathlib.c:function math_random: error: undefined reference to 'rand'
collect2: error: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/home/USERNAME/git/ags/Android/buildlibs/armeabi/lua-5.1.5/src'
make[1]: *** [generic] Error 2
make[1]: Leaving directory `/home/USERNAME/git/ags/Android/buildlibs/armeabi/lua-5.1.5/src'
make: *** [generic] Error 2
[close]

Crimson Wizard

#730
eri0o, you basically described same thing I mentioned in the previous post :).

E: Unless I am mistaken, I could have actually installed version 14 of NDK.

eri0o

Sorry Crimson, I had to start somewhere. But hey, I ignored everything you said and eventually felled in the same route, so this must be positive somehow :O

Chicky

Good work guys, it's exciting seeing your progress even if I don't understand half the stuff :)

eri0o

#733
Hey CW! The lua thing, following this below appears to solve for lua. Now I hit the same error as below in libogg

Change the Lua patch, in line 23 use:
-CFLAGS= -O2 -Wall $(MYCFLAGS)
+CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API

ags/Android/patches/liblua.patch
Spoiler
Code: patch

diff -Naur src/llex.c src/llex.c
--- src/llex.c	2007-12-27 14:02:25.000000000 +0100
+++ src/llex.c	2012-07-30 12:19:06.628478800 +0200
@@ -176,9 +176,8 @@
 
 static void trydecpoint (LexState *ls, SemInfo *seminfo) {
   /* format error: try to update decimal point separator */
-  struct lconv *cv = localeconv();
   char old = ls->decpoint;
-  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+  ls->decpoint = '.';
   buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
   if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
     /* format error with correct decimal point: no more options */
diff -Naur src/Makefile src/Makefile
--- src/Makefile	2008-01-19 20:37:58.000000000 +0100
+++ src/Makefile	2012-07-30 12:10:36.058644700 +0200
@@ -7,17 +7,12 @@
 # Your platform. See PLATS for possible values.
 PLAT= none
 
-CC= gcc
-CFLAGS= -O2 -Wall $(MYCFLAGS)
+CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API
 AR= ar rcu
 RANLIB= ranlib
 RM= rm -f
 LIBS= -lm $(MYLIBS)
 
-MYCFLAGS=
-MYLDFLAGS=
-MYLIBS=
-
 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
 
 PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
@@ -93,7 +88,7 @@
 	$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
 
 generic:
-	$(MAKE) all MYCFLAGS=
+	$(MAKE) all
 
 linux:
 	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
[close]


You need to add the same flag (I think) in the ogg.sh script, in the part it passes the CFlags, but I couldn't find out where ogg.sh comes from!

Edit: ok, found a download.sh script that takes libraries from magical machines in Amazon. Edit2: yet it doesn't look that the ogg.sh comes from there...

Spoiler

eri0o@SUPERCOMPUTER:~/git/ags$ find . -iname ogg.sh
./iOS/buildlibs/armv7/ogg.sh
./iOS/buildlibs/x86_64/ogg.sh
./iOS/buildlibs/armv7s/ogg.sh
./iOS/buildlibs/i386/ogg.sh
./iOS/buildlibs/arm64/ogg.sh
./Android/buildlibs/armeabi-v7a/ogg.sh
./Android/buildlibs/armeabi/ogg.sh
./Android/buildlibs/x86/ogg.sh
./Android/buildlibs/mips/ogg.sh
eri0o@SUPERCOMPUTER:~/git/ags$ grep --recursive ogg.sh *
Android/buildlibs/buildall.sh:   ./ogg.sh   
iOS/buildlibs/buildall.sh:   ./ogg.sh

[close]

ogg.sh must be like this below (I tested and it works, but I couldn't find a clean way to for it to be like this)
Spoiler
Code: bash

#!/bin/bash

set -e 

source ./ndkenv

SRC_DIR=libogg-1.3.2
rm -rf $SRC_DIR
mkdir $SRC_DIR
tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared

make
make install

popd 

rm -rf $SRC_DIR
[close]


Edit3: I am not very smart. It come like this from the repository already. I need to modify it directly.

Edit4: Ok, now for some reason allegro.sh fails on line 17 saying it can't find cmake, but ndk has cmake, so I don't know yet what's wrong...

Edit5: I didn't have cmake, and NDK requires a newer cmake then the offered by Ubuntu repo. Installed newest cmake using pip install cmake . In allegro.sh, I also changed line 31 to use:
  -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake

which points to my correct cmake toolchain for Android. Unfortunately, I now fail with the following

Spoiler
Code: bash

-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "allegrogl".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "loadpng".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "logg".


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
RT_LIBRARY
    linked by target "allegro" in directory /home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2

-- Configuring incomplete, errors occurred!
See also "/home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeOutput.log".
See also "/home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeError.log".

[close]

Edit6: Apparently, cmake looks the missign targets here : ~/Android/Sdk/ndk-bundle/platforms/android-14/arch-arm/usr/lib/ . I am not completely sure if this is true or either if the missing things are libraries. Question : which libpng version should be used with Allegro 4.4.2 ? Trying what is written here: https://stackoverflow.com/questions/14263016/adding-libpng-in-android-ndk-project . Tried. It doesn't change, it still can't find libpng. I removed the compiled libs from the Sdk directories because it doesn't seem to be the correct place. Tried placing in NDK_ADDITIONAL_LIBRARY_PATH but it didn't work too.

Letting full error below, noticed a missing: OSS_COMPILES message too.

Spoiler
Code: bash

~/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2$ cmake . -G "Unix Makefiles" -DWANT_TESTS=off -DWANT_EXAMPLES=off -DWANT_TOOLS=off -DWANT_LOGG=off -DWANT_ALLEGROGL=off -DSHARED=off -DCMAKE_C_FLAGS="$NDK_CFLAGS -fsigned-char" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_LD_FLAGS="$NDK_LDFLAGS"   -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DCMAKE_INSTALL_PREFIX=$NDK_ADDITIONAL_LIBRARY_PATH
-- Performing Test ALLEGRO_USE_CONSTRUCTOR
-- Performing Test ALLEGRO_USE_CONSTRUCTOR - Failed
-- Could NOT find OSS (missing: OSS_COMPILES) 
-- Checking for module 'alsa'
--   No package 'alsa' found
-- Checking for module 'jack'
--   No package 'jack' found
-- Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR) 
CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "allegrogl".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "loadpng".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "logg".


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
RT_LIBRARY
    linked by target "allegro" in directory /home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2

-- Configuring incomplete, errors occurred!
See also "/home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeOutput.log".
See also "/home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeError.log".


[close]

Edit7: Re-reading what CW has said, he WAS able to build allegro, so I am doing something wrong, but I don't know what yet...

I am leaving a git diff of my ags git directory to the master at the time I was trying to do this, maybe it's useful in the future. I can't pursue this tomorrow since I need to work on my games too.

Spoiler
Code: dif

diff --git a/Android/buildlibs/armeabi-v7a/allegro.sh b/Android/buildlibs/armeabi-v7a/allegro.sh
index 2b97658..8b00f1d 100755
--- a/Android/buildlibs/armeabi-v7a/allegro.sh
+++ b/Android/buildlibs/armeabi-v7a/allegro.sh
@@ -14,6 +14,10 @@ pushd $SRC_DIR
 # Platform independent patch
 patch -p0 < ../../../patches/liballegro-4.4.2.patch
 
+echo ${ANDROID_NDK}
+
+echo ""
+
 cmake . -G "Unix Makefiles" \
 	-DWANT_TESTS=off \
 	-DWANT_EXAMPLES=off \
@@ -24,9 +28,10 @@ cmake . -G "Unix Makefiles" \
 	-DCMAKE_C_FLAGS="$NDK_CFLAGS -fsigned-char" \
 	-DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
 	-DCMAKE_LD_FLAGS="$NDK_LDFLAGS" \'
-	-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-android-gcc.cmake \
+  -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake \
 	-DCMAKE_INSTALL_PREFIX=$NDK_ADDITIONAL_LIBRARY_PATH
 
+	#-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-android-gcc.cmake \
 make 
 make install
 
diff --git a/Android/buildlibs/armeabi-v7a/ndkenv b/Android/buildlibs/armeabi-v7a/ndkenv
index cf9fdfb..f3bf4e3 100644
--- a/Android/buildlibs/armeabi-v7a/ndkenv
+++ b/Android/buildlibs/armeabi-v7a/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/arm
 export NDK_PLATFORM_NAME=armeabi-v7a
 export NDK_HOST_NAME=arm-linux-androideabi
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/armeabi-v7a/ogg.sh b/Android/buildlibs/armeabi-v7a/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/armeabi-v7a/ogg.sh
+++ b/Android/buildlibs/armeabi-v7a/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/armeabi/ndkenv b/Android/buildlibs/armeabi/ndkenv
index 0df6781..1a01191 100644
--- a/Android/buildlibs/armeabi/ndkenv
+++ b/Android/buildlibs/armeabi/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/arm
 export NDK_PLATFORM_NAME=armeabi
 export NDK_HOST_NAME=arm-linux-androideabi
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/armeabi/ogg.sh b/Android/buildlibs/armeabi/ogg.sh
index 21062a3..56ed267 100755
--- a/Android/buildlibs/armeabi/ogg.sh
+++ b/Android/buildlibs/armeabi/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char" 
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API" 
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/buildall.sh b/Android/buildlibs/buildall.sh
index b813057..73dec33 100755
--- a/Android/buildlibs/buildall.sh
+++ b/Android/buildlibs/buildall.sh
@@ -6,7 +6,7 @@ pushd ../../libsrc
 ./download.sh
 popd
 
-for arch in armeabi armeabi-v7a x86 mips
+for arch in  armeabi-v7a x86 mips
 do
 	rm -rf ../nativelibs/$arch
 	mkdir -p ../nativelibs/$arch
diff --git a/Android/buildlibs/makestandalones.sh b/Android/buildlibs/makestandalones.sh
index 7f327cd..65fb734 100755
--- a/Android/buildlibs/makestandalones.sh
+++ b/Android/buildlibs/makestandalones.sh
@@ -5,18 +5,18 @@
 set -e
 
 # Last committed pre-compiled libs were with R8
-NDK_HOME=/opt/android-ndk-r10e
+NDK_HOME=/home/USERNAME/Android/Sdk/ndk-bundle
 
 # android-9 is minimum to support mips and x86
-PLATFORM=android-9
+PLATFORM=android-14
 
 # standalone toolchains cannot share same directory
-NDK_STANDALONE=/opt/android-ndk-r10e-standalone/$PLATFORM
+NDK_STANDALONE=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/$PLATFORM
 
 for arch in arm x86 mips
 do
     INSTALL_DIR=$NDK_STANDALONE/$arch
     mkdir -p $INSTALL_DIR
-    $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
+    $NDK_HOME/build/tools/make-standalone-toolchain.sh --install-dir=$INSTALL_DIR --arch=$arch --force
 done
 
diff --git a/Android/buildlibs/mips/ndkenv b/Android/buildlibs/mips/ndkenv
index f1f7c78..9c06777 100644
--- a/Android/buildlibs/mips/ndkenv
+++ b/Android/buildlibs/mips/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/mips
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/mips
 export NDK_PLATFORM_NAME=mips
 export NDK_HOST_NAME=mipsel-linux-android
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/mips/ogg.sh b/Android/buildlibs/mips/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/mips/ogg.sh
+++ b/Android/buildlibs/mips/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/x86/ndkenv b/Android/buildlibs/x86/ndkenv
index d0710f4..2fb380f 100644
--- a/Android/buildlibs/x86/ndkenv
+++ b/Android/buildlibs/x86/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/x86
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/x86
 export NDK_PLATFORM_NAME=x86
 export NDK_HOST_NAME=i686-linux-android
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/x86/ogg.sh b/Android/buildlibs/x86/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/x86/ogg.sh
+++ b/Android/buildlibs/x86/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/patches/liblua.patch b/Android/patches/liblua.patch
index 4d040bc..759ce81 100644
--- a/Android/patches/liblua.patch
+++ b/Android/patches/liblua.patch
@@ -20,7 +20,8 @@ diff -Naur src/Makefile src/Makefile
  PLAT= none
  
 -CC= gcc
- CFLAGS= -O2 -Wall $(MYCFLAGS)
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
++CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
diff --git a/debian/ags+libraries/hooks/B00_copy_libs.sh b/debian/ags+libraries/hooks/B00_copy_libs.sh
index 7f34e12..c3c3825 100755
--- a/debian/ags+libraries/hooks/B00_copy_libs.sh
+++ b/debian/ags+libraries/hooks/B00_copy_libs.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-BINDMOUNT=
+BINDMOUNT=/home/USERNAME/git/ags/ags+libraries
 BIT=32
 
   set +x
diff --git a/debian/changelog b/debian/changelog
index 5fb163c..1bf9500 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-ags (3~git-1) UNRELEASED; urgency=low
+ags (3.4.1.7) UNRELEASED; urgency=low
 
   * some release
 
[close]

edit8: adding link for topic in allegro forums: https://www.allegro.cc/forums/thread/617273/1035262#target

edit9: Nick confirmed the steps are indeed run the Android/buildlibs first, being 1) http://makestandalones.sh  and then 2) http://buildall.sh . so I really don't know why it doesn't build for me. My machine is Ubuntu 16.04 64-bits so if someone ever reads this, this is all the info :/

eri0o

#734
Ok, I deleted everything, cloned the Repo again, followed the README closely, and did my modifications regarding the lua and ogg. Below are my modifications.

myGitDiff.dif
Spoiler
Code: ags

diff --git a/Android/buildlibs/armeabi-v7a/ndkenv b/Android/buildlibs/armeabi-v7a/ndkenv
index cf9fdfb..6e3d130 100644
--- a/Android/buildlibs/armeabi-v7a/ndkenv
+++ b/Android/buildlibs/armeabi-v7a/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/arm
 export NDK_PLATFORM_NAME=armeabi-v7a
 export NDK_HOST_NAME=arm-linux-androideabi
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
@@ -15,3 +15,5 @@ export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
 
 export NDK_CFLAGS=" -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 "
 export NDK_LDFLAGS=" -march=armv7-a -Wl,--fix-cortex-a8 "
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-g++ 
diff --git a/Android/buildlibs/armeabi-v7a/ogg.sh b/Android/buildlibs/armeabi-v7a/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/armeabi-v7a/ogg.sh
+++ b/Android/buildlibs/armeabi-v7a/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/armeabi/ndkenv b/Android/buildlibs/armeabi/ndkenv
index 0df6781..db11d13 100644
--- a/Android/buildlibs/armeabi/ndkenv
+++ b/Android/buildlibs/armeabi/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/arm
 export NDK_PLATFORM_NAME=armeabi
 export NDK_HOST_NAME=arm-linux-androideabi
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
@@ -14,3 +14,5 @@ export PKG_CONFIG_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/lib/pkgconfig
 export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
 
 export NDK_CFLAGS=" -mthumb "
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-g++  
diff --git a/Android/buildlibs/armeabi/ogg.sh b/Android/buildlibs/armeabi/ogg.sh
index 21062a3..56ed267 100755
--- a/Android/buildlibs/armeabi/ogg.sh
+++ b/Android/buildlibs/armeabi/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char" 
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API" 
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/makestandalones.sh b/Android/buildlibs/makestandalones.sh
index 7f327cd..d4ecd64 100755
--- a/Android/buildlibs/makestandalones.sh
+++ b/Android/buildlibs/makestandalones.sh
@@ -5,18 +5,18 @@
 set -e
 
 # Last committed pre-compiled libs were with R8
-NDK_HOME=/opt/android-ndk-r10e
+NDK_HOME=~/Android/Sdk/ndk-bundle
 
 # android-9 is minimum to support mips and x86
-PLATFORM=android-9
+PLATFORM=android-14
 
 # standalone toolchains cannot share same directory
-NDK_STANDALONE=/opt/android-ndk-r10e-standalone/$PLATFORM
+NDK_STANDALONE=~/Android/Sdk/ndk-bundle/platforms/$PLATFORM
 
 for arch in arm x86 mips
 do
     INSTALL_DIR=$NDK_STANDALONE/$arch
     mkdir -p $INSTALL_DIR
-    $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
+    $NDK_HOME/build/tools/make-standalone-toolchain.sh  --force --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
 done
 
diff --git a/Android/buildlibs/mips/ndkenv b/Android/buildlibs/mips/ndkenv
index f1f7c78..8156536 100644
--- a/Android/buildlibs/mips/ndkenv
+++ b/Android/buildlibs/mips/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/mips
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/mips
 export NDK_PLATFORM_NAME=mips
 export NDK_HOST_NAME=mipsel-linux-android
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
@@ -15,3 +15,5 @@ export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
 
 # NDK before R8b turns on "-mno-shared" in MIPS toolchain which disables -fpic
 export NDK_CFLAGS=" -fpic "
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/mips/bin/mipsel-linux-android-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/mips/bin/mipsel-linux-android-g++  
diff --git a/Android/buildlibs/mips/ogg.sh b/Android/buildlibs/mips/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/mips/ogg.sh
+++ b/Android/buildlibs/mips/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/x86/ndkenv b/Android/buildlibs/x86/ndkenv
index d0710f4..ea2176f 100644
--- a/Android/buildlibs/x86/ndkenv
+++ b/Android/buildlibs/x86/ndkenv
@@ -5,10 +5,14 @@ get_abs_path() {
 
 unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
 
-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/x86
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/x86
 export NDK_PLATFORM_NAME=x86
 export NDK_HOST_NAME=i686-linux-android
 export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
 export PATH=$NDK_PLATFORM_ROOT/bin:$PATH
 export PKG_CONFIG_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/lib/pkgconfig
 export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
+
+
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/x86/bin/i686-linux-android-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/x86/bin/i686-linux-android-g++  
diff --git a/Android/buildlibs/x86/ogg.sh b/Android/buildlibs/x86/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/x86/ogg.sh
+++ b/Android/buildlibs/x86/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
 
 pushd $SRC_DIR
 
-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
 export LDFLAGS="$NDK_LDFLAGS"
 
 ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/patches/liblua.patch b/Android/patches/liblua.patch
index 4d040bc..e717f0d 100644
--- a/Android/patches/liblua.patch
+++ b/Android/patches/liblua.patch
@@ -20,7 +20,8 @@ diff -Naur src/Makefile src/Makefile
  PLAT= none
  
 -CC= gcc
- CFLAGS= -O2 -Wall $(MYCFLAGS)
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
++CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$AP
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
[close]
Note: I think you can git apply my diff as a patch, but I haven't never actually tried. Since my experience with taking patches from html pages is poor, I also linked above a link to a copy of the diff in my github gist.

After applying the modifications in all files, you need to build things

Code: bash

export PATH=$PATH:~/Android/Sdk/ndk-bundle/
cd git/ags/Android/buildlibs/
./makestandalones.sh 
./buildall.sh 
cd ../library/
ndk-build 


notice that doing that PATH export is very important. My environment is Ubuntu 16.04 and I used the Android Sdk and ndk installed through Android Studio 3.0.1

details of my Android Studio :
Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.0-32-generic


Finally, I was able to fail at the right spot



Now it appears what is needed, is to add those OpenGL defines, which was said here http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.msg636579076#msg636579076 and is pointed in the github issue here. I need to sleep now, and have no idea how to do that, but at least, now things build as they should.



Crimson Wizard

#735
eri0o, could you make a pull request of the changes you made to building Android libs? just a patch file will also work.

QuoteNow it appears what is needed, is to add those OpenGL defines, which was said here http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.msg636579076#msg636579076 and is pointed in the github issue here. I need to sleep now, and have no idea how to do that

Same way as other functions are connected through macros, there should be awhole bunch of these already.

I will probably be able to check this out tomorrow.

eri0o

Hey CW! Created the pull request here!.

This is my first pull request in a public project, so please check if I did any mistake! (nod)

Crimson Wizard

Quote from: eri0o on Wed 14/02/2018 03:06:03
Hey CW! Created the pull request here!.

This is my first pull request in a public project, so please check if I did any mistake! (nod)

Ouch, I forgot to mention, could you do that in "release-3.4.1" branch? Because master already has some differences, and I'd like to be able to make a compilable 3.4.1 Android port.

eri0o

#738
Hey CW! Did a new pull request here!

I tested and it failed at the same lines.

Spoiler
Code: bash

jni/../jni/../../../Engine/game/savegame.cpp:537:30: note: place parentheses around the '&&'
      expression to silence this warning
            crossFading <= 0 && !channels[SCHAN_MUSIC])
                             ^
            (                                         )
6 warnings generated.
[armeabi] Compile++ arm  : agsengine <= ali3dogl.cpp
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
In file included from jni/../jni/../../../Engine/gfx/ali3dogl.cpp:19:
In file included from jni/../jni/../../../Engine/gfx/ali3dogl.h:24:
In file included from jni/../jni/../../../Common/gfx/bitmap.h:49:
jni/../jni/../../../Common/gfx/allegrobitmap.h:84:17: warning: 'this' pointer cannot be null in
      well-defined C++ code; pointer may be assumed to always convert to true
      [-Wundefined-bool-conversion]
        return !this || !_alBitmap;
               ~^~~~
In file included from jni/../jni/../../../Engine/gfx/ali3dogl.cpp:23:
In file included from jni/../jni/../../../Engine/platform/base/agsplatformdriver.h:24:
In file included from jni/../jni/../../../Engine/ac/datetime.h:21:
In file included from jni/../jni/../../../Engine/ac/dynobj/scriptdatetime.h:21:
In file included from jni/../jni/../../../Engine/ac/dynobj/cc_agsdynamicobject.h:18:
In file included from jni/../jni/../../../Engine/ac/dynobj/cc_dynamicobject.h:23:
In file included from jni/../jni/../../../Engine/script/runtimescriptvalue.h:21:
In file included from jni/../jni/../../../Engine/script/script_api.h:24:
jni/../jni/../../../Engine/ac/runtime_defines.h:135:9: warning: 'HWND' macro redefined
      [-Wmacro-redefined]
#define HWND long
        ^
jni/../jni/../../../Engine/gfx/ogl_headers.h:45:9: note: previous definition is here
#define HWND void*
        ^
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:466:7: fatal error: use of undeclared identifier
      'glSwapIntervalEXT'
  if (glSwapIntervalEXT)
      ^
4 warnings and 1 error generated.
make: *** [obj/local/armeabi/objs/agsengine/gfx/ali3dogl.o] Error 1

[close]

---- below this line I don't know what I am doing ----

Edit1: The failing is atually related to SwapInterval and the fact that you can't (apparently) control V-Sync in Android. Below is a modification of ali3dogl.cpp that actually fails in glCreateShader. I just removed things related to V-Sync with if !defined (ANDROID_VERSION) so I am not sure this won't break anything.

ags/Engine/gfx/ali3dogl.cpp

Where this version fails:
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:621:8: fatal error: use of undeclared identifier
      'glCreateShader'
  if (!glCreateShader)


Edit2: Right below the first if defined (ANDROID_VERSION) I added (idea came from here):
#include <GLES2/gl2.h>

In the project.properties, I modified the target from 16 to 14.
# Project target.
target=android-14


And then it failed with a lot of things.

Spoiler
Code: bash

...
[armeabi] Compile arm    : agsengine <= aautil.c
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
1 warning generated.
[armeabi] Compile arm    : agsengine <= midi.c
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
1 warning generated.
[armeabi] SharedLibrary  : libagsengine.so

jni/../jni/../../../Engine/gfx/ali3dogl.cpp:717: error: undefined reference to 'glCreateShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:718: error: undefined reference to 'glShaderSource'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:719: error: undefined reference to 'glCompileShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:721: error: undefined reference to 'glGetShaderiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:729: error: undefined reference to 'glCreateProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:730: error: undefined reference to 'glAttachShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:731: error: undefined reference to 'glLinkProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:734: error: undefined reference to 'glGetProgramiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:742: error: undefined reference to 'glDetachShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:743: error: undefined reference to 'glDeleteShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:746: error: undefined reference to 'glGetUniformLocation'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:747: error: undefined reference to 'glGetUniformLocation'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:748: error: undefined reference to 'glGetUniformLocation'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:738: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:738: error: undefined reference to 'glDeleteShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:762: error: undefined reference to 'glGetShaderiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:764: error: undefined reference to 'glGetProgramiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:767: error: undefined reference to 'glGetShaderInfoLog'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:769: error: undefined reference to 'glGetProgramInfoLog'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1092: error: undefined reference to 'glUseProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1127: error: undefined reference to 'glUseProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1119: error: undefined reference to 'glUniform1i'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1120: error: undefined reference to 'glUniform3f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1121: error: undefined reference to 'glUniform3f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1150: error: undefined reference to 'glUniform1i'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1151: error: undefined reference to 'glUniform1f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1152: error: undefined reference to 'glUniform1f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1264: error: undefined reference to 'glUseProgram'
/home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/allegro.c:619: error: undefined reference to 'stderr'
/home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/allegro.c:503: error: undefined reference to 'stdout'
/home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/unicode.c:2294: error: undefined reference to 'atof'
jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(rendsig.o):rendsig.c:function duh_sigrenderer_set_callback: error: undefined reference to 'stderr'
jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(rendsig.o):rendsig.c:function duh_sigrenderer_set_analyser_callback: error: undefined reference to 'stderr'
jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(itread.o):itread.c:function it_load_sigdata: error: undefined reference to 'stderr'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libagsengine.so] Error 1

[close]

CW, I will wait you do this correctly, since I have no idea how to do this.

Crimson Wizard

#739
Quote
Edit2: Right below the first if defined (ANDROID_VERSION) I added
#include <GLES2/gl2.h>

This header should be included in ogl_headers.h, where <GLES/gl.h> is.

Firstly we need to find out whether gl2.h is enough, secondly if there are still functions that have different names (if there are) should be remapped using defines, similar to how other GL functions are remapped, e.g.
Code: cpp

#define glGenFramebuffersEXT glGenFramebuffersOES
#define glDeleteFramebuffersEXT glDeleteFramebuffersOES

IDK if that is needed, so just mentioning FYI.


But not sure if that would be enough.
I was going to try that out after I am able to build it.

Right now I am very concerned about changing platform versions, from platform-9 to 14 in library scripts, and the one you mentioned later in project-properties, because I have no idea how that work and what could be broken by doing that.
E: I found platform version history here: https://en.wikipedia.org/wiki/Android_version_history
E2: Also some similar discussion, for reference: https://github.com/koreader/koreader-base/issues/332


What bothers me also is whether these shader functions are supported on all Android devices or not. And what will happen if we demand it inclusion into program. For instance, Windows version works with function pointers which it first tries to get from OpenGL's DLL. If it fails, it can simply check for that and skip some code during drawing.

There's an alternative solution, when the functions that are not found right now will be declared as ints = 0, and similarily skipped during drawing. This will disable tinting on mobile devices (at least with OpenGL means), but at least won't break anything that already exists.

PS. Ideally the OpenGL renderer should be rewritten, having some generic OpenGL API exposed, and the inner workings hidden in implementations, one for each platform. But that will take some time to do.

SMF spam blocked by CleanTalk