Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android, Build : Build dependencies using official tools and from source #720

Closed
folecr opened this issue Feb 12, 2012 · 9 comments
Closed

Comments

@folecr
Copy link
Contributor

folecr commented Feb 12, 2012

Cocos2D-X on Android depends on the following external BINARY libraries :

  • libxml2

  • libjpeg

  • libpng

    ... also due to the current build system it automatically incorporates

  • some Crystax libraries

  • libiconv

  • unneeded portions of libjpeg in the prebuilt binaries

This needs to be fixed.

Explanation

Currently external depenencies are built using Crystax's toolchain and distributed as prebuilt binaries.
Reasons :

  1. There are no distributable makefiles in the Cocos sources for these dependencies
  2. For a long time Android did not support C++ fully
  3. It is assumed that the build time will be very long (possibly because of Android's poor build sytem)

The fix is now possible because Android NDK has

  • Better makefiles
  • Better C++ support

Suggested fix

  1. Modularize the Android NDK makefiles
  2. Add Cocos2dx/Android specific makefiles to external dependencies
  3. Fork a correct version of external depenencies to Cocos2D's github
  4. Build external dependencies from source
  5. Use standard toolchain
  6. Remove depenency on 3rd-party toolchain
  7. Prove that compile time is reasonable (so that it is possible to distribute as source)
@folecr
Copy link
Contributor Author

folecr commented Feb 12, 2012

I'll submit a pull request to fix these issues. I currently have the fix and successfully building HelloWorld.
I am testing HelloLua.

@folecr
Copy link
Contributor Author

folecr commented Feb 13, 2012

Here are the source repositories for the dependencies

libxml2

libpng

libjpeg

  • https://github.com/folecr/jpeg8d
  • Newer version than that used by Android Gingerbread
  • Cocos2D-x uses functions that are available in latest version so I used this version instead of hacking the old

@minggo
Copy link
Contributor

minggo commented Feb 13, 2012

Great.
I think we should use prebuilt lib as default to reduce build time.
We also provide resource code for those who want to build from source code.

What's your opinion?

@folecr
Copy link
Contributor Author

folecr commented Feb 13, 2012

I will commit changes and let you decide : I did not see significant
slowdown in build time.

On Feb 12, 2012, at 6:01 PM, minggo
reply@reply.github.com
wrote:

Great.
I think we should use prebuilt lib as default to reduce build time.
We also provide resource code for those who want to build from source code.

What's your opinion?


Reply to this email directly or view it on GitHub:
#720 (comment)

@folecr
Copy link
Contributor Author

folecr commented Feb 14, 2012

FYI, changes are here : https://github.com/folecr/cocos2d-x/tree/externals

I am tracking down a crash in libjpeg when running HelloLua. When I am satisfied that it is stable I will submit a pull request.

@minggo
Copy link
Contributor

minggo commented Feb 14, 2012

Ok, thank you.

@folecr
Copy link
Contributor Author

folecr commented Feb 14, 2012

BTW, where can I find the scripts/makefiles used to build the currently used binary libraries? I want to check the build flags used. Thanks.

@minggo
Copy link
Contributor

minggo commented Feb 14, 2012

You can refer HelloWorld/android/build_native.sh.

@folecr
Copy link
Contributor Author

folecr commented Feb 17, 2012

I have submitted a pull request.

You can refer HelloWorld/android/build_native.sh.

Thanks - that only builds from prebuilt binaries. I wanted to check what the original flags and options were to generate the binaries.

@folecr folecr closed this as completed Jun 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants