media-autobuild_suite.bat 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055
  1. @echo off
  2. rem -----------------------------------------------------------------------------
  3. rem LICENSE --------------------------------------------------------------------
  4. rem -----------------------------------------------------------------------------
  5. rem This Windows Batchscript is for setup a compiler environment for building
  6. rem ffmpeg and other media tools under Windows.
  7. rem
  8. rem Copyright (C) 2013 jb_alvarado
  9. rem
  10. rem This program is free software: you can redistribute it and/or modify
  11. rem it under the terms of the GNU General Public License as published by
  12. rem the Free Software Foundation, either version 3 of the License, or
  13. rem (at your option) any later version.
  14. rem
  15. rem This program is distributed in the hope that it will be useful,
  16. rem but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. rem GNU General Public License for more details.
  19. rem
  20. rem You should have received a copy of the GNU General Public License
  21. rem along with this program. If not, see <https://www.gnu.org/licenses/>.
  22. rem -----------------------------------------------------------------------------
  23. color 70
  24. title media-autobuild_suite
  25. setlocal
  26. chcp 65001 >nul 2>&1
  27. cd /d "%~dp0"
  28. set "TERM=xterm-256color"
  29. setlocal
  30. set instdir=%CD%
  31. if %PROCESSOR_ARCHITECTURE%==x86 if NOT DEFINED PROCESSOR_ARCHITEW6432 (
  32. echo ----------------------------------------------------------------------
  33. echo. 32-bit host machine and OS are no longer supported by the suite
  34. echo. nor upstream for building.
  35. echo. Please consider either moving to a 64-bit machine and OS or use
  36. echo. a 64-bit machine to compile the binaries you need.
  37. pause
  38. exit
  39. )
  40. if not exist %instdir% (
  41. echo ----------------------------------------------------------------------
  42. echo. You have probably run the script in a path with spaces.
  43. echo. This is not supported.
  44. echo. Please move the script to use a path without spaces. Example:
  45. echo. Incorrect: C:\build suite\
  46. echo. Correct: C:\build_suite\
  47. pause
  48. exit
  49. )
  50. if not ["%instdir:~32,1%"]==[""] (
  51. echo -------------------------------------------------------------------------------
  52. echo. The total filepath to the suite seems too large (larger than 32 characters^):
  53. echo. %instdir%
  54. echo. Some packages might fail building because of it.
  55. echo. Please move the suite directory closer to the root of your drive and maybe
  56. echo. rename the suite directory to a smaller name. Examples:
  57. echo. Avoid: C:\Users\Administrator\Desktop\testing\media-autobuild_suite-master
  58. echo. Prefer: C:\media-autobuild_suite
  59. echo. Prefer: C:\ab-suite
  60. pause
  61. )
  62. for /f "usebackq tokens=*" %%f in (`powershell -noprofile -command $PSVersionTable.PSVersion.Major`) ^
  63. do if %%f lss 4 (
  64. echo ----------------------------------------------------------------------
  65. echo. You do not have a powershell version greater than 4.
  66. echo. This is not supported.
  67. echo. Please upgrade your powershell either through downloading and installing WMF 5.1
  68. echo. https://docs.microsoft.com/en-us/powershell/wmf/5.1/install-configure
  69. echo. or by upgrading your OS.
  70. echo. This is not Powershell Core. That is separate.
  71. pause
  72. exit
  73. )
  74. (
  75. where lib.exe || ^
  76. where cl.exe || ^
  77. if DEFINED VSINSTALLDIR cd .
  78. ) >nul 2>&1 && (
  79. rem MSVCINSTALLED
  80. echo ----------------------------------------------------------------------
  81. echo. You are running in a MSVC environment (cl.exe or lib.exe detected^)
  82. echo. This is not supported.
  83. echo. Please run the script through a normal cmd.exe some other way.
  84. echo.
  85. echo. Detected Paths:
  86. where lib.exe 2>nul
  87. where cl.exe 2>nul
  88. echo %VSINSTALLDIR%
  89. pause
  90. exit
  91. )
  92. set build=%instdir%\build
  93. if not exist %build% mkdir %build%
  94. set msyspackages=asciidoc autoconf-wrapper automake-wrapper autogen base bison diffstat dos2unix filesystem help2man ^
  95. intltool libtool patch python xmlto make zip unzip git subversion wget p7zip man-db ^
  96. gperf winpty texinfo gyp doxygen autoconf-archive itstool ruby mintty flex msys2-runtime pacutils
  97. set mingwpackages=cmake dlfcn libpng nasm pcre tools-git yasm ninja pkgconf meson ccache jq ^
  98. clang gettext-tools lld rust
  99. :: built-ins
  100. set ffmpeg_options_builtin=--disable-autodetect amf bzlib cuda cuvid d3d11va dxva2 ^
  101. iconv lzma nvenc schannel zlib sdl2 ffnvcodec nvdec cuda-llvm
  102. :: common external libs
  103. set ffmpeg_options_basic=gmp libmp3lame libopus libvorbis libvpx libx264 libx265 ^
  104. libdav1d libaom --disable-debug libfdk-aac
  105. :: options used in zeranoe builds and not present above
  106. set ffmpeg_options_zeranoe=fontconfig gnutls libass libbluray libfreetype ^
  107. libmfx libmysofa libopencore-amrnb libopencore-amrwb libopenjpeg libsnappy ^
  108. libsoxr libspeex libtheora libtwolame libvidstab libvo-amrwbenc ^
  109. libwebp libxml2 libzimg libshine gpl openssl libtls avisynth mbedtls libxvid ^
  110. libopenmpt version3 librav1e libsrt libgsm libvmaf libsvtav1
  111. :: options also available with the suite
  112. set ffmpeg_options_full=chromaprint decklink frei0r libaribb24 libbs2b libcaca ^
  113. libcdio libflite libfribidi libgme libilbc libsvthevc ^
  114. libsvtvp9 libkvazaar libmodplug librist librtmp librubberband #libssh ^
  115. libtesseract libxavs libzmq libzvbi openal libcodec2 ladspa #vapoursynth #liblensfun ^
  116. libglslang vulkan libdavs2 libxavs2 libuavs3d libplacebo libjxl
  117. :: options also available with the suite that add shared dependencies
  118. set ffmpeg_options_full_shared=opencl opengl cuda-nvcc libnpp libopenh264
  119. :: built-ins
  120. set mpv_options_builtin=#cplayer #manpage-build #lua #javascript ^
  121. #libbluray #uchardet #rubberband #lcms2 #libarchive #libavdevice ^
  122. #shaderc #spirv-cross #d3d11 #jpeg #vapoursynth #vulkan #libplacebo
  123. :: overriden defaults
  124. set mpv_options_basic=--disable-debug-build "--lua=luajit"
  125. :: all supported options
  126. set mpv_options_full=dvdnav cdda #egl-angle #html-build ^
  127. #pdf-build libmpv-shared openal sdl2 #sdl2-gamepad #sdl2-audio #sdl2-video
  128. set iniOptions=arch license2 vpx2 x2643 x2652 other265 flac fdkaac mediainfo ^
  129. soxB ffmpegB2 ffmpegUpdate ffmpegChoice mp4box rtmpdump mplayer2 mpv cores deleteSource ^
  130. strip pack logging bmx standalone updateSuite aom faac exhale ffmbc curl cyanrip2 ^
  131. rav1e ripgrep dav1d libavif vvc uvg266 jq dssim avs2 dovitool hdr10plustool ^
  132. timeStamp noMintty ccache svthevc svtav1 svtvp9 xvc jo vlc CC jpegxl vvenc vvdec ffmpegPath
  133. @rem re-add autouploadlogs if we find some way to upload to github directly instead
  134. set deleteIni=0
  135. set ini=%build%\media-autobuild_suite.ini
  136. rem Set all INI options to 0
  137. for %%a in (%iniOptions%) do set %%aINI=0
  138. if exist %ini% (
  139. rem Set INI options to what's found in the inifile
  140. echo.foreach ($option in $env:iniOptions.split(" "^)^) { ^
  141. $m = Select-String -Path $env:ini -CaseSensitive -SimpleMatch -Pattern $option; ^
  142. if ($null -ne $m^) { ^
  143. Write-Output "set `"${option}INI^=$($m.Line.Split("="^, 2^)[1]^)`"" ^
  144. } else { ^
  145. Write-Output "set `"${option}INI^=0^`"" ^
  146. } ^
  147. } | powershell -NoProfile -Command - > %build%\options.bat
  148. call %build%\options.bat
  149. del %build%\options.bat
  150. ) else set deleteIni=1
  151. setlocal EnableDelayedExpansion
  152. rem Check if any of the *INI options are still unset (0)
  153. for %%a in (%iniOptions%) do if [0]==[!%%aINI!] set deleteIni=1 && goto :endINIcheck
  154. :endINIcheck
  155. endlocal & set deleteIni=%deleteIni%
  156. if %deleteINI%==1 echo.[compiler list] >"%ini%"
  157. :selectSystem
  158. if [0]==[%archINI%] (
  159. echo -------------------------------------------------------------------------------
  160. echo -------------------------------------------------------------------------------
  161. echo.
  162. echo. Select the build target system:
  163. echo. 1 = both [32 bit and 64 bit]
  164. echo. 2 = 32 bit build system
  165. echo. 3 = 64 bit build system
  166. echo.
  167. echo -------------------------------------------------------------------------------
  168. echo -------------------------------------------------------------------------------
  169. set /P buildEnv="Build System: "
  170. ) else set buildEnv=%archINI%
  171. if "%buildEnv%"=="" GOTO selectSystem
  172. if %buildEnv%==1 set "build32=yes" && set "build64=yes"
  173. if %buildEnv%==2 set "build32=yes" && set "build64=no"
  174. if %buildEnv%==3 set "build32=no" && set "build64=yes"
  175. if %buildEnv% GTR 3 GOTO selectSystem
  176. if %deleteINI%==1 echo.arch=^%buildEnv%>>%ini%
  177. :ffmpeglicense
  178. if [0]==[%license2INI%] (
  179. echo -------------------------------------------------------------------------------
  180. echo -------------------------------------------------------------------------------
  181. echo.
  182. echo. Build FFmpeg with which license?
  183. echo. 1 = Non-free [unredistributable, but can include anything]
  184. echo. 2 = GPLv3 [disables OpenSSL and FDK-AAC]
  185. echo. 3 = GPLv2.1
  186. echo. [Same disables as GPLv3 with addition of gmp, opencore codecs]
  187. echo. 4 = LGPLv3
  188. echo. [Disables x264, x265, XviD, GPL filters, etc.
  189. echo. but reenables OpenSSL/FDK-AAC]
  190. echo. 5 = LGPLv2.1 [same disables as LGPLv3 + GPLv2.1]
  191. echo.
  192. echo. If building for yourself, it's OK to choose non-free.
  193. echo. If building to redistribute online, choose GPL or LGPL.
  194. echo. If building to include in a GPLv2.1 binary, choose LGPLv2.1 or GPLv2.1.
  195. echo. If you want to use FFmpeg together with closed source software, choose LGPL
  196. echo. and follow instructions in https://www.ffmpeg.org/legal.html
  197. echo.
  198. echo. OpenSSL and FDK-AAC have licenses incompatible with GPL but compatible
  199. echo. with LGPL, so they won't be disabled automatically if you choose LGPL.
  200. echo.
  201. echo -------------------------------------------------------------------------------
  202. echo -------------------------------------------------------------------------------
  203. set /P ffmpegLicense="FFmpeg license: "
  204. ) else set ffmpegLicense=%license2INI%
  205. if "%ffmpegLicense%"=="" GOTO ffmpeglicense
  206. if %ffmpegLicense%==1 set "license2=nonfree"
  207. if %ffmpegLicense%==2 set "license2=gplv3"
  208. if %ffmpegLicense%==3 set "license2=gpl"
  209. if %ffmpegLicense%==4 set "license2=lgplv3"
  210. if %ffmpegLicense%==5 set "license2=lgpl"
  211. if %ffmpegLicense% GTR 5 GOTO ffmpeglicense
  212. if %deleteINI%==1 echo.license2=^%ffmpegLicense%>>%ini%
  213. :standalone
  214. if [0]==[%standaloneINI%] (
  215. echo -------------------------------------------------------------------------------
  216. echo -------------------------------------------------------------------------------
  217. echo.
  218. echo. Build standalone binaries for libraries included in FFmpeg?
  219. echo. eg. Compile opusenc.exe if --enable-libopus
  220. echo. 1 = Yes
  221. echo. 2 = No
  222. echo.
  223. echo -------------------------------------------------------------------------------
  224. echo -------------------------------------------------------------------------------
  225. set /P buildstandalone="Build standalone binaries: "
  226. ) else set buildstandalone=%standaloneINI%
  227. if "%buildstandalone%"=="" GOTO standalone
  228. if %buildstandalone%==1 set "standalone=y"
  229. if %buildstandalone%==2 set "standalone=n"
  230. if %buildstandalone% GTR 2 GOTO standalone
  231. if %deleteINI%==1 echo.standalone=^%buildstandalone%>>%ini%
  232. :vpx
  233. if [0]==[%vpx2INI%] (
  234. echo -------------------------------------------------------------------------------
  235. echo -------------------------------------------------------------------------------
  236. echo.
  237. echo. Build vpx [VP8/VP9 encoder]?
  238. echo. 1 = Yes
  239. echo. 2 = No
  240. echo.
  241. echo. Binaries being built depends on "standalone=y"
  242. echo.
  243. echo -------------------------------------------------------------------------------
  244. echo -------------------------------------------------------------------------------
  245. set /P buildvpx="Build vpx: "
  246. ) else set buildvpx=%vpx2INI%
  247. if "%buildvpx%"=="" GOTO vpx
  248. if %buildvpx%==1 set "vpx2=y"
  249. if %buildvpx%==2 set "vpx2=n"
  250. if %buildvpx% GTR 2 GOTO vpx
  251. if %deleteINI%==1 echo.vpx2=^%buildvpx%>>%ini%
  252. :aom
  253. if [0]==[%aomINI%] (
  254. echo -------------------------------------------------------------------------------
  255. echo -------------------------------------------------------------------------------
  256. echo.
  257. echo. Build aom [Alliance for Open Media codec]?
  258. echo. 1 = Yes
  259. echo. 2 = No
  260. echo.
  261. echo. Binaries being built depends on "standalone=y"
  262. echo.
  263. echo -------------------------------------------------------------------------------
  264. echo -------------------------------------------------------------------------------
  265. set /P buildaom="Build aom: "
  266. ) else set buildaom=%aomINI%
  267. if "%buildaom%"=="" GOTO aom
  268. if %buildaom%==1 set "aom=y"
  269. if %buildaom%==2 set "aom=n"
  270. if %buildaom% GTR 2 GOTO aom
  271. if %deleteINI%==1 echo.aom=^%buildaom%>>%ini%
  272. :rav1e
  273. if [0]==[%rav1eINI%] (
  274. echo -------------------------------------------------------------------------------
  275. echo -------------------------------------------------------------------------------
  276. echo.
  277. echo. Build rav1e [Alternative, faster AV1 standalone encoder]?
  278. echo. 1 = Yes
  279. echo. 2 = No
  280. echo.
  281. echo -------------------------------------------------------------------------------
  282. echo -------------------------------------------------------------------------------
  283. set /P buildrav1e="Build rav1e: "
  284. ) else set buildrav1e=%rav1eINI%
  285. if "%buildrav1e%"=="" GOTO rav1e
  286. if %buildrav1e%==1 set "rav1e=y"
  287. if %buildrav1e%==2 set "rav1e=n"
  288. if %buildrav1e% GTR 2 GOTO rav1e
  289. if %deleteINI%==1 echo.rav1e=^%buildrav1e%>>%ini%
  290. :dav1d
  291. if [0]==[%dav1dINI%] (
  292. echo -------------------------------------------------------------------------------
  293. echo -------------------------------------------------------------------------------
  294. echo.
  295. echo. Build dav1d [Alternative, faster AV1 decoder]?
  296. echo. 1 = Yes
  297. echo. 2 = No
  298. echo.
  299. echo. Binaries being built depends on "standalone=y" and are always static.
  300. echo.
  301. echo -------------------------------------------------------------------------------
  302. echo -------------------------------------------------------------------------------
  303. set /P builddav1d="Build dav1d: "
  304. ) else set builddav1d=%dav1dINI%
  305. if "%builddav1d%"=="" GOTO dav1d
  306. if %builddav1d%==1 set "dav1d=y"
  307. if %builddav1d%==2 set "dav1d=n"
  308. if %builddav1d% GTR 2 GOTO dav1d
  309. if %deleteINI%==1 echo.dav1d=^%builddav1d%>>%ini%
  310. :libavif
  311. if [0]==[%libavifINI%] (
  312. echo -------------------------------------------------------------------------------
  313. echo -------------------------------------------------------------------------------
  314. echo.
  315. echo. Build libavif [AV1 image format encoder and decoder]?
  316. echo. 1 = Yes
  317. echo. 2 = No
  318. echo.
  319. echo. Binaries being built depends on "standalone=y" and are always static.
  320. echo. Will build aom, dav1d, and rav1e if not already previously enabled
  321. echo.
  322. echo -------------------------------------------------------------------------------
  323. echo -------------------------------------------------------------------------------
  324. set /P buildlibavif="Build libavif: "
  325. ) else set buildlibavif=%libavifINI%
  326. if "%buildlibavif%"=="" GOTO libavif
  327. if %buildlibavif%==1 set "libavif=y"
  328. if %buildlibavif%==2 set "libavif=n"
  329. if %buildlibavif% GTR 2 GOTO libavif
  330. if %deleteINI%==1 echo.libavif=^%buildlibavif%>>%ini%
  331. :jpegxl
  332. if [0]==[%jpegxlINI%] (
  333. echo -------------------------------------------------------------------------------
  334. echo -------------------------------------------------------------------------------
  335. echo.
  336. echo. Build jpeg-xl tools [JPEG XL image format encoder and decoder]?
  337. echo. 1 = Yes
  338. echo. 2 = No
  339. echo.
  340. echo -------------------------------------------------------------------------------
  341. echo -------------------------------------------------------------------------------
  342. set /P buildjpegxl="Build jpegxl: "
  343. ) else set buildjpegxl=%jpegxlINI%
  344. if "%buildjpegxl%"=="" GOTO jpegxl
  345. if %buildjpegxl%==1 set "jpegxl=y"
  346. if %buildjpegxl%==2 set "jpegxl=n"
  347. if %buildjpegxl% GTR 2 GOTO jpegxl
  348. if %deleteINI%==1 echo.jpegxl=^%buildjpegxl%>>%ini%
  349. :x264
  350. if [0]==[%x2643INI%] (
  351. echo -------------------------------------------------------------------------------
  352. echo -------------------------------------------------------------------------------
  353. echo.
  354. echo. Build x264 [H.264 encoder]?
  355. echo. 1 = Lib/binary with 8 and 10-bit
  356. echo. 2 = No
  357. echo. 3 = Lib/binary with only 10-bit
  358. echo. 4 = Lib/binary with 8 and 10-bit, and libavformat and ffms2
  359. echo. 5 = Shared lib/binary with 8 and 10-bit
  360. echo. 6 = Same as 4 with video codecs only (can reduce size by ~3MB^)
  361. echo. 7 = Lib/binary with only 8-bit
  362. echo.
  363. echo. Binaries being built depends on "standalone=y" and are always static.
  364. echo.
  365. echo -------------------------------------------------------------------------------
  366. echo -------------------------------------------------------------------------------
  367. set /P buildx264="Build x264: "
  368. ) else set buildx264=%x2643INI%
  369. if "%buildx264%"=="" GOTO x264
  370. if %buildx264%==1 set "x2643=yes"
  371. if %buildx264%==2 set "x2643=no"
  372. if %buildx264%==3 set "x2643=high"
  373. if %buildx264%==4 set "x2643=full"
  374. if %buildx264%==5 set "x2643=shared"
  375. if %buildx264%==6 set "x2643=fullv"
  376. if %buildx264%==7 set "x2643=o8"
  377. if %buildx264% GTR 7 GOTO x264
  378. if %deleteINI%==1 echo.x2643=^%buildx264%>>%ini%
  379. :x265
  380. if [0]==[%x2652INI%] (
  381. echo -------------------------------------------------------------------------------
  382. echo -------------------------------------------------------------------------------
  383. echo.
  384. echo. Build x265 [H.265 encoder]?
  385. echo. 1 = Lib/binary with Main, Main10 and Main12
  386. echo. 2 = No
  387. echo. 3 = Lib/binary with Main10 only
  388. echo. 4 = Lib/binary with Main only
  389. echo. 5 = Lib/binary with Main, shared libs with Main10 and Main12
  390. echo. 6 = Same as 1 with XP support and non-XP compatible x265-numa.exe
  391. echo. 7 = Lib/binary with Main12 only
  392. echo.
  393. echo. Binaries being built depends on "standalone=y"
  394. echo.
  395. echo -------------------------------------------------------------------------------
  396. echo -------------------------------------------------------------------------------
  397. set /P buildx265="Build x265: "
  398. ) else set buildx265=%x2652INI%
  399. if "%buildx265%"=="" GOTO x265
  400. if %buildx265%==1 set "x2652=y"
  401. if %buildx265%==2 set "x2652=n"
  402. if %buildx265%==3 set "x2652=o10"
  403. if %buildx265%==4 set "x2652=o8"
  404. if %buildx265%==5 set "x2652=s"
  405. if %buildx265%==6 set "x2652=d"
  406. if %buildx265%==7 set "x2652=o12"
  407. if %buildx265% GTR 7 GOTO x265
  408. if %deleteINI%==1 echo.x2652=^%buildx265%>>%ini%
  409. :other265
  410. if [0]==[%other265INI%] (
  411. echo -------------------------------------------------------------------------------
  412. echo -------------------------------------------------------------------------------
  413. echo.
  414. echo. Build Kvazaar? [H.265 encoder]
  415. echo. 1 = Yes
  416. echo. 2 = No
  417. echo.
  418. echo -------------------------------------------------------------------------------
  419. echo -------------------------------------------------------------------------------
  420. set /P buildother265="Build kvazaar: "
  421. ) else set buildother265=%other265INI%
  422. if "%buildother265%"=="" GOTO other265
  423. if %buildother265%==1 set "other265=y"
  424. if %buildother265%==2 set "other265=n"
  425. if %buildother265% GTR 2 GOTO other265
  426. if %deleteINI%==1 echo.other265=^%buildother265%>>%ini%
  427. :svthevc
  428. if [0]==[%svthevcINI%] (
  429. echo -------------------------------------------------------------------------------
  430. echo -------------------------------------------------------------------------------
  431. echo.
  432. echo. Build SVT-HEVC? [H.265 encoder]
  433. echo. 1 = Yes
  434. echo. 2 = No
  435. echo.
  436. echo -------------------------------------------------------------------------------
  437. echo -------------------------------------------------------------------------------
  438. set /P buildsvthevc="Build SVT-HEVC: "
  439. ) else set buildsvthevc=%svthevcINI%
  440. if "%buildsvthevc%"=="" GOTO svthevc
  441. if %buildsvthevc%==1 set "svthevc=y"
  442. if %buildsvthevc%==2 set "svthevc=n"
  443. if %buildsvthevc% GTR 2 GOTO svthevc
  444. if %deleteINI%==1 echo.svthevc=^%buildsvthevc%>>%ini%
  445. :xvc
  446. if [0]==[%xvcINI%] (
  447. echo -------------------------------------------------------------------------------
  448. echo -------------------------------------------------------------------------------
  449. echo.
  450. echo. Build xvc? [HEVC and AV1 competitor]
  451. echo. 1 = Yes
  452. echo. 2 = No
  453. echo.
  454. echo. Any issues with this will be considered low-priority due to lack of
  455. echo. potential stability
  456. echo -------------------------------------------------------------------------------
  457. echo -------------------------------------------------------------------------------
  458. set /P buildxvc="Build xvc: "
  459. ) else set buildxvc=%xvcINI%
  460. if "%buildxvc%"=="" GOTO xvc
  461. if %buildxvc%==1 set "xvc=y"
  462. if %buildxvc%==2 set "xvc=n"
  463. if %buildxvc% GTR 2 GOTO xvc
  464. if %deleteINI%==1 echo.xvc=^%buildxvc%>>%ini%
  465. :vvc
  466. if [0]==[%vvcINI%] (
  467. echo -------------------------------------------------------------------------------
  468. echo -------------------------------------------------------------------------------
  469. echo.
  470. echo. Build VVC Reference Software? [H.265 successor enc/decoder]
  471. echo. 1 = Yes
  472. echo. 2 = No
  473. echo.
  474. echo -------------------------------------------------------------------------------
  475. echo -------------------------------------------------------------------------------
  476. set /P buildvvc="Build vvc: "
  477. ) else set buildvvc=%vvcINI%
  478. if "%buildvvc%"=="" GOTO vvc
  479. if %buildvvc%==1 set "vvc=y"
  480. if %buildvvc%==2 set "vvc=n"
  481. if %buildvvc% GTR 2 GOTO vvc
  482. if %deleteINI%==1 echo.vvc=^%buildvvc%>>%ini%
  483. :uvg266
  484. if [0]==[%uvg266INI%] (
  485. echo -------------------------------------------------------------------------------
  486. echo -------------------------------------------------------------------------------
  487. echo.
  488. echo. Build uvg266? [H.266 encoder by ultravideo, the Kvazaar team]
  489. echo. 1 = Yes
  490. echo. 2 = No
  491. echo.
  492. echo -------------------------------------------------------------------------------
  493. echo -------------------------------------------------------------------------------
  494. set /P builduvg266="Build uvg266: "
  495. ) else set builduvg266=%uvg266INI%
  496. if "%builduvg266%"=="" GOTO uvg266
  497. if %builduvg266%==1 set "uvg266=y"
  498. if %builduvg266%==2 set "uvg266=n"
  499. if %builduvg266% GTR 2 GOTO uvg266
  500. if %deleteINI%==1 echo.uvg266=^%builduvg266%>>%ini%
  501. :vvenc
  502. if [0]==[%vvencINI%] (
  503. echo -------------------------------------------------------------------------------
  504. echo -------------------------------------------------------------------------------
  505. echo.
  506. echo. Build vvenc? [Fraunhofer HHI Versatile Video Encoder]
  507. echo. 1 = Yes
  508. echo. 2 = No
  509. echo.
  510. echo -------------------------------------------------------------------------------
  511. echo -------------------------------------------------------------------------------
  512. set /P buildvvenc="Build vvenc: "
  513. ) else set buildvvenc=%vvencINI%
  514. if "%buildvvenc%"=="" GOTO vvenc
  515. if %buildvvenc%==1 set "vvenc=y"
  516. if %buildvvenc%==2 set "vvenc=n"
  517. if %buildvvenc% GTR 2 GOTO vvenc
  518. if %deleteINI%==1 echo.vvenc=^%buildvvenc%>>%ini%
  519. :vvdec
  520. if [0]==[%vvdecINI%] (
  521. echo -------------------------------------------------------------------------------
  522. echo -------------------------------------------------------------------------------
  523. echo.
  524. echo. Build vvdec? [Fraunhofer HHI Versatile Video Decoder]
  525. echo. 1 = Yes
  526. echo. 2 = No
  527. echo.
  528. echo -------------------------------------------------------------------------------
  529. echo -------------------------------------------------------------------------------
  530. set /P buildvvdec="Build vvdec: "
  531. ) else set buildvvdec=%vvdecINI%
  532. if "%buildvvdec%"=="" GOTO vvdec
  533. if %buildvvdec%==1 set "vvdec=y"
  534. if %buildvvdec%==2 set "vvdec=n"
  535. if %buildvvdec% GTR 2 GOTO vvdec
  536. if %deleteINI%==1 echo.vvdec=^%buildvvdec%>>%ini%
  537. :svtav1
  538. if [0]==[%svtav1INI%] (
  539. echo -------------------------------------------------------------------------------
  540. echo -------------------------------------------------------------------------------
  541. echo.
  542. echo. Build SVT-AV1? [AV1 encoder]
  543. echo. 1 = Yes
  544. echo. 2 = No
  545. echo.
  546. echo. Look at the link for hardware requirements
  547. echo. https://github.com/OpenVisualCloud/SVT-AV1/blob/master/README.md#Hardware
  548. echo.
  549. echo -------------------------------------------------------------------------------
  550. echo -------------------------------------------------------------------------------
  551. set /P buildsvtav1="Build SVT-AV1: "
  552. ) else set buildsvtav1=%svtav1INI%
  553. if "%buildsvtav1%"=="" GOTO svtav1
  554. if %buildsvtav1%==1 set "svtav1=y"
  555. if %buildsvtav1%==2 set "svtav1=n"
  556. if %buildsvtav1% GTR 2 GOTO svtav1
  557. if %deleteINI%==1 echo.svtav1=^%buildsvtav1%>>%ini%
  558. :svtvp9
  559. if [0]==[%svtvp9INI%] (
  560. echo -------------------------------------------------------------------------------
  561. echo -------------------------------------------------------------------------------
  562. echo.
  563. echo. Build SVT-VP9? [VP9 encoder]
  564. echo. 1 = Yes
  565. echo. 2 = No
  566. echo.
  567. echo. Look at the link for hardware requirements
  568. echo. https://github.com/OpenVisualCloud/SVT-VP9#Hardware
  569. echo.
  570. echo -------------------------------------------------------------------------------
  571. echo -------------------------------------------------------------------------------
  572. set /P buildsvtvp9="Build SVT-VP9: "
  573. ) else set buildsvtvp9=%svtvp9INI%
  574. if "%buildsvtvp9%"=="" GOTO svtvp9
  575. if %buildsvtvp9%==1 set "svtvp9=y"
  576. if %buildsvtvp9%==2 set "svtvp9=n"
  577. if %buildsvtvp9% GTR 2 GOTO svtvp9
  578. if %deleteINI%==1 echo.svtvp9=^%buildsvtvp9%>>%ini%
  579. :flac
  580. if [0]==[%flacINI%] (
  581. echo -------------------------------------------------------------------------------
  582. echo -------------------------------------------------------------------------------
  583. echo.
  584. echo. Build FLAC? [Free Lossless Audio Codec]
  585. echo. 1 = Yes
  586. echo. 2 = No
  587. echo.
  588. echo -------------------------------------------------------------------------------
  589. echo -------------------------------------------------------------------------------
  590. set /P buildflac="Build flac: "
  591. ) else set buildflac=%flacINI%
  592. if "%buildflac%"=="" GOTO flac
  593. if %buildflac%==1 set "flac=y"
  594. if %buildflac%==2 set "flac=n"
  595. if %buildflac% GTR 2 GOTO flac
  596. if %deleteINI%==1 echo.flac=^%buildflac%>>%ini%
  597. :fdkaac
  598. if [0]==[%fdkaacINI%] (
  599. echo -------------------------------------------------------------------------------
  600. echo -------------------------------------------------------------------------------
  601. echo.
  602. echo. Build FDK-AAC library and binary? [AAC-LC/HE/HEv2 codec]
  603. echo. 1 = Yes
  604. echo. 2 = No
  605. echo.
  606. echo -------------------------------------------------------------------------------
  607. echo -------------------------------------------------------------------------------
  608. set /P buildfdkaac="Build fdkaac: "
  609. ) else set buildfdkaac=%fdkaacINI%
  610. if "%buildfdkaac%"=="" GOTO fdkaac
  611. if %buildfdkaac%==1 set "fdkaac=y"
  612. if %buildfdkaac%==2 set "fdkaac=n"
  613. if %buildfdkaac% GTR 2 GOTO fdkaac
  614. if %deleteINI%==1 echo.fdkaac=^%buildfdkaac%>>%ini%
  615. :faac
  616. if [0]==[%faacINI%] (
  617. echo -------------------------------------------------------------------------------
  618. echo -------------------------------------------------------------------------------
  619. echo.
  620. echo. Build FAAC library and binary? [old, low-quality and nonfree AAC-LC codec]
  621. echo. 1 = Yes
  622. echo. 2 = No
  623. echo.
  624. echo -------------------------------------------------------------------------------
  625. echo -------------------------------------------------------------------------------
  626. set /P buildfaac="Build faac: "
  627. ) else set buildfaac=%faacINI%
  628. if "%buildfaac%"=="" GOTO faac
  629. if %buildfaac%==1 set "faac=y"
  630. if %buildfaac%==2 set "faac=n"
  631. if %buildfaac% GTR 2 GOTO faac
  632. if %deleteINI%==1 echo.faac=^%buildfaac%>>%ini%
  633. :exhale
  634. if [0]==[%exhaleINI%] (
  635. echo -------------------------------------------------------------------------------
  636. echo -------------------------------------------------------------------------------
  637. echo.
  638. echo. Build exhale binary? [open-source ISO/IEC 23003-3 USAC, xHE-AAC encoder]
  639. echo. 1 = Yes
  640. echo. 2 = No
  641. echo.
  642. echo. Binaries being built do not depend on "standalone=y"
  643. echo.
  644. echo -------------------------------------------------------------------------------
  645. echo -------------------------------------------------------------------------------
  646. set /P buildexhale="Build exhale: "
  647. ) else set buildexhale=%exhaleINI%
  648. if "%buildexhale%"=="" GOTO exhale
  649. if %buildexhale%==1 set "exhale=y"
  650. if %buildexhale%==2 set "exhale=n"
  651. if %buildexhale% GTR 2 GOTO exhale
  652. if %deleteINI%==1 echo.exhale=^%buildexhale%>>%ini%
  653. :mediainfo
  654. if [0]==[%mediainfoINI%] (
  655. echo -------------------------------------------------------------------------------
  656. echo -------------------------------------------------------------------------------
  657. echo.
  658. echo. Build mediainfo binaries [Multimedia file information tool]?
  659. echo. 1 = Yes
  660. echo. 2 = No
  661. echo.
  662. echo -------------------------------------------------------------------------------
  663. echo -------------------------------------------------------------------------------
  664. set /P buildmediainfo="Build mediainfo: "
  665. ) else set buildmediainfo=%mediainfoINI%
  666. if "%buildmediainfo%"=="" GOTO mediainfo
  667. if %buildmediainfo%==1 set "mediainfo=y"
  668. if %buildmediainfo%==2 set "mediainfo=n"
  669. if %buildmediainfo% GTR 2 GOTO mediainfo
  670. if %deleteINI%==1 echo.mediainfo=^%buildmediainfo%>>%ini%
  671. :sox
  672. if [0]==[%soxBINI%] (
  673. echo -------------------------------------------------------------------------------
  674. echo -------------------------------------------------------------------------------
  675. echo.
  676. echo. Build sox binaries [Sound processing tool]?
  677. echo. 1 = Yes
  678. echo. 2 = No
  679. echo.
  680. echo -------------------------------------------------------------------------------
  681. echo -------------------------------------------------------------------------------
  682. set /P buildsox="Build sox: "
  683. ) else set buildsox=%soxBINI%
  684. if "%buildsox%"=="" GOTO sox
  685. if %buildsox%==1 set "sox=y"
  686. if %buildsox%==2 set "sox=n"
  687. if %buildsox% GTR 2 GOTO sox
  688. if %deleteINI%==1 echo.soxB=^%buildsox%>>%ini%
  689. :ffmpeg
  690. if [0]==[%ffmpegB2INI%] (
  691. echo -------------------------------------------------------------------------------
  692. echo -------------------------------------------------------------------------------
  693. echo.
  694. echo. Build FFmpeg binaries and libraries:
  695. echo. 1 = Yes [static] [recommended]
  696. echo. 2 = No
  697. echo. 3 = Shared
  698. echo. 4 = Both static and shared [shared goes to an isolated directory]
  699. echo. 5 = Shared-only with some shared dependencies (libass, freetype and fribidi^)
  700. echo. 6 = Same as 4, but static compilation ignores shared dependencies
  701. echo.
  702. echo. Note: Option 5 differs from 3 in that libass, freetype and fribidi are
  703. echo. compiled shared so they take less space. Currently broken if libass or libass
  704. echo. dependees are enabled.
  705. echo. Option 6 produces static and shared ffmpeg and ffmpeg libs where the static
  706. echo. one includes only strictly static dependencies (opencl, opengl, cuda-nvcc,
  707. echo. libnpp, libopenh264 are hard disabled.^)
  708. echo.
  709. echo -------------------------------------------------------------------------------
  710. echo -------------------------------------------------------------------------------
  711. set /P buildffmpeg="Build FFmpeg: "
  712. ) else set buildffmpeg=%ffmpegB2INI%
  713. if "%buildffmpeg%"=="" GOTO ffmpeg
  714. if %buildffmpeg%==1 set "ffmpeg=static"
  715. if %buildffmpeg%==2 set "ffmpeg=no"
  716. if %buildffmpeg%==3 set "ffmpeg=shared"
  717. if %buildffmpeg%==4 set "ffmpeg=both"
  718. if %buildffmpeg%==5 set "ffmpeg=sharedlibs"
  719. if %buildffmpeg%==6 set "ffmpeg=bothstatic"
  720. if %buildffmpeg% GTR 6 GOTO ffmpeg
  721. if %deleteINI%==1 echo.ffmpegB2=^%buildffmpeg%>>%ini%
  722. set defaultFFmpegPath=https://git.ffmpeg.org/ffmpeg.git
  723. :ffmpegPath
  724. if [0]==[%ffmpegPathINI%] (
  725. set ffmpegPath=%defaultFFmpegPath%
  726. echo -------------------------------------------------------------------------------
  727. echo -------------------------------------------------------------------------------
  728. echo.
  729. echo. Using default ffmpeg source path: https://git.ffmpeg.org/ffmpeg.git
  730. echo.
  731. echo. If you want to use a custom source repository, add a line like this
  732. echo. to media-autobuild_suite.ini:
  733. echo.
  734. echo. ffmpegPath=https://github.com/username/FFmpeg.git#branch=branchname
  735. echo.
  736. echo. or for a local repository like:
  737. echo.
  738. echo. ffmpegPath=../myrepos/ffmpeg
  739. echo.
  740. echo -------------------------------------------------------------------------------
  741. echo -------------------------------------------------------------------------------
  742. ) else set ffmpegPath=%ffmpegPathINI%
  743. if %deleteINI%==1 echo.ffmpegPath=%ffmpegPath%>>%ini%
  744. rem Handle relative paths and convert to absolute path
  745. rem after sanitizing: back- to forward-slashes, remove colon after drive letter
  746. call :resolvePath %ffmpegPath%
  747. setlocal EnableDelayedExpansion
  748. if exist %resolvePath% (
  749. set nixdir=!resolvePath:\=/!
  750. set "ffmpegPath=/!nixdir::=!"
  751. )
  752. endlocal & set "ffmpegPath=%ffmpegPath%"
  753. if not [%defaultFFmpegPath%]==[%ffmpegPath%] (
  754. echo -------------------------------------------------------------------------------
  755. echo.
  756. echo. Using ffmpeg path: %ffmpegPath%
  757. echo.
  758. echo -------------------------------------------------------------------------------
  759. )
  760. :ffmpegUp
  761. if [0]==[%ffmpegUpdateINI%] (
  762. echo -------------------------------------------------------------------------------
  763. echo -------------------------------------------------------------------------------
  764. echo.
  765. echo. Always build FFmpeg when libraries have been updated?
  766. echo. 1 = Yes
  767. echo. 2 = No
  768. echo. 3 = Only build FFmpeg/mpv and missing dependencies
  769. echo.
  770. echo. FFmpeg is updated a lot so you only need to select this if you
  771. echo. absolutely need updated external libraries in FFmpeg.
  772. echo.
  773. echo -------------------------------------------------------------------------------
  774. echo -------------------------------------------------------------------------------
  775. set /P buildffmpegUp="Build ffmpeg if lib is new: "
  776. ) else set buildffmpegUp=%ffmpegUpdateINI%
  777. if "%buildffmpegUp%"=="" GOTO ffmpegUp
  778. if %buildffmpegUp%==1 set "ffmpegUpdate=y"
  779. if %buildffmpegUp%==2 set "ffmpegUpdate=n"
  780. if %buildffmpegUp%==3 set "ffmpegUpdate=onlyFFmpeg"
  781. if %buildffmpegUp% GTR 3 GOTO ffmpegUp
  782. if %deleteINI%==1 echo.ffmpegUpdate=^%buildffmpegUp%>>%ini%
  783. :ffmpegChoice
  784. if [0]==[%ffmpegChoiceINI%] (
  785. echo -------------------------------------------------------------------------------
  786. echo -------------------------------------------------------------------------------
  787. echo.
  788. echo. Choose ffmpeg and mpv optional libraries?
  789. echo. 1 = Yes
  790. echo. 2 = No (Light build^)
  791. echo. 3 = No (Mimic Zeranoe^)
  792. echo. 4 = No (All available external libs^)
  793. echo.
  794. echo. Avoid the last two unless you really want useless libraries you'll never use.
  795. echo. Just because you can include a shitty codec no one uses doesn't mean you should.
  796. echo.
  797. echo. If you select yes, we will create files with the default options
  798. echo. we use with FFmpeg and mpv. You can remove any that you don't need or prefix
  799. echo. them with #
  800. echo.
  801. echo -------------------------------------------------------------------------------
  802. echo -------------------------------------------------------------------------------
  803. set /P buildffmpegChoice="Choose ffmpeg and mpv optional libs: "
  804. ) else set buildffmpegChoice=%ffmpegChoiceINI%
  805. if "%buildffmpegChoice%"=="" GOTO ffmpegChoice
  806. if %buildffmpegChoice%==1 (
  807. set "ffmpegChoice=y"
  808. if not exist %build%\ffmpeg_options.txt (
  809. (
  810. echo.# Lines starting with this character are ignored
  811. echo.# To override some options specifically for the shared build, create a ffmpeg_options_shared.txt file.
  812. echo.
  813. echo.# Basic built-in options, can be removed if you delete "--disable-autodetect"
  814. call :writeOption %ffmpeg_options_builtin%
  815. echo.
  816. echo.# Common options
  817. call :writeOption %ffmpeg_options_basic%
  818. echo.
  819. echo.# Zeranoe
  820. call :writeOption %ffmpeg_options_zeranoe%
  821. echo.
  822. echo.# Full
  823. call :writeOption %ffmpeg_options_full%
  824. echo.
  825. echo.# Full plus options that add shared dependencies
  826. call :writeOption %ffmpeg_options_full_shared%
  827. )>%build%\ffmpeg_options.txt
  828. echo -------------------------------------------------------------------------------
  829. echo. File with default FFmpeg options has been created in
  830. echo. %build%\ffmpeg_options.txt
  831. echo.
  832. echo. Edit it now or leave it unedited to compile according to defaults.
  833. echo -------------------------------------------------------------------------------
  834. pause
  835. )
  836. if not exist %build%\mpv_options.txt (
  837. (
  838. echo.# Lines starting with this character are ignored
  839. echo.
  840. echo.# Built-in options, use --disable- to disable them
  841. call :writeOption %mpv_options_builtin%
  842. echo.
  843. echo.# Common options or overriden defaults
  844. call :writeOption %mpv_options_basic%
  845. echo.
  846. echo.# Full
  847. call :writeOption %mpv_options_full%
  848. )>%build%\mpv_options.txt
  849. echo -------------------------------------------------------------------------------
  850. echo. File with default mpv options has been created in
  851. echo. %build%\mpv_options.txt
  852. echo.
  853. echo. Edit it now or leave it unedited to compile according to defaults.
  854. echo -------------------------------------------------------------------------------
  855. pause
  856. )
  857. )
  858. if %buildffmpegChoice%==2 set "ffmpegChoice=n"
  859. if %buildffmpegChoice%==3 set "ffmpegChoice=z"
  860. if %buildffmpegChoice%==4 set "ffmpegChoice=f"
  861. if %buildffmpegChoice% GTR 4 GOTO ffmpegChoice
  862. if %deleteINI%==1 echo.ffmpegChoice=^%buildffmpegChoice%>>%ini%
  863. :mp4boxStatic
  864. if [0]==[%mp4boxINI%] (
  865. echo -------------------------------------------------------------------------------
  866. echo -------------------------------------------------------------------------------
  867. echo.
  868. echo. Build static mp4box [mp4 muxer/toolbox] binary?
  869. echo. 1 = Yes
  870. echo. 2 = No
  871. echo.
  872. echo -------------------------------------------------------------------------------
  873. echo -------------------------------------------------------------------------------
  874. set /P buildMp4box="Build mp4box: "
  875. ) else set buildMp4box=%mp4boxINI%
  876. if "%buildMp4box%"=="" GOTO mp4boxStatic
  877. if %buildMp4box%==1 set "mp4box=y"
  878. if %buildMp4box%==2 set "mp4box=n"
  879. if %buildMp4box% GTR 2 GOTO mp4boxStatic
  880. if %deleteINI%==1 echo.mp4box=^%buildMp4box%>>%ini%
  881. :rtmpdump
  882. if [0]==[%rtmpdumpINI%] (
  883. echo -------------------------------------------------------------------------------
  884. echo -------------------------------------------------------------------------------
  885. echo.
  886. echo. Build static rtmpdump binaries [rtmp tools]?
  887. echo. 1 = Yes
  888. echo. 2 = No
  889. echo.
  890. echo -------------------------------------------------------------------------------
  891. echo -------------------------------------------------------------------------------
  892. set /P buildrtmpdump="Build rtmpdump: "
  893. ) else set buildrtmpdump=%rtmpdumpINI%
  894. if "%buildrtmpdump%"=="" GOTO rtmpdump
  895. if %buildrtmpdump%==1 set "rtmpdump=y"
  896. if %buildrtmpdump%==2 set "rtmpdump=n"
  897. if %buildrtmpdump% GTR 2 GOTO rtmpdump
  898. if %deleteINI%==1 echo.rtmpdump=^%buildrtmpdump%>>%ini%
  899. :mplayer
  900. if [0]==[%mplayer2INI%] (
  901. echo -------------------------------------------------------------------------------
  902. echo -------------------------------------------------------------------------------
  903. echo.
  904. echo ######### UNSUPPORTED, IF IT BREAKS, IT BREAKS ################################
  905. echo.
  906. echo. Build static mplayer/mencoder binary?
  907. echo. 1 = Yes
  908. echo. 2 = No
  909. echo.
  910. echo. Don't bother opening issues about this if it breaks, I don't fucking care
  911. echo. about ancient unmaintained shit code. One more issue open about this that
  912. echo. isn't the suite's fault and mplayer goes fucking out.
  913. echo.
  914. echo -------------------------------------------------------------------------------
  915. echo -------------------------------------------------------------------------------
  916. set /P buildmplayer="Build mplayer: "
  917. ) else set buildmplayer=%mplayer2INI%
  918. if "%buildmplayer%"=="" GOTO mplayer
  919. if %buildmplayer%==1 set "mplayer=y"
  920. if %buildmplayer%==2 set "mplayer=n"
  921. if %buildmplayer% GTR 2 GOTO mplayer
  922. if %deleteINI%==1 echo.mplayer2=^%buildmplayer%>>%ini%
  923. :mpv
  924. if [0]==[%mpvINI%] (
  925. echo -------------------------------------------------------------------------------
  926. echo -------------------------------------------------------------------------------
  927. echo.
  928. echo. Build mpv?
  929. echo. 1 = Yes
  930. echo. 2 = No
  931. echo.
  932. echo. Note: when built with shared-only FFmpeg, mpv is also shared.
  933. echo. Note: the third option was removed since vapoursynth is now a delay-import
  934. echo. dependency that is only required if you try to use the corresponding filter.
  935. echo -------------------------------------------------------------------------------
  936. echo -------------------------------------------------------------------------------
  937. set /P buildmpv="Build mpv: "
  938. ) else set buildmpv=%mpvINI%
  939. if "%buildmpv%"=="" GOTO mpv
  940. if %buildmpv%==1 set "mpv=y"
  941. if %buildmpv%==2 set "mpv=n"
  942. if %buildmpv% GTR 2 GOTO mpv
  943. if %deleteINI%==1 echo.mpv=^%buildmpv%>>%ini%
  944. :vlc
  945. if [0]==[%vlcINI%] (
  946. echo -------------------------------------------------------------------------------
  947. echo -------------------------------------------------------------------------------
  948. echo.
  949. echo. Build vlc?
  950. echo. Takes a long time because of qt5 and wouldn't recommend it if you
  951. echo. don't have ccache enabled.
  952. echo. 1 = Yes
  953. echo. 2 = No
  954. echo.
  955. echo. Note: the resulting vlc is extra buggy, do not expect it to work smoothly
  956. echo.
  957. echo -------------------------------------------------------------------------------
  958. echo -------------------------------------------------------------------------------
  959. set /P buildvlc="Build vlc: "
  960. ) else set buildvlc=%vlcINI%
  961. if "%buildvlc%"=="" GOTO vlc
  962. if %buildvlc%==1 set "vlc=y"
  963. if %buildvlc%==2 set "vlc=n"
  964. if %buildvlc% GTR 2 GOTO vlc
  965. if %deleteINI%==1 echo.vlc=^%buildvlc%>>%ini%
  966. :bmx
  967. if [0]==[%bmxINI%] (
  968. echo -------------------------------------------------------------------------------
  969. echo -------------------------------------------------------------------------------
  970. echo.
  971. echo. Build static bmx tools?
  972. echo. 1 = Yes
  973. echo. 2 = No
  974. echo.
  975. echo -------------------------------------------------------------------------------
  976. echo -------------------------------------------------------------------------------
  977. set /P buildbmx="Build bmx: "
  978. ) else set buildbmx=%bmxINI%
  979. if "%buildbmx%"=="" GOTO bmx
  980. if %buildbmx%==1 set "bmx=y"
  981. if %buildbmx%==2 set "bmx=n"
  982. if %buildbmx% GTR 2 GOTO bmx
  983. if %deleteINI%==1 echo.bmx=^%buildbmx%>>%ini%
  984. :curl
  985. if [0]==[%curlINI%] (
  986. echo -------------------------------------------------------------------------------
  987. echo -------------------------------------------------------------------------------
  988. echo.
  989. echo. Build static curl?
  990. echo. 1 = Yes (same backend as FFmpeg's^)
  991. echo. 2 = No
  992. echo. 3 = SChannel backend
  993. echo. 4 = GnuTLS backend
  994. echo. 5 = OpenSSL backend
  995. echo. 6 = LibreSSL backend
  996. echo. 7 = mbedTLS backend
  997. echo.
  998. echo. A curl-ca-bundle.crt will be created to be used as trusted certificate store
  999. echo. for all backends except SChannel.
  1000. echo.
  1001. echo -------------------------------------------------------------------------------
  1002. echo -------------------------------------------------------------------------------
  1003. set /P buildcurl="Build curl: "
  1004. ) else set buildcurl=%curlINI%
  1005. if "%buildcurl%"=="" GOTO curl
  1006. if %buildcurl%==1 set "curl=y"
  1007. if %buildcurl%==2 set "curl=n"
  1008. if %buildcurl%==3 set "curl=schannel"
  1009. if %buildcurl%==4 set "curl=gnutls"
  1010. if %buildcurl%==5 set "curl=openssl"
  1011. if %buildcurl%==6 set "curl=libressl"
  1012. if %buildcurl%==7 set "curl=mbedtls"
  1013. if %buildcurl% GTR 7 GOTO curl
  1014. if %deleteINI%==1 echo.curl=^%buildcurl%>>%ini%
  1015. :ffmbc
  1016. if [0]==[%ffmbcINI%] (
  1017. echo -------------------------------------------------------------------------------
  1018. echo -------------------------------------------------------------------------------
  1019. echo.
  1020. echo ######### UNSUPPORTED, IF IT BREAKS, IT BREAKS ################################
  1021. echo.
  1022. echo. Build FFMedia Broadcast binary?
  1023. echo. 1 = Yes
  1024. echo. 2 = No
  1025. echo.
  1026. echo. Note: this is a fork of FFmpeg 0.10. As such, it's very likely to fail
  1027. echo. to build, work, might burn your computer, kill your children, like mplayer.
  1028. echo. Only enable it if you absolutely need it. If it breaks, complain first to
  1029. echo. the author in #ffmbc in Freenode IRC.
  1030. echo.
  1031. echo -------------------------------------------------------------------------------
  1032. echo -------------------------------------------------------------------------------
  1033. set /P buildffmbc="Build ffmbc: "
  1034. ) else set buildffmbc=%ffmbcINI%
  1035. if "%buildffmbc%"=="" GOTO ffmbc
  1036. if %buildffmbc%==1 set "ffmbc=y"
  1037. if %buildffmbc%==2 set "ffmbc=n"
  1038. if %buildffmbc% GTR 2 GOTO ffmbc
  1039. if %deleteINI%==1 echo.ffmbc=^%buildffmbc%>>%ini%
  1040. :cyanrip
  1041. if [0]==[%cyanrip2INI%] (
  1042. echo -------------------------------------------------------------------------------
  1043. echo -------------------------------------------------------------------------------
  1044. echo.
  1045. echo. Build cyanrip (CLI CD ripper^)?
  1046. echo. 1 = Yes
  1047. echo. 2 = No
  1048. echo.
  1049. echo -------------------------------------------------------------------------------
  1050. echo -------------------------------------------------------------------------------
  1051. set /P buildcyanrip="Build cyanrip: "
  1052. ) else set buildcyanrip=%cyanrip2INI%
  1053. if "%buildcyanrip%"=="" GOTO cyanrip
  1054. if %buildcyanrip%==1 set "cyanrip=y"
  1055. if %buildcyanrip%==2 set "cyanrip=n"
  1056. if %buildcyanrip% GTR 2 GOTO cyanrip
  1057. if %deleteINI%==1 echo.cyanrip2=^%buildcyanrip%>>%ini%
  1058. :ripgrep
  1059. if [0]==[%ripgrepINI%] (
  1060. echo -------------------------------------------------------------------------------
  1061. echo -------------------------------------------------------------------------------
  1062. echo.
  1063. echo. Build ripgrep (faster grep in Rust^)?
  1064. echo. 1 = Yes
  1065. echo. 2 = No
  1066. echo.
  1067. echo -------------------------------------------------------------------------------
  1068. echo -------------------------------------------------------------------------------
  1069. set /P buildripgrep="Build ripgrep: "
  1070. ) else set buildripgrep=%ripgrepINI%
  1071. if "%buildripgrep%"=="" GOTO ripgrep
  1072. if %buildripgrep%==1 set "ripgrep=y"
  1073. if %buildripgrep%==2 set "ripgrep=n"
  1074. if %buildripgrep% GTR 2 GOTO ripgrep
  1075. if %deleteINI%==1 echo.ripgrep=^%buildripgrep%>>%ini%
  1076. :jq
  1077. if [0]==[%jqINI%] (
  1078. echo -------------------------------------------------------------------------------
  1079. echo -------------------------------------------------------------------------------
  1080. echo.
  1081. echo. Build jq (CLI JSON processor^)?
  1082. echo. 1 = Yes
  1083. echo. 2 = No
  1084. echo.
  1085. echo -------------------------------------------------------------------------------
  1086. echo -------------------------------------------------------------------------------
  1087. set /P buildjq="Build jq: "
  1088. ) else set buildjq=%jqINI%
  1089. if "%buildjq%"=="" GOTO jq
  1090. if %buildjq%==1 set "jq=y"
  1091. if %buildjq%==2 set "jq=n"
  1092. if %buildjq% GTR 2 GOTO jq
  1093. if %deleteINI%==1 echo.jq=^%buildjq%>>%ini%
  1094. :jo
  1095. if [0]==[%joINI%] (
  1096. echo -------------------------------------------------------------------------------
  1097. echo -------------------------------------------------------------------------------
  1098. echo.
  1099. echo. Build jo (CLI JSON from shell^)?
  1100. echo. 1 = Yes
  1101. echo. 2 = No
  1102. echo.
  1103. echo -------------------------------------------------------------------------------
  1104. echo -------------------------------------------------------------------------------
  1105. set /P buildjo="Build jo: "
  1106. ) else set buildjo=%joINI%
  1107. if "%buildjo%"=="" GOTO jo
  1108. if %buildjo%==1 set "jo=y"
  1109. if %buildjo%==2 set "jo=n"
  1110. if %buildjo% GTR 2 GOTO jo
  1111. if %deleteINI%==1 echo.jo=^%buildjo%>>%ini%
  1112. :dssim
  1113. if [0]==[%dssimINI%] (
  1114. echo -------------------------------------------------------------------------------
  1115. echo -------------------------------------------------------------------------------
  1116. echo.
  1117. echo. Build dssim (multiscale SSIM in Rust^)?
  1118. echo. 1 = Yes
  1119. echo. 2 = No
  1120. echo.
  1121. echo -------------------------------------------------------------------------------
  1122. echo -------------------------------------------------------------------------------
  1123. set /P builddssim="Build dssim: "
  1124. ) else set builddssim=%dssimINI%
  1125. if "%builddssim%"=="" GOTO dssim
  1126. if %builddssim%==1 set "dssim=y"
  1127. if %builddssim%==2 set "dssim=n"
  1128. if %builddssim% GTR 2 GOTO dssim
  1129. if %deleteINI%==1 echo.dssim=^%builddssim%>>%ini%
  1130. :avs2
  1131. if [0]==[%avs2INI%] (
  1132. echo -------------------------------------------------------------------------------
  1133. echo -------------------------------------------------------------------------------
  1134. echo.
  1135. echo. Build avs2 (Audio Video Coding Standard Gen2 encoder/decoder^)?
  1136. echo. 1 = Yes
  1137. echo. 2 = No
  1138. echo.
  1139. echo. Binaries being built depends on "standalone=y" and are always static.
  1140. echo.
  1141. echo -------------------------------------------------------------------------------
  1142. echo -------------------------------------------------------------------------------
  1143. set /P buildavs2="Build avs2: "
  1144. ) else set buildavs2=%avs2INI%
  1145. if "%buildavs2%"=="" GOTO avs2
  1146. if %buildavs2%==1 set "avs2=y"
  1147. if %buildavs2%==2 set "avs2=n"
  1148. if %buildavs2% GTR 2 GOTO avs2
  1149. if %deleteINI%==1 echo.avs2=^%buildavs2%>>%ini%
  1150. :dovitool
  1151. if [0]==[%dovitoolINI%] (
  1152. echo -------------------------------------------------------------------------------
  1153. echo -------------------------------------------------------------------------------
  1154. echo.
  1155. echo. Build dovi_tool (CLI tool for working with Dolby Vision^)?
  1156. echo. 1 = Yes
  1157. echo. 2 = No
  1158. echo.
  1159. echo -------------------------------------------------------------------------------
  1160. echo -------------------------------------------------------------------------------
  1161. set /P builddovitool="Build dovi_tool: "
  1162. ) else set builddovitool=%dovitoolINI%
  1163. if "%builddovitool%"=="" GOTO dovitool
  1164. if %builddovitool%==1 set "dovitool=y"
  1165. if %builddovitool%==2 set "dovitool=n"
  1166. if %builddovitool% GTR 2 GOTO dovitool
  1167. if %deleteINI%==1 echo.dovitool=^%builddovitool%>>%ini%
  1168. :hdr10plustool
  1169. if [0]==[%hdr10plustoolINI%] (
  1170. echo -------------------------------------------------------------------------------
  1171. echo -------------------------------------------------------------------------------
  1172. echo.
  1173. echo. Build hdr10plus_tool (CLI utility to work with HDR10+ in HEVC files^)?
  1174. echo. 1 = Yes
  1175. echo. 2 = No
  1176. echo.
  1177. echo -------------------------------------------------------------------------------
  1178. echo -------------------------------------------------------------------------------
  1179. set /P buildhdr10plustool="Build hdr10plus_tool: "
  1180. ) else set buildhdr10plustool=%hdr10plustoolINI%
  1181. if "%buildhdr10plustool%"=="" GOTO hdr10plustool
  1182. if %buildhdr10plustool%==1 set "hdr10plustool=y"
  1183. if %buildhdr10plustool%==2 set "hdr10plustool=n"
  1184. if %buildhdr10plustool% GTR 2 GOTO hdr10plustool
  1185. if %deleteINI%==1 echo.hdr10plustool=^%buildhdr10plustool%>>%ini%
  1186. :CC
  1187. if [0]==[%CCINI%] (
  1188. echo -------------------------------------------------------------------------------
  1189. echo -------------------------------------------------------------------------------
  1190. echo.
  1191. echo. Use clang instead of gcc (C compiler^)?
  1192. echo. Experimental and possibly broken due to gcc assumptions
  1193. echo. 1 = Yes
  1194. echo. 2 = No [Recommended]
  1195. echo.
  1196. echo.
  1197. echo -------------------------------------------------------------------------------
  1198. echo -------------------------------------------------------------------------------
  1199. set /P buildCC="Build using clang: "
  1200. ) else set buildCC=%CCINI%
  1201. if "%buildCC%"=="" GOTO CC
  1202. if %buildCC%==1 set "CC=clang"
  1203. if %buildCC%==2 set "CC=gcc"
  1204. if %buildCC% GTR 2 GOTO CC
  1205. if %deleteINI%==1 echo.CC=^%buildCC%>>%ini%
  1206. :numCores
  1207. if %NUMBER_OF_PROCESSORS% EQU 1 ( set coreHalf=1 ) else set /a coreHalf=%NUMBER_OF_PROCESSORS%/2
  1208. if [0]==[%coresINI%] (
  1209. echo -------------------------------------------------------------------------------
  1210. echo -------------------------------------------------------------------------------
  1211. echo.
  1212. echo. Number of CPU Cores/Threads for compiling:
  1213. echo. [it is non-recommended to use all cores/threads!]
  1214. echo.
  1215. echo. Recommended: %coreHalf%
  1216. echo.
  1217. echo. If you have Windows Defender Real-time protection on, most of your processing
  1218. echo. power will go to it. It is recommended to whitelist this directory from
  1219. echo. scanning due to the amount of new files and copying/moving done by the suite.
  1220. echo. If you do not know how to do this, google it. If you don't care, ignore this.
  1221. echo.
  1222. echo -------------------------------------------------------------------------------
  1223. echo -------------------------------------------------------------------------------
  1224. set /P cpuCores="Core/Thread Count: "
  1225. ) else set cpuCores=%coresINI%
  1226. for /l %%a in (1,1,%cpuCores%) do set cpuCount=%%a
  1227. if "%cpuCount%"=="" GOTO numCores
  1228. if %deleteINI%==1 echo.cores=^%cpuCount%>>%ini%
  1229. if [0]==[%deleteSourceINI%] (
  1230. :delete
  1231. echo -------------------------------------------------------------------------------
  1232. echo -------------------------------------------------------------------------------
  1233. echo.
  1234. echo. Delete versioned source folders after compile is done?
  1235. echo. 1 = Yes [recommended]
  1236. echo. 2 = No
  1237. echo.
  1238. echo. This will save a bit of space for libraries not compiled from git.
  1239. echo.
  1240. echo -------------------------------------------------------------------------------
  1241. echo -------------------------------------------------------------------------------
  1242. set /P deleteS="Delete source: "
  1243. ) else set deleteS=%deleteSourceINI%
  1244. if "%deleteS%"=="" GOTO delete
  1245. if %deleteS%==1 set "deleteSource=y"
  1246. if %deleteS%==2 set "deleteSource=n"
  1247. if %deleteS% GTR 2 GOTO delete
  1248. if %deleteINI%==1 echo.deleteSource=^%deleteS%>>%ini%
  1249. :stripEXE
  1250. if [0]==[%stripINI%] (
  1251. echo -------------------------------------------------------------------------------
  1252. echo -------------------------------------------------------------------------------
  1253. echo.
  1254. echo. Strip compiled files binaries?
  1255. echo. 1 = Yes [recommended]
  1256. echo. 2 = No
  1257. echo.
  1258. echo. Makes binaries smaller at only a small time cost after compiling.
  1259. echo.
  1260. echo -------------------------------------------------------------------------------
  1261. echo -------------------------------------------------------------------------------
  1262. set /P stripF="Strip files: "
  1263. ) else set stripF=%stripINI%
  1264. if "%stripF%"=="" GOTO stripEXE
  1265. if %stripF%==1 set "stripFile=y"
  1266. if %stripF%==2 set "stripFile=n"
  1267. if %stripF% GTR 2 GOTO stripEXE
  1268. if %deleteINI%==1 echo.strip=^%stripF%>>%ini%
  1269. :packEXE
  1270. if [0]==[%packINI%] (
  1271. echo -------------------------------------------------------------------------------
  1272. echo -------------------------------------------------------------------------------
  1273. echo.
  1274. echo. Pack compiled files?
  1275. echo. 1 = Yes
  1276. echo. 2 = No [recommended]
  1277. echo.
  1278. echo. Attention: Some security applications may detect packed binaries as malware.
  1279. echo. Increases delay on runtime during which files need to be unpacked.
  1280. echo. Makes binaries smaller at a big time cost after compiling and on runtime.
  1281. echo.
  1282. echo. If distributing the files, consider packing them with 7-zip instead.
  1283. echo.
  1284. echo -------------------------------------------------------------------------------
  1285. echo -------------------------------------------------------------------------------
  1286. set /P packF="Pack files: "
  1287. ) else set packF=%packINI%
  1288. if "%packF%"=="" GOTO packEXE
  1289. if %packF%==1 set "packFile=y"
  1290. if %packF%==2 set "packFile=n"
  1291. if %packF% GTR 2 GOTO packEXE
  1292. if %deleteINI%==1 echo.pack=^%packF%>>%ini%
  1293. :logging
  1294. if [0]==[%loggingINI%] (
  1295. echo -------------------------------------------------------------------------------
  1296. echo -------------------------------------------------------------------------------
  1297. echo.
  1298. echo. Write logs of compilation commands?
  1299. echo. 1 = Yes [recommended]
  1300. echo. 2 = No
  1301. echo.
  1302. echo Note: Setting this to yes will also hide output from these commands.
  1303. echo On successful compilation, these logs are deleted since they aren't needed.
  1304. echo.
  1305. echo -------------------------------------------------------------------------------
  1306. echo -------------------------------------------------------------------------------
  1307. set /P loggingF="Write logs: "
  1308. ) else set loggingF=%loggingINI%
  1309. if "%loggingF%"=="" GOTO logging
  1310. if %loggingF%==1 set "logging=y"
  1311. if %loggingF%==2 set "logging=n"
  1312. if %loggingF% GTR 2 GOTO logging
  1313. if %deleteINI%==1 echo.logging=^%loggingF%>>%ini%
  1314. @REM :autouploadlogs
  1315. @REM if [0]==[%autouploadlogsINI%] (
  1316. @REM echo -------------------------------------------------------------------------------
  1317. @REM echo -------------------------------------------------------------------------------
  1318. @REM echo.
  1319. @REM echo. Automatically upload error logs to 0x0.st?
  1320. @REM echo. 1 = Yes [recommended]
  1321. @REM echo. 2 = No
  1322. @REM echo.
  1323. @REM echo This will upload logs.zip to 0x0.st for easy copy and pasting into github
  1324. @REM echo issues. If you choose no, then uploading logs will be your responsibility and
  1325. @REM echo no guarantees will be made for issues lacking logs.
  1326. @REM echo.
  1327. @REM echo -------------------------------------------------------------------------------
  1328. @REM echo -------------------------------------------------------------------------------
  1329. @REM set /P autouploadlogsF="Upload logs: "
  1330. @REM ) else set autouploadlogsF=%autouploadlogsINI%
  1331. @REM if "%autouploadlogsF%"=="" GOTO autouploadlogs
  1332. @REM if %autouploadlogsF%==1 set "autouploadlogs=y"
  1333. @REM if %autouploadlogsF%==2 set "autouploadlogs=n"
  1334. @REM if %autouploadlogsF% GTR 2 GOTO autouploadlogs
  1335. @REM if %deleteINI%==1 echo.autouploadlogs=^%autouploadlogsF%>>%ini%
  1336. :updateSuite
  1337. if [0]==[%updateSuiteINI%] (
  1338. echo -------------------------------------------------------------------------------
  1339. echo -------------------------------------------------------------------------------
  1340. echo.
  1341. echo. Create script to update suite files automatically?
  1342. echo. 1 = Yes
  1343. echo. 2 = No
  1344. echo.
  1345. echo If you have made changes to the scripts, they will be reset but saved to a
  1346. echo .diff text file inside %build%
  1347. echo.
  1348. echo -------------------------------------------------------------------------------
  1349. echo -------------------------------------------------------------------------------
  1350. set /P updateSuiteF="Create update script: "
  1351. ) else set updateSuiteF=%updateSuiteINI%
  1352. if "%updateSuiteF%"=="" GOTO updateSuite
  1353. if %updateSuiteF%==1 set "updateSuite=y"
  1354. if %updateSuiteF%==2 set "updateSuite=n"
  1355. if %updateSuiteF% GTR 2 GOTO updateSuite
  1356. if %deleteINI%==1 echo.updateSuite=^%updateSuiteF%>>%ini%
  1357. :timeStamp
  1358. if [0]==[%timeStampINI%] (
  1359. echo -------------------------------------------------------------------------------
  1360. echo -------------------------------------------------------------------------------
  1361. echo.
  1362. echo. Show timestamps of commands during compilation?
  1363. echo. 1 = Yes
  1364. echo. 2 = No
  1365. echo.
  1366. echo This will show the start times of commands during compilation.
  1367. echo Don't turn this on unless you really want to see the timestamps.
  1368. echo.
  1369. echo -------------------------------------------------------------------------------
  1370. echo -------------------------------------------------------------------------------
  1371. set /P timeStampF="Show Timestamps: "
  1372. ) else set timeStampF=%timeStampINI%
  1373. if "%timeStampF%"=="" GOTO timestamp
  1374. if %timeStampF%==1 set "timeStamp=y"
  1375. if %timeStampF%==2 set "timeStamp=n"
  1376. if %timeStampF% GTR 2 GOTO timeStamp
  1377. if %deleteINI%==1 echo.timeStamp=^%timeStampF%>>%ini%
  1378. :ccache
  1379. if [0]==[%ccacheINI%] (
  1380. echo -------------------------------------------------------------------------------
  1381. echo -------------------------------------------------------------------------------
  1382. echo.
  1383. echo. Use ccache when compiling?
  1384. echo. Experimental.
  1385. echo. Speeds up rebuilds and recompilations, but requires the files to be
  1386. echo. compiled at least once before any effect is seen
  1387. echo. 1 = Yes
  1388. echo. 2 = No
  1389. echo.
  1390. echo -------------------------------------------------------------------------------
  1391. echo -------------------------------------------------------------------------------
  1392. set /P buildwithccache="Use ccache: "
  1393. ) else set buildwithccache=%ccacheINI%
  1394. if "%buildwithccache%"=="" GOTO ccache
  1395. if %buildwithccache%==1 set "ccache=y"
  1396. if %buildwithccache%==2 set "ccache=n"
  1397. if %buildwithccache% GTR 2 GOTO ccache
  1398. if %deleteINI%==1 echo.ccache=^%buildwithccache%>>%ini%
  1399. :noMintty
  1400. if [0]==[%noMinttyINI%] (
  1401. echo -------------------------------------------------------------------------------
  1402. echo -------------------------------------------------------------------------------
  1403. echo.
  1404. echo. Are you running this script through ssh or similar?
  1405. echo. (Can't open another window outside of this terminal^)
  1406. echo. 1 = Yes
  1407. echo. 2 = No
  1408. echo.
  1409. echo This will disable the use of mintty and print the output to this console.
  1410. echo There is no guarantee that this will work properly.
  1411. echo You must make sure that you have ssh keep-alive enabled or something similar
  1412. echo to screen that will allow you to run this script in the background.
  1413. echo.
  1414. echo -------------------------------------------------------------------------------
  1415. echo -------------------------------------------------------------------------------
  1416. set /P noMinttyF="SSH: "
  1417. ) else set noMinttyF=%noMinttyINI%
  1418. if "%noMinttyF%"=="" GOTO noMintty
  1419. if %noMinttyF%==1 (
  1420. set "noMintty=y"
  1421. color
  1422. )
  1423. if %noMinttyF%==2 set "noMintty=n"
  1424. if %noMinttyF% GTR 2 GOTO noMintty
  1425. if %deleteINI%==1 echo.noMintty=^%noMinttyF%>>%ini%
  1426. rem ------------------------------------------------------------------
  1427. rem download and install basic msys2 system:
  1428. rem ------------------------------------------------------------------
  1429. cd %build%
  1430. set scripts=media-suite_compile.sh media-suite_helper.sh media-suite_update.sh
  1431. for %%s in (%scripts%) do (
  1432. if not exist "%build%\%%s" (
  1433. powershell -Command (New-Object System.Net.WebClient^).DownloadFile('"https://github.com/m-ab-s/media-autobuild_suite/raw/master/build/%%s"', '"%%s"' ^)
  1434. )
  1435. )
  1436. rem checkmsys2
  1437. if not exist "%instdir%\msys64\msys2_shell.cmd" (
  1438. echo -------------------------------------------------------------------------------
  1439. echo.
  1440. echo.- Download and install msys2 basic system
  1441. echo.
  1442. echo -------------------------------------------------------------------------------
  1443. echo [System.Net.ServicePointManager]::SecurityProtocol = 'Tls12'; ^
  1444. (New-Object System.Net.WebClient^).DownloadFile(^
  1445. 'https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe', ^
  1446. "$PWD\msys2-base.sfx.exe"^) | powershell -NoProfile -Command - || goto :errorMsys
  1447. :unpack
  1448. if exist %build%\msys2-base.sfx.exe (
  1449. echo -------------------------------------------------------------------------------
  1450. echo.
  1451. echo.- unpacking msys2 basic system
  1452. echo.
  1453. echo -------------------------------------------------------------------------------
  1454. .\msys2-base.sfx.exe x -y -o".."
  1455. if exist msys2-base.sfx.exe del msys2-base.sfx.exe
  1456. )
  1457. if not exist %instdir%\msys64\usr\bin\msys-2.0.dll (
  1458. :errorMsys
  1459. echo -------------------------------------------------------------------------------
  1460. echo.
  1461. echo.- Download msys2 basic system failed,
  1462. echo.- please download it manually from:
  1463. echo.- http://repo.msys2.org/distrib/
  1464. echo.- extract and put the msys2 folder into
  1465. echo.- the root media-autobuid_suite folder
  1466. echo.- and start the batch script again!
  1467. echo.
  1468. echo -------------------------------------------------------------------------------
  1469. pause
  1470. GOTO :unpack
  1471. )
  1472. )
  1473. rem getMintty
  1474. set "bash=%instdir%\msys64\usr\bin\bash.exe"
  1475. set "PATH=%instdir%\msys64\opt\bin;%instdir%\msys64\usr\bin;%PATH%"
  1476. if not exist %instdir%\mintty.lnk (
  1477. echo -------------------------------------------------------------------------------
  1478. echo.- make a first run
  1479. echo -------------------------------------------------------------------------------
  1480. call :runBash firstrun.log exit
  1481. sed -i "s/#Color/Color/;s/^^IgnorePkg.*/#&/" %instdir%\msys64\etc\pacman.conf
  1482. echo.-------------------------------------------------------------------------------
  1483. echo.first update
  1484. echo.-------------------------------------------------------------------------------
  1485. title first msys2 update
  1486. call :runBash firstUpdate.log pacman --noconfirm -Sy --asdeps pacman-mirrors
  1487. echo.-------------------------------------------------------------------------------
  1488. echo.critical updates
  1489. echo.-------------------------------------------------------------------------------
  1490. pacman -S --needed --ask=20 --noconfirm --asdeps bash pacman msys2-runtime
  1491. echo.-------------------------------------------------------------------------------
  1492. echo.second update
  1493. echo.-------------------------------------------------------------------------------
  1494. title second msys2 update
  1495. call :runBash secondUpdate.log pacman --noconfirm -Syu --asdeps
  1496. (
  1497. echo.Set Shell = CreateObject("WScript.Shell"^)
  1498. echo.Set link = Shell.CreateShortcut("%instdir%\mintty.lnk"^)
  1499. echo.link.Arguments = "-full-path -mingw -where .."
  1500. echo.link.Description = "msys2 shell console"
  1501. echo.link.TargetPath = "%instdir%\msys64\msys2_shell.cmd"
  1502. echo.link.WindowStyle = 1
  1503. echo.link.IconLocation = "%instdir%\msys64\msys2.ico"
  1504. echo.link.WorkingDirectory = "%instdir%\msys64"
  1505. echo.link.Save
  1506. )>%build%\setlink.vbs
  1507. cscript /B /Nologo %build%\setlink.vbs
  1508. del %build%\setlink.vbs
  1509. )
  1510. rem createFolders
  1511. if %build32%==yes call :createBaseFolders local32
  1512. if %build64%==yes call :createBaseFolders local64
  1513. rem checkFstab
  1514. set "removefstab=no"
  1515. set "fstab=%instdir%\msys64\etc\fstab"
  1516. if exist %fstab%. (
  1517. findstr build32 %fstab% >nul 2>&1 && set "removefstab=yes"
  1518. findstr trunk %fstab% >nul 2>&1 || set "removefstab=yes"
  1519. for /f "tokens=1 delims= " %%a in ('findstr trunk %fstab%') do if not [%%a]==[%instdir%\] set "removefstab=yes"
  1520. findstr local32 %fstab% >nul 2>&1 && ( if [%build32%]==[no] set "removefstab=yes" ) || if [%build32%]==[yes] set "removefstab=yes"
  1521. findstr local64 %fstab% >nul 2>&1 && ( if [%build64%]==[no] set "removefstab=yes" ) || if [%build64%]==[yes] set "removefstab=yes"
  1522. ) else set removefstab=yes
  1523. if not [%removefstab%]==[no] (
  1524. rem writeFstab
  1525. echo -------------------------------------------------------------------------------
  1526. echo.
  1527. echo.- write fstab mount file
  1528. echo.
  1529. echo -------------------------------------------------------------------------------
  1530. (
  1531. echo.none / cygdrive binary,posix=0,noacl,user 0 0
  1532. echo.
  1533. echo.%instdir%\ /trunk ntfs binary,posix=0,noacl,user 0 0
  1534. echo.%instdir%\build\ /build ntfs binary,posix=0,noacl,user 0 0
  1535. echo.%instdir%\msys64\mingw32\ /mingw32 ntfs binary,posix=0,noacl,user 0 0
  1536. echo.%instdir%\msys64\mingw64\ /mingw64 ntfs binary,posix=0,noacl,user 0 0
  1537. if "%build32%"=="yes" echo.%instdir%\local32\ /local32 ntfs binary,posix=0,noacl,user 0 0
  1538. if "%build64%"=="yes" echo.%instdir%\local64\ /local64 ntfs binary,posix=0,noacl,user 0 0
  1539. )>"%instdir%\msys64\etc\fstab."
  1540. )
  1541. if not exist "%instdir%\msys64\home\%USERNAME%" mkdir "%instdir%\msys64\home\%USERNAME%"
  1542. set "TERM="
  1543. type nul >>"%instdir%\msys64\home\%USERNAME%\.minttyrc"
  1544. for /F "tokens=2 delims==" %%b in ('findstr /i TERM "%instdir%\msys64\home\%USERNAME%\.minttyrc"') do set TERM=%%b
  1545. if not defined TERM (
  1546. printf %%s\n Locale=en_US Charset=UTF-8 Font=Consolas Columns=120 Rows=30 TERM=xterm-256color ^
  1547. > "%instdir%\msys64\home\%USERNAME%\.minttyrc"
  1548. set "TERM=xterm-256color"
  1549. )
  1550. rem gitsettings
  1551. if not exist "%instdir%\msys64\home\%USERNAME%\.gitconfig" (
  1552. echo.[user]
  1553. echo.name = %USERNAME%
  1554. echo.email = %USERNAME%@%COMPUTERNAME%
  1555. echo.
  1556. echo.[color]
  1557. echo.ui = true
  1558. echo.
  1559. echo.[core]
  1560. echo.editor = vim
  1561. echo.autocrlf =
  1562. echo.
  1563. echo.[merge]
  1564. echo.tool = vimdiff
  1565. echo.
  1566. echo.[push]
  1567. echo.default = simple
  1568. )>"%instdir%\msys64\home\%USERNAME%\.gitconfig"
  1569. rem installbase
  1570. if exist "%instdir%\msys64\etc\pac-base.pk" del "%instdir%\msys64\etc\pac-base.pk"
  1571. for %%i in (%msyspackages%) do echo.%%i>>%instdir%\msys64\etc\pac-base.pk
  1572. if not exist %instdir%\msys64\usr\bin\make.exe (
  1573. echo.-------------------------------------------------------------------------------
  1574. echo.install msys2 base system
  1575. echo.-------------------------------------------------------------------------------
  1576. if exist %build%\install_base_failed del %build%\install_base_failed
  1577. title install base system
  1578. (
  1579. echo.echo -ne "\033]0;install base system\007"
  1580. echo.msysbasesystem="$(cat /etc/pac-base.pk | tr '\n\r' ' ')"
  1581. echo.[[ "$(uname)" = *6.1* ]] ^&^& nargs="-n 4"
  1582. echo.echo $msysbasesystem ^| xargs $nargs pacman -Sw --noconfirm --ask=20 --needed
  1583. echo.echo $msysbasesystem ^| xargs $nargs pacman -S --noconfirm --ask=20 --needed
  1584. echo.echo $msysbasesystem ^| xargs $nargs pacman -D --asexplicit
  1585. echo.sleep ^3
  1586. echo.exit
  1587. )>%build%\pacman.sh
  1588. call :runBash pacman.log /build/pacman.sh
  1589. del %build%\pacman.sh
  1590. )
  1591. for %%i in (%instdir%\msys64\usr\ssl\cert.pem) do if %%~zi==0 call :runBash cert.log update-ca-trust
  1592. rem installmingw
  1593. rem extra package for clang
  1594. if %CC%==clang (
  1595. set "mingwpackages=%mingwpackages% gcc-compat"
  1596. ) else (
  1597. set "mingwpackages=%mingwpackages% binutils gcc"
  1598. )
  1599. if exist "%instdir%\msys64\etc\pac-mingw.pk" del "%instdir%\msys64\etc\pac-mingw.pk"
  1600. for %%i in (%mingwpackages%) do echo.%%i>>%instdir%\msys64\etc\pac-mingw.pk
  1601. if %build32%==yes call :getmingw 32
  1602. if %build64%==yes call :getmingw 64
  1603. if exist "%build%\mingw.sh" del %build%\mingw.sh
  1604. rem updatebase
  1605. echo.-------------------------------------------------------------------------------
  1606. echo.update autobuild suite
  1607. echo.-------------------------------------------------------------------------------
  1608. cd %build%
  1609. if %updateSuite%==y (
  1610. if not exist %instdir%\update_suite.sh (
  1611. echo -------------------------------------------------------------------------------
  1612. echo. Creating suite update file...
  1613. echo.
  1614. echo. Run this file by dragging it to mintty before the next time you run
  1615. echo. the suite and before reporting an issue.
  1616. echo.
  1617. echo. It needs to be run separately and with the suite not running!
  1618. echo -------------------------------------------------------------------------------
  1619. )
  1620. (
  1621. echo.#!/bin/bash
  1622. echo.
  1623. echo.# Run this file by dragging it to mintty shortcut.
  1624. echo.# Be sure the suite is not running before using it!
  1625. echo.
  1626. echo.update=yes
  1627. %instdir%\msys64\usr\bin\sed -n '/start suite update/,/end suite update/p' ^
  1628. %build%/media-suite_update.sh
  1629. )>%instdir%\update_suite.sh
  1630. )
  1631. rem update
  1632. call :runBash update.log /build/media-suite_update.sh --build32=%build32% --build64=%build64%
  1633. if exist "%build%\update_core" (
  1634. echo.-------------------------------------------------------------------------------
  1635. echo.critical updates
  1636. echo.-------------------------------------------------------------------------------
  1637. pacman -S --needed --noconfirm --ask=20 --asdeps bash pacman msys2-runtime
  1638. del "%build%\update_core"
  1639. )
  1640. rem ------------------------------------------------------------------
  1641. rem write config profiles:
  1642. rem ------------------------------------------------------------------
  1643. if %build32%==yes call :writeProfile 32
  1644. if %build64%==yes call :writeProfile 64
  1645. mkdir "%instdir%\msys64\home\%USERNAME%\.gnupg" > nul 2>&1
  1646. findstr hkps://keys.openpgp.org "%instdir%\msys64\home\%USERNAME%\.gnupg\gpg.conf" >nul 2>&1 || echo keyserver hkps://keys.openpgp.org >> "%instdir%\msys64\home\%USERNAME%\.gnupg\gpg.conf"
  1647. rem loginProfile
  1648. if exist %instdir%\msys64\etc\profile.pacnew ^
  1649. move /y %instdir%\msys64\etc\profile.pacnew %instdir%\msys64\etc\profile
  1650. (
  1651. echo.case "$MSYSTEM" in
  1652. echo.*32^) source /local32/etc/profile2.local ;;
  1653. echo.*64^) source /local64/etc/profile2.local ;;
  1654. echo.esac
  1655. echo.case $- in
  1656. echo.*i*^) ;;
  1657. echo.*^) export LANG=en_US.UTF-8 ;;
  1658. echo.esac
  1659. )>%instdir%\msys64\etc\profile.d\Zab-suite.sh
  1660. rem compileLocals
  1661. cd %instdir%
  1662. title MABSbat
  1663. if exist %build%\compilation_failed del %build%\compilation_failed
  1664. if exist %build%\fail_comp del %build%\compilation_failed
  1665. endlocal & (
  1666. set compileArgs=--cpuCount=%cpuCount% --build32=%build32% --build64=%build64% ^
  1667. --deleteSource=%deleteSource% --mp4box=%mp4box% --vpx=%vpx2% --x264=%x2643% --x265=%x2652% ^
  1668. --other265=%other265% --flac=%flac% --fdkaac=%fdkaac% --mediainfo=%mediainfo% --sox=%sox% ^
  1669. --ffmpeg=%ffmpeg% --ffmpegUpdate=%ffmpegUpdate% --ffmpegChoice=%ffmpegChoice% --mplayer=%mplayer% ^
  1670. --mpv=%mpv% --license=%license2% --stripping=%stripFile% --packing=%packFile% --rtmpdump=%rtmpdump% ^
  1671. --logging=%logging% --bmx=%bmx% --standalone=%standalone% --aom=%aom% --faac=%faac% --exhale=%exhale% ^
  1672. --ffmbc=%ffmbc% --curl=%curl% --cyanrip=%cyanrip% --rav1e=%rav1e% --ripgrep=%ripgrep% --dav1d=%dav1d% ^
  1673. --vvc=%vvc% --uvg266=%uvg266% --vvenc=%vvenc% --vvdec=%vvdec% --jq=%jq% --jo=%jo% --dssim=%dssim% ^
  1674. --avs2=%avs2% --dovitool=%dovitool% --hdr10plustool=%hdr10plustool% --timeStamp=%timeStamp% ^
  1675. --noMintty=%noMintty% --ccache=%ccache% --svthevc=%svthevc% ^
  1676. --svtav1=%svtav1% --svtvp9=%svtvp9% --xvc=%xvc% --vlc=%vlc% --libavif=%libavif% --jpegxl=%jpegxl% ^
  1677. --ffmpegPath=%ffmpegPath% --exitearly=%MABS_EXIT_EARLY%
  1678. @REM --autouploadlogs=%autouploadlogs%
  1679. set "noMintty=%noMintty%"
  1680. if %build64%==yes ( set "MSYSTEM=MINGW64" ) else set "MSYSTEM=MINGW32"
  1681. set "MSYS2_PATH_TYPE=inherit"
  1682. if %noMintty%==y set "PATH=%PATH%"
  1683. set "build=%build%"
  1684. set "instdir=%instdir%"
  1685. )
  1686. if %noMintty%==y (
  1687. call :runBash compile.log /build/media-suite_compile.sh %compileArgs%
  1688. ) else (
  1689. if exist %build%\compile.log del %build%\compile.log
  1690. start "compile" /I /LOW %CD%\msys64\usr\bin\mintty.exe -i /msys2.ico -t "media-autobuild_suite" ^
  1691. --log 2>&1 %build%\compile.log /bin/env MSYSTEM=%MSYSTEM% MSYS2_PATH_TYPE=inherit ^
  1692. /usr/bin/bash ^
  1693. --login /build/media-suite_compile.sh %compileArgs%
  1694. )
  1695. color
  1696. exit /B %ERRORLEVEL%
  1697. endlocal
  1698. goto :EOF
  1699. :createBaseFolders
  1700. if not exist %instdir%\%1\share (
  1701. echo.-------------------------------------------------------------------------------
  1702. echo.creating %1-bit install folders
  1703. echo.-------------------------------------------------------------------------------
  1704. mkdir %instdir%\%1 2>NUL
  1705. mkdir %instdir%\%1\bin 2>NUL
  1706. mkdir %instdir%\%1\bin-audio 2>NUL
  1707. mkdir %instdir%\%1\bin-global 2>NUL
  1708. mkdir %instdir%\%1\bin-video 2>NUL
  1709. mkdir %instdir%\%1\etc 2>NUL
  1710. mkdir %instdir%\%1\include 2>NUL
  1711. mkdir %instdir%\%1\lib 2>NUL
  1712. mkdir %instdir%\%1\lib\pkgconfig 2>NUL
  1713. mkdir %instdir%\%1\share 2>NUL
  1714. )
  1715. goto :EOF
  1716. :writeProfile
  1717. (
  1718. echo.#!/usr/bin/bash
  1719. if %CC%==clang (
  1720. echo.MSYSTEM=CLANG%1
  1721. ) else (
  1722. echo.MSYSTEM=MINGW%1
  1723. )
  1724. echo.source /etc/msystem
  1725. echo.
  1726. echo.# package build directory
  1727. echo.export LOCALBUILDDIR='/build'
  1728. echo.# package installation prefix
  1729. echo.export LOCALDESTDIR='/local%1'
  1730. echo.
  1731. echo.bits='%1bit'
  1732. echo.
  1733. echo.export CONFIG_SITE=/etc/config.site
  1734. echo.alias dir='ls -la --color=auto'
  1735. echo.alias ls='ls --color=auto'
  1736. if %CC%==clang (
  1737. echo.export CC="ccache clang"
  1738. echo.export CXX="ccache clang++"
  1739. ) else (
  1740. echo.export CC="ccache gcc"
  1741. echo.export CXX="ccache g++"
  1742. )
  1743. echo.
  1744. echo.CARCH="${MINGW_CHOST%%%%-*}"
  1745. echo.C_INCLUDE_PATH="$(cygpath -pm $LOCALDESTDIR/include:$MINGW_PREFIX/include)"
  1746. echo.CPLUS_INCLUDE_PATH="$(cygpath -pm $LOCALDESTDIR/include)"
  1747. echo.export C_INCLUDE_PATH CPLUS_INCLUDE_PATH
  1748. echo.
  1749. echo.MANPATH="${LOCALDESTDIR}/share/man:${MINGW_PREFIX}/share/man:/usr/share/man"
  1750. echo.INFOPATH="${LOCALDESTDIR}/share/info:${MINGW_PREFIX}/share/info:/usr/share/info"
  1751. echo.
  1752. echo.DXSDK_DIR="${MINGW_PREFIX}/${MINGW_CHOST}"
  1753. echo.ACLOCAL_PATH="${LOCALDESTDIR}/share/aclocal:${MINGW_PREFIX}/share/aclocal:/usr/share/aclocal"
  1754. echo.PKG_CONFIG="${MINGW_PREFIX}/bin/pkgconf --keep-system-cflags --static"
  1755. echo.PKG_CONFIG_PATH="${LOCALDESTDIR}/lib/pkgconfig:${MINGW_PREFIX}/lib/pkgconfig"
  1756. echo.
  1757. echo.CFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-strong" # security related flags
  1758. echo.CFLAGS+=" -mtune=generic -O2 -pipe" # performance related flags
  1759. echo.CFLAGS+=" -D__USE_MINGW_ANSI_STDIO=1" # mingw-w64 specific flags for c99 printf
  1760. echo.CXXFLAGS="${CFLAGS}" # copy CFLAGS to CXXFLAGS
  1761. echo.LDFLAGS="${CFLAGS} -static-libgcc" # copy CFLAGS to LDFLAGS
  1762. echo.case "$CC" in
  1763. echo.*clang^)
  1764. echo. # clang complains about using static-libstdc++ with C files.
  1765. echo. LDFLAGS+=" --start-no-unused-arguments -static-libstdc++ --end-no-unused-arguments"
  1766. echo. CFLAGS+=" --start-no-unused-arguments -mthreads --end-no-unused-arguments" # mingw-w64 specific flags for windows threads.
  1767. echo. CFLAGS+=" -Qunused-arguments" # clang 17.0.1 complains about -mwindows being present during compilation
  1768. echo.;;
  1769. echo.*gcc^)
  1770. echo. # while gcc doesn't.
  1771. echo. LDFLAGS+=" -static-libstdc++"
  1772. echo. CFLAGS+=" -mthreads" # mingw-w64 specific flags for windows threads.
  1773. echo.;;
  1774. echo.esac
  1775. echo.# CPPFLAGS used to be here, but cmake ignores it, so it's not as useful.
  1776. echo.export DXSDK_DIR ACLOCAL_PATH PKG_CONFIG PKG_CONFIG_PATH CFLAGS CXXFLAGS LDFLAGS
  1777. echo.
  1778. echo.export CARGO_HOME="/opt/cargo"
  1779. echo.export CCACHE_DIR="${LOCALBUILDDIR}/cache"
  1780. echo.
  1781. echo.export PYTHONPATH=
  1782. echo.
  1783. echo.LANG=en_US.UTF-8
  1784. echo.PATH="${MINGW_PREFIX}/bin:${INFOPATH}:${MSYS2_PATH}:${ORIGINAL_PATH}"
  1785. echo.PATH="${LOCALDESTDIR}/bin-audio:${LOCALDESTDIR}/bin-global:${LOCALDESTDIR}/bin-video:${LOCALDESTDIR}/bin:${PATH}"
  1786. echo.PATH="/opt/bin:${PATH}"
  1787. echo.source '/etc/profile.d/perlbin.sh'
  1788. echo.PS1='\[\033[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
  1789. echo.HOME="/home/${USERNAME}"
  1790. echo.GIT_GUI_LIB_DIR=`cygpath -w /usr/share/git-gui/lib`
  1791. echo.export LANG PATH PS1 HOME GIT_GUI_LIB_DIR
  1792. echo.stty susp undef
  1793. echo.test -f "$LOCALDESTDIR/etc/custom_profile" ^&^& source "$LOCALDESTDIR/etc/custom_profile"
  1794. )>%instdir%\local%1\etc\profile2.local
  1795. %instdir%\msys64\usr\bin\dos2unix -q %instdir%\local%1\etc\profile2.local
  1796. goto :EOF
  1797. :writeOption
  1798. setlocal enabledelayedexpansion
  1799. for %%i in (%*) do (
  1800. set _opt=%%~i
  1801. if ["!_opt:~0,2!"]==["--"] (
  1802. echo !_opt!
  1803. ) else if ["!_opt:~0,3!"]==["#--"] (
  1804. echo !_opt!
  1805. ) else if ["!_opt:~0,1!"]==["#"] (
  1806. echo #--enable-!_opt:~1!
  1807. ) else (
  1808. echo --enable-!_opt!
  1809. )
  1810. )
  1811. endlocal
  1812. goto :EOF
  1813. :runBash
  1814. setlocal enabledelayedexpansion
  1815. set "log=%1"
  1816. shift
  1817. set "command=%1"
  1818. shift
  1819. set args=%*
  1820. set arg=!args:%log% %command%=!
  1821. if %noMintty%==y (
  1822. start "bash" /B /LOW /WAIT bash %build%\bash.sh "%build%\%log%" "%command%" "%arg%"
  1823. ) else (
  1824. if exist %build%\%log% del %build%\%log%
  1825. start /I /LOW /WAIT %instdir%\msys64\usr\bin\mintty.exe -d -i /msys2.ico ^
  1826. -t "media-autobuild_suite" --log 2>&1 %build%\%log% /usr/bin/bash -lc ^
  1827. "%command% %arg%"
  1828. )
  1829. endlocal
  1830. goto :EOF
  1831. :getmingw
  1832. setlocal
  1833. set found=0
  1834. set "compilers=%instdir%\msys64\mingw%1\bin\gcc.exe %instdir%\msys64\clang%1\bin\clang.exe"
  1835. for %%i in (%compilers%) do if exist %%i set found=1
  1836. if %found%==1 GOTO :EOF
  1837. echo.-------------------------------------------------------------------------------
  1838. echo.install %1 bit compiler
  1839. echo.-------------------------------------------------------------------------------
  1840. if %CC%==clang (
  1841. if "%1"=="32" (
  1842. set prefix=mingw-w64-clang-i686-
  1843. ) else set prefix=mingw-w64-clang-x86_64-
  1844. ) else (
  1845. if "%1"=="32" (
  1846. set prefix=mingw-w64-i686-
  1847. ) else set prefix=mingw-w64-x86_64-
  1848. )
  1849. (
  1850. echo.printf '\033]0;install %1 bit compiler\007'
  1851. echo.[[ "$(uname)" = *6.1* ]] ^&^& nargs="-n 4"
  1852. echo.sed 's/^^/%prefix%/g' /etc/pac-mingw.pk ^| xargs $nargs pacman -Sw --noconfirm --ask=20 --needed
  1853. echo.sed 's/^^/%prefix%/g' /etc/pac-mingw.pk ^| xargs $nargs pacman -S --noconfirm --ask=20 --needed
  1854. echo.sleep 3
  1855. echo.exit
  1856. )>%build%\mingw.sh
  1857. call :runBash mingw%1.log /build/mingw.sh
  1858. for %%i in (%compilers%) do if exist %%i set found=1
  1859. if %found%==0 (
  1860. echo -------------------------------------------------------------------------------
  1861. echo.
  1862. echo.MinGW%1 compiler isn't installed; maybe the download didn't work
  1863. echo.Do you want to try it again?
  1864. echo.
  1865. echo -------------------------------------------------------------------------------
  1866. set /P try="try again [y/n]: "
  1867. if [%try%]==[y] GOTO getmingw %1
  1868. exit
  1869. )
  1870. endlocal
  1871. goto :EOF
  1872. :resolvePath
  1873. set "resolvePath=%~dpnx1"
  1874. goto :EOF