[Libav-user] weard behavior of bash script for configure ffmpeg
Wagner Patriota
wagner.patriota at gmail.com
Thu Jul 5 19:00:37 CEST 2012
does anybody understand what happens here?
when my script reachs the *./configure* line... it gets the error:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
is unable to create an executable file.
C compiler test failed.
but if I type "*echo*" before ./configure, I see this big command line here:
./configure
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
--as='/usr/local/bin/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
--arch=arm --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'
--prefix=compiled/armv6 --enable-cross-compile --target-os=darwin
--enable-nonfree --enable-gpl --disable-armv5te --disable-swscale-alpha
--disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe
--disable-ffserver --disable-asm --disable-debug
If I copy/paste this big line in my shell and execute, the configure *works
pretty perfect*. But why it *doesn't work on the script*? What is the
difference between these 2 scenarios?
#!/bin/bash
parameters="--enable-cross-compile \
--target-os=darwin \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debug"
archs="armv6 armv7 i386"
libs=( libavcodec libavdevice libavformat libavutil libswresample
libswresample libpostproc libswscale libavfilter )
declare -a lipo
for (( i = 0; i < ${#libs[@]}; i++ )); do
lipo[i]="lipo -output ./compiled/fat/lib/${libs[${i}]}.a -create"
done
for arch in $( echo $archs ); do
echo "Configuring for $arch..."
if [ $arch = "i386" ]; then
arch_base="i386"
platform="iPhoneSimulator"
cpu="i386"
elif [ $arch = "armv6" ]; then
arch_base="arm"
platform="iPhoneOS"
cpu="arm1176jzf-s"
elif [ $arch = "armv7" ]; then
arch_base="arm"
platform="iPhoneOS"
cpu="cortex-a8"
fi
* ./configure \*
* --cc="/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/usr/bin/gcc"
\*
* --as="'/usr/local/bin/gas-preprocessor.pl/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/usr/bin/gcc'"
\*
* --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}5.1.sdk"
\*
* --arch="${arch_base}" \*
* --cpu="${cpu}" \*
* --extra-cflags="'-arch ${arch}'" \*
* --extra-ldflags="'-arch ${arch} -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}5.1.sdk'"
\*
* --prefix="compiled/${arch}" \*
* $parameters*
make clean
make && make install
for (( i = 0; i < ${#libs[@]}; i++ )); do
lipo[i]="${lipo[${i}]} -arch $arch ./compiled/$arch/lib/${libs[${i}]}.a"
done
done
for (( i = 0; i < ${#libs[@]}; i++ )); do
echo `${lipo[i]}`
done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120705/45a3040f/attachment.html>
More information about the Libav-user
mailing list