dec1/Boost-for-Android

Compiling boost with zlib

Closed this issue · 4 comments

Hi, great work, very useful!

I need to use the gzip utilities in Boost.Iostreams, but for that I need to compile boost with zlib..
I understand that I need to specify ZLIB_INCLUDE, ZLIB_LIBPATH and ZLIB_BINARY when running ./b2.
Do you know where I can get these? I know that zlib is now part of the Android NDK, is there some way to use that?

Will appreciate your help.

dec1 commented

Hello.
I ported libzip 1.2 a while back. Check out this.
The libzip that comes with android should be usable via c++, but Im not sure how. It also doesn't contain all features of the full libzop as far as I know.

Best Wishes.

Hmm.. can boost use this? I'm trying to compile boost with zlib because I'm getting gzip error: unspecified iostream_category error when trying to use boost::iostreams::gzip_decompressor. I'm guessing it's because I'm not compiling boost with zlib. I tried to do so using Android's NDK's zlib, like so:

    run ./b2 -d+2 -q -j$NUM_JOBS \
        variant=release \
        ...
        ...
	-sZLIB_INCLUDE=$ANDROID_NDK_ROOT/sysroot/usr/include \
	-sZLIB_LIBPATH=$ANDROID_NDK_ROOT/sysroot/usr/lib/$TCPREFIX \
        install \

but it's not working. I'm even getting zlib: no in the build output. Do you have any idea how to compile Boost with zlib? Maybe (probably) I'm using the flags wrong? Maybe I need to take some zlib for android 3rd party library (although Android NDK does include it).

Thanks in advance

dec1 commented

Looking at eg here you could try adding

`NO_ZLIB=0` and   `ZLIB_BINARY=z`

Android's libzip is a stripped down version. It doesn't have all the features of the original

dec1 commented

I just contributed the android build scripts for libzip here in case its of use:
nih-at/libzip#93