Ticket #11170: mythbuild.diff
File mythbuild.diff, 15.1 KB (added by , 12 years ago) |
---|
-
Win32/mythbuild.sh
diff --git a/Win32/mythbuild.sh b/Win32/mythbuild.sh index 4fb21c6..5ae55ba 100755
a b else 230 230 cpus=1 231 231 fi 232 232 [ $cpus -gt 1 ] && makejobs=`expr $cpus + 1` || makejobs=1 233 verbose="no" 233 : ${MYTHVERBOSE:=no} 234 export MYTHVERBOSE 234 235 unset dosudo 235 236 unset patchmaster 236 237 : ${DXVA2:="no"} 238 : ${X264:="yes"} # Enable x264 for mythffmpeg transcoding 239 PROFILE="no" 237 240 238 241 239 242 ############################################################### … … function myhelp() { 257 260 echo " -b tag Checkout MythTV branch [$branch]" 258 261 echo " -r *Release build (sticky)" 259 262 echo " -d Debug build (sticky)" 260 echo " -p Profile build (sticky)"263 echo " -p Build for gprof profiling (sticky) [$PROFILE]" 261 264 echo " -I <path> Install prefix [${MYTHINSTALL#$MYTHDIR/}]" 262 265 echo " -H Build for Host (sticky)" 263 266 echo " -M Build for MacOSX-i686 (32-bit) (sticky)" … … function myhelp() { 267 270 echo " -c <cpu> Set target CPU (host|i?86|...) [$cpu]" 268 271 echo " -j n Number of parallel make jobs [$makejobs]" 269 272 echo " -t <n> Timeout after configure [$readtimeout Seconds]" 270 echo " -v Verbose build messages [$ verbose]"273 echo " -v Verbose build messages [$MYTHVERBOSE]" 271 274 echo " -C Force a clean re-build" 272 275 echo " -E Force a clean re-install" 273 276 echo " -F Enable mythtv and mythplugins master patches [${patchmaster:-no}]" … … function myhelp() { 284 287 echo "MYTHPATCHES Patches to apply [$MYTHPATCHES]" 285 288 echo "MYTHVER MythTV version [$MYTHVER]" 286 289 echo "DXVA2 Windows DXVA2 support [$DXVA2]" 290 echo "X264 libx264 support for transcoding and HLS [$X264]" 287 291 echo "MYTHGIT Myth git repository [$MYTHGIT]" 288 292 echo "MYTHREPO Primary mirror [$MYTHREPO]" 289 293 echo "SOURCEFORGE Sourceforge mirror [$SOURCEFORGE]" … … do 314 318 b) [ "${OPTARG:0:1}" != "-" ] && MYTHBRANCH=$OPTARG || die "Invalid branch tag: $OPTARG" ;; 315 319 c) [ "${OPTARG:0:1}" != "-" ] && cpu=$OPTARG || die "Invalid CPU: $OPTARG" ;; 316 320 d) MYTHBUILD="debug" ;; 317 p) MYTHBUILD="profile" ;;321 p) PROFILE="yes" ;; 318 322 r) MYTHBUILD="release" ;; 319 323 j) [ $OPTARG -lt 0 -o $OPTARG -gt 99 ] && die "Invalid number of jobs: $OPTARG" 320 324 [ $OPTARG -lt 1 ] && die "Invalid make jobs: $OPTARG" 321 325 makejobs=$OPTARG ;; 322 326 t) [ $OPTARG \< 0 -o $OPTARG -gt 999 ] && die "Invalid timeout: $OPTARG" 323 327 readtimeout=$OPTARG ;; 324 v) verbose="yes" ;;328 v) MYTHVERBOSE="yes" ;; 325 329 l) logging="yes" ;; 326 330 C) cleanbuild="yes" ;; 327 331 E) reinstall="yes" ;; … … function dumpenv() { 611 615 echo "" 612 616 613 617 local param param1="MYTHTARGET MYTHBUILD MYTHBRANCH readtimeout logging patches" 614 local param2="cleanbuild reconfig reinstall cpu cpus makejobs verbosedosudo themes patchmaster"618 local param2="cleanbuild reconfig reinstall cpu cpus makejobs MYTHVERBOSE dosudo themes patchmaster" 615 619 for param in $param1 $param2 ; do 616 620 echo "$param=${!param}" 617 621 done … … function isWinTarget() { 644 648 return 1 645 649 } 646 650 651 # Print and execute a command 652 function Show() { 653 echo "$*" 654 "$@" 655 } 656 647 657 648 658 ############################################################### 649 659 # Installation check … … if [ "$MYTHTARGET" != "Host" -a "$MSYSTEM" != "MINGW32" ]; then 753 763 *) die "Unhown target: $MYTHTARGET" ;; 754 764 esac 755 765 fi 766 #[ -n "$bprefix" ] && echo "BUILD=$bprefix" >&2 767 768 769 # Detect cross compiler 770 if [ -n "$xprefix" ]; then 771 : 772 elif isWinTarget && [ "$MSYSTEM" != "MINGW32" ]; then 773 # Cross compiling to Windows 774 # Ubuntu 10.10 775 if which i586-mingw32msvc-gcc >/dev/null 2>&1 ; then 776 xprefix="i586-mingw32msvc" 777 # Mandriva 2010.2 (32 bit) 778 elif which i586-pc-mingw32-gcc >/dev/null 2>&1 ; then 779 xprefix="i586-pc-mingw32" 780 # Fedora 14 781 elif which i686-pc-mingw32-gcc >/dev/null 2>&1 ; then 782 xprefix="i686-pc-mingw32" 783 elif xcc=`locate "/usr/bin/*mingw32*-gcc" 2>/dev/null` ; then 784 xprefix=`basename "${xcc%-gcc}"` 785 else 786 die "mingw is required for cross compiling to Windows.\n"\ 787 "Try: sudo apt-get install mingw32\n"\ 788 "Or: sudo yum install mingw32-gcc.i686 mingw32-g++.i686" 789 fi 790 elif [ "$MYTHTARGET" = "MacOSX-i686" ]; then 791 # Cross compiling to MacOSX 792 for xprefix in i686-apple-darwin11 i686-apple-darwin10 i686-apple-darwin9 i686-apple-darwin8 ; do 793 which "$xprefix-gcc" >/dev/null 2>&1 && break 794 done 795 elif [ "$MYTHTARGET" = "MacOSX-PPC" ]; then 796 # Cross compiling to MacOSX 797 for xprefix in powerpc-apple-darwin10 powerpc-apple-darwin9 powerpc-apple-darwin8 powerpc-apple-darwin7 ; do 798 which "$xprefix-gcc" >/dev/null 2>&1 && break 799 done 800 fi 801 #[ -n "$xprefix" ] && echo "HOST=$xprefix" >&2 756 802 757 803 758 804 # Redirect output to log file as if invoked by: mythbuild.sh 2>&1 | tee -a mythbuild.log … … make --version >/dev/null 2>&1 || install_pkg make 855 901 gcc --version >/dev/null 2>&1 || install_pkg gcc 856 902 g++ --version >/dev/null 2>&1 || install_pkg g++ 857 903 858 if isWinTarget && [ "$MSYSTEM" != "MINGW32" ]; then859 # Cross compiling to Windows860 if [ -z "$xprefix" ]; then861 # Ubuntu 10.10862 if which i586-mingw32msvc-gcc >/dev/null 2>&1 ; then863 xprefix="i586-mingw32msvc"864 # Mandriva 2010.2 (32 bit)865 elif which i586-pc-mingw32-gcc >/dev/null 2>&1 ; then866 xprefix="i586-pc-mingw32"867 # Fedora 14868 elif which i686-pc-mingw32-gcc >/dev/null 2>&1 ; then869 xprefix="i686-pc-mingw32"870 elif xcc=`locate "/usr/bin/*mingw32*-gcc" 2>/dev/null` ; then871 xprefix=`basename "${xcc%-gcc}"`872 else873 die "mingw is required for cross compiling to Windows.\n"\874 "Try: sudo apt-get install mingw32\n"\875 "Or: sudo yum install mingw32-gcc.i686 mingw32-g++.i686"876 fi877 fi878 elif [ "$MYTHTARGET" = "MacOSX-i686" ]; then879 # Cross compiling to MacOSX880 for xprefix in i686-apple-darwin11 i686-apple-darwin10 i686-apple-darwin9 i686-apple-darwin8 ; do881 which "$xprefix-gcc" >/dev/null 2>&1 && break882 done883 elif [ "$MYTHTARGET" = "MacOSX-PPC" ]; then884 # Cross compiling to MacOSX885 for xprefix in powerpc-apple-darwin10 powerpc-apple-darwin9 powerpc-apple-darwin8 powerpc-apple-darwin7 ; do886 which "$xprefix-gcc" >/dev/null 2>&1 && break887 done888 fi889 904 # Check the C/C++ cross compilers exist 890 905 if [ -n "$xprefix" ]; then 891 906 # Check the C/C++ cross compilers exist … … function build() { 1254 1269 if [ ! -e "$stampconfigtag" -o -n "${!libcfg}" -o ! -e "Makefile" ]; then 1255 1270 rm -f "$stampconfigtag" 1256 1271 [ -e Makefile ] && make_distclean || true 1257 set -x 1258 ./configure "--prefix=$MYTHINSTALL" ${xprefix:+--host=$xprefix} \ 1272 Show ./configure "--prefix=$MYTHINSTALL" ${xprefix:+--host=$xprefix} \ 1259 1273 ${bprefix:+--build=$bprefix} $debugflag "$@" ${!libcfg} 1260 set +x1261 1274 # Call post-config function if defined 1262 1275 local libpost=${lib}_POST 1263 1276 local libpostv=${!libpost} … … if isWinTarget ; then 1297 1310 dopatches "$name" || rm -f Makefile 1298 1311 if [ ! -e Makefile ]; then 1299 1312 cp -f win32/Makefile.gcc Makefile 1300 set -x 1301 $make ${xprefix:+CC=$xprefix-gcc} \ 1313 Show $make ${xprefix:+CC=$xprefix-gcc} \ 1302 1314 ${xprefix:+AR=$xprefix-ar} \ 1303 1315 ${xprefix:+RC=$xprefix-windres} \ 1304 1316 LOCAL_UNZIP="-DCHEAP_SFX_AUTORUN" \ 1305 1317 guisfx 1306 set +x1307 1318 fi 1308 1319 popd >/dev/null 1309 1320 fi … … if [ ! -e "$stampconfig.$debug" -o -n "${!compcfg}" -o ! -e Makefile ]; then 1877 1888 1878 1889 if [ "$MSYSTEM" = "MINGW32" ]; then 1879 1890 args="$args -I $incdir/mysql -L `pwd -W`/../$MYSQLW/lib/opt -l mysql" 1880 set -x 1881 cmd /c "configure.exe $args ${!compcfg}" 1882 set +x 1891 Show cmd /c "configure.exe $args ${!compcfg}" 1883 1892 else 1884 1893 # Disable unused XmlPatterns to speed up build 1885 1894 args="$args -no-javascript-jit -no-xmlpatterns" … … if [ ! -e "$stampconfig.$debug" -o -n "${!compcfg}" -o ! -e Makefile ]; then 1933 1942 ;; 1934 1943 esac 1935 1944 1936 set -x 1937 ./configure -prefix $MYTHINSTALL $args ${!compcfg} 1938 set +x 1945 Show ./configure -prefix $MYTHINSTALL $args ${!compcfg} 1939 1946 fi 1940 1947 pausecont 1941 1948 touch "$stampconfig.$debug" … … if [ ! -e "$precis" ]; then 2057 2064 EOF 2058 2065 fi 2059 2066 2067 # Configure 2060 2068 pushd "$name" >/dev/null 2061 2069 [ "$reconfig" = "yes" ] && rm -f $stampconfig* 2062 2070 if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ … … if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ 2072 2080 # liblibmythav... are left in lib 2073 2081 $dosudo rm -f $libdir/lib*myth* 2074 2082 2083 # NB avfilter required for ffmpeg 2075 2084 args="--sysinclude=$incdir \ 2076 2085 --extra-cflags=-I$incdir --extra-cxxflags=-I$incdir --extra-libs=-L$libdir \ 2077 --disable-avdevice --disable-avfilter \ 2086 --extra-cflags=-Wuninitialized --extra-cxxflags=-Wuninitialized \ 2087 --disable-avdevice \ 2078 2088 --enable-libfftw3 --disable-joystick-menu" 2079 2089 case "$MYTHVER" in 2080 2090 0.23*) args="$args --disable-directfb" ;; 2081 2091 0.24*) args="$args --disable-directfb --enable-vaapi" ;; 2082 ""|0.25*|master) args="$args --enable-vaapi" ;;2092 *) args="$args --enable-vaapi" ;; 2083 2093 esac 2084 2094 rprefix=".." 2085 2095 case "$MYTHTARGET" in 2086 2096 [Hh]ost) 2087 2097 targetos="" 2088 # Enable x264 for mythffmpeg transcoding 2089 args="$args --enable-libx264 --enable-libmp3lame" 2098 case "$X264" in 2099 yes|y|YES|Y|1) args="$args --enable-libx264" ;; 2100 esac 2101 args="$args --enable-libmp3lame" 2090 2102 ;; 2091 2103 [Ww]indows) 2092 2104 targetos="mingw32" … … if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ 2113 2125 *) die "Unknown target: $MYTHTARGET" ;; 2114 2126 esac 2115 2127 2116 set -x 2117 ./configure "--prefix=$MYTHINSTALL" "--runprefix=$rprefix" \ 2128 Show ./configure "--prefix=$MYTHINSTALL" "--runprefix=$rprefix" \ 2118 2129 "--qmake=$MYTHWORK/$QT/bin/qmake" \ 2119 2130 ${xprefix:+--enable-cross-compile} \ 2120 2131 ${xprefix:+--cross-prefix=$xprefix-} \ 2121 2132 ${targetos:+--target_os=$targetos} \ 2122 2133 ${arch:+--arch=$arch} ${cpu:+--cpu=$cpu} \ 2123 2134 $args --compile-type=$MYTHBUILD $MYTHTV_CFG 2124 set +x2125 2135 2126 2136 case "$MYTHTARGET" in 2127 2137 [Hh]ost) … … if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ 2130 2140 ;; 2131 2141 esac 2132 2142 2143 # gprof options 2144 [ "$PROFILE" = "yes" ] && cat >> config.mak <<-EOF 2145 QMAKE_CFLAGS+="-pg" 2146 QMAKE_CXXFLAGS+="-pg" 2147 QMAKE_LFLAGS+="-pg" 2148 EOF 2149 2133 2150 # This quietens the build noise but is irreversible 2134 2151 #cat >> config.mak <<< CCONFIG+=silent 2135 2152 … … function helpmyth() { 2157 2174 exit 1 2158 2175 } 2159 2176 2160 [ "$verbose" = "no" ] && make="$make -s" 2161 : ${MYTHVERBOSE:=$verbose} 2162 $make || helpmyth 2177 [ "$MYTHVERBOSE" = "no" ] && make="$make -s" || export V=1 2178 $make $MYTHMAKEFLAGS || helpmyth 2163 2179 2164 2180 banner "Installing $name ($MYTHBUILD)" 2165 2181 make_install … … if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHPLUGINS_CFG" \ 2180 2196 plugins="--enable-all --enable-fftw" 2181 2197 case "$MYTHVER" in 2182 2198 0.23*|0.24*) plugins="$plugins --enable-libvisual" ;; 2183 ""|0.25*|master) ;;2184 2199 esac 2185 2200 2186 2201 if ! isdebug QT ; then … … if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHPLUGINS_CFG" \ 2189 2204 [ "$MYTHNETVISION" = "yes" ] || plugins="$plugins --disable-mythnetvision" 2190 2205 case "$MYTHVER" in 2191 2206 ""|0.23*|0.24*) [ "$MYTHWEATHER" = "yes" ] || plugins="$plugins --disable-mythweather" ;; 2192 0.25*|master) ;;2193 2207 esac 2194 2208 fi 2195 2209 … … if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHPLUGINS_CFG" \ 2211 2225 ;; 2212 2226 esac 2213 2227 2214 set -x; ./configure $args $plugins $MYTHPLUGINS_CFG ; set +x2228 Show ./configure $args $plugins $MYTHPLUGINS_CFG 2215 2229 pausecont 2216 2230 touch "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" 2217 2231 fi … … fi 2280 2294 ############################################################################### 2281 2295 # Create the installation 2282 2296 ############################################################################### 2283 mythlibs="myth mythfreemheg myth tv mythui mythupnp mythlivemedia"2297 mythlibs="myth mythfreemheg mythlivemedia mythtv mythui mythupnp" 2284 2298 if [ -z "$MYTHVER" ]; then 2285 2299 case "$branch" in 2286 2300 *-master) MYTHVER="master" ;; 2287 2301 *-0*24) MYTHVER="0.24" ;; 2288 2302 *-0*25) MYTHVER="0.25" ;; 2303 *-0*26) MYTHVER="0.26" ;; 2289 2304 esac 2290 2305 fi 2291 2306 case "$MYTHVER" in 2292 0.23*) mythlibs="$mythlibs mythdb" ;; 2293 0.24*) mythlibs="$mythlibs mythdb mythmetadata" ;; 2294 0.25*|master) mythlibs="$mythlibs mythbase mythmetadata mythservicecontracts mythprotoserver" ;; 2295 *) mythlibs="$mythlibs mythbase mythmetadata mythservicecontracts mythprotoserver" 2296 echo "WARNING Installation untested with this version." ;; 2307 0.23*) mythlibs="$mythlibs mythdb" ;; 2308 0.24*) mythlibs="$mythlibs mythdb mythmetadata" ;; 2309 0.25*) mythlibs="$mythlibs mythbase mythmetadata mythservicecontracts mythprotoserver" ;; 2310 0.26*) mythlibs="$mythlibs mythbase mythmetadata mythnzmqt mythprotoserver mythqjson mythservicecontracts mythzmq" ;; 2311 *) echo "WARNING mythtv nstallation untested with this version." ;& 2312 master) mythlibs="$mythlibs mythbase mythmetadata mythnzmqt mythprotoserver mythqjson mythservicecontracts mythzmq" ;; 2297 2313 esac 2314 2298 2315 ffmpeglibs="mythavcodec mythavformat mythavutil mythswscale" 2299 2316 case "$MYTHVER" in 2300 0.24*|0.23*) ffmpeglibs="$ffmpeglibs mythavcore mythpostproc" ;; 2301 0.25*|master|"") ffmpeglibs="$ffmpeglibs mythpostproc" ;; 2317 0.24*|0.23*) ffmpeglibs="$ffmpeglibs mythavcore mythpostproc" ;; 2318 0.25*) ffmpeglibs="$ffmpeglibs mythpostproc" ;; 2319 0.26*) ffmpeglibs="$ffmpeglibs mythavfilter mythpostproc mythswresample" ;; 2320 *) echo "WARNING ffmpeg installation untested with this version." ;& 2321 master) ffmpeglibs="$ffmpeglibs mythavfilter mythpostproc mythswresample" ;; 2302 2322 esac 2323 2303 2324 xtralibs="xml2 xslt freetype mp3lame dvdcss exif ogg vorbis vorbisenc tag cdio cdio_cdda cdio_paranoia udf visual-0.4" 2304 2325 QTDLLS="QtCore QtGui QtNetwork QtOpenGL QtSql QtSvg QtWebKit QtXml Qt3Support" 2305 2326 case "$MYTHVER" in 2306 ""|0.25*|master) QTDLLS="$QTDLLS QtScript" ;; 2327 0.2[0-4]*) ;; 2328 *) QTDLLS="$QTDLLS QtScript" ;; 2307 2329 esac 2308 2330 2309 2331 if isWinTarget ; then … … if isWinTarget ; then 2316 2338 ln -s $bindir/myth*.exe . 2317 2339 [ -r "$bindir/mtd.exe" ] && ln -s $bindir/mtd.exe . 2318 2340 for lib in $mythlibs ; do 2319 ln -s $bindir/lib$lib-*.dll . 2341 if [ -e $bindir/lib$lib-*.dll ] ; then 2342 ln -s $bindir/lib$lib-*.dll . 2343 elif [ -e $bindir/lib$lib.dll ] ; then 2344 ln -s $bindir/lib$lib.dll . 2345 elif [ -e $bindir/$lib.dll ] ; then 2346 ln -s $bindir/$lib.dll . 2347 fi 2320 2348 done 2321 2349 2322 2350 # Mingw runtime