Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - eri0o

#2741
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)
#2742
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.


#2743
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 :/
#2744
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
#2745
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]
#2746
Hey, about the masks, I make them in Aseprite (which is open source and you can also buy on steam), just use indexed colors, first color is 0, second color is 1 and so on.
#2747
For Your Consideration

Dungeon Hands

Possible Awards:
Best Game Created with AGS
Best Non Adventure Game Created with AGS (I totally made this up)
Best Freeware Game Created with AGS
Best Programming
Best Short Game
Best Gameplay
Best Music and Sound
Best Background Art
Best Character Art

Summary of the game: It's a two player card game you have to play with your mouse. This is not an adventure game.

:smiley: Link to Itch.io (includes download)

:) AGS Database Link




#2748
Hey! What's the status of this plugin? Is there an update? Is source code available somewhere? The first page link points to an expired wiki.

I played a little bit with love2d this weekend and would like to test using lua to use shaders :]
#2749
I think you are misunderstanding: those are good pieces of software, I am not saying to build AGS on top of any commercial engine, I am saying LOOK AT HOW THEY SOLVE THE EXACT SAME PROBLEMS, and take a note. Seriously.

I have absolutely no idea why you don't look commercial engines up considering considering they have history - not for building on top, taking inspiration, and they have open bits (or are completely open), either on github or bitbucket. I know that I will stay on AGS and migrate to a better maintained engine if the "replacement" is just New Mistakes Edition. It's completely not fun being in middle of development and have your engine swept away.
#2750
Just a reminder you can just do what Unity does and have the thing you write code separated from the rest - this is also how working with Chrome/Firefox developer tools with VSCode works, and I think with Unreal too. People seem to be OK with this - I know in the past we used to have IDEs but not doing it looks to me more maintainable. Also think about a package manager (you can use one that already exists) to share scripts.
#2751
Monodevelop is redistributable, isn't?
#2752
In Android docs I found:

https://developer.android.com/reference/android/opengl/GLES20.html

Doing ctrl+f on each thing from the issue, things look available. I don't know where are iOS docs.

Edit: android moved docs from 'development' to 'developer' and I had a mini heart attack here.
#2753
CW, I still couldn't understand: is the current master branch supposed to build for Android or it should fail?
#2754
Unity distributes monodevelop
#2755
You know what AGS does really well, as simple as is it's functions and editor? GUIs. I made a game using only GUIs. GUIs in AGS are very easy to do.
#2756
Is there any reason why ignoring Unity3D, Gamemaker, RPGMaker, Unreal, Lumberjack, Pygame, Phaser, Pico8, Visionaire Studio, Construct, ...?
#2757
I will try to shine some light on why I think Unity works... If any normal person opens Unity, you can't possibly say "this is great piece of software". BUT once you commit to learn all the rough things in Unity, the same language you used to build your very tiny, probably in a jam, C# game, well... You can use that same knowledge to build tools for it! The base can be a magic proprietary box that mostly does nothing, but you now can build your own tools to make games with the same knowledge you have for making games, and you can share those tools. And you can share assets too! In the end I see Unity as this thing that Has a store to share stuff, and build across multiple devices, but that when you just install, it does nothing.

In AGS you have 3 type of people:
1 - people who can script, using AGS Script
2 - people who can make plugins, using SOMETHING (I have no idea how to make plugins).
3 - people who can mod and advance the engine, using C and C++.
...
and a secret 4th type:
4 - people who can draw Adventure Game Stuff.

Being good in 1 and 4 doesn't contribute much to becoming 2. And the majority is too distant from 3.

So to create Yet Another Game Engine, I think the idea that would work would be just like Unity. Have something basic that does nothing, a package manager for distributing assets, and start from there. I would strongly advice being 2D AND 3D, choose ONE and stick with it. Doing the 2 there is already GODOT.

Also AGS Script is typed, which allows very good prediction of things while typing. I would advise against bare javascript, python or other non typed languages. I like that AGS Script is very non-verbose when compared to C#, making easy to sketch commands in forum (without smart predictions of things).

I would ignore collaborative and just guarantee things to work with git.

Also I think such engine should have as priority having an asset for AGS like workflow of game making, but you know... Allow if someone want to one day add a Mario Maker asset or crazy RTS designer asset, SIM RPG MAKER asset.
#2758
morganw! If you can create a fork of this version of the engine, share on github and create a thread somewhere in the forums so people can keep an update on what you try that works and what does not, it would be cool!
#2759
Hey, I don't understand any of this. What is the dates and time? What are the categories? Can I submit my totally not an adventure game made in AGS? N00b send help plz.
#2760
Please check the Editor manual pages below if you are building with the Editor!

https://adventuregamestudio.github.io/ags-manual/BuildAndroid.html
https://adventuregamestudio.github.io/ags-manual/DistGame.html#compiled-folder-structure
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#android
https://adventuregamestudio.github.io/ags-manual/EditorPreferences.html#android

Below follows information if you instead are using Android Studio yourself and diving in AGS source code.



>> The documentation for releasing for Android is here: [tt]README.md[/tt] <<

Please in case of trouble ask here in this thread! It's possible I screwed up somewhere too, so report any problems!

Note: due to Google Play App size limits, it's important your game not be bigger than 1GB. You can put some files in the app bundle and the rest on the install time asset pack if you need it to be just a bit (100MB) bigger.

---

The information below is outdated, it was relevant for old Android port.
Spoiler

I will try to explain what I did here, questions will arise, hopefully everything can be answered here and this will allow me to generate a guide.

So first two things are important:
- Android port of the engine currently doesn't report correctly mouse.isButtonDown, so your game CAN'T BE USING THIS, use if(System.OperatingSystem == eOSAndroid) in your code to work for this.
- I am using the latest prebuilt APK as libs, those were for the previous stable version, so your game must be built with that AGS.

1. You need to install the latest Android Studio, just download and install. https://developer.android.com/studio/index.html .

2. You will also need JDK, NDK and Android SDK.

3. After installing Android Studio, download the repository I made here: https://github.com/ericoporto/mythsuntold_dungeonhands . This is my modded version of Monkey's Android Studio Project.

4. Open the folder in Android Studio.

5. Building should generate my game .apk!

6. Ok, let's make YOUR game .apk. In the folder Android Studio placed the Sdk, there is a magical tool called jobb. I use Ubuntu, and the tool is in the folder ~/Android/Sdk/tools/bin/ in my computer. If you use Windows, then it's probably in %appdata%\Local\Android\Sdk . (if someone can confirm this information, it would be awesome!). This is just so you can understand what will happen next.

7. In your game Compiled folder, there is a YOURGAMENAME.ags file. Open a cmd.exe (windows) or bash terminal (Linux/OSX). Change Directory to the folder YOURGAMENAME.ags is.

In Windows (untested!)
Code: cmd
cd YOURGAMENAME\Compiled\
mkdir obb
move YOURGAMENAME.ags obb\
%appdata%\Local\Android\Sdk\tools\bin\jobb -d \obb\ -o main.3.com.YOURSTUDIONAME.YOURGAMENAME.obb -pn com.YOURSTUDIONAME.YOURGAMENAME -pv 3
 
In Linux/OSX
Code: cmd
cd YOURGAMENAME/Compiled/
mkdir obb
mv YOURGAMENAME.ags obb/
~/Android/Sdk/tools/bin/jobb -d ./obb/ -o main.3.com.YOURSTUDIONAME.YOURGAMENAME.obb -pn com.YOURSTUDIONAME.YOURGAMENAME -pv 3

In the code above, 3 is simply the OBB version number. Every time you change the content of the OBB linked to your APK and release, you have to increase that number - and update in your Android Studio Project accordingly. Also make sure that YOURGAMENAME and YOURSTUDIONAME are correctly updated in your android studio project.

8. In the README there is a line called Setting up the project for your game. I will copy below:

-Update package name:

Open the project in Android Studio, then in the project tree navigate to app/java/com.mythsuntold.osd.scourge.
Right-click on this folder and select "Refactor -> Move...". When prompted, select "Move package 'com.mythsuntold.dungeonhands' to another package" (the default). You may receive a warning that multiple directories will be moved, select Yes. Type the parent name of your package, not the final package name (e.g., com.bigbluecup not com.bigbluecup.game), select "Refactor" and then click "Do Refactor".
Right-click on the new project folder in the project tree (e.g., com.bigbluecup.scourge) and select "Refactor -> Rename". Type the package name for your game (e.g., game), then select "Refactor" and click "Do Refactor".

Finally, delete the com.mythsuntold.dungeonhands folder.

- Update project.properties. This file contains gradle settings related to your project. The application ID, version code, and version name need to be set to match your project settings (application ID is your package name).

- Update project.xml. This file contains resources for your project. The values there are described in that file.

- Update local.static.properties. This file contains local data that should NOT be added to version control (.gitignore will ignore your changes to this file). You need to add your keystore path, alias, and passwords, and optionally the path to your copy of the AGS source (if you are rebuilding the engine native libraries). See the Java docs on keytool or use the Android Studio signing wizard to generate a keystore.

- Update private.xml. This file contains definitions for your RSA public key and an integer-array with bytes for your salt which is used by the ExpansionDownloaderService. These values are necessary if distributing your app via the Google Play Store. The RSA public key is provided in the Google Play Developer Console, and the salt bytes may be any number of values in the range [-128, 127]. You may need to upload an APK without the RSA public key first before the key is provided. That APK should not be public unless the OBB file is embedded.

- Update graphics resources (app/src/main/res). You can use the Android Asset Studio to easily generate graphics for your app, or use your preferred method. Everything in the drawable and various mipmap-* folders should be replaced with your resources.

I made this post with the intent to help Mehrdad, so please try this!
[close]
SMF spam blocked by CleanTalk