Instructions to compile for android

2 replies [Last post]
francot514
User offline. Last seen 49 weeks 5 days ago. Offline
Joined: 2015-03-20
Posts: 163

Hey i need some instruction to compile project, mostly how to use freepascal and pas2c to get so files

Wuzzy
Wuzzy's picture
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 2012-06-20
Posts: 1254

I am not responsible for the Anrdoid build, and I don't know if it still works, but here's a guide:

https://hedgewars.org/kb/BuildingForAndroid

The guide might be outdated, I don't know.

The main platform for Hedgewars is still PC.

If you manage to build it somehow, please let me know! Smile

I hope someone else from our team shows up to answer this question.

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

sheepluva
sheepluva's picture
User offline. Last seen 5 days 8 hours ago. Offline
Joined: 2009-07-18
Posts: 541

My build setup partially died with my SSD recently, but here's some hints/downfalls I remember or see in my current local repo diff:

* Building a 64-bit binary is the default these days and pretty much mandatory, even if you decide to (additionally) build for a 32-bit target.

* Make sure to provide the 64-bit versions of the libraries to the 64-bit build (and 32-bit to the 32-bit build, if you're going for that)

* Since you will need different FPC cross-compilers inluding their respective run-time libraries and such, I found the program FPCupdeluxe extremly helpful. It's purpose is to generate FPC cross-compilers tailored to your needs.

* I build with local libphysfs in the repo. We removed it from there a while ago, so you'll have to place it in misc/ again manually. Also you may want to checkout misc/libphysfs/Android.mk from a revision before it was deleted ( 0e113487c4b2 )

* If you're trying to build using SDL2, you'll have to replace/update the SDL project files in the repos, which are partially just copied of the boilerplate/example code iirc

* project_files/Android-build/download_libs.sh is full of dead links, you'll have to manually download these

* In hedgewars/uWorld.pas it seems I ran into an compiler issue:

-procedure ShiftWorld(Dir: LongInt); inline;
+// inlining this with fpc-dev for aarch64-android produced garbage asm for me
+procedure ShiftWorld(Dir: LongInt);{$IFNDEF ANDROID} inline;{$ENDIF}

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

Copyright © 2004-2021 Hedgewars Project. All rights reserved. [ contact ]