Hey all I've included our Travis config below. We're trying to build each QF_ARCH (OSX, x86, and x86_64) with and without steamlib. There should be six builds in the matrix, but it's only attempting to build three.
Actual build attempt: https://app.travis-ci.com/github/TeamForbiddenLLC/warfork-qfusion/builds/247038265
Example:
- QF_ARCH=x86_64
- QF_ARCH=x86_64 BUILD_STEAMLIB=1
Config: https://github.com/TeamForbiddenLLC/warfork-qfusion/blob/master/.travis.yml
Full travis.yml
dist: trusty
cache:
apt: true
directories:
- $HOME/.deps
matrix:
include:
- os: osx
osx_image: xcode8.3
env:
- QF_ARCH=OSX
- QF_ARCH=OSX BUILD_STEAMLIB=1
language: c++
compiler: clang
- os: linux
language: c++
compiler: gcc-4.9
env:
- QF_ARCH=x86
- QF_ARCH=x86 BUILD_STEAMLIB=1
addons:
apt:
sources:
- kubuntu-backports
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- cmake
- build-essential
- gcc-4.9-multilib
- g++-4.9-multilib
- gcc-multilib
- libgnutls-dev:i386
- libidn11-dev:i386
- libkrb5-dev:i386
- librtmp-dev:i386
- libpng-dev:i386
- libgl1-mesa-dev:i386
- libglu1-mesa-dev:i386
- libpulse-dev:i386
- libsdl2-dev:i386
- libopenal-dev:i386
- libvorbis-dev:i386
- libtheora-dev:i386
- libfreetype6-dev:i386
- zlib1g-dev:i386
- libcurl4-gnutls-dev:i386
- libglib2.0-dev:i386
- os: linux
language: c++
compiler: clang
env:
- QF_ARCH=x86_64
- QF_ARCH=x86_64 BUILD_STEAMLIB=1
addons:
apt:
packages:
- clang
- cmake
- build-essential
- libsdl2-dev
- libopenal-dev
- libvorbis-dev
- libtheora-dev
- libfreetype6-dev
- zlib1g-dev
- libcurl4-gnutls-dev
install:
- if [[ "$QF_ARCH" == "x86_64" ]]; then export CC=clang CXX=clang++; fi
- if [[ "$QF_ARCH" == "x86" ]]; then export CC=gcc-4.9 CXX=g++-4.9; fi
- cd "$TRAVIS_BUILD_DIR/source"
- if [[ "$QF_ARCH" == "x86_64" ]]; then cmake -DBUILD_STEAMLIB=$BUILD_STEAMLIB .; fi
- if [[ "$QF_ARCH" == "x86" ]]; then cmake -DCMAKE_TOOLCHAIN_FILE=cmake/i386-linux-gnu.cmake -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DBUILD_STEAMLIB=$BUILD_STEAMLIB .; fi
- if [[ "$QF_ARCH" == "OSX" ]]; then cmake -G Xcode -DBUILD_STEAMLIB=$BUILD_STEAMLIB .; fi
- cd "$TRAVIS_BUILD_DIR"
script:
- if [[ "$BUILD_STEAMLIB" == "1" ]]; then curl https://warfork.com/downloads/sdk/ --output "$TRAVIS_BUILD_DIR/third-party/steamworks/sdk.zip"; fi
- if [[ "$BUILD_STEAMLIB" == "1" ]]; then unzip "$TRAVIS_BUILD_DIR/third-party/steamworks/sdk.zip"; fi
- cd source
- if [[ "$QF_ARCH" == "x86_64" ]]; then make -j8; fi
- if [[ "$QF_ARCH" == "x86" ]]; then make -j8; fi
- if [[ "$QF_ARCH" == "OSX" ]]; then xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD; fi
- cd build
- echo "${TRAVIS_COMMIT}" >commit.txt
- if [[ "$BUILD_STEAMLIB" == "1" ]]; then echo "671610" >steam_appid.txt; fi
- if [[ "$QF_ARCH" == "OSX" ]]; then cd Release && tar -czvf ../../tmp.tar.gz *.app && cd ..; fi
- if [[ "$QF_ARCH" != "OSX" ]]; then tar -czvf ../tmp.tar.gz * --exclude *.a --exclude base*/*.a libs/*.a; fi
- cd ..
- mv tmp.tar.gz ${QF_ARCH}-Release.tar.gz
- curl -F "file=#${QF_ARCH}-Release.tar.gz" https://file.io```
Related
https://travis-ci.org/poma/ton/builds/600655302
The 2 jobs that failed are listed in allow_failures list, but the build overall is still marked as failed. Why?
Travis config:
if: tag IS blank
language: cpp
compiler: clang
matrix:
include:
- os: linux
dist: bionic
addons:
apt:
packages:
- ninja-build
- pkg-config
- libssl-dev
- zlib1g-dev
- libreadline-dev
- libmicrohttpd-dev
- gperf
- os: linux
dist: xenial
compiler: gcc
addons:
apt:
packages:
- ninja-build
- pkg-config
- libssl-dev
- zlib1g-dev
- libreadline-dev
- libmicrohttpd-dev
- gperf
- os: osx
osx_image: xcode11.2
addons:
homebrew:
packages:
- ninja
- cmake
- openssl
- os: osx
osx_image: xcode10.2
addons:
homebrew:
packages:
- ninja
- cmake
- openssl
- os: osx
osx_image: xcode9.4
addons:
homebrew:
packages:
- ninja
- cmake
- openssl
- os: windows
allow_failures:
- os: linux
dist: xenial
- os: windows
install:
- env
- ${CC} --version
- ${CC} -v
- ${CXX} --version
- ${CXX} -v
- git clone --recursive https://github.com/ton-blockchain/ton
- cd ton
- export COMMIT=`git rev-parse HEAD`
- export COMMIT_SHORT=`git rev-parse --short HEAD`
- export COMMIT_MESSAGE=`git log -1 --pretty=%B`
- echo "Using git commit $COMMIT"
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export RELEASE_FILE=ton_linux_${TRAVIS_DIST}_${TRAVIS_ARCH}_${TRAVIS_COMPILER}_${COMMIT_SHORT}.tar.gz
wget https://test.ton.org/ton-lite-client-test1.config.json
wget https://test.ton.org/ton-global.config.json
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export RELEASE_FILE=ton_osx_$(sw_vers -productVersion)_${TRAVIS_OSX_IMAGE}_${TRAVIS_ARCH}_${TRAVIS_COMPILER}_${COMMIT_SHORT}.tar.gz
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
wget https://test.ton.org/ton-lite-client-test1.config.json
wget https://test.ton.org/ton-global.config.json
elif [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
export RELEASE_FILE=ton_windows_${TRAVIS_ARCH}_${TRAVIS_COMPILER}_${COMMIT_SHORT}.tar.gz
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
choco install ninja gperf openssl getopt # zlib libmicrohttpd
# git clone https://github.com/Microsoft/vcpkg.git
# cd vcpkg
# export VCPKG_DEFAULT_TRIPLET=x86-windows
# ./bootstrap-vcpkg.bat
# ./vcpkg integrate install
# ./vcpkg install zlib # libmicrohttpd
# cd ..
fi
script:
- mkdir build
- cd build
- cmake -G "Ninja" ..
- ninja
# Also compatible with regular CMake build (slower)
# - cmake -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" ..
# - cmake ..
# - cmake --build .
# - test?
- mkdir -p release/lib
# todo: exe file names
- |
mv lite-client/lite-client \
crypto/fift \
crypto/tlbc \
crypto/create-state \
crypto/dump-block \
crypto/func \
validator-engine/validator-engine \
validator-engine-console/validator-engine-console \
tonlib/tonlib-cli \
utils/generate-random-id \
adnl/adnl-proxy \
adnl/adnl-pong \
tdnet/tcp_ping_pong \
tdnet/udp_ping_pong \
dht-server/dht-server \
../ton-lite-client-test1.config.json \
../ton-global.config.json \
release/
- |
mv ../crypto/fift/lib/* \
../crypto/smartcont/stdlib.fc \
release/lib/
- tar -czvf $RELEASE_FILE release
# Skipped files:
# ./tl/generate/generate_common
# ./tl/generate/tonlib_generate_java_api
# ../tl/generate/scheme
# ./utils/json2tlo
before_deploy:
- git config --local user.name "poma"
- git config --local user.email "semenov.roman#mail.ru"
- export TRAVIS_TAG=${TRAVIS_TAG:-build-$TRAVIS_BUILD_NUMBER}
- git tag -f $TRAVIS_TAG
deploy:
provider: releases
name: TON binaries for commit $COMMIT_SHORT
# body: "Last commit: $COMMIT_MESSAGE" # causes error in travis
api_key:
secure: FHXDvia6qgFleDoTVBoOgKYZKHN8GG5A98E9z/mO+5EZ4GNssa7kUZylXkNnDq1GFSiBI8GojME2MnryqPKPX7+eAdRW+BfxdjNoY2mkqKFV2pTSBfC5M6W/qvgYE7w8U+8vVKexPWl6AnX4ex5xwWE0Eu7LgI0eNCOOagypieO0E7VzB8Au8s4KQ+00VYt/U6i0hVvyHkQOksk7cpWXLZr3qkspBOlgBS2erOAKtw3uVdXSMa4XKVvHBTV+OmlDrTvPK66eGtopAGbS8MRtfJP4H5FULyD+uHCeyYj5eE1mEmUsOjMOrv7Q69rVYj9gAFbmFfAFv4uL+6mZSQwKw+sm6VmqUxxbii0pD7TXaUK0BBiVgKDSkV8v1qYJKCWkynjdznX4yzSsm7jh8AjnL9GCa7vGjngTniBZiVaTCr3NriEVpQ8/cWsqv3fWnvdjNg6gNysWg8mHQhclabNUhOoDVYJEuoyifxVqIWP0SEBuaZl/i/YA00EyIwsgTughbrjdX/odLCRKvfHtTRLwIjKAgpsVJ8UMYaCa7trfa8+NmIpDsGIpzq9CyxOaUBry0QQOO9IPVm/TfPpCqMTIpOmHqY22Re7fkwmIqfJxTXiLjVOH9d+oHj1+kUBw+HIP+lXv/3jd8HaI8fhxlyhFbeijLBrp5WY4oBSs2mx97tA=
file: $RELEASE_FILE
skip_cleanup: true
allow_failures should be under matrix but was top level
Is there a way to setup travis-ci to build multiple projects in different languages ?
Lets say my repo is
AwesomeRepoThatDoestOneThingInDifferentLanguages
-cpp
-csharp
-python2
-python3
-java
-go
-ruby
-lua
-objectivec
Now, I wish to apply ci to this.
If I just add .travis.yml file to my python2 project, travis-ci complains that no .travis.yml found, since its looking for one at the root of the repo.
So, is there a way where I can put a .travis.yml at the top, which then further invokes the travis.yml in each of my sub-modules ?
I was able to find a way to actually do this. This is not complete yet since some of the jobs are still failing and I need to fix them individually, but overall the idea works just fine.
I am using travis ci's matrix way. Here is my .travis.yml
Thought this might help if someone else had the same question or scenario.
---
matrix:
include:
-
before_script:
- "cd java"
jdk: oraclejdk8
language: java
script: "mvn clean package"
-
before_script:
- "cd python2"
- "pip install --upgrade setuptools"
- "pip install nose"
- "pip freeze > requirements.txt"
- "pip install -r requirements.txt"
- "cd tests"
cache: pip
language: python
python: 2.7
script: nosetests
-
before_script:
- "cd python3"
- "pip install --upgrade setuptools"
- "pip install nose"
- "pip freeze > requirements.txt"
- "pip install -r requirements.txt"
- "cd tests"
language: python
python: 3.6
script: nosetests
-
before_script:
- "cd objectivec"
language: objective-c
os: osx
osx_image: xcode10
script:
- "xcodebuild clean test -project DiffMatchPatch.xcodeproj -scheme DiffMatchPatch -destination 'platform=OS X,arch=x86_64'"
-
before_script:
- "sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa"
- "sudo apt-get update -qq"
- "sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev"
language: cpp
script:
- "qmake -qt=qt5 -v"
- "qmake -qt=qt5"
- make
-
before_script:
- "cd csharp"
dotnet: "1.1.5"
env: DOTNETCORE=1
language: csharp
mono: latestscript
script:
- "dotnet restore"
solution: solution-name.sln
-
before_script:
- "cd dart"
dart: "1.15.0"
dart_task:
-
test: "--exclude-tags no-xvfb"
-
test: "--tags no-xvfb"
language: dart
with_content_shell: true
-
after_success:
- coveralls -b .. -r .. -i ./lua --dump c.report.json
- luacov-coveralls -j c.report.json -v
before_install:
- "cd lua"
- "pip install --upgrade pip"
- "pip install --upgrade setuptools"
- "pip freeze > requirements.txt"
- "pip install -r requirements.txt"
- "sudo wget https://luarocks.org/releases/luarocks-2.4.4.tar.gz"
- "sudo tar zxpf luarocks-2.4.4.tar.gz"
- "cd luarocks-2.4.4"
- "./configure --prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit \
--lua-suffix=jit-2.1.0-beta2 \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1; sudo make bootstrap"
- "sudo luarocks install luasocket"
- "pip install cpp-coveralls"
- "luarocks install Lua-cURL --server=https://luarocks.org/dev"
- "luarocks install luacov-coveralls --server=https://luarocks.org/dev"
- "luarocks install lunitx"
- "luarocks install luabitop"
language: python
script:
- "lunit.sh tests/diff_match_patch_test.lua"
- "lunit.sh tests/speedtest.lua"
notifications:
email:
-
sudo: required
I compiled FFMPEG libs which supports for iOS 7 and 8 but since recent release with iOS 9 there is a new feature has issued which called bitcode mode , as a default setting , this setting has set to NO .
But if i set this as yes , following error will execute ,
libavdevice.a(avfoundation.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
Is there any way to compile FFMPEG which supports FFMpeg in bitcode enabled mode
here is the build script i used
#!/bin/sh
# directories
SOURCE="ffmpeg-2.6.2"
FAT="FFmpeg-iOS"
SCRATCH="scratch"
# must be an absolute path
THIN=`pwd`/"thin"
# absolute path to x264 library
#X264=`pwd`/fat-x264
#FDK_AAC=`pwd`/fdk-aac/fdk-aac-ios
CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-programs \
--disable-doc --enable-pic"
if [ "$X264" ]
then
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-gpl --enable-libx264"
fi
if [ "$FDK_AAC" ]
then
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-libfdk-aac"
fi
# avresample
#CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
ARCHS="arm64 armv7 x86_64 i386"
COMPILE="y"
LIPO="y"
DEPLOYMENT_TARGET="6.0"
if [ "$*" ]
then
if [ "$*" = "lipo" ]
then
# skip compile
COMPILE=
else
ARCHS="$*"
if [ $# -eq 1 ]
then
# skip lipo
LIPO=
fi
fi
fi
if [ "$COMPILE" ]
then
if [ ! `which yasm` ]
then
echo 'Yasm not found'
if [ ! `which brew` ]
then
echo 'Homebrew not found. Trying to install...'
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" \
|| exit 1
fi
echo 'Trying to install Yasm...'
brew install yasm || exit 1
fi
if [ ! `which gas-preprocessor.pl` ]
then
echo 'gas-preprocessor.pl not found. Trying to install...'
(curl -L https://github.com/libav/gas-preprocessor/raw/master/gas-preprocessor.pl \
-o /usr/local/bin/gas-preprocessor.pl \
&& chmod +x /usr/local/bin/gas-preprocessor.pl) \
|| exit 1
fi
if [ ! -r $SOURCE ]
then
echo 'FFmpeg source not found. Trying to download...'
curl http://www.ffmpeg.org/releases/$SOURCE.tar.bz2 | tar xj \
|| exit 1
fi
CWD=`pwd`
for ARCH in $ARCHS
do
echo "building $ARCH..."
mkdir -p "$SCRATCH/$ARCH"
cd "$SCRATCH/$ARCH"
CFLAGS="-arch $ARCH"
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]
then
PLATFORM="iPhoneSimulator"
CFLAGS="$CFLAGS -mios-simulator-version-min=$DEPLOYMENT_TARGET"
else
PLATFORM="iPhoneOS"
CFLAGS="$CFLAGS -mios-version-min=$DEPLOYMENT_TARGET"
if [ "$ARCH" = "arm64" ]
then
EXPORT="GASPP_FIX_XCODE5=1"
fi
fi
XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'`
CC="xcrun -sdk $XCRUN_SDK clang"
CXXFLAGS="$CFLAGS"
LDFLAGS="$CFLAGS"
if [ "$X264" ]
then
CFLAGS="$CFLAGS -I$X264/include"
LDFLAGS="$LDFLAGS -L$X264/lib"
fi
if [ "$FDK_AAC" ]
then
CFLAGS="$CFLAGS -I$FDK_AAC/include"
LDFLAGS="$LDFLAGS -L$FDK_AAC/lib"
fi
TMPDIR=${TMPDIR/%\/} $CWD/$SOURCE/configure \
--target-os=darwin \
--arch=$ARCH \
--cc="$CC" \
$CONFIGURE_FLAGS \
--extra-cflags="$CFLAGS" \
--extra-cxxflags="$CXXFLAGS" \
--extra-ldflags="$LDFLAGS" \
--prefix="$THIN/$ARCH" \
|| exit 1
make -j3 install $EXPORT || exit 1
cd $CWD
done
fi
if [ "$LIPO" ]
then
echo "building fat binaries..."
mkdir -p $FAT/lib
set - $ARCHS
CWD=`pwd`
cd $THIN/$1/lib
for LIB in *.a
do
cd $CWD
echo lipo -create `find $THIN -name $LIB` -output $FAT/lib/$LIB 1>&2
lipo -create `find $THIN -name $LIB` -output $FAT/lib/$LIB || exit 1
done
cd $CWD
cp -rf $THIN/$1/include $FAT
fi
echo Done
I got it working using the following CONFIGURE_FLAGS:
CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-programs \
--disable-doc --enable-pic \
--extra-cflags=-fembed-bitcode --extra-cxxflags=-fembed-bitcode"
If you only need to decode videos, you should add more flags to disable all muxers,encoders. You'll also probably don't need filters. This will save some space. I also disabled the ARCH i386, which is not needed for the iOS simulator.
I use these flags for my project:
CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-programs \
--disable-doc --enable-pic \
--extra-cflags=-fembed-bitcode --extra-cxxflags=-fembed-bitcode \
--enable-nonfree --enable-gpl \
--disable-ffserver --disable-ffmpeg --disable-ffprobe \
--disable-avdevice --disable-avfilter --disable-encoders \
--disable-parsers --disable-decoders --disable-protocols \
--disable-filters --disable-muxers --disable-bsfs \
--disable-indevs --disable-outdevs --disable-demuxers \
--enable-protocol=file \
--enable-protocol=tcp \
--enable-protocol=udp \
--enable-decoder=msmpeg4v3 \
--enable-decoder=mpeg4 \
--enable-decoder=mjpeg \
--enable-decoder=h264 \
--enable-parser=mpeg4video \
--enable-parser=mjpeg \
--enable-parser=h263 \
--enable-parser=h264 \
--enable-parser=aac \
--enable-demuxer=avi \
--enable-demuxer=mov \
--enable-demuxer=rtsp \
"
Add -fembed-bitcode-marker to CONFIGURE_FLAGS
like this:
CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-programs \
--disable-doc --enable-pic -fembed-bitcode-marker"
I compile ffmpeg in OSX. My xcode version is 5.1. ffmpeg configure is :
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/usr/bin/gcc ' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk' --enable-pic --disable-asm --prefix="../lib"
This is the error:
/usr/bin/ranlib: object: libavfilter/libavfilter.a(aeval.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make: *** [libavfilter/libavfilter.a] Error 1
I'm not sure what this error means or how to solve it.
I see you are trying to build it for ARM, therefore iOS...
It's not that simple... run this script here... if you uncomment X264 you can compile it with libx264, if you need that, I can send you the other script later.
#!/bin/sh
# directories
SOURCE="ffmpeg-2.3"
FAT=`pwd`/"fat"
SCRATCH="scratch"
# must be an absolute path
THIN=`pwd`/"thin"
# absolute path to x264 library
#X264=`pwd`/../x264/fat
CONFIGURE_FLAGS="--enable-cross-compile \
--disable-debug \
--disable-programs \
--disable-doc \
--enable-pic \
--enable-cross-compile \
--target-os=darwin \
--enable-nonfree \
--enable-gpl \
--enable-static \
--disable-shared \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm"
if [ "$X264" ]
then
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-gpl --enable-libx264"
fi
# avresample
#CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
ARCHS="arm64 armv7s armv7 x86_64 i386"
COMPILE="y"
LIPO="y"
DEPLOYMENT_TARGET="6.0"
if [ "$*" ]
then
if [ "$*" = "lipo" ]
then
# skip compile
COMPILE=
else
ARCHS="$*"
if [ $# -eq 1 ]
then
# skip lipo
LIPO=
fi
fi
fi
if [ "$COMPILE" ]
then
if [ ! `which yasm` ]
then
echo 'Yasm not found'
if [ ! `which brew` ]
then
echo 'Homebrew not found. Trying to install...'
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" \
|| exit 1
fi
echo 'Trying to install Yasm...'
brew install yasm || exit 1
fi
if [ ! `which gas-preprocessor.pl` ]
then
echo 'gas-preprocessor.pl not found. Trying to install...'
(curl -3L https://github.com/libav/gas-preprocessor/raw/master/gas-preprocessor.pl \
-o /usr/local/bin/gas-preprocessor.pl \
&& chmod +x /usr/local/bin/gas-preprocessor.pl) \
|| exit 1
fi
if [ ! -r $SOURCE ]
then
echo 'FFmpeg source not found. Trying to download...'
curl http://www.ffmpeg.org/releases/$SOURCE.tar.bz2 | tar xj \
|| exit 1
fi
CWD=`pwd`
for ARCH in $ARCHS
do
echo "building $ARCH..."
mkdir -p "$SCRATCH/$ARCH"
cd "$SCRATCH/$ARCH"
CFLAGS="-arch $ARCH"
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]
then
PLATFORM="iPhoneSimulator"
CFLAGS="$CFLAGS -mios-simulator-version-min=$DEPLOYMENT_TARGET"
else
PLATFORM="iPhoneOS"
CFLAGS="$CFLAGS -mios-version-min=$DEPLOYMENT_TARGET"
if [ "$ARCH" = "arm64" ]
then
EXPORT="GASPP_FIX_XCODE5=1"
fi
fi
XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'`
CC="xcrun -sdk $XCRUN_SDK clang"
CXXFLAGS="$CFLAGS"
LDFLAGS="$CFLAGS"
if [ "$X264" ]
then
CFLAGS="$CFLAGS -I$X264/include"
LDFLAGS="$LDFLAGS -L$X264/lib"
fi
$CWD/$SOURCE/configure \
--target-os=darwin \
--arch=$ARCH \
--cc="$CC" \
$CONFIGURE_FLAGS \
--extra-cflags="$CFLAGS" \
--extra-cxxflags="$CXXFLAGS" \
--extra-ldflags="$LDFLAGS" \
--prefix="$THIN/$ARCH" \
|| exit 1
make -j3 install $EXPORT || exit 1
cd $CWD
done
fi
if [ "$LIPO" ]
then
echo "building fat binaries..."
mkdir -p $FAT/lib
set - $ARCHS
CWD=`pwd`
cd $THIN/$1/lib
for LIB in *.a
do
cd $CWD
echo lipo -create `find $THIN -name $LIB` -output $FAT/lib/$LIB 1>&2
lipo -create `find $THIN -name $LIB` -output $FAT/lib/$LIB || exit 1
done
cd $CWD
cp -rf $THIN/$1/include $FAT
fi
echo Done
Environment: Mac OS X 10.9.2, Xcode 5.1.
I have compiled librtmp, libogg and libspeex successfully, they are in the directories named fat-librtmp, fat-libogg and fat-libspeex , then I run the shell script as below to coompile them into FFmpeg:
#!/bin/sh
# OS X Mavericks, Xcode 5.1
set -ex
VERSION="2.2.2"
CURRPATH=`pwd`
DSTDIR="ffmpeg-built"
SCRATCH="scratch"
LIBRTMP=$CURRPATH/librtmp
ARCHS="i386 x86_64 armv7 armv7s arm64"
CONFIGURE_FLAGS="--enable-shared \
--disable-doc \
--disable-stripping \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-decoders \
--disable-encoders \
--disable-protocols \
--enable-protocol=file \
--enable-protocol=rtmp \
--enable-librtmp \
--enable-encoder=flv \
--enable-decoder=flv \
--disable-symver \
--disable-asm \
--enable-cross-compile"
rm -rf $DSTDIR
mkdir $DSTDIR
if [ ! `which yasm` ]; then
if [ ! `which brew` ]; then
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
fi
brew install yasm
fi
if [ ! `which gas-preprocessor.pl` ]; then
curl -3L https://github.com/libav/gas-preprocessor/raw/master/gas-preprocessor.pl -o /usr/local/bin/gas-preprocessor.pl
chmod +x /usr/local/bin/gas-preprocessor.pl
fi
if [ ! -e ffmpeg-$VERSION.tar.bz2 ]; then
curl -O http://www.ffmpeg.org/releases/ffmpeg-$VERSION.tar.bz2
fi
tar jxf ffmpeg-$VERSION.tar.bz2
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
for ARCH in $ARCHS; do
mkdir -p $DSTDIR/$SCRATCH/$ARCH
cd $DSTDIR/$SCRATCH/$ARCH
CFLAGS="-arch $ARCH"
if [ $ARCH == "i386" -o $ARCH == "x86_64" ]; then
PLATFORM="iPhoneSimulator"
CFLAGS="$CFLAGS -mios-simulator-version-min=6.0"
else
PLATFORM="iPhoneOS"
CFLAGS="$CFLAGS -mios-version-min=6.0"
if [ $ARCH == "arm64" ]; then
EXPORT="GASPP_FIX_XCODE5=1"
fi
fi
XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'`
CC="xcrun -sdk $XCRUN_SDK clang"
CFLAGS="$CFLAGS -I$LIBRTMP/include"
CXXFLAGS="$CFLAGS"
LDFLAGS="$CFLAGS -L$LIBRTMP/lib"
$CURRPATH/ffmpeg-$VERSION/configure \
--target-os=darwin \
--arch=$ARCH \
--cc="$CC" \
$CONFIGURE_FLAGS \
--extra-cflags="$CFLAGS" \
--extra-cxxflags="$CXXFLAGS" \
--extra-ldflags="$LDFLAGS" \
--prefix=$CURRPATH/$DSTDIR/$ARCH
make -j3 install $EXPORT
cd $CURRPATH
done
rm -rf $DSTDIR/$SCRATCH
mkdir -p $DSTDIR/lib
cd $DSTDIR/$ARCH/lib
LIBS=`ls *.a`
cd $CURRPATH
for LIB in $LIBS; do
lipo -create `find $DSTDIR -name $LIB` -output $DSTDIR/lib/$LIB
done
cp -rf $DSTDIR/$ARCH/include $DSTDIR
for ARCH in $ARCHS; do
rm -rf $DSTDIR/$ARCH
done
Unluckily, the config.log shows:
check_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
pkg-config --exists --print-errors librtmp
Package librtmp was not found in the pkg-config search path.
Perhaps you should add the directory containing `librtmp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'librtmp' found
ERROR: librtmp not found
I have googled and knew that configure contains a line enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket, which maybe be wrong. Right? Can somebody help me to solve it?
UPDATE at 2014/06/10
I think it's about pkgconfig or something, so I have create a file named librtmp.pc at /usr/local/lib/pkgconfig, which contains below text:
prefix=/usr/local/librtmp
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: librtmp
Description: RTMP implementation
Version: v2.3
Requires:
URL: http://rtmpdump.mplayerhq.hu
Libs: -L${libdir} -lrtmp -lz
Cflags: -I${includedir}
Also I have moved built librtmp to /usr/local. After above being done, I run the shell script again, but still same error! Can somebody told me why and how to solve it?
The below links give some insight while building ffmpeg.
https://trac.ffmpeg.org/wiki/CompilationGuide/Generic
Check whether LD_LIBRARY_PATH environment variable is set properly.