Compiling ffmpeg to support SPEEX decoding - ios

I am trying to compile ffmpeg to support Speex decoding. I have enabled speex decoding using the following flag --enable-libspeex in my shell script. I have also compiled speex 1.2rc1 downloaded from this link. After compiling the header files are available on this path /usr/local/include/speex. Following the above procedure when ffmpeg is compiled to produce support for SPEEX decoding I get the error libspeex not found.
Can anyone help me with this?
Config.log :
BEGIN /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
1 #include <math.h>
2 float foo(float f, float g) { return roundf(f); }
3 int main(void){ return (int) foo; }
END /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
xcrun -sdk iphoneos clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -
DPIC -arch armv7s -mios-version-min=6.0 -mcpu= -std=c99 -fomit-frame-pointer -fPIC -
mthumb -c -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o
/var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
clang: warning: joined argument expects additional value: '-mcpu='
xcrun -sdk iphoneos clang -arch armv7s -mios-version-min=6.0 -Wl,-dynamic,-
search_paths_first -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.vFN4Vpqk
/var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o -lm -lz
check_mathfunc sinf 1
check_ld cc
check_cc
BEGIN /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
1 #include <math.h>
2 float foo(float f, float g) { return sinf(f); }
3 int main(void){ return (int) foo; }
END /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
xcrun -sdk iphoneos clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -
DPIC -arch armv7s -mios-version-min=6.0 -mcpu= -std=c99 -fomit-frame-pointer -fPIC -
mthumb -c -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o
/var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
clang: warning: joined argument expects additional value: '-mcpu='
xcrun -sdk iphoneos clang -arch armv7s -mios-version-min=6.0 -Wl,-dynamic,-
search_paths_first -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.vFN4Vpqk
/var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o -lm -lz
check_mathfunc trunc 1
check_ld cc
check_cc
BEGIN /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
1 #include <math.h>
2 float foo(float f, float g) { return trunc(f); }
3 int main(void){ return (int) foo; }
END /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
xcrun -sdk iphoneos clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -
DPIC -arch armv7s -mios-version-min=6.0 -mcpu= -std=c99 -fomit-frame-pointer -fPIC -
mthumb -c -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o
/var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
clang: warning: joined argument expects additional value: '-mcpu='
xcrun -sdk iphoneos clang -arch armv7s -mios-version-min=6.0 -Wl,-dynamic,- search_paths_first -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.vFN4Vpqk /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o -lm -lz
check_mathfunc truncf 1
check_ld cc
check_cc
BEGIN /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
1 #include <math.h>
2 float foo(float f, float g) { return truncf(f); }
3 int main(void){ return (int) foo; }
END /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
xcrun -sdk iphoneos clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -arch armv7s -mios-version-min=6.0 -mcpu= -std=c99 -fomit-frame-pointer -fPIC -mthumb -c -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
clang: warning: joined argument expects additional value: '-mcpu='
xcrun -sdk iphoneos clang -arch armv7s -mios-version-min=6.0 -Wl,-dynamic,-search_paths_first -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.vFN4Vpqk /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o -lm -lz
check_lib speex/speex.h speex_decoder_init -lspeex
check_header speex/speex.h
check_cpp
BEGIN /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
1 #include <speex/speex.h>
2 int x;
END /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
xcrun -sdk iphoneos clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -arch armv7s -mios-version-min=6.0 -mcpu= -std=c99 -fomit-frame-pointer -fPIC -mthumb -E -o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.8q3GcEO3.o /var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c
clang: warning: joined argument expects additional value: '-mcpu='
/var/folders/5p/cffcbsm954b632yfzq4jrbbw0000gn/T//ffconf.5U5MfgMb.c:1:10: fatal error: 'speex/speex.h' file not found
#include <speex/speex.h>
^
1 error generated.
ERROR: libspeex not found

Either your gcc is not looking in /usr/local/include or your dynamic linker does not have /usr/local/lib in its path.
Recompile speex and pass the --prefix=/usr option to configure.

Related

Does Clang lack CRC32 for ARMv8/Aarch64?

I'm attempting to set-up CI for our Xcode cross-compiles. The cross-compiles test both ARMv7 and ARMv8. Things look good except when it comes time to link for ARMv8:
clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \
-stdlib=libc++ -c cryptlib.cpp
clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \
-stdlib=libc++ -c cpu.cpp
...
clang++ -o cryptest.exe -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \
-stdlib=libc++ test.o bench1.o bench2.o ... ./libcryptopp.a
Undefined symbols for architecture arm64:
"CryptoPP::CRC32_Update_ARMV8(unsigned char const*, unsigned long, unsigned int&)", referenced from:
CryptoPP::CRC32::Update(unsigned char const*, unsigned long) in libcryptopp.a(crc.o)
"CryptoPP::CRC32C_Update_ARMV8(unsigned char const*, unsigned long, unsigned int&)", referenced from:
CryptoPP::CRC32C::Update(unsigned char const*, unsigned long) in libcryptopp.a(crc.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [cryptest.exe] Error 1
We obviously don't run the output artifact cryptest.exe. We just compile and link to test things.
The code has been testing fine under LLVM Clang.
All ARMv8/Aarch64 machines have CRC-32 and CRC-32C; but the Crypto extensions are optional. The error does not make much sense.
Does Clang lack CRC32 for ARMv8/Aarch64?
Below is the code that's causing the errors.
#if defined(__ARM_FEATURE_CRC32)
void CRC32_Update_ARMV8(const uint8_t *s, size_t n, uint32_t& c)
{
for(; !IsAligned<uint32_t>(s) && n > 0; s++, n--)
c = __crc32b(c, *s);
for(; n > 4; s+=4, n-=4)
c = __crc32w(c, *s);
for(; n > 0; s++, n--)
c = __crc32b(c, *s);
}
#endif
Under Xcode 8.3.3, I came across the compile error at __crc32*(). Then I added the command line switch
-march=armv8-a+crc
as found at this link, then the code compiles well. I tested with iphone7+/iOS10.3.1 and it's working.
Note according to ARM's document ("ARMĀ® Architecture Reference Manual
ARMv8, for ARMv8-A architecture profile" DDI0487B_a_armv8_arm.pdf: page A1-58), crc32 instructions are optional for v8 and mandatory for v8.1. When I ran the same program on iphone6+/iOS9.3.3, it crashed at __crc32*(). I also verified it with inline assembler. To avoid the crash, therefore, some kind of run-time check is necessary. I don't fully understand how, but as a last resort, we could use the model names.

"C Compiler not working" While building trying to build VLC in iOS

Here is part of my compilation result:
===============================================================================
You are ready to build VLC and its contribs
make: '.gas' is up to date.
[info] Building contrib for iOS in '/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/iPhoneOS-arm64'
[info] LD FLAGS SELECTED = '-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.1'
/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc
error: invalid deployment target '5.1.0' for architecture 'arm64' (requires
'7.0.0' or later)
1 error generated.
make: Nothing to be done for `fetch'.
error: invalid deployment target '5.1.0' for architecture 'arm64' (requires
'7.0.0' or later)
1 error generated.
sed -i.orig s/-ansi// freetype/builds/unix/configure
cd freetype && GNUMAKE=make CC="xcrun clang" CXX="xcrun clang++" LD="xcrun ld" AR="xcrun ar" CCAS="gas-preprocessor.pl xcrun clang -c" RANLIB="xcrun ranlib" STRIP="xcrun strip" PATH="/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/bin:/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin:/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin:/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include" CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include -g" CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include -g" LDFLAGS="-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.1 -arch arm64 -miphoneos-version-min=5.1 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.1 -L/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/lib" ./configure --without-png --prefix="/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64" --build="arm-apple-darwin11" --host="x86_64-apple-darwin11" --target="x86_64-apple-darwin11" --program-prefix="" --enable-static --disable-shared --disable-dependency-tracking --with-pic
FreeType build system -- automatic system detection
The following settings are used:
platform unix
compiler xcrun clang
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk
If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.
Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).
cd builds/unix; /bin/sh ./configure '--without-png' '--prefix=/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64' '--build=arm-apple-darwin11' '--host=x86_64-apple-darwin11' '--target=x86_64-apple-darwin11' '--program-prefix=' '--enable-static' '--disable-shared' '--disable-dependency-tracking' '--with-pic'
configure: WARNING: unrecognized options: --disable-dependency-tracking
checking build system type... arm-apple-darwin11
checking host system type... x86_64-apple-darwin11
checking for x86_64-apple-darwin11-gcc... xcrun clang
checking whether the C compiler works... no
configure: error: in `/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/iPhoneOS-arm64/freetype/builds/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [setup] Error 77
make: *** [.freetype2] Error 2
===================================================================
I am using guideline provided by VLC
I tried to change the xcrun path in build.sh (ImportedSources/vlc/extras/package/ios/build.sh) but it resets to original once I build the script.
Is there another way I could change this, so that c compiler works for me?
I am stuck on this for the last 9 days, please provide some guidance.
Thanks,
Albin.K.J
The first error is:
error: invalid deployment target '5.1.0' for architecture 'arm64' (requires
'7.0.0' or later)
... so I would suggest trying what it suggests: bumping the deployment target up from 5.1.0 to 7.0.0, or remove arm64 support.
May be wrong compiler path.
Check the CC points to the correct path also it is as expected in the script file.
I also have the same issue, setting CC correctly did the trick for me.
The required compilers are missing from your system. You need both a C++ compiler and a C compiler.
You can install the compilers (GCC and G++) using apt-get install gcc g++.

How to generate link map file for Clang on iOS?

I know for armcc(armlink), I can use -L--map flag to generate a map file. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0474c/BABDJCAA.html
But for clang compiler and linker, I tried all these flags, but none of them can generate link map file:
flag1: xcrun -sdk iphoneos clang -arch armv7s -Wl,-dead_strip -Wl,--map -o exe objtest.o libtest.a
flag2: xcrun -sdk iphoneos clang -arch armv7s -Wl,-dead_strip -Wl,-M -o exe objtest.o libtest.a
flag3: xcrun -sdk iphoneos clang -arch armv7s -Wl,-dead_strip -Wl,-m -o exe objtest.o libtest.a
What's wrong with my flag? Thanks in advance.
Try -Wl,-map,output.map, that should do it.

Can't compile libjpeg-turbo for iOS on Xcode 5 / Clang toolchain with SIMD / NEON support

Looks like with Xcode 5 and the removal of LLVM-GCC-4.2 and its replacement by Clang, building libjpeg-turbo for iOS devices now fails during the compilation of NEON support.
Configure step:
export PLATFORM="iPhoneOS"
export IPHONE_SDK="7.0"
export IPHONE_MIN_VERSION="5.0"
export DEVELOPER=`xcode-select --print-path`
export DEVROOT="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export SDKROOT="${DEVROOT}/SDKs/${PLATFORM}${IPHONE_SDK}.sdk"
export CC=`xcrun -find gcc`
export LD=`xcrun -find ld`
export IOS_CFLAGS="-arch armv7"
export CFLAGS="-O3 ${IOS_CFLAGS} -isysroot ${SDKROOT}"
export LDFLAGS="${IOS_CFLAGS} -isysroot ${SDKROOT}"
export CPPFLAGS="${CFLAGS}"
export CFLAGS="${CFLAGS} -miphoneos-version-min=${IPHONE_MIN_VERSION}"
./configure --with-jpeg8 --host arm-apple-darwin --enable-static --disable-shared
...
checking if we have SIMD optimisations for cpu type... yes (arm)
checking if the assembler is GNU-compatible and can be used... yes
...
Build step:
make -j4
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in java
echo timestamp > classnodist_noinst.stamp
Making all in simd
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -E -I.. -I../simd ./jsimdcfg.inc.h | grep -E "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's#% define#%define#g' > jsimdcfg.inc
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
if /bin/sh ../libtool --mode=compile --tag=CC /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.0 -MT jsimd_arm.lo -MD -MP -MF ".deps/jsimd_arm.Tpo" -c -o jsimd_arm.lo jsimd_arm.c; \
then mv -f ".deps/jsimd_arm.Tpo" ".deps/jsimd_arm.Plo"; else rm -f ".deps/jsimd_arm.Tpo"; exit 1; fi
/bin/sh ../libtool --mode=compile gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.0 -c -o jsimd_arm_neon.lo jsimd_arm_neon.S
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
make[3]: *** [jsimd_arm_neon.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -O3 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.0 -MT jsimd_arm.lo -MD -MP -MF .deps/jsimd_arm.Tpo -c jsimd_arm.c -o jsimd_arm.o
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Any idea how to fix this? The build succeeds if disabling SIMD support but that's obviously not great.
It has been fixed by the maintainer of libjpeg-turbo:
http://sourceforge.net/mailarchive/message.php?msg_id=31902025
What is needed is a special CLANG compatible version of gas-preprocessor:
http://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor/
There is a known issue when cross-compiling for iOS on OSX:
http://sourceforge.net/mailarchive/message.php?msg_id=30462917
In short, you need to run
$ autoreconf -fiv
in the libjpeg-turbo directory before running configure.
On OSX 10.9 and Xcode 5, below are the versions of tools that you will need to compile the lib successfully. Newer versions will not work.
autoconf 2.69
nasm 2.08.01
automake 1.13
Alternatively, you can just use the prebuilt binaries that comes with the DMG:
http://sourceforge.net/mailarchive/forum.php?thread_name=5255ABCE.8070705%40users.sourceforge.net&forum_name=libjpeg-turbo-users

compile XBMC for iOS error with missing binary operator before token "("

I'm compile XBMC for iOS with the following configuration:
$ cd $HOME/XBMC
$ cd tools/depends
$ ./bootstrap
$ ./configure --host=arm-apple-darwin
$ make
I get the following output:
>/bin/sh ../../libtool --tag=CC --mode=compile /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I../.. -I../../include/shairplay -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include -MT libshairplay_la-dnssd.lo -MD -MP -MF .deps/libshairplay_la-dnssd.Tpo -c -o libshairplay_la-dnssd.lo `test -f 'dnssd.c' || echo './'`dnssd.c
libtool: compile: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I../.. -I../../include/shairplay -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include -MT libshairplay_la-dnssd.lo -MD -MP -MF .deps/libshairplay_la-dnssd.Tpo -c dnssd.c -fno-common -DPIC -o .libs/libshairplay_la-dnssd.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/dispatch/dispatch.h:49,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/dns_sd.h:140,
from dnssd.c:62:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/dispatch/base.h:103:44: error: missing binary operator before token "("
make[7]: *** [libshairplay_la-dnssd.lo] Error 1
make[6]: *** [all-recursive] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [iphoneos6.1_armv7-target/src/lib/.libs/libshairplay.so.0.0.0] Error 2
make[1]: *** [libshairplay] Error 2
make: *** [target/.installed-iphoneos6.1_armv7-target] Error 2
I find dispatch.h 49 line in this:
#include <dispatch/base.h>
dns_sd.h 140 line in this:
#if _DNS_SD_LIBDISPATCH
#include <dispatch/dispatch.h>
#endif
base.h 103 line in this:
#if defined(__has_feature) && __has_feature(objc_fixed_enum)
#define DISPATCH_ENUM(name, type, ...) \ typedef enum : type { __VA_ARGS__ } name##_t
#else
#define DISPATCH_ENUM(name, type, ...) \ enum { __VA_ARGS__ }; typedef type name##_t
#endif
base.h 44 line in this:
#define DISPATCH_SENTINEL __attribute__((__sentinel__))
dnssd.c 62 line in this:
#include <dns_sd.h>
#define DNSSD_STDCALL
I don't understand why it is complaining about a binary operator here, is this a XBMC bug?
I'm new to clang, however I managed to fix this issue. Open the file:
dnssd.c
And paste the following code at the top of the file:
#ifndef __has_feature // Optional of course.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef __has_extension
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
It will improve compatibility with some compilers as of Clang Language documentation.

Resources