|
Compiling 5.1.10 for Android-arm (Xubuntu 14.04 64bit) |
Yodhe23
Member #8,726
June 2007
|
So in honour of the release of 5.1.10, I decided to take a serious crack at making a guide to compiling Allegro (5.1.10) for Android, on Linux (Xubuntu)... Anyway I installed a completely clean 14.04 Xubuntu and git'd Allegro, and compiled it for Linux as per the instructions with no problems whatsoever. Then it came to making the Android build, and here is what I found... As it found all of the OpenGLES stuff without error, I assumed (rightly or wrongly?) that the OpenGL missing libraries weren't needed for the Android build? For the missing PKG_CONFIG_EXECUTABLE I pointed the make file to the pkgconfig included with the ndk at Compiling OpenAL (using version1.16.0, as 1.15.1 fails to build) as per this site I found the same is also true for flac-1.3.1 despite it cross compiling fine, with However OGG (1.3.2) seems to be fine, compiling exactly the same way as above. LibVorbis (1.3.5) compiles fine as above, but when the Allegro cmakes file runs it says that it fails on the LibVorbis compile test. LibTheora (1.1.1) gives me a error trying to cross compile it - Freetype2 seems to build fine, without error, and builds fine with Allegro-Android, with no reported crashes thus far. I used the instructions as per the I haven't been able to figure out thus far how to cross compile PhysFS or DUMB. (EDIT) I found this link so will try and cross compile PhysFS later and see if it works, I don't know whether to feel elated at having achieved something, and despondent at getting so little progress after three days, especially as I managed to get OpenAL, FLAC and Vorbis (but not FreeType2) to compile on an earlier version of Allegro about 18months (don't ask me how, I have forgotten, hence why I wanted also to preserve this "quest" in stone for future adventurers). Any help would be greatly appreciated. www.justanotherturn.com |
jmasterx
Member #11,410
October 2009
|
It took me 4 days to get all the iOS port up and working. I looked into building the Android port and gave up. So I commend you for your efforts, they seem really great. It would be nice to have scripts at least for one OS that get and build the deps for Android. I hope to eventually have time to take all my iOS build scripts and consolidate them into something that can autogenerate the deps for arm7 / arm64. I wish I could be more help on the matter of Android, but I myself found it pretty tricky. Agui GUI API -> https://github.com/jmasterx/Agui |
Yodhe23
Member #8,726
June 2007
|
Well I just tried the physFS link we both put up above. And after commenting out the lines 268 and 270 with the lastDirectory variables, in wad.c, (these caused a compile error as it was "set but unused", and setting the compiler flags in the cmake file to -Wno-error didn't help), it compiled without complaint. I also manually added the $HOME/allegro/build/deps to the PREFIX_INSTALL option in the make file. Thanks for your kind words, its nice to know I am not the only one, as sometimes I just think I am really stupid for not being able to figure this out. www.justanotherturn.com |
SiegeLord
Member #7,827
October 2006
|
I had no trouble compiling Allegro proper (following directions) but I didn't try any of the dependencies. Addressing the Android and iOS situation is something to do (it'll probably be essentially the same thing done for Windows now). "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Yodhe23
Member #8,726
June 2007
|
Yeah I didn't have any problem with compiling Allegro-android without dependencies "out of the box", which was nice. Good news, after playing around some more, and deepening my knowledge of cmake/cross compiling I managed to get physFS to cross compile from the link above. I had to turn off/comment out CD-Rom Support in the CMakeLists.txt file. This is because when I tried to cross compile it would throw an exception saying that there were undefined references to a couple of function calls from mntent.h Here is the cmake command I used incase it helps anyone else:- (Edit) Some more success of a sort, I can get Vorbis to cross-compile and build with Allegro without complaint now, but it crashes the examples. :/ www.justanotherturn.com |
Mark Oates
Member #1,146
March 2001
|
How unreasonable would it be to make/have an installer? -- |
Yodhe23
Member #8,726
June 2007
|
Success - I can compile and build with the Vorbis dependency. Off to try the same with the FLAC and THEORA cross compiles. (Edit FLAC) Okay I can get Flac to cross-compile (both 1.2 and 1.3) and neither these, (Edit THEORA) No luck with THEORA either, after playing around it flips out during the cross compile make with a (Edit OpenAL) The problem with OpenAl is that the linker seems to be ignoring the LDFLAGS=-avoid-version, so it is created libraries with the .so.1 and so.16.0 extensions as well, which then cause an exception from inside the Android Allegro build at runtime, as the libraries should only be .so, with no version number. (Edit OGG is borked for Android 5+) Now this combined with the lround and log functions missing from FLAC compile crash and I am beginning to suspect due to the changes in how android deals with some libraries as can be seen in this thread www.justanotherturn.com |
SiegeLord
Member #7,827
October 2006
|
You could try compiling for an older NDK, perhaps. Sorry I can't be more help with this... a bit busy with other things. Android is definitely a very important platform to get right (I'd say it's second after Windows, actually), it's a shame you're having so much trouble with it. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Yodhe23
Member #8,726
June 2007
|
I tried an older NDK, (r9c v r10e) and no joy. www.justanotherturn.com |
SiegeLord
Member #7,827
October 2006
|
Ok, I have some free time now. So what are you trying now? Currently I just have a plain Allegro compiled and it produces sound (I assume through OpenSL?). I am compiling for API level 19. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Yodhe23
Member #8,726
June 2007
|
This is my Allegro Android build from a fresh Xubuntu install following the instructions. 1yodhe@Development:~/allegro/build$ cmake .. -DANDROID_NDK_TOOLCHAIN_ROOT=$TC -DWANT_ANDROID=on -DANDROID_TARGET=android-15 # -G"MSYS Makefiles"
2-- Selected Android toolchain: /home/yodhe/android-toolchain
3-- The C compiler identification is GNU 4.8.0
4-- The CXX compiler identification is GNU 4.8.0
5-- Check for working C compiler: /home/yodhe/android-toolchain/bin/arm-linux-androideabi-gcc
6-- Check for working C compiler: /home/yodhe/android-toolchain/bin/arm-linux-androideabi-gcc -- works
7-- Detecting C compiler ABI info
8-- Detecting C compiler ABI info - done
9-- Check for working CXX compiler: /home/yodhe/android-toolchain/bin/arm-linux-androideabi-g++
10-- Check for working CXX compiler: /home/yodhe/android-toolchain/bin/arm-linux-androideabi-g++ -- works
11-- Detecting CXX compiler ABI info
12-- Detecting CXX compiler ABI info - done
13-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
14-- Check if the system is big endian
15-- Searching 16 bit integer
16-- Looking for sys/types.h
17-- Looking for sys/types.h - found
18-- Looking for stdint.h
19-- Looking for stdint.h - found
20-- Looking for stddef.h
21-- Looking for stddef.h - found
22-- Check size of unsigned short
23-- Check size of unsigned short - done
24-- Using unsigned short
25-- Check if the system is big endian - little endian
26-- Looking for include file dirent.h
27-- Looking for include file dirent.h - found
28-- Looking for include file inttypes.h
29-- Looking for include file inttypes.h - found
30-- Looking for include file linux/input.h
31-- Looking for include file linux/input.h - found
32-- Looking for include file stdbool.h
33-- Looking for include file stdbool.h - found
34-- Looking for include file stdint.h
35-- Looking for include file stdint.h - found
36-- Looking for include file sys/io.h
37-- Looking for include file sys/io.h - not found
38-- Looking for include file sys/stat.h
39-- Looking for include file sys/stat.h - found
40-- Looking for include file sys/time.h
41-- Looking for include file sys/time.h - found
42-- Looking for include file time.h
43-- Looking for include file time.h - found
44-- Looking for include file sys/utsname.h
45-- Looking for include file sys/utsname.h - found
46-- Looking for include file sys/types.h
47-- Looking for include file sys/types.h - found
48-- Looking for include file soundcard.h
49-- Looking for include file soundcard.h - not found
50-- Looking for include file sys/soundcard.h
51-- Looking for include file sys/soundcard.h - not found
52-- Looking for include file machine/soundcard.h
53-- Looking for include file machine/soundcard.h - not found
54-- Looking for include file linux/soundcard.h
55-- Looking for include file linux/soundcard.h - found
56-- Looking for include file libkern/OSAtomic.h
57-- Looking for include file libkern/OSAtomic.h - not found
58-- Looking for include file sys/inotify.h
59-- Looking for include file sys/inotify.h - found
60-- Looking for include file sal.h
61-- Looking for include file sal.h - not found
62-- Looking for getexecname
63-- Looking for getexecname - not found
64-- Looking for mkstemp
65-- Looking for mkstemp - found
66-- Looking for mmap
67-- Looking for mmap - found
68-- Looking for mprotect
69-- Looking for mprotect - found
70-- Looking for sched_yield
71-- Looking for sched_yield - found
72-- Looking for sysconf
73-- Looking for sysconf - found
74-- Looking for fseeko
75-- Looking for fseeko - found
76-- Looking for ftello
77-- Looking for ftello - found
78-- Looking for strerror_r
79-- Looking for strerror_r - found
80-- Looking for strerror_s
81-- Looking for strerror_s - not found
82-- Check size of _Bool
83-- Check size of _Bool - done
84-- Performing Test ALLEGRO_HAVE_PROCFS_ARGCV
85-- Performing Test ALLEGRO_HAVE_PROCFS_ARGCV - Failed
86-- Performing Test ALLEGRO_HAVE_SV_PROCFS_H
87-- Performing Test ALLEGRO_HAVE_SV_PROCFS_H - Failed
88-- Performing Test ALLEGRO_HAVE_VA_COPY
89-- Performing Test ALLEGRO_HAVE_VA_COPY - Success
90-- Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR)
91-- Found OPENGLES: /home/yodhe/android-toolchain/sysroot/usr/include
92-- Found OPENGLES2: /home/yodhe/android-toolchain/sysroot/usr/include
93S3TC locking disabled. You will not be able to load/save pre-compressed textures with OpenGL.
94-- Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
95-- Found OPENSL: /home/yodhe/android-toolchain/sysroot/usr/include
96-- Could NOT find FLAC (missing: FLAC_INCLUDE_DIR OGG_LIBRARY FLAC_LIBRARY)
97WARNING: libFLAC not found or compile test failed, disabling support.
98-- Could NOT find DUMB (missing: DUMB_INCLUDE_DIR DUMB_LIBRARY)
99WARNING: libdumb not found or compile test failed, disabling support. <http://dumb.sourceforge.net/>
100-- Could NOT find OGG (missing: OGG_INCLUDE_DIR OGG_LIBRARY)
101WARNING: libvorbis not found or compile test failed, disabling support.
102-- Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
103WARNING: FreeType not found, disabling support.
104-- Could NOT find PhysFS (missing: PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
105-- Could NOT find PHYSFS (missing: PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
106-- Found ZLIB: /home/yodhe/android-toolchain/sysroot/usr/lib/libz.so (found version "1.2.3")
107-- Could NOT find OGG (missing: OGG_INCLUDE_DIR OGG_LIBRARY)
108-- Could NOT find OGG (missing: OGG_INCLUDE_DIR OGG_LIBRARY)
109WARNING: allegro_video wanted but no supported backend found
110-- Not building ex_file - console program
111-- Not building ex_file_slice - console program
112-- Not building ex_memfile - console program
113-- Not building ex_colorhttp://hardforum.com/showthread.php?t=1454823
114-- Not building ex_convert - console program
115-- Not building ex_depth_mask
116-- Not building ex_haptic2
117-- Not building ex_physfs
118-- Not building ex_video
119-- Not building ex_font_justify
120-- Not building ex_font_multiline
121-- Not building ex_logo
122-- Not building ex_projection
123-- Not building ex_ttf
124-- Not building ex_acodec - console program
125-- Not building ex_acodec_multi - console program
126-- Not building ex_audio_chain
127-- Not building ex_audio_simple - console program
128-- Not building ex_kcm_direct - console program
129-- Not building ex_mixer_chain - console program
130-- Not building ex_stream_file - console program
131-- Not building ex_synth
132-- Not building ex_native_filechooser
133-- Not building ex_menu
134-- Not building tests due to missing library. Have: allegro allegro_main allegro_image allegro_color allegro_font allegro_primitives
135-- Configuring done
136-- Generating done
137-- Build files have been written to: /home/yodhe/allegro/build
And FYI Allegro Linux compiles/builds perfectly and all works including audio. EDIT - Okay I just spend an hour doing an sdk/ndk/allegro install on my other linux machine to check if it was a hardware configuration error or something as arcane. www.justanotherturn.com |
SiegeLord
Member #7,827
October 2006
|
So I see that at least some audio examples got configured in your log (the audio examples that are not built are those with TTF fonts and console ones)... when you build, do you get ex_audio_props built? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Yodhe23
Member #8,726
June 2007
|
sitting in the corner with 'D' hat on My mistake, it was compiling allegro_audio and allegro_acodec in the vanilla build, it just wasn't listing them alongside the other libraries at the end of the cmake build output, when it says Also it turns out the skater and cosmic protector don't have sound until I compile and build allegro with ogg AND vorbis. That will teach me to NOT have the great idea to turn off the examples to speed up the build times. Anyway OpenAl still crashes with that LookUpUInt, though I am going to have a go a adding that function to the source to see if it makes a difference, as it seems to be a function in older OpenAl versions. Thanks, and I'm back to getting the other dependencies to play nice. EDIT Still getting the same errors with FLAC, though 1.2.1 produces only missing "log" function rather than 1.3.1 with "log and lround" missing. www.justanotherturn.com |
SiegeLord
Member #7,827
October 2006
|
Ok. So I compiled the dependencies like so: Ogg-1.3.2: ./configure CC=/home/siege/android/toolchain/arm-linux-androideabi/bin/gcc --host arm-linux-androideabi --prefix=/home/siege/android/local --disable-shared Vorbis-1.3.5: ./configure CC=/home/siege/android/toolchain/arm-linux-androideabi/bin/gcc --host arm-linux-androideabi --prefix=/home/siege/android/local \ --disable-shared CFLAGS=-I/home/siege/android/local/include LDFLAGS=-L/home/siege/android/local/lib FLAC-1.3.1: ./configure CC=/home/siege/android/toolchain/arm-linux-androideabi/bin/gcc CXX=/home/siege/android/toolchain/arm-linux-androideabi/bin/g++ --host arm-linux-androideabi \ --prefix=/home/siege/android/local --disable-shared CFLAGS=-I/home/siege/android/local/include LDFLAGS=-L/home/siege/android/local/lib Allegro's compile test failed, as you said, but I easily fixed it by adding libm as a required library (I've now committed this change). With that, everything worked fine on my device. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Yodhe23
Member #8,726
June 2007
|
FLAC seems to test compile successfully now, but Allegro won't build after I re-git'd it. I have to sudo everything now, such as mkdir build, etc, and then it keeps saying android-tool not found when I cmake it, regardless of what export PATH i do. www.justanotherturn.com |
|