| 112 | === Supporting multiple architectures (armv6 and armv7) === |
| 113 | |
| 114 | You need to compile separately for each architecture. For armv7, you need to compile using the flags: |
| 115 | |
| 116 | {{{ |
| 117 | export CFLAGS += -march=armv7 -mcpu=arm1176jzf-s -mcpu=cortex-a8 |
| 118 | export LDFLAGS += -march=armv7 -mcpu=arm1176jzf-s -mcpu=cortex-a8 |
| 119 | }}} |
| 120 | |
| 121 | For armv6, you need to compile using the flags: |
| 122 | |
| 123 | {{{ |
| 124 | export CFLAGS += -march=armv6 -mcpu=arm1176jzf-s |
| 125 | export LDFLAGS += -march=armv6 -mcpu=arm1176jzf-s |
| 126 | }}} |
| 127 | |
| 128 | Then you need to combine the resulting libraries using the '''{{{lipo}}}''' command. For example: |
| 129 | |
| 130 | {{{ |
| 131 | lipo -arch armv6 lib/armv6/libpjlib.a -arch armv7 lib/armv7/libpjlib.a -create -output lib/libpjlib.a |
| 132 | }}} |
| 133 | |
| 134 | Another way to build a universal binary (for reference on how to build it on MacOS X, please see [https://trac.pjsip.org/repos/wiki/FAQ#osx-universal the FAQ here]) is to use '''{{{llvm-gcc}}}''' compiler provided in the iPhone SDK. For reference, please see [http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2011-June/013052.html this discussion] in pjsip mailing list. |
| 135 | |