Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szanni/ios-autotools
Helper tools for cross-compilation of autotools libraries for iOS (and simulator) on OS X.
https://github.com/szanni/ios-autotools
Last synced: 2 months ago
JSON representation
Helper tools for cross-compilation of autotools libraries for iOS (and simulator) on OS X.
- Host: GitHub
- URL: https://github.com/szanni/ios-autotools
- Owner: szanni
- License: isc
- Created: 2014-11-23T13:01:20.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T06:14:55.000Z (about 3 years ago)
- Last Synced: 2024-08-03T01:39:29.772Z (6 months ago)
- Language: Shell
- Size: 134 KB
- Stars: 72
- Watchers: 7
- Forks: 25
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Autotools helpers for iOS
=========================Helper tools for cross-compilation of autotools libraries for iOS (and simulator) on OS X.
All libraries are static, since iOS does not support linking of custom dynamic libraries.You will have to install `automake`, `autoconf` and `libtool` via your favorite mechanism (compile from source, homebrew, macports, ...).
Usage: iconfigure
-----------------To configure a library for a specific architecture run `iconfigure` in the directory containing the
*configure* script.iconfigure armv7|armv7s|arm64|i686|x86_64
This will set up the environment for cross-compiling for the specified architecture.
You can then proceed as usual by running `make` and `make install`. `make install`
will default to install your libraries system-wide in */opt/* so that you can use them
in multiple projects.All this can be configured by setting the following variables:
SDKVERSION e.g.: 7.1
PREFIX e.g.: /User/Home/project/staticlibAnd the typical compiler flags:
CFLAGS CPPFLAGS CXXFLAGS LDFLAGS PKG_CONFIG_PATH
For more variables and their functionality see the usage instructions and/or read
the source code.For example to build a library locally in your project targeting the iOS SDK version 7.1 on armv7 run:
SDKVERSION=7.1 PREFIX=/User/Home/project/staticlib iconfigure armv7
make
make installUsage: autoframework
--------------------To build an iOS framework for all architectures run `autoframework` in the directory containing
the *configure* script.This will create two directories *Static* and *Frameworks*. *Static* will contain one
subdirectory for each architecture, each containing all installation targets for that
architecture. *Frameworks* will contain the resulting multiarch framework.autoframework MyLib libmylib.a
As with `iconfigure` there are a few optional settings:
ARCHS e.g. armv7 armv7s
PREFIX e.g. /User/Home/projectFor example for building your framework locally for armv7 and armv7s you could run:
ARCHS="armv7 armv7s" PREFIX=/User/Home/project autoframework MyLib libmylib.a
External build system
---------------------While *Xcode* does not directly support *autotools* it has support for plain *Makefiles*.
You can use this to build all your libraries within your project automatically.Add a new *External Build System* target to your project (*File > New > Target > OS X > Other > External Build System*).
Enter a name like *StaticLibs* and create a *Makefile* in the top level of your project:ARCHS="armv7 armv7s arm64 i686 x86_64"
FRAMEWORKS = Frameworks/MyLib.frameworkall: $(FRAMEWORKS)
Frameworks/MyLib.framework: mylib
cd $< && ./autogen.sh
# $(PROJECT_DIR) set by Xcode
# $(ARCHS) set by Xcode, but sadly does not include all target architectures
cd $< && PREFIX=$(PROJECT_DIR) ARCHS=$(ARCHS) autoframework MyLib libmylib.aBe aware that Xcode itself does set the ARCHS variable to an incorrect value. We therefore
have to override the value by manually specifying the desired architectures in the
Makefile.Now add the new target to the dependencies of your main project and build.
You should now be able to either add your libraries either by adding the
desired frameworks in *Frameworks/* or by adding *Static/{include,lib}* to the
paths in your main project and setting the appropriate linker flags.Depending on where you installed your autotools suite you might have to adjust the
*PATH* variable in your new target. Go to: *Build Settings > + > Add User-Defined Setting*
and enter *PATH* with the value *$PATH:/usr/local/bin* (or wherever your tools are
located).License
-------ISC license, see the LICENSE file for more details.
Origins
-------Inspired by the initial *iOS-autoconf* scripts of intlres1 and sbooth.