Merge "Fixed buffer selection for UV in AltRef filtering"
[profile/ivi/libvpx.git] / release.sh
1 #!/bin/sh
2 ##
3 ##  Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
4 ##
5 ##  Use of this source code is governed by a BSD-style license
6 ##  that can be found in the LICENSE file in the root of the source
7 ##  tree. An additional intellectual property rights grant can be found
8 ##  in the file PATENTS.  All contributing project authors may
9 ##  be found in the AUTHORS file in the root of the source tree.
10 ##
11
12
13
14 self=$0
15
16 for opt; do
17     case $opt in
18         --clean) clean=yes;;
19         -j*) jopt=$opt;;
20         *) echo "Unsupported option $opt"; exit 1;;
21     esac
22 done
23
24 TAB="$(printf '\t')"
25 cat > release.mk << EOF
26 %\$(BUILD_SFX).tar.bz2: %/.done
27 ${TAB}@echo "\$(subst .tar.bz2,,\$@): tarball"
28 ${TAB}@cd \$(dir \$<); tar -cf - \$(subst .tar.bz2,,\$@) | bzip2 > ../\$@
29
30 %\$(BUILD_SFX).zip: %/.done
31 ${TAB}@echo "\$(subst .zip,,\$@): zip"
32 ${TAB}@rm -f \$@; cd \$(dir \$<); zip -rq ../\$@ \$(subst .zip,,\$@)
33
34 logs/%\$(BUILD_SFX).log.bz2: %/.done
35 ${TAB}@echo "\$(subst .log.bz2,,\$(notdir \$@)): tarlog"
36 ${TAB}@mkdir -p logs
37 ${TAB}@cat \$< | bzip2 > \$@
38
39 %/.done:
40 ${TAB}@mkdir -p \$(dir \$@)
41 ${TAB}@echo "\$(dir \$@): configure \$(CONFIG_OPTS) \$(EXTRA_PATH)"
42 ${TAB}@cd \$(dir \$@); export PATH=\$\$PATH\$(EXTRA_PATH); ../\$(SRC_ROOT)/configure \$(CONFIG_OPTS) >makelog.txt 2>&1
43 ${TAB}@echo "\$(dir \$@): make"
44 ${TAB}@cd \$(dir \$@); PATH=\$\$PATH\$(EXTRA_PATH) \$(MAKE) >>makelog.txt 2>&1
45 ${TAB}@echo "\$(dir \$@): test install"
46 ${TAB}@cd \$(dir \$@); PATH=\$\$PATH\$(EXTRA_PATH) \$(MAKE) install >>makelog.txt 2>&1
47 ${TAB}@cd \$(dir \$@)/dist/build; PATH=\$\$PATH\$(EXTRA_PATH) \$(MAKE) >>makelog.txt 2>&1
48 ${TAB}@echo "\$(dir \$@): install"
49 ${TAB}@cd \$(dir \$@); PATH=\$\$PATH\$(EXTRA_PATH) \$(MAKE) install DIST_DIR=\$(TGT) >>makelog.txt 2>&1
50 ${TAB}@touch \$@
51
52 #include release-deps.mk
53 EOF
54
55 #[ -f release-deps.mk ] || \
56 #    find ${self%/*} -name .git -prune -o -type f -print0 \
57 #    | xargs -0 -n1 echo \
58 #    | sed -e 's; ;\\ ;g' | awk '{print "$(TGT)/.done: "$0}' > release-deps.mk
59
60 build_config_list() {
61     for codec in $CODEC_LIST; do
62         for arch in $ARCH_LIST; do
63             if [ -n "$OS_LIST" ]; then
64                 for os in $OS_LIST; do
65                     CONFIGS="$CONFIGS vpx-${codec}-${arch}-${os}"
66                 done
67             else
68                 CONFIGS="$CONFIGS vpx-${codec}-${arch}"
69             fi
70         done
71     done
72 }
73
74 CODEC_LIST="vp8 vp8cx vp8dx"
75 case `uname` in
76     Linux*)
77         ARCH_LIST="x86 x86_64"
78         OS_LIST="linux"
79         build_config_list
80         ARCH_LIST="armv5te armv6 armv7"
81         OS_LIST="linux-gcc"
82
83         ;;
84     CYGWIN*)
85         TAR_SFX=.zip
86         for vs in vs7 vs8; do
87             for arch in x86-win32 x86_64-win64; do
88                 for msvcrt in md mt; do
89                     case $vs,$arch in
90                         vs7,x86_64-win64) continue ;;
91                     esac
92                     ARCH_LIST="$ARCH_LIST ${arch}${msvcrt}-${vs}"
93                 done
94             done
95         done
96         ;;
97     Darwin*)
98         ARCH_LIST="universal"
99         OS_LIST="darwin8 darwin9"
100         ;;
101     sun_os*)
102         ARCH_LIST="x86 x86_64"
103         OS_LIST="solaris"
104         ;;
105 esac
106 build_config_list
107
108 TAR_SFX=${TAR_SFX:-.tar.bz2}
109 ARM_TOOLCHAIN=/usr/local/google/csl-2009q3-67
110 for cfg in $CONFIGS; do
111     full_cfg=$cfg
112     cfg=${cfg#vpx-}
113     opts=
114     rm -f makelog.txt
115
116     case $cfg in
117         src-*)  opts="$opts --enable-codec-srcs"
118                 cfg=${cfg#src-}
119                 ;;
120         eval-*) opts="$opts --enable-eval-limit"
121                 cfg=${cfg#src-}
122                 ;;
123     esac
124
125     case $cfg in
126         #
127         # Linux
128         #
129         *x86-linux)
130             opts="$opts --target=x86-linux-gcc" ;;
131         *x86_64-linux)
132             opts="$opts --target=x86_64-linux-gcc" ;;
133         *arm*-linux-gcc)
134             armv=${cfg##*armv}
135             armv=${armv%%-*}
136             opts="$opts --target=armv${armv}-linux-gcc" ;;
137         *arm*-linux-rvct)
138             armv=${cfg##*armv}
139             armv=${armv%%-*}
140             opts="$opts --target=armv${armv}-linux-rvct"
141             opts="$opts --libc=${ARM_TOOLCHAIN}/arm-none-linux-gnueabi/libc" ;;
142
143
144         #
145         # Windows
146         #
147         # need --enable-debug-libs for now until we're smarter about
148         # building the debug/release from the customer installed
149         # environment
150         *-x86-win32*-vs*)
151             opts="$opts --target=x86-win32-vs${cfg##*-vs} --enable-debug-libs";;
152         *-x86_64-win64*-vs8)
153             opts="$opts --target=x86_64-win64-vs8 --enable-debug-libs" ;;
154
155         #
156         # Darwin
157         #
158         *-universal-darwin*)
159             opts="$opts --target=universal-darwin${cfg##*-darwin}-gcc" ;;
160
161         #
162         # Solaris
163         #
164         *x86-solaris)
165             opts="$opts --target=x86-solaris-gcc" ;;
166         *x86_64-solaris)
167             opts="$opts --target=x86_64-solaris-gcc" ;;
168     esac
169
170     case $cfg in
171         *x86-linux | *x86-solaris) opts="$opts --enable-pic" ;;
172     esac
173
174     case $cfg in
175         *-win[36][24]mt*)  opts="$opts --enable-static-msvcrt" ;;
176         *-win[36][24]md*)  opts="$opts --disable-static-msvcrt" ;;
177     esac
178
179     opts="$opts --disable-codecs"
180     case $cfg in
181         vp8*) opts="$opts --enable-vp8" ;;
182     esac
183     case $cfg in
184         *cx-*) opts="${opts}-encoder" ;;
185         *dx-*) opts="${opts}-decoder" ;;
186     esac
187     opts="$opts --enable-postproc"
188
189     [ "x${clean}" = "xyes" ] \
190         && rm -rf ${full_cfg}${BUILD_SFX}${TAR_SFX} \
191         && rm -rf logs/${full_cfg}${BUILD_SFX}.log.bz2
192
193     TGT=${full_cfg}${BUILD_SFX}
194     BUILD_TARGETS="logs/${TGT}.log.bz2 ${TGT}${TAR_SFX}"
195     echo "${BUILD_TARGETS}: CONFIG_OPTS=$opts" >>release.mk
196     echo "${BUILD_TARGETS}: TGT=${TGT}" >>release.mk
197     case $cfg in
198         *-arm*-linux-*)
199             echo "${BUILD_TARGETS}: EXTRA_PATH=:${ARM_TOOLCHAIN}/bin/" >>release.mk ;;
200         *-vs7)
201             echo "${BUILD_TARGETS}: EXTRA_PATH=:/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ .NET\ 2003/Common7/IDE" >>release.mk ;;
202         *-vs8)
203             echo "${BUILD_TARGETS}: EXTRA_PATH=:/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 8/Common7/IDE" >>release.mk ;;
204     esac
205     MAKE_TGTS="$MAKE_TGTS ${TGT}${TAR_SFX} logs/${TGT}.log.bz2"
206 done
207
208
209 ${MAKE:-make} ${jopt:--j3} -f release.mk  \
210     SRC_ROOT=${self%/*} BUILD_SFX=${BUILD_SFX} ${MAKE_TGTS}