Skip to content

Instantly share code, notes, and snippets.

@sc0rch
Last active September 13, 2018 08:25
Show Gist options
  • Save sc0rch/d239e424f2a1bd4a7107f5d709b5d4f9 to your computer and use it in GitHub Desktop.
Save sc0rch/d239e424f2a1bd4a7107f5d709b5d4f9 to your computer and use it in GitHub Desktop.
Build xdelta3 as static libraries to use in iOS applications

How to compile xdelta3 for iOS

Download iOS autotools (https://github.com/sc0rch/ios-autotools).

Download xdelta-3.0.11.tar.gz (http://xdelta.org).

brew install automake
brew install libtool

autoreconf --install
./configure

# make armv7
make clean
./iconfigure armv7
make xdelta3 CFLAGS="-DREGRESSION_TEST=0 -DNOT_MAIN=1"
ar rcs ./libxdelta3_armv7.a ./xdelta3-xdelta3.o

# make armv7s
make clean
./iconfigure armv7s
make xdelta3 CFLAGS="-DREGRESSION_TEST=0 -DNOT_MAIN=1"
ar rcs ./libxdelta3_armv7s.a ./xdelta3-xdelta3.o

# make arm64
make clean
./iconfigure arm64
make xdelta3 CFLAGS="-DREGRESSION_TEST=0 -DNOT_MAIN=1"
ar rcs ./libxdelta3_arm64.a ./xdelta3-xdelta3.o

# make x86_64
make clean
./iconfigure x86_64
make xdelta3 CFLAGS="-DREGRESSION_TEST=0 -DNOT_MAIN=1"
ar rcs ./libxdelta3_x86_64.a ./xdelta3-xdelta3.o

lipo -create ./libxdelta3_armv7.a ./libxdelta3_armv7s.a ./libxdelta3_arm64.a ./libxdelta3_x86_64.a -output ./libxdelta3.a

Add libraries to your target. Don't forget to check "Copy if needed". Also double check Library Search Path in target's build settings and remove any duplicate records.

@sc0rch
Copy link
Author

sc0rch commented Sep 13, 2018

If you have any issues, ask in comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment