problem compiling ffmpeg for iFrameExtractor - iphone

I'm trying to compile the ffmpeg by using the make and build files in iFrameExtractor example. firstly i tried to follow the readme file on the github, which only says to run the ./build_universal in ffmpeg folder. it did not work
i then tried to follow the info in INSTALL without success. i then tried doing the stuff in INSTALL followed by the ./build_universal which didn't work. All the *.a files that are imported to the project exists until the end of the build sequence. when the lipo commands in build_universal are run, which i guess concat the .a files for the different architectures(?). anyhow these leave the following errors:
lipo: specifed architecture type (armv6) for file (armv6/libavcodec.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libavdevice.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libavformat.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libavutil.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libswscale.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
i can get the project to compile for simulator if i only use ./build_armv7 but if i run the universal the .a files are removed in the end. and only using doesn't work to build for iphone 4 .

After a week of trial and error, I was finally able to create the ffmpeg universal libraries and successfully compile and run iFrameExtractor for the device as well as the simulator.
To compile and run the project on your iPhone device OR simulator:
1) open Terminal
2) clone the repository: git clone git://github.com/lajos/iFrameExtractor.git
3) go to the ffmpeg folder in the project: cd iFrameExtractor/ffmpeg
4) run: ./configure
5) Edit the build scripts (build_armv6, build_armv7, build_i386) as follows:
These scripts assume you are using iOS SDK 5.0 on Xcode 4.2.
build_armv6:
#!/bin/tcsh -f
if (! -d armv6) mkdir armv6
if (! -d lib) mkdir lib
rm armv6/*.a
make clean
./configure \
--disable-bzlib --disable-doc \
--disable-ffmpeg --disable-ffplay \
--disable-ffserver --disable-mmx \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--enable-cross-compile --target-os=darwin \
--arch=arm --cpu=arm1176jzf-s \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk \
--extra-ldflags="-arch armv6 -L//Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system" \
--extra-cflags="-arch armv6"
make
mv libavcodec/libavcodec.a armv6/
mv libavdevice/libavdevice.a armv6/
mv libavformat/libavformat.a armv6/
mv libavutil/libavutil.a armv6/
mv libswscale/libswscale.a armv6/
rm lib/*.a
cp armv6/*.a lib/
build_armv7:
#!/bin/tcsh -f
if (! -d armv7) mkdir armv7
if (! -d lib) mkdir lib
rm armv7/*.a
make clean
./configure \
--disable-bzlib --disable-doc \
--disable-ffmpeg --disable-ffplay \
--disable-ffserver --disable-mmx \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--enable-cross-compile --target-os=darwin \
--arch=arm --cpu=cortex-a8 --enable-pic \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk \
--extra-ldflags="-arch armv7 - L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system" \
--extra-cflags="-arch armv7"
make
mv libavcodec/libavcodec.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/
rm lib/*.a
cp armv7/*.a lib/
build_i386:
#!/bin/tcsh -f
if (! -d i386) mkdir i386
if (! -d lib) mkdir lib
rm i386/*.a
make clean
./configure \
--disable-bzlib --disable-doc \
--disable-ffmpeg --disable-ffplay \
--disable-ffserver --disable-mmx \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk \
--extra-ldflags="-arch i386 -L//Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system" \
--extra-cflags="-arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -O0 -fasm-blocks -Wreturn-type -Wunused-variable -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2"
make
mv libavcodec/libavcodec.a i386/
mv libavdevice/libavdevice.a i386/
mv libavformat/libavformat.a i386/
mv libavutil/libavutil.a i386/
mv libswscale/libswscale.a i386/
rm lib/*.a
cp i386/*.a lib/
6) build the ffmpeg libraries: ./build_universal
7) open the xcode project and run it on your iPhone device or simulator
These steps work perfectly for me. I hope this will help others struggling to get the ffmpeg libraries working for iOS.

i downloaded the latest ffmpeg repository and used the following to compile only for armv6 and armv7. I couldn't get it working for i386, i receive errors that the cputype and subcputype are wrong. apparently the cputype is supposed to be x86 and subcputype should be intel.
anyhow i used the following build scripts to compile for the arm architectures:
build script:
#!/bin/sh
set -e
SCRIPT_DIR=$( (cd -P $(dirname $0) && pwd) )
DIST_DIR_BASE=${DIST_DIR_BASE:="$SCRIPT_DIR/dist"}
if [ -d ffmpeg ]
then
echo "Found ffmpeg source directory, no need to fetch from git..."
else
echo "Fetching ffmpeg from git://git.videolan.org/ffmpeg.git..."
git clone git://git.videolan.org/ffmpeg.git
fi
ARCHS=${ARCHS:-"armv6 armv7"}
for ARCH in $ARCHS
do
FFMPEG_DIR=ffmpeg-$ARCH
if [ -d $FFMPEG_DIR ]
then
echo "Removing old directory $FFMPEG_DIR"
rm -rf $FFMPEG_DIR
fi
echo "Copying source for $ARCH to directory $FFMPEG_DIR"
cp -a ffmpeg $FFMPEG_DIR
cd $FFMPEG_DIR
DIST_DIR=$DIST_DIR_BASE-$ARCH
mkdir -p $DIST_DIR
case $ARCH in
armv6)
EXTRA_FLAGS="--enable-cross-compile --target-os=darwin --arch=arm --cpu=arm1176jzf-s"
EXTRA_CFLAGS="-arch $ARCH"
EXTRA_LDFLAGS="-arch $ARCH"
;;
armv7)
EXTRA_FLAGS="--enable-cross-compile --target-os=darwin --arch=arm --cpu=cortex-a8 --enable-pic"
EXTRA_CFLAGS="-arch $ARCH"
EXTRA_LDFLAGS="-arch $ARCH"
;;
x86_64)
EXTRA_CC_FLAGS="-mdynamic-no-pic"
;;
esac
echo "Configuring ffmpeg for $ARCH..."
./configure \
--prefix=$DIST_DIR \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--disable-bzlib \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--extra-ldflags="$EXTRA_LDFLAGS" \
--extra-cflags="$EXTRA_CFLAGS" \
$EXTRA_FLAGS
echo "Installing ffmpeg for $ARCH..."
make && make install
cd $SCRIPT_DIR
if [ -d $DIST_DIR/bin ]
then
rm -rf $DIST_DIR/bin
fi
if [ -d $DIST_DIR/share ]
then
rm -rf $DIST_DIR/share
fi
done
and combine libs script:
#!/bin/bash
set -e
ARCHS="armv6 armv7"
for ARCH in $ARCHS
do
if [ -d dist-$ARCH ]
then
MAIN_ARCH=$ARCH
fi
done
if [ -z "$MAIN_ARCH" ]
then
echo "Please compile an architecture"
exit 1
fi
OUTPUT_DIR="dist-uarch"
rm -rf $OUTPUT_DIR
mkdir -p $OUTPUT_DIR/lib $OUTPUT_DIR/include
for LIB in dist-$MAIN_ARCH/lib/*.a
do
LIB=`basename $LIB`
LIPO_CREATE=""
for ARCH in $ARCHS
do
if [ -d dist-$ARCH ]
then
LIPO_CREATE="$LIPO_CREATE-arch $ARCH dist-$ARCH/lib/$LIB "
fi
done
OUTPUT="$OUTPUT_DIR/lib/$LIB"
echo "Creating: $OUTPUT"
lipo -create $LIPO_CREATE -output $OUTPUT
lipo -info $OUTPUT
done
echo "Copying headers from dist-$MAIN_ARCH..."
cp -R dist-$MAIN_ARCH/include/* $OUTPUT_DIR/include
then i import the .a files from BUILD-FOLDER/dist-uarch and it builds in xcode like a charm!

building FFMPEG for iOS 5.1
hope this will help you to build latest FFMPEG for iOS 5.1
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./build_universal
note: you have to create build_* scripts first, to do this see code below
script for ARMV7 - create file build_armv7
#!/bin/tcsh -f
if (! -d armv7) mkdir armv7
if (! -d lib) mkdir lib
rm armv7/*.a
make clean
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' --enable-pic
make
mv libavcodec/libavcodec.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/
rm lib/*.a
cp armv7/*.a lib/
script for ARMV6 - create file build_armv6
#!/bin/tcsh -f
if (! -d armv6) mkdir armv6
if (! -d lib) mkdir lib
rm armv6/*.a
make clean
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk --cpu=arm1176jzf-s --extra-cflags='-arch armv6' --extra-ldflags='-arch armv6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk'
make
mv libavcodec/libavcodec.a armv6/
mv libavdevice/libavdevice.a armv6/
mv libavformat/libavformat.a armv6/
mv libavutil/libavutil.a armv6/
mv libswscale/libswscale.a armv6/
rm lib/*.a
cp armv6/*.a lib/
script for simulator - create file build_i386
#!/bin/tcsh -f
if (! -d i386) mkdir i386
if (! -d lib) mkdir lib
rm i386/*.a
make clean
./configure \
--disable-bzlib --disable-doc \
--disable-ffmpeg --disable-ffplay \
--disable-ffserver --disable-mmx \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk \
--extra-ldflags="-arch i386 -L//Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/lib/system" \
--extra-cflags="-arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -O0 -fasm-blocks -Wreturn-type -Wunused-variable -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2"
make
mv libavcodec/libavcodec.a i386/
mv libavdevice/libavdevice.a i386/
mv libavformat/libavformat.a i386/
mv libavutil/libavutil.a i386/
mv libswscale/libswscale.a i386/
rm lib/*.a
cp i386/*.a lib/
script for universal build (will merge libraries into one universal) - create file build_universal
#!/bin/tcsh -f
source ./build_armv6
source ./build_armv7
source ./build_i386
if (! -d universal) mkdir universal
if (! -d lib) mkdir lib
rm universal/*.a
lipo -create -arch armv6 armv6/libavcodec.a -arch armv7 armv7/libavcodec.a -arch i386 i386/libavcodec.a -output universal/libavcodec.a
lipo -create -arch armv6 armv6/libavdevice.a -arch armv7 armv7/libavdevice.a -arch i386 i386/libavdevice.a -output universal/libavdevice.a
lipo -create -arch armv6 armv6/libavformat.a -arch armv7 armv7/libavformat.a -arch i386 i386/libavformat.a -output universal/libavformat.a
lipo -create -arch armv6 armv6/libavutil.a -arch armv7 armv7/libavutil.a -arch i386 i386/libavutil.a -output universal/libavutil.a
lipo -create -arch armv6 armv6/libswscale.a -arch armv7 armv7/libswscale.a -arch i386 i386/libswscale.a -output universal/libswscale.a
rm lib/*.a
cp universal/*.a lib/

Related

libapreq2: libtool: link: CURRENT `' must be a nonnegative integer

When I try to install libapreq2, I get the error:
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `:0:8' is not valid version information
How do I resolve it?
bash-3.2$ wget http://search.cpan.org/CPAN/authors/id/I/IS/ISAAC/libapreq2-2.13.tar.gz
bash-3.2$ tar xvf libapreq2-2.13.tar.gz
bash-3.2$ ./configure --enable-perl-glue --with-apache2-apxs=/install/others/apache2/bin/apxs --prefix=/install/others --with-apache2-src=/install/others/httpd-2.2.25 --with-apache2-httpd=/install/others/apache2/bin/httpd --with-apr-config=/install/others/httpd-2.2.25/srclib/apr/apr-1-config --with-apu-config=/install/others/httpd-2.2.25/srclib/apr-util/apu-1-config
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
........
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for ranlib... (cached) ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for /install/others/httpd-2.2.25/include/httpd.h... yes
checking for /install/others/httpd-2.2.25/srclib/apr/apr-1-config... yes
checking for /install/others/httpd-2.2.25/srclib/apr-util/apu-1-config... yes
checking for perl... perl
checking for ExtUtils::XSBuilder... yes
checking for mod_perl2... yes
checking for Apache::Test... yes
checking for ExtUtils::MakeMaker... yes
setting APR_INCLUDES to " -I/install/others/httpd-2.2.25/srclib/apr/include "
adding "-I/install/others/httpd-2.2.25/srclib/apr-util/include" to APR_INCLUDES
adding "-I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib" to APR_INCLUDES
setting APR_LTFLAGS to " /install/others/httpd-2.2.25/srclib/apr/libapr-1.la"
adding "/install/others/httpd-2.2.25/srclib/apr-util/libaprutil-1.la" to APR_LTFLAGS
setting APR_LIBS to " -luuid -lrt -lcrypt -lpthread -ldl"
adding "/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la" to APR_LIBS
setting APR_LDFLAGS to " -L/install/others/httpd-2.2.25/srclib/apr-util -laprutil-1 "
adding "-L/install/others/httpd-2.2.25/srclib/apr" to APR_LDFLAGS
adding "-lapr-1" to APR_LDFLAGS
setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
expr: syntax error
libapreq2 Version: 2.8.0
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating library/Makefile
config.status: creating library/t/Makefile
config.status: creating module/Makefile
config.status: creating module/apache2/Makefile
config.status: creating glue/Makefile
config.status: creating build/doxygen.conf
config.status: creating include/groups.dox
config.status: creating apreq2-config
config.status: creating include/apreq_config.h
config.status: executing depfiles commands
bash-3.2$
bash-3.2$
bash-3.2$
bash-3.2$ make
Making all in .
make[1]: Entering directory `/install/others/libapreq2-2.13'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/install/others/libapreq2-2.13'
Making all in include
make[1]: Entering directory `/install/others/libapreq2-2.13/include'
make all-am
make[2]: Entering directory `/install/others/libapreq2-2.13/include'
make[2]: Leaving directory `/install/others/libapreq2-2.13/include'
make[1]: Leaving directory `/install/others/libapreq2-2.13/include'
Making all in library
make[1]: Entering directory `/install/others/libapreq2-2.13/library'
make all-am
make[2]: Entering directory `/install/others/libapreq2-2.13/library'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c -o util.lo util.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c util.c -fPIC -DPIC -o .libs/util.o
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c util.c -o util.o >/dev/null 2>&1
.........
mv -f .deps/module_cgi.Tpo .deps/module_cgi.Plo
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c -o error.lo error.c
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -fPIC -DPIC -o .libs/error.o
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o >/dev/null 2>&1
mv -f .deps/error.Tpo .deps/error.Plo
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -version-info :0:8 /install/others/httpd-2.2.25/srclib/apr/libapr-1.la /install/others/httpd-2.2.25/srclib/apr-util/libaprutil-1.la -luuid -lrt -lcrypt -lpthread -ldl /install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la -o libapreq2.la -rpath /install/others/lib util.lo version.lo cookie.lo param.lo parser.lo parser_urlencoded.lo parser_header.lo parser_multipart.lo module.lo module_custom.lo module_cgi.lo error.lo
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `:0:8' is not valid version information
make[2]: *** [libapreq2.la] Error 1
make[2]: Leaving directory `/install/others/libapreq2-2.13/library'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/install/others/libapreq2-2.13/library'
make: *** [all-recursive] Error 1
bash-3.2$
bash-3.2$
bash-3.2$ make install
Making install in .
make[1]: Entering directory `/install/others/libapreq2-2.13'
make[2]: Entering directory `/install/others/libapreq2-2.13'
test -z "/install/others/bin" || /bin/mkdir -p "/install/others/bin"
/usr/bin/install -c 'apreq2-config' '/install/others/bin/apreq2-config'
cd /install/others/httpd-2.2.25; make install
make[3]: Entering directory `/install/others/httpd-2.2.25'
Making install in srclib
make[4]: Entering directory `/install/others/httpd-2.2.25/srclib'
Making install in apr
make[5]: Entering directory `/install/others/httpd-2.2.25/srclib/apr'
make[6]: Entering directory `/install/others/httpd-2.2.25/srclib/apr'
make[6]: Nothing to be done for `local-all'.
make[6]: Leaving directory `/install/others/httpd-2.2.25/srclib/apr'
/install/others/httpd-2.2.25/srclib/apr/build/mkdir.sh /install/others/apache2/lib /install/others/apache2/bin /install/others/apache2/build \
/install/others/apache2/lib/pkgconfig /install/others/apache2/include
/usr/bin/install -c -m 644 /install/others/httpd-2.2.25/srclib/apr/include/apr.h /install/others/apache2/include
for f in /install/others/httpd-2.2.25/srclib/apr/include/apr_*.h; do \
/usr/bin/install -c -m 644 ${f} /install/others/apache2/include; \
done
/bin/sh /install/others/httpd-2.2.25/srclib/apr/libtool --mode=install /usr/bin/install -c -m 755 libapr-1.la /install/others/apache2/lib
/usr/bin/install -c -m 755 .libs/libapr-1.so.0.4.8 /install/others/apache2/lib/libapr-1.so.0.4.8
(cd /install/others/apache2/lib && { ln -s -f libapr-1.so.0.4.8 libapr-1.so.0 || { rm -f libapr-1.so.0 && ln -s libapr-1.so.0.4.8 libapr-1.so.0; }; })
(cd /install/others/apache2/lib && { ln -s -f libapr-1.so.0.4.8 libapr-1.so || { rm -f libapr-1.so && ln -s libapr-1.so.0.4.8 libapr-1.so; }; })
/usr/bin/install -c -m 755 .libs/libapr-1.lai /install/others/apache2/lib/libapr-1.la
/usr/bin/install -c -m 755 .libs/libapr-1.a /install/others/apache2/lib/libapr-1.a
chmod 644 /install/others/apache2/lib/libapr-1.a
ranlib /install/others/apache2/lib/libapr-1.a
PATH="$PATH:/sbin" ldconfig -n /install/others/apache2/lib
----------------------------------------------------------------------
Libraries have been installed in:
/install/others/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /install/others/apache2/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /install/others/apache2/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /install/others/apache2/build; fi; \
done
/usr/bin/install -c -m 755 /install/others/httpd-2.2.25/srclib/apr/build/mkdir.sh /install/others/apache2/build
for f in make_exports.awk make_var_export.awk; do \
/usr/bin/install -c -m 644 /install/others/httpd-2.2.25/srclib/apr/build/${f} /install/others/apache2/build; \
done
.............
/usr/bin/install -c .libs/libexpat.lai /install/others/apache2/lib/libexpat.la
/usr/bin/install -c .libs/libexpat.a /install/others/apache2/lib/libexpat.a
chmod 644 /install/others/apache2/lib/libexpat.a
ranlib /install/others/apache2/lib/libexpat.a
PATH="$PATH:/sbin" ldconfig -n /install/others/apache2/lib
----------------------------------------------------------------------
Libraries have been installed in:
/install/others/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 ./lib/expat.h /install/others/apache2/include
make[6]: Leaving directory `/install/others/httpd-2.2.25/srclib/apr-util/xml/expat'
/bin/sh /install/others/httpd-2.2.25/srclib/apr/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /install/others/apache2/lib
libtool: install: warning: relinking `libaprutil-1.la'
(cd /install/others/httpd-2.2.25/srclib/apr-util; /bin/sh /install/others/httpd-2.2.25/srclib/apr/libtool --silent --mode=relink gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/include/private -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -version-info 5:2:5 -o libaprutil-1.la -rpath /install/others/apache2/lib buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo -luuid -lrt -lcrypt -lpthread -ldl /install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la /install/others/httpd-2.2.25/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl )
/usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.5.2T /install/others/apache2/lib/libaprutil-1.so.0.5.2
(cd /install/others/apache2/lib && { ln -s -f libaprutil-1.so.0.5.2 libaprutil-1.so.0 || { rm -f libaprutil-1.so.0 && ln -s libaprutil-1.so.0.5.2 libaprutil-1.so.0; }; })
(cd /install/others/apache2/lib && { ln -s -f libaprutil-1.so.0.5.2 libaprutil-1.so || { rm -f libaprutil-1.so && ln -s libaprutil-1.so.0.5.2 libaprutil-1.so; }; })
/usr/bin/install -c -m 755 .libs/libaprutil-1.lai /install/others/apache2/lib/libaprutil-1.la
/usr/bin/install -c -m 755 .libs/libaprutil-1.a /install/others/apache2/lib/libaprutil-1.a
chmod 644 /install/others/apache2/lib/libaprutil-1.a
ranlib /install/others/apache2/lib/libaprutil-1.a
PATH="$PATH:/sbin" ldconfig -n /install/others/apache2/lib
----------------------------------------------------------------------
Libraries have been installed in:
/install/others/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 aprutil.exp /install/others/apache2/lib
/usr/bin/install -c -m 755 apu-config.out /install/others/apache2/bin/apu-1-config
make[5]: Leaving directory `/install/others/httpd-2.2.25/srclib/apr-util'
Making install in pcre
make[5]: Entering directory `/install/others/httpd-2.2.25/srclib/pcre'
make[6]: Entering directory `/install/others/httpd-2.2.25/srclib/pcre'
make[6]: Leaving directory `/install/others/httpd-2.2.25/srclib/pcre'
make[5]: Leaving directory `/install/others/httpd-2.2.25/srclib/pcre'
..................
Making install in support
make[4]: Entering directory `/install/others/httpd-2.2.25/support'
make[5]: Entering directory `/install/others/httpd-2.2.25/support'
make[5]: Leaving directory `/install/others/httpd-2.2.25/support'
make[4]: Leaving directory `/install/others/httpd-2.2.25/support'
make[4]: Entering directory `/install/others/httpd-2.2.25'
Installing configuration files
[PRESERVING EXISTING HTDOCS SUBDIR: /install/others/apache2/htdocs]
[PRESERVING EXISTING ERROR SUBDIR: /install/others/apache2/error]
[PRESERVING EXISTING ICONS SUBDIR: /install/others/apache2/icons]
[PRESERVING EXISTING CGI SUBDIR: /install/others/apache2/cgi-bin]
Installing header files
Installing build system files
Installing man pages and online manual
make[4]: Leaving directory `/install/others/httpd-2.2.25'
make[3]: Leaving directory `/install/others/httpd-2.2.25'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/install/others/libapreq2-2.13'
make[1]: Leaving directory `/install/others/libapreq2-2.13'
Making install in include
make[1]: Entering directory `/install/others/libapreq2-2.13/include'
make[2]: Entering directory `/install/others/libapreq2-2.13/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/install/others/include/apreq2" || /bin/mkdir -p "/install/others/include/apreq2"
/usr/bin/install -c -m 644 'apreq.h' '/install/others/include/apreq2/apreq.h'
/usr/bin/install -c -m 644 'apreq_cookie.h' '/install/others/include/apreq2/apreq_cookie.h'
/usr/bin/install -c -m 644 'apreq_error.h' '/install/others/include/apreq2/apreq_error.h'
/usr/bin/install -c -m 644 'apreq_module.h' '/install/others/include/apreq2/apreq_module.h'
/usr/bin/install -c -m 644 'apreq_param.h' '/install/others/include/apreq2/apreq_param.h'
/usr/bin/install -c -m 644 'apreq_parser.h' '/install/others/include/apreq2/apreq_parser.h'
/usr/bin/install -c -m 644 'apreq_util.h' '/install/others/include/apreq2/apreq_util.h'
/usr/bin/install -c -m 644 'apreq_version.h' '/install/others/include/apreq2/apreq_version.h'
make[2]: Leaving directory `/install/others/libapreq2-2.13/include'
make[1]: Leaving directory `/install/others/libapreq2-2.13/include'
Making install in library
make[1]: Entering directory `/install/others/libapreq2-2.13/library'
make install-am
make[2]: Entering directory `/install/others/libapreq2-2.13/library'
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -version-info :0:8 /install/others/httpd-2.2.25/srclib/apr/libapr-1.la /install/others/httpd-2.2.25/srclib/apr-util/libaprutil-1.la -luuid -lrt -lcrypt -lpthread -ldl /install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la -o libapreq2.la -rpath /install/others/lib util.lo version.lo cookie.lo param.lo parser.lo parser_urlencoded.lo parser_header.lo parser_multipart.lo module.lo module_custom.lo module_cgi.lo error.lo
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `:0:8' is not valid version information
make[2]: *** [libapreq2.la] Error 1
make[2]: Leaving directory `/install/others/libapreq2-2.13/library'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/install/others/libapreq2-2.13/library'
make: *** [install-recursive] Error 1
Note: I don't have root access. I am installing in home directory /install/others. The server is RedHat Linux.
Here is a success story: http://www.perlmonks.org/?node_id=660325
### change the path accordingly
./configure --enable-shared --with-gnu-ld --enable-perl-glue --with-perl=/usr/bin/perl --with-apache2-apxs=/usr/sbin/apxs --with-httpd=/usr/sbin/httpd
/sbin/ldconfig /usr/lib
Other solution is to use perlbrew or local::lib and install a local perl in you home, then you maybe able to install it with cpanm.

Getting LibCurl to work on iOs...

Does anyone have any experience getting LibCurl working on iPhone OS? Any Tutorials or sample code available for getting understand all thing related to cURL for iOS Development.
You can find a sample application and static libaries at:
http://seiryu.home.comcast.net/~seiryu/libcurl-ios.html
i wasn't able to build a working xcode project to compile my own framework, so i wrote a bash script
CurlVersion="7.29.0"
export IPHONEOS_DEPLOYMENT_TARGET="4.3"
otherBuildFlags="--with-darwinssl"
rm -rf results
rm -rf Products/libcurl.framework/Versions/$CurlVersion
mkdir -p results/iOS
mkdir -p results/Sim
make clean
export CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2"
export CFLAGS="-arch armv7 -arch armv7s -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk"
export LDFLAGS="-arch armv7 -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk"
./configure --disable-shared --enable-static --disable-dependency-tracking --host="armv7-apple-darwin" --host="armv7s-apple-darwin" $otherBuildFlags
make -j `sysctl -n hw.logicalcpu_max`
cp lib/.libs/* results/iOS/
make clean
export CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2"
export CFLAGS="-arch i386 -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk"
export CPPFLAGS="-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IPHONEOS_DEPLOYMENT_TARGET%%.*}0000"
export LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk"
./configure --disable-shared --enable-static --host="i386-apple-darwin" $otherBuildFlags
make -j `sysctl -n hw.logicalcpu_max`
cp lib/.libs/* results/Sim/
lipo -create results/iOS/libcurl.a results/Sim/libcurl.a -output results/libcurl.a
mkdir -p Products/libcurl.framework/Versions/$CurlVersion/Headers
mkdir -p Products/libcurl.framework/Versions/$CurlVersion/Resources
cp include/curl/*.h Products/libcurl.framework/Versions/$CurlVersion/Headers/
cp results/libcurl.a Products/libcurl.framework/Versions/$CurlVersion/
cd Products/libcurl.framework/Versions/
ln -fs $CurlVersion Current
cd ..
ln -fs Versions/Current/libcurl.a libcurl
ln -fs Versions/Current/Headers .
ln -fs Versions/Current/Resources .

ffmpeg on iOS 5.1 Undefined Symbols Error

So I've spent several hours now working through the scant amount of information available online about building ffmpeg for iOS. The building process seems to work well and I end up with fat files for armv6 and armv7 which I drag over into my project.
However, whenever I try to use the "avcodec_init()" command I get the following error:
Undefined symbols for architecture armv7:
"_avcodec_init", referenced from:
-[FirstViewController viewDidLoad] in FirstViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The library files are included in the 'Link Binary with Libraries' of the project settings, so they are definitely compiled into the app. I just can't for the life of me work out why I'm getting an error on this.
I've tried several different projects, and downloaded some existing project files from the web and get the same error.
This is the build script I used:
export PLATFORM="iPhoneOS" export MIN_VERSION="4.0" export
MAX_VERSION="5.1" export
DEVROOT=/Volumes/Lion/Applications/Xcode.app/Contents/Developer/Platforms/${PLATFORM}.platform/Developer
export SDKROOT=$DEVROOT/SDKs/${PLATFORM}${MAX_VERSION}.sdk export
CC=$DEVROOT/usr/bin/llvm-gcc export LD=$DEVROOT/usr/bin/ld export
CPP=$DEVROOT/usr/bin/cpp export CXX=$DEVROOT/usr/bin/llvm-g++ export
AR=$DEVROOT/usr/bin/ar export LIBTOOL=$DEVROOT/usr/bin/libtool export
NM=$DEVROOT/usr/bin/nm export CXXCPP=$DEVROOT/usr/bin/cpp export
RANLIB=$DEVROOT/usr/bin/ranlib
COMMONFLAGS="-pipe -gdwarf-2 -no-cpp-precomp -isysroot ${SDKROOT}
-marm -fPIC" export LDFLAGS="${COMMONFLAGS} -fPIC" export CFLAGS="${COMMONFLAGS} -fvisibility=hidden" export
CXXFLAGS="${COMMONFLAGS} -fvisibility=hidden
-fvisibility-inlines-hidden"
FFMPEG_LIBS="libavcodec libavdevice libavformat libavutil libswscale"
echo "Building armv6..."
make clean ./configure \
--cpu=arm1176jzf-s \
--extra-cflags='-arch armv6 -miphoneos-version-min=${MIN_VERSION} -mthumb' \
--extra-ldflags='-arch armv6 -miphoneos-version-min=${MIN_VERSION}' \
--enable-cross-compile \
--arch=arm \
--target-os=darwin \
--cc=${CC} \
--sysroot=${SDKROOT} \
--prefix=installed \
--disable-network \
--disable-decoders \
--disable-muxers \
--disable-demuxers \
--disable-devices \
--disable-parsers \
--disable-encoders \
--disable-protocols \
--disable-filters \
--disable-bsfs \
--enable-decoder=h264 \
--enable-decoder=svq3 \
--enable-gpl \
--enable-pic \
--disable-doc perl -pi -e 's/HAVE_INLINE_ASM 1/HAVE_INLINE_ASM 0/' config.h make -j3
mkdir -p build.armv6 for i in ${FFMPEG_LIBS}; do cp ./$i/$i.a
./build.armv6/; done
echo "Building armv7..."
make clean ./configure \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7 -miphoneos-version-min=${MIN_VERSION} -mthumb' \
--extra-ldflags='-arch armv7 -miphoneos-version-min=${MIN_VERSION}' \
--enable-cross-compile \
--arch=arm \
--target-os=darwin \
--cc=${CC} \
--sysroot=${SDKROOT} \
--prefix=installed \
--disable-network \
--disable-decoders \
--disable-muxers \
--disable-demuxers \
--disable-devices \
--disable-parsers \
--disable-encoders \
--disable-protocols \
--disable-filters \
--disable-bsfs \
--enable-decoder=h264 \
--enable-decoder=svq3 \
--enable-gpl \
--enable-pic \
--disable-doc perl -pi -e 's/HAVE_INLINE_ASM 1/HAVE_INLINE_ASM 0/' config.h make -j3
mkdir -p build.armv7 for i in ${FFMPEG_LIBS}; do cp ./$i/$i.a
./build.armv7/; done
mkdir -p build.universal for i in ${FFMPEG_LIBS}; do lipo -create
./build.armv7/$i.a ./build.armv6/$i.a -output ./build.universal/$i.a;
done
for i in ${FFMPEG_LIBS}; do cp ./build.universal/$i.a ./$i/$i.a; done
make install
I haven't used ffmpeg yet (even though a number of my bosses have had me thinking about using it), but lemme suggest a couple things that could be happening here.
1)
Let's see if the symbol really exists in your compiled library.
Go to Terminal and "cd" to the directory where your .a library lives.
Then type in "nm -arch armv7 ffmpeg.a | egrep avcodec_init" (where you can replace ffmpeg.a in my sample command with the actual name of the .a library) all on one line. That dumps out the symbols in the library for the armv7 architecture and pipes it into grep, which should show you if avcodec_init really does exist in your library.
If it doesn't appear, then it didn't get compiled into your library.
2)
If the symbol does exist in your library, then make sure the path to your .a file is correct in your project. You may be accidentally only including a simulator-only (i386 architecture) version of ffmpeg.

fail building ffmpeg for armv6-7

I've been trying to build ffmpeg in every possible way I can think of. I'm trying with the latest revision from their git repository and with a build script which I have confirmation that it works, it's from this question: iPhone SDK 4.3 libav compiling problem. The script was updated yesterday and apparently works for the guy in the question.
my problem is that it doesn't generate the .a files (or actually any files) for armv6 anc armv7. and therefor the lipo commands, to concat into universal libs, fail. I've also tried using the build scripts from iFrameExtractor without any success it also fails with the lipo-commands in the end, i get the following:
lipo: can't open input file: ./compiled/armv6/lib/libavcodec.a (No such file or directory)
lipo: can't open input file: ./compiled/armv6/lib/libavdevice.a (No such file or directory)
lipo: can't open input file: ./compiled/armv6/lib/libavfilter.a (No such file or directory)
lipo: can't open input file: ./compiled/armv6/lib/libavformat.a (No such file or directory)
lipo: can't open input file: ./compiled/armv6/lib/libavutil.a (No such file or directory)
lipo: can't open input file: ./compiled/armv6/lib/libpostproc.a (No such file or directory)
lipo: can't open input file: ./compiled/armv6/lib/libswscale.a (No such file or directory)
and i have also posted the entire output here if anyone has any idea what to look for there (because i don't know where to start, it almost 5000 lines of output.)
i should also mention that i'm compiling it for armv6, armv7 and i386. I want to import it in XCode to get H.264 frames from video feed.
when i try to build for armv6 i use the following configure:
./configure \
--enable-cross-compile \
--arch=arm \
--extra-cflags='-arch armv6' \
--extra-ldflags='-arch armv6' \
--target-os=darwin \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--cpu=arm1176jzf-s \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
--prefix=compiled/armv6
and get the following output:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
so the question, what c compiler should I use? i've tried different:
arm-apple-darwin10-gcc-4.2.1
arm-apple-darwin10-llvm-gcc-4.2
gcc
but with the same result. gcc works for both i386 and armv7 so i guess it should work for armv6 aswell
i used the following to compile only for armv6 and armv7. I couldn't get it working for i386, i receive errors that the cputype and subcputype are wrong. apparently the cputype is supposed to be x86 and subcputype should be intel.
anyhow i used the following build scripts to compile (i ended up using gcc and it worked, it was the configure flags that were wrong from the beginning i guess) for the arm architectures:
build script:
#!/bin/sh
set -e
SCRIPT_DIR=$( (cd -P $(dirname $0) && pwd) )
DIST_DIR_BASE=${DIST_DIR_BASE:="$SCRIPT_DIR/dist"}
if [ -d ffmpeg ]
then
echo "Found ffmpeg source directory, no need to fetch from git..."
else
echo "Fetching ffmpeg from git://git.videolan.org/ffmpeg.git..."
git clone git://git.videolan.org/ffmpeg.git
fi
ARCHS=${ARCHS:-"armv6 armv7"}
for ARCH in $ARCHS
do
FFMPEG_DIR=ffmpeg-$ARCH
if [ -d $FFMPEG_DIR ]
then
echo "Removing old directory $FFMPEG_DIR"
rm -rf $FFMPEG_DIR
fi
echo "Copying source for $ARCH to directory $FFMPEG_DIR"
cp -a ffmpeg $FFMPEG_DIR
cd $FFMPEG_DIR
DIST_DIR=$DIST_DIR_BASE-$ARCH
mkdir -p $DIST_DIR
case $ARCH in
armv6)
EXTRA_FLAGS="--enable-cross-compile --target-os=darwin --arch=arm --cpu=arm1176jzf-s"
EXTRA_CFLAGS="-arch $ARCH"
EXTRA_LDFLAGS="-arch $ARCH"
;;
armv7)
EXTRA_FLAGS="--enable-cross-compile --target-os=darwin --arch=arm --cpu=cortex-a8 --enable-pic"
EXTRA_CFLAGS="-arch $ARCH"
EXTRA_LDFLAGS="-arch $ARCH"
;;
x86_64)
EXTRA_CC_FLAGS="-mdynamic-no-pic"
;;
esac
echo "Configuring ffmpeg for $ARCH..."
./configure \
--prefix=$DIST_DIR \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--disable-bzlib \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--extra-ldflags="$EXTRA_LDFLAGS" \
--extra-cflags="$EXTRA_CFLAGS" \
$EXTRA_FLAGS
echo "Installing ffmpeg for $ARCH..."
make && make install
cd $SCRIPT_DIR
if [ -d $DIST_DIR/bin ]
then
rm -rf $DIST_DIR/bin
fi
if [ -d $DIST_DIR/share ]
then
rm -rf $DIST_DIR/share
fi
done
and combine libs script:
#!/bin/bash
set -e
ARCHS="armv6 armv7"
for ARCH in $ARCHS
do
if [ -d dist-$ARCH ]
then
MAIN_ARCH=$ARCH
fi
done
if [ -z "$MAIN_ARCH" ]
then
echo "Please compile an architecture"
exit 1
fi
OUTPUT_DIR="dist-uarch"
rm -rf $OUTPUT_DIR
mkdir -p $OUTPUT_DIR/lib $OUTPUT_DIR/include
for LIB in dist-$MAIN_ARCH/lib/*.a
do
LIB=`basename $LIB`
LIPO_CREATE=""
for ARCH in $ARCHS
do
if [ -d dist-$ARCH ]
then
LIPO_CREATE="$LIPO_CREATE-arch $ARCH dist-$ARCH/lib/$LIB "
fi
done
OUTPUT="$OUTPUT_DIR/lib/$LIB"
echo "Creating: $OUTPUT"
lipo -create $LIPO_CREATE -output $OUTPUT
lipo -info $OUTPUT
done
echo "Copying headers from dist-$MAIN_ARCH..."
cp -R dist-$MAIN_ARCH/include/* $OUTPUT_DIR/include
then i import the .a files from BUILD-FOLDER/dist-uarch and it builds in xcode like a charm!

iPhone SDK 4.3 libav compiling problem

I faced with strange problem. I installed iPhone SDK 4.3 and xCode 4 and now I can't compile libav from ffmpeg for ARMv6 architecture. This is my script to compile it (it works fine for iPhone SDK 4.2):
./configure \
--disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile \
--enable-encoder=rawvideo \
--enable-decoder=h264 \
--enable-decoder=mpeg4 \
--enable-encoder=mjpeg \
--enable-muxer=rawvideo \
--enable-demuxer=h264 \
--enable-parser=h264 \
--enable-cross-compile \
--arch=c \
--target-os=darwin \
--enable-libopencore-amrnb --enable-libopencore-amrwb \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 \
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer /usr/bin/arm-apple-darwin10-gcc-4.2.1' \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--cpu=arm1176jzf-s --extra-cflags='-arch armv6' --extra-ldflags='-arch armv6'
make clean
make
as a result I get library files but when I check it with lipo -info command it shows that library was compiled for i386 architecture.
Maybe somebody faced with such problem? Help me please.
Thanks.
Updated Post
Here is an updated script that removes armv6, adds armv7s, uses the iOS 6.0 SDK, and fixes issues with changes to the lipo tool. Make sure you have the latest gas-preprocessor.pl from github in /usr/local/bin:
rm -r ./compiled
# configure for armv7 build
./configure \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7' \
--extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' \
--prefix=compiled/armv7 \
--enable-pic \
--enable-neon \
--enable-cross-compile \
--enable-optimizations \
--disable-debug \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-armvfp \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
# build for armv7
make clean
make && make install
# configure for armv7s build
./configure \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7s' \
--extra-ldflags='-arch armv7s' \
--extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' \
--prefix=compiled/armv7s \
--enable-pic \
--enable-neon \
--enable-cross-compile \
--enable-optimizations \
--disable-debug \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-armvfp \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
# build for armv7s
make clean
make && make install
# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-mmx \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-armvfp \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
# build for i386
make clean
make && make install
# make fat (universal) libs
mkdir -p ./compiled/fat/lib
lipo -output ./compiled/fat/lib/libavcodec.a -create \
./compiled/armv7s/lib/libavcodec.a \
./compiled/armv7/lib/libavcodec.a \
./compiled/i386/lib/libavcodec.a
lipo -output ./compiled/fat/lib/libavdevice.a -create \
./compiled/armv7s/lib/libavdevice.a \
./compiled/armv7/lib/libavdevice.a \
./compiled/i386/lib/libavdevice.a
lipo -output ./compiled/fat/lib/libavfilter.a -create \
./compiled/armv7s/lib/libavfilter.a \
./compiled/armv7/lib/libavfilter.a \
./compiled/i386/lib/libavfilter.a
lipo -output ./compiled/fat/lib/libavformat.a -create \
./compiled/armv7s/lib/libavformat.a \
./compiled/armv7/lib/libavformat.a \
./compiled/i386/lib/libavformat.a
lipo -output ./compiled/fat/lib/libavutil.a -create \
./compiled/armv7s/lib/libavutil.a \
./compiled/armv7/lib/libavutil.a \
./compiled/i386/lib/libavutil.a
lipo -output ./compiled/fat/lib/libswresample.a -create \
./compiled/armv7s/lib/libswresample.a \
./compiled/armv7/lib/libswresample.a \
./compiled/i386/lib/libswresample.a
lipo -output ./compiled/fat/lib/libswscale.a -create \
./compiled/armv7s/lib/libswscale.a \
./compiled/armv7/lib/libswscale.a \
./compiled/i386/lib/libswscale.a
Original Post
This will build ffmpeg static libraries for armv6, armv7, and i386 architectures and combine them into fat (universal) files for iOS 4.3 (iPhoneOS4.3 and iPhoneSimulator4.3):
rm -r ./compiled
# configure for armv7 build
./configure \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7' \
--prefix=compiled/armv7 \
--enable-pic \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
# build for armv7
make clean
make && make install
# configure for armv6 build
./configure \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=arm1176jzf-s \
--extra-cflags='-arch armv6' \
--extra-ldflags='-arch armv6' \
--prefix=compiled/armv6 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
# build for armv6
make clean
make && make install
# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
# build for i386
make clean
make && make install
# make fat (universal) libs
mkdir -p ./compiled/fat/lib
lipo -output ./compiled/fat/lib/libavcodec.a -create \
-arch armv6 ./compiled/armv6/lib/libavcodec.a \
-arch armv7 ./compiled/armv7/lib/libavcodec.a \
-arch i386 ./compiled/i386/lib/libavcodec.a
lipo -output ./compiled/fat/lib/libavdevice.a -create \
-arch armv6 ./compiled/armv6/lib/libavdevice.a \
-arch armv7 ./compiled/armv7/lib/libavdevice.a \
-arch i386 ./compiled/i386/lib/libavdevice.a
lipo -output ./compiled/fat/lib/libavfilter.a -create \
-arch armv6 ./compiled/armv6/lib/libavfilter.a \
-arch armv7 ./compiled/armv7/lib/libavfilter.a \
-arch i386 ./compiled/i386/lib/libavfilter.a
lipo -output ./compiled/fat/lib/libavformat.a -create \
-arch armv6 ./compiled/armv6/lib/libavformat.a \
-arch armv7 ./compiled/armv7/lib/libavformat.a \
-arch i386 ./compiled/i386/lib/libavformat.a
lipo -output ./compiled/fat/lib/libavutil.a -create \
-arch armv6 ./compiled/armv6/lib/libavutil.a \
-arch armv7 ./compiled/armv7/lib/libavutil.a \
-arch i386 ./compiled/i386/lib/libavutil.a
lipo -output ./compiled/fat/lib/libpostproc.a -create \
-arch armv6 ./compiled/armv6/lib/libpostproc.a \
-arch armv7 ./compiled/armv7/lib/libpostproc.a \
-arch i386 ./compiled/i386/lib/libpostproc.a
lipo -output ./compiled/fat/lib/libswscale.a -create \
-arch armv6 ./compiled/armv6/lib/libswscale.a \
-arch armv7 ./compiled/armv7/lib/libswscale.a \
-arch i386 ./compiled/i386/lib/libswscale.a